From ab2cd25cd6c28433594ebb2bce482b059d380420 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 3 Jun 2026 07:17:19 +0000 Subject: [PATCH 01/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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 From ecc063e48672cfc8343f0bc2d310aa7b137ac0da Mon Sep 17 00:00:00 2001 From: Ryan Ouyang Date: Mon, 13 Jul 2026 20:10:24 -0700 Subject: [PATCH 18/34] Build SDK Stainless-Generated-From: 99afef3ebb542c64ccf51084a69c0d8b213b6f67 --- .stats.yml | 2 +- README.md | 4 +- lib/whop_sdk.rb | 139 +- lib/whop_sdk/client.rb | 271 +- lib/whop_sdk/internal/type/union.rb | 12 +- lib/whop_sdk/models.rb | 122 +- lib/whop_sdk/models/account.rb | 836 ++- lib/whop_sdk/models/account_create_params.rb | 11 +- lib/whop_sdk/models/account_list_params.rb | 73 +- lib/whop_sdk/models/account_list_response.rb | 66 - .../account_recommend_actions_params.rb | 20 + .../account_recommend_actions_response.rb | 143 + lib/whop_sdk/models/account_update_params.rb | 289 +- lib/whop_sdk/models/account_wallet.rb | 46 - .../accounts/preference_retrieve_params.rb | 22 + .../accounts/preference_retrieve_response.rb | 129 + .../accounts/preference_update_params.rb | 142 + .../accounts/preference_update_response.rb | 129 + lib/whop_sdk/models/ad.rb | 718 +- lib/whop_sdk/models/ad_budget_type.rb | 16 - lib/whop_sdk/models/ad_campaign.rb | 585 +- .../models/ad_campaign_create_params.rb | 194 + ...params.rb => ad_campaign_delete_params.rb} | 4 +- .../models/ad_campaign_delete_response.rb | 8 + .../models/ad_campaign_list_params.rb | 166 +- .../models/ad_campaign_list_response.rb | 329 - lib/whop_sdk/models/ad_campaign_platform.rb | 16 - .../models/ad_campaign_retrieve_params.rb | 29 +- lib/whop_sdk/models/ad_campaign_status.rb | 20 - .../models/ad_campaign_update_params.rb | 105 +- lib/whop_sdk/models/ad_create_params.rb | 660 ++ lib/whop_sdk/models/ad_delete_params.rb | 20 + lib/whop_sdk/models/ad_delete_response.rb | 8 + lib/whop_sdk/models/ad_group.rb | 714 +- lib/whop_sdk/models/ad_group_create_params.rb | 346 + lib/whop_sdk/models/ad_group_list_params.rb | 167 +- lib/whop_sdk/models/ad_group_list_response.rb | 351 - .../models/ad_group_retrieve_params.rb | 29 +- lib/whop_sdk/models/ad_group_status.rb | 20 - lib/whop_sdk/models/ad_group_update_params.rb | 3351 +-------- lib/whop_sdk/models/ad_list_params.rb | 203 +- lib/whop_sdk/models/ad_list_response.rb | 357 - lib/whop_sdk/models/ad_retrieve_params.rb | 29 +- lib/whop_sdk/models/ad_update_params.rb | 650 ++ lib/whop_sdk/models/app.rb | 82 +- .../models/app_build_create_params.rb | 4 +- lib/whop_sdk/models/app_create_params.rb | 11 +- lib/whop_sdk/models/app_list_response.rb | 20 +- lib/whop_sdk/models/app_logs_params.rb | 103 + lib/whop_sdk/models/app_logs_response.rb | 157 + lib/whop_sdk/models/app_update_params.rb | 22 +- lib/whop_sdk/models/audience.rb | 120 + lib/whop_sdk/models/audience_create_params.rb | 96 + lib/whop_sdk/models/audience_delete_params.rb | 20 + .../models/audience_delete_response.rb | 16 + lib/whop_sdk/models/audience_list_params.rb | 46 + .../models/authorized_user_create_params.rb | 71 +- lib/whop_sdk/models/bounty_create_params.rb | 73 +- lib/whop_sdk/models/bounty_create_response.rb | 1 + lib/whop_sdk/models/bounty_list_params.rb | 1 + lib/whop_sdk/models/bounty_list_response.rb | 1 + .../models/bounty_retrieve_response.rb | 1 + lib/whop_sdk/models/card_brands.rb | 1 + lib/whop_sdk/models/card_create_params.rb | 88 + lib/whop_sdk/models/card_create_response.rb | 277 + lib/whop_sdk/models/card_list_params.rb | 30 + lib/whop_sdk/models/card_list_response.rb | 287 + lib/whop_sdk/models/card_retrieve_params.rb | 37 + lib/whop_sdk/models/card_retrieve_response.rb | 277 + lib/whop_sdk/models/card_update_params.rb | 181 + lib/whop_sdk/models/card_update_response.rb | 277 + .../chat_message_created_webhook_event.rb | 151 + .../chat_reaction_created_webhook_event.rb | 159 + lib/whop_sdk/models/checkout_configuration.rb | 36 +- .../checkout_configuration_create_params.rb | 1349 +--- .../checkout_configuration_create_response.rb | 275 + .../checkout_configuration_delete_params.rb | 20 + .../checkout_configuration_list_params.rb | 91 +- .../checkout_configuration_list_response.rb | 271 +- ...heckout_configuration_retrieve_response.rb | 275 + lib/whop_sdk/models/company.rb | 4 +- lib/whop_sdk/models/company_list_response.rb | 4 +- .../models/conversion_create_response.rb | 19 - lib/whop_sdk/models/course.rb | 4 +- lib/whop_sdk/models/course_list_response.rb | 4 +- lib/whop_sdk/models/deposit_create_params.rb | 37 +- .../models/deposit_create_response.rb | 238 +- ...lance_params.rb => deposit_list_params.rb} | 8 +- lib/whop_sdk/models/deposit_list_response.rb | 101 + lib/whop_sdk/models/dispute.rb | 16 +- ...reate_params.rb => event_create_params.rb} | 159 +- lib/whop_sdk/models/event_create_response.rb | 16 + lib/whop_sdk/models/event_list_params.rb | 75 + lib/whop_sdk/models/event_list_response.rb | 242 + lib/whop_sdk/models/experience.rb | 13 +- .../models/experience_list_response.rb | 7 +- lib/whop_sdk/models/external_ad_status.rb | 20 - .../models/financial_activity_list_params.rb | 45 +- .../financial_activity_list_response.rb | 683 +- lib/whop_sdk/models/forum_post.rb | 4 +- .../models/forum_post_list_response.rb | 4 +- ...identity_profile_approved_webhook_event.rb | 8 +- ...tity_profile_needs_action_webhook_event.rb | 8 +- ...identity_profile_rejected_webhook_event.rb | 8 +- .../identity_profile_updated_webhook_event.rb | 8 +- lib/whop_sdk/models/invoice_create_params.rb | 20 +- lib/whop_sdk/models/invoice_update_params.rb | 10 +- ...r_account_funds_available_webhook_event.rb | 578 ++ .../ledger_account_retrieve_response.rb | 8 +- lib/whop_sdk/models/lesson.rb | 12 +- lib/whop_sdk/models/media_asset.rb | 224 + lib/whop_sdk/models/media_generate_params.rb | 105 + lib/whop_sdk/models/media_retrieve_params.rb | 20 + lib/whop_sdk/models/membership.rb | 12 +- .../models/membership_list_response.rb | 12 +- ...bership_trial_ending_soon_webhook_event.rb | 60 + lib/whop_sdk/models/payment.rb | 178 +- lib/whop_sdk/models/payment_create_params.rb | 24 +- lib/whop_sdk/models/payment_list_response.rb | 90 +- lib/whop_sdk/models/payout_create_params.rb | 58 + lib/whop_sdk/models/payout_create_response.rb | 185 + .../models/payout_destination_category.rb | 20 - lib/whop_sdk/models/payout_list_params.rb | 70 + lib/whop_sdk/models/payout_list_response.rb | 195 + .../payout_method_created_webhook_event.rb | 23 +- .../models/payout_method_list_params.rb | 54 - .../models/payout_method_list_response.rb | 140 - .../models/payout_method_retrieve_response.rb | 140 - .../models/payouts/method_list_params.rb | 120 + .../models/payouts/method_list_response.rb | 315 + lib/whop_sdk/models/person_list_params.rb | 103 + lib/whop_sdk/models/person_list_response.rb | 167 + lib/whop_sdk/models/person_retrieve_params.rb | 50 + .../models/person_retrieve_response.rb | 179 + lib/whop_sdk/models/plan.rb | 244 +- .../models/plan_calculate_tax_params.rb | 248 + .../models/plan_calculate_tax_response.rb | 94 + lib/whop_sdk/models/plan_create_params.rb | 79 +- lib/whop_sdk/models/plan_list_params.rb | 12 +- lib/whop_sdk/models/plan_list_response.rb | 132 +- lib/whop_sdk/models/plan_update_params.rb | 37 +- lib/whop_sdk/models/product.rb | 72 +- lib/whop_sdk/models/product_create_params.rb | 245 +- lib/whop_sdk/models/product_list_item.rb | 26 +- lib/whop_sdk/models/product_list_params.rb | 92 +- lib/whop_sdk/models/product_update_params.rb | 176 +- .../models/referral_referred_users_params.rb | 66 + .../referral_referred_users_response.rb | 127 + .../referrals/business_leaderboard_params.rb | 45 + .../business_leaderboard_response.rb | 284 + .../models/referrals/business_list_params.rb | 175 + .../referrals/business_list_response.rb | 361 + .../referrals/business_retrieve_params.rb | 22 + .../referrals/business_retrieve_response.rb | 881 +++ .../businesses/earning_list_params.rb | 131 + .../businesses/earning_list_response.rb | 371 + .../models/referrals/partner_create_params.rb | 16 + .../referrals/partner_create_response.rb | 31 + .../models/refund_created_webhook_event.rb | 10 +- .../models/refund_retrieve_response.rb | 10 +- .../models/refund_updated_webhook_event.rb | 10 +- lib/whop_sdk/models/result_label_keys.rb | 10 + lib/whop_sdk/models/review_list_response.rb | 4 +- .../models/review_retrieve_response.rb | 11 +- lib/whop_sdk/models/setup_intent.rb | 11 +- lib/whop_sdk/models/social_account.rb | 101 + .../models/social_account_connect_params.rb | 74 + .../models/social_account_connect_response.rb | 17 + .../models/social_account_create_params.rb | 45 + .../models/social_account_delete_params.rb | 42 + .../models/social_account_delete_response.rb | 8 + .../models/social_account_list_params.rb | 152 + lib/whop_sdk/models/social_account_post.rb | 99 + .../models/social_account_posts_params.rb | 53 + .../models/social_account_posts_response.rb | 39 + ...let_list_params.rb => stat_list_params.rb} | 4 +- lib/whop_sdk/models/stat_list_response.rb | 89 + lib/whop_sdk/models/stat_retrieve_params.rb | 265 + lib/whop_sdk/models/stat_retrieve_response.rb | 88 + lib/whop_sdk/models/swap_create_params.rb | 30 +- .../models/swap_create_quote_params.rb | 39 +- .../models/swap_create_quote_response.rb | 52 +- lib/whop_sdk/models/swap_create_response.rb | 34 +- lib/whop_sdk/models/swap_list_params.rb | 22 + lib/whop_sdk/models/swap_list_response.rb | 77 + lib/whop_sdk/models/swap_retrieve_params.rb | 10 +- lib/whop_sdk/models/swap_retrieve_response.rb | 26 +- lib/whop_sdk/models/tax_identifier_type.rb | 2 + lib/whop_sdk/models/transfer.rb | 299 - lib/whop_sdk/models/transfer_create_params.rb | 91 +- .../models/transfer_create_response.rb | 452 ++ lib/whop_sdk/models/transfer_list_params.rb | 86 +- lib/whop_sdk/models/transfer_list_response.rb | 65 +- .../models/transfer_retrieve_response.rb | 267 + lib/whop_sdk/models/unwrap_webhook_event.rb | 10 +- lib/whop_sdk/models/user.rb | 277 +- lib/whop_sdk/models/user_balance.rb | 226 + lib/whop_sdk/models/user_retrieve_params.rb | 62 +- .../models/verification_create_params.rb | 414 ++ .../models/verification_create_response.rb | 400 + .../models/verification_list_params.rb | 70 +- .../models/verification_list_response.rb | 430 +- .../models/verification_retrieve_params.rb | 8 +- .../models/verification_retrieve_response.rb | 394 +- .../models/verification_update_params.rb | 578 ++ .../models/verification_update_response.rb | 400 + .../models/wallet_balance_response.rb | 84 - lib/whop_sdk/models/wallet_list_response.rb | 38 - lib/whop_sdk/models/wallet_send_params.rb | 38 - lib/whop_sdk/models/wallet_send_response.rb | 90 - lib/whop_sdk/models/webhook_event.rb | 4 + lib/whop_sdk/models/withdrawal.rb | 1 + .../models/withdrawal_create_params.rb | 4 +- .../models/workforce/bounty_list_params.rb | 153 + .../workforce/bounty_retrieve_params.rb | 22 + .../models/workforce/workforce_bounty.rb | 351 + .../workforce/workforce_bounty_list_item.rb | 347 + lib/whop_sdk/resources/access_tokens.rb | 1 - lib/whop_sdk/resources/account_links.rb | 1 - lib/whop_sdk/resources/accounts.rb | 102 +- .../resources/accounts/preferences.rb | 78 + lib/whop_sdk/resources/ad_campaigns.rb | 156 +- lib/whop_sdk/resources/ad_groups.rb | 204 +- lib/whop_sdk/resources/ad_reports.rb | 1 - lib/whop_sdk/resources/ads.rb | 199 +- lib/whop_sdk/resources/affiliates.rb | 2 - .../resources/affiliates/overrides.rb | 1 - lib/whop_sdk/resources/ai_chats.rb | 1 - lib/whop_sdk/resources/app_builds.rb | 1 - lib/whop_sdk/resources/apps.rb | 66 +- lib/whop_sdk/resources/audiences.rb | 104 + lib/whop_sdk/resources/authorized_users.rb | 5 +- lib/whop_sdk/resources/bounties.rb | 11 +- lib/whop_sdk/resources/cards.rb | 178 + lib/whop_sdk/resources/chat_channels.rb | 1 - .../resources/checkout_configurations.rb | 111 +- lib/whop_sdk/resources/companies.rb | 1 - .../resources/company_token_transactions.rb | 1 - lib/whop_sdk/resources/conversions.rb | 78 - lib/whop_sdk/resources/course_chapters.rb | 1 - .../resources/course_lesson_interactions.rb | 1 - lib/whop_sdk/resources/course_lessons.rb | 1 - lib/whop_sdk/resources/course_students.rb | 1 - lib/whop_sdk/resources/courses.rb | 1 - lib/whop_sdk/resources/deposits.rb | 43 +- lib/whop_sdk/resources/dispute_alerts.rb | 1 - lib/whop_sdk/resources/disputes.rb | 1 - lib/whop_sdk/resources/dm_channels.rb | 1 - lib/whop_sdk/resources/dm_members.rb | 1 - lib/whop_sdk/resources/entries.rb | 1 - lib/whop_sdk/resources/events.rb | 121 + lib/whop_sdk/resources/experiences.rb | 1 - lib/whop_sdk/resources/fee_markups.rb | 1 - lib/whop_sdk/resources/files.rb | 1 - lib/whop_sdk/resources/financial_activity.rb | 36 +- lib/whop_sdk/resources/forum_posts.rb | 1 - lib/whop_sdk/resources/forums.rb | 1 - lib/whop_sdk/resources/invoices.rb | 1 - lib/whop_sdk/resources/leads.rb | 1 - lib/whop_sdk/resources/ledger_accounts.rb | 1 - lib/whop_sdk/resources/media.rb | 77 + lib/whop_sdk/resources/members.rb | 1 - lib/whop_sdk/resources/memberships.rb | 1 - lib/whop_sdk/resources/messages.rb | 1 - lib/whop_sdk/resources/notifications.rb | 1 - lib/whop_sdk/resources/payment_methods.rb | 1 - lib/whop_sdk/resources/payments.rb | 1 - lib/whop_sdk/resources/payout_accounts.rb | 1 - lib/whop_sdk/resources/payout_methods.rb | 76 - lib/whop_sdk/resources/payouts.rb | 107 + lib/whop_sdk/resources/payouts/methods.rb | 71 + lib/whop_sdk/resources/people.rb | 99 + lib/whop_sdk/resources/plans.rb | 93 +- lib/whop_sdk/resources/products.rb | 145 +- lib/whop_sdk/resources/promo_codes.rb | 1 - lib/whop_sdk/resources/reactions.rb | 1 - lib/whop_sdk/resources/referrals.rb | 77 + .../resources/referrals/businesses.rb | 132 + .../referrals/businesses/earnings.rb | 67 + lib/whop_sdk/resources/referrals/partners.rb | 42 + lib/whop_sdk/resources/refunds.rb | 1 - .../resources/resolution_center_cases.rb | 1 - lib/whop_sdk/resources/reviews.rb | 1 - lib/whop_sdk/resources/setup_intents.rb | 1 - lib/whop_sdk/resources/shipments.rb | 1 - lib/whop_sdk/resources/social_accounts.rb | 192 + lib/whop_sdk/resources/stats.rb | 113 + lib/whop_sdk/resources/support_channels.rb | 1 - lib/whop_sdk/resources/swaps.rb | 79 +- lib/whop_sdk/resources/topups.rb | 1 - lib/whop_sdk/resources/transfers.rb | 84 +- lib/whop_sdk/resources/users.rb | 29 +- lib/whop_sdk/resources/verifications.rb | 101 +- lib/whop_sdk/resources/wallets.rb | 87 - lib/whop_sdk/resources/webhooks.rb | 3 +- lib/whop_sdk/resources/withdrawals.rb | 3 +- lib/whop_sdk/resources/workforce.rb | 25 + lib/whop_sdk/resources/workforce/bounties.rb | 97 + rbi/whop_sdk/client.rbi | 258 +- rbi/whop_sdk/models.rbi | 127 +- rbi/whop_sdk/models/account.rbi | 1384 +++- rbi/whop_sdk/models/account_create_params.rbi | 13 + rbi/whop_sdk/models/account_list_params.rbi | 122 +- rbi/whop_sdk/models/account_list_response.rbi | 115 - .../account_recommend_actions_params.rbi | 38 + .../account_recommend_actions_response.rbi | 296 + rbi/whop_sdk/models/account_update_params.rbi | 870 ++- rbi/whop_sdk/models/account_wallet.rbi | 75 - .../accounts/preference_retrieve_params.rbi | 40 + .../accounts/preference_retrieve_response.rbi | 323 + .../accounts/preference_update_params.rbi | 331 + .../accounts/preference_update_response.rbi | 323 + rbi/whop_sdk/models/ad.rbi | 890 ++- rbi/whop_sdk/models/ad_budget_type.rbi | 20 - rbi/whop_sdk/models/ad_campaign.rbi | 825 ++- .../models/ad_campaign_create_params.rbi | 428 ++ ...rams.rbi => ad_campaign_delete_params.rbi} | 4 +- .../models/ad_campaign_delete_response.rbi | 8 + .../models/ad_campaign_list_params.rbi | 337 +- .../models/ad_campaign_list_response.rbi | 457 -- rbi/whop_sdk/models/ad_campaign_platform.rbi | 22 - .../models/ad_campaign_retrieve_params.rbi | 45 +- rbi/whop_sdk/models/ad_campaign_status.rbi | 27 - .../models/ad_campaign_update_params.rbi | 215 +- rbi/whop_sdk/models/ad_create_params.rbi | 1491 ++++ rbi/whop_sdk/models/ad_delete_params.rbi | 35 + rbi/whop_sdk/models/ad_delete_response.rbi | 7 + rbi/whop_sdk/models/ad_group.rbi | 907 ++- .../models/ad_group_create_params.rbi | 654 ++ rbi/whop_sdk/models/ad_group_list_params.rbi | 306 +- .../models/ad_group_list_response.rbi | 497 -- .../models/ad_group_retrieve_params.rbi | 45 +- rbi/whop_sdk/models/ad_group_status.rbi | 24 - .../models/ad_group_update_params.rbi | 6493 ++--------------- rbi/whop_sdk/models/ad_list_params.rbi | 332 +- rbi/whop_sdk/models/ad_list_response.rbi | 514 -- rbi/whop_sdk/models/ad_retrieve_params.rbi | 45 +- rbi/whop_sdk/models/ad_update_params.rbi | 1473 ++++ rbi/whop_sdk/models/app.rbi | 111 + .../models/app_build_create_params.rbi | 6 +- rbi/whop_sdk/models/app_create_params.rbi | 10 + rbi/whop_sdk/models/app_list_response.rbi | 20 + rbi/whop_sdk/models/app_logs_params.rbi | 154 + rbi/whop_sdk/models/app_logs_response.rbi | 261 + rbi/whop_sdk/models/app_update_params.rbi | 24 + rbi/whop_sdk/models/audience.rbi | 140 + .../models/audience_create_params.rbi | 160 + .../models/audience_delete_params.rbi | 35 + .../models/audience_delete_response.rbi | 26 + rbi/whop_sdk/models/audience_list_params.rbi | 76 + .../models/authorized_user_create_params.rbi | 102 + rbi/whop_sdk/models/bounty_create_params.rbi | 168 +- .../models/bounty_create_response.rbi | 5 + rbi/whop_sdk/models/bounty_list_params.rbi | 2 + rbi/whop_sdk/models/bounty_list_response.rbi | 5 + .../models/bounty_retrieve_response.rbi | 5 + rbi/whop_sdk/models/card_brands.rbi | 1 + rbi/whop_sdk/models/card_create_params.rbi | 167 + rbi/whop_sdk/models/card_create_response.rbi | 446 ++ rbi/whop_sdk/models/card_list_params.rbi | 57 + rbi/whop_sdk/models/card_list_response.rbi | 511 ++ rbi/whop_sdk/models/card_retrieve_params.rbi | 63 + .../models/card_retrieve_response.rbi | 457 ++ rbi/whop_sdk/models/card_update_params.rbi | 299 + rbi/whop_sdk/models/card_update_response.rbi | 446 ++ .../chat_message_created_webhook_event.rbi | 319 + .../chat_reaction_created_webhook_event.rbi | 335 + .../models/checkout_configuration.rbi | 80 +- .../checkout_configuration_create_params.rbi | 1996 +---- ...checkout_configuration_create_response.rbi | 420 ++ .../checkout_configuration_delete_params.rbi | 38 + .../checkout_configuration_list_params.rbi | 193 +- .../checkout_configuration_list_response.rbi | 412 +- ...eckout_configuration_retrieve_response.rbi | 422 ++ rbi/whop_sdk/models/company.rbi | 4 +- rbi/whop_sdk/models/company_list_response.rbi | 4 +- rbi/whop_sdk/models/course.rbi | 4 +- rbi/whop_sdk/models/course_list_response.rbi | 4 +- rbi/whop_sdk/models/deposit_create_params.rbi | 39 +- .../models/deposit_create_response.rbi | 410 +- ...nce_params.rbi => deposit_list_params.rbi} | 8 +- rbi/whop_sdk/models/deposit_list_response.rbi | 163 + rbi/whop_sdk/models/dispute.rbi | 16 +- ...ate_params.rbi => event_create_params.rbi} | 274 +- ...response.rbi => event_create_response.rbi} | 11 +- rbi/whop_sdk/models/event_list_params.rbi | 111 + rbi/whop_sdk/models/event_list_response.rbi | 350 + rbi/whop_sdk/models/experience.rbi | 12 +- .../models/experience_list_response.rbi | 4 +- rbi/whop_sdk/models/external_ad_status.rbi | 26 - .../models/financial_activity_list_params.rbi | 57 +- .../financial_activity_list_response.rbi | 917 ++- rbi/whop_sdk/models/forum_post.rbi | 4 +- .../models/forum_post_list_response.rbi | 4 +- ...dentity_profile_approved_webhook_event.rbi | 12 +- ...ity_profile_needs_action_webhook_event.rbi | 12 +- ...dentity_profile_rejected_webhook_event.rbi | 12 +- ...identity_profile_updated_webhook_event.rbi | 12 +- rbi/whop_sdk/models/invoice_create_params.rbi | 16 + rbi/whop_sdk/models/invoice_update_params.rbi | 8 + ..._account_funds_available_webhook_event.rbi | 1001 +++ .../ledger_account_retrieve_response.rbi | 4 +- rbi/whop_sdk/models/lesson.rbi | 12 +- rbi/whop_sdk/models/media_asset.rbi | 325 + rbi/whop_sdk/models/media_generate_params.rbi | 204 + rbi/whop_sdk/models/media_retrieve_params.rbi | 35 + rbi/whop_sdk/models/membership.rbi | 20 +- .../models/membership_list_response.rbi | 20 +- ...ership_trial_ending_soon_webhook_event.rbi | 85 + rbi/whop_sdk/models/payment.rbi | 236 +- rbi/whop_sdk/models/payment_create_params.rbi | 36 +- rbi/whop_sdk/models/payment_list_response.rbi | 137 +- rbi/whop_sdk/models/payout_create_params.rbi | 83 + .../models/payout_create_response.rbi | 352 + .../models/payout_destination_category.rbi | 33 - rbi/whop_sdk/models/payout_list_params.rbi | 112 + rbi/whop_sdk/models/payout_list_response.rbi | 353 + .../payout_method_created_webhook_event.rbi | 67 +- .../models/payout_method_list_params.rbi | 75 - .../models/payout_method_list_response.rbi | 234 - .../payout_method_retrieve_response.rbi | 238 - .../models/payouts/method_list_params.rbi | 209 + .../models/payouts/method_list_response.rbi | 554 ++ rbi/whop_sdk/models/person_list_params.rbi | 160 + rbi/whop_sdk/models/person_list_response.rbi | 282 + .../models/person_retrieve_params.rbi | 76 + .../models/person_retrieve_response.rbi | 349 + rbi/whop_sdk/models/plan.rbi | 292 +- .../models/plan_calculate_tax_params.rbi | 795 ++ .../models/plan_calculate_tax_response.rbi | 170 + rbi/whop_sdk/models/plan_create_params.rbi | 97 +- rbi/whop_sdk/models/plan_list_params.rbi | 16 +- rbi/whop_sdk/models/plan_list_response.rbi | 144 +- rbi/whop_sdk/models/plan_update_params.rbi | 42 +- rbi/whop_sdk/models/product.rbi | 90 +- rbi/whop_sdk/models/product_create_params.rbi | 352 +- rbi/whop_sdk/models/product_list_item.rbi | 36 +- rbi/whop_sdk/models/product_list_params.rbi | 153 +- rbi/whop_sdk/models/product_update_params.rbi | 245 +- .../models/referral_referred_users_params.rbi | 106 + .../referral_referred_users_response.rbi | 259 + .../referrals/business_leaderboard_params.rbi | 120 + .../business_leaderboard_response.rbi | 535 ++ .../models/referrals/business_list_params.rbi | 376 + .../referrals/business_list_response.rbi | 701 ++ .../referrals/business_retrieve_params.rbi | 40 + .../referrals/business_retrieve_response.rbi | 1846 +++++ .../businesses/earning_list_params.rbi | 308 + .../businesses/earning_list_response.rbi | 693 ++ .../referrals/partner_create_params.rbi | 32 + .../referrals/partner_create_response.rbi | 48 + .../models/refund_created_webhook_event.rbi | 16 +- .../models/refund_retrieve_response.rbi | 16 +- .../models/refund_updated_webhook_event.rbi | 16 +- rbi/whop_sdk/models/result_label_keys.rbi | 23 + rbi/whop_sdk/models/review_list_response.rbi | 4 +- .../models/review_retrieve_response.rbi | 8 +- rbi/whop_sdk/models/setup_intent.rbi | 16 +- rbi/whop_sdk/models/social_account.rbi | 129 + .../models/social_account_connect_params.rbi | 146 + .../social_account_connect_response.rbi | 30 + .../models/social_account_create_params.rbi | 81 + .../models/social_account_delete_params.rbi | 67 + .../models/social_account_delete_response.rbi | 8 + .../models/social_account_list_params.rbi | 308 + rbi/whop_sdk/models/social_account_post.rbi | 261 + .../models/social_account_posts_params.rbi | 82 + .../models/social_account_posts_response.rbi | 83 + ...t_list_params.rbi => stat_list_params.rbi} | 4 +- rbi/whop_sdk/models/stat_list_response.rbi | 159 + rbi/whop_sdk/models/stat_retrieve_params.rbi | 411 ++ .../models/stat_retrieve_response.rbi | 198 + rbi/whop_sdk/models/swap_create_params.rbi | 26 +- .../models/swap_create_quote_params.rbi | 32 +- .../models/swap_create_quote_response.rbi | 26 + rbi/whop_sdk/models/swap_create_response.rbi | 20 + rbi/whop_sdk/models/swap_list_params.rbi | 40 + rbi/whop_sdk/models/swap_list_response.rbi | 137 + rbi/whop_sdk/models/swap_retrieve_params.rbi | 13 +- .../models/swap_retrieve_response.rbi | 24 +- rbi/whop_sdk/models/tax_identifier_type.rbi | 2 + rbi/whop_sdk/models/transfer.rbi | 407 -- .../models/transfer_create_params.rbi | 134 +- .../models/transfer_create_response.rbi | 767 ++ rbi/whop_sdk/models/transfer_list_params.rbi | 171 +- .../models/transfer_list_response.rbi | 72 +- .../models/transfer_retrieve_response.rbi | 416 ++ rbi/whop_sdk/models/unwrap_webhook_event.rbi | 4 + rbi/whop_sdk/models/user.rbi | 429 +- rbi/whop_sdk/models/user_balance.rbi | 301 + rbi/whop_sdk/models/user_retrieve_params.rbi | 95 + .../models/verification_create_params.rbi | 783 ++ .../models/verification_create_response.rbi | 757 ++ .../models/verification_list_params.rbi | 122 +- .../models/verification_list_response.rbi | 822 ++- .../models/verification_retrieve_params.rbi | 8 +- .../models/verification_retrieve_response.rbi | 752 +- .../models/verification_update_params.rbi | 1187 +++ .../models/verification_update_response.rbi | 757 ++ .../models/wallet_balance_response.rbi | 145 - rbi/whop_sdk/models/wallet_list_response.rbi | 66 - rbi/whop_sdk/models/wallet_send_params.rbi | 59 - rbi/whop_sdk/models/wallet_send_response.rbi | 146 - rbi/whop_sdk/models/webhook_event.rbi | 14 + rbi/whop_sdk/models/withdrawal.rbi | 5 + .../models/withdrawal_create_params.rbi | 4 +- .../models/workforce/bounty_list_params.rbi | 313 + .../workforce/bounty_retrieve_params.rbi | 40 + .../models/workforce/workforce_bounty.rbi | 588 ++ .../workforce/workforce_bounty_list_item.rbi | 590 ++ rbi/whop_sdk/resources/access_tokens.rbi | 1 - rbi/whop_sdk/resources/account_links.rbi | 1 - rbi/whop_sdk/resources/accounts.rbi | 113 +- .../resources/accounts/preferences.rbi | 62 + rbi/whop_sdk/resources/ad_campaigns.rbi | 233 +- rbi/whop_sdk/resources/ad_groups.rbi | 358 +- rbi/whop_sdk/resources/ad_reports.rbi | 1 - rbi/whop_sdk/resources/ads.rbi | 306 +- rbi/whop_sdk/resources/affiliates.rbi | 2 - .../resources/affiliates/overrides.rbi | 1 - rbi/whop_sdk/resources/ai_chats.rbi | 1 - rbi/whop_sdk/resources/app_builds.rbi | 3 +- rbi/whop_sdk/resources/apps.rbi | 67 +- rbi/whop_sdk/resources/audiences.rbi | 82 + rbi/whop_sdk/resources/authorized_users.rbi | 5 +- rbi/whop_sdk/resources/bounties.rbi | 26 +- rbi/whop_sdk/resources/cards.rbi | 160 + rbi/whop_sdk/resources/chat_channels.rbi | 1 - .../resources/checkout_configurations.rbi | 133 +- rbi/whop_sdk/resources/companies.rbi | 1 - .../resources/company_token_transactions.rbi | 1 - rbi/whop_sdk/resources/conversions.rbi | 84 - rbi/whop_sdk/resources/course_chapters.rbi | 1 - .../resources/course_lesson_interactions.rbi | 1 - rbi/whop_sdk/resources/course_lessons.rbi | 1 - rbi/whop_sdk/resources/course_students.rbi | 1 - rbi/whop_sdk/resources/courses.rbi | 1 - rbi/whop_sdk/resources/deposits.rbi | 34 +- rbi/whop_sdk/resources/dispute_alerts.rbi | 1 - rbi/whop_sdk/resources/disputes.rbi | 1 - rbi/whop_sdk/resources/dm_channels.rbi | 1 - rbi/whop_sdk/resources/dm_members.rbi | 1 - rbi/whop_sdk/resources/entries.rbi | 1 - rbi/whop_sdk/resources/events.rbi | 122 + rbi/whop_sdk/resources/experiences.rbi | 1 - rbi/whop_sdk/resources/fee_markups.rbi | 1 - rbi/whop_sdk/resources/files.rbi | 1 - rbi/whop_sdk/resources/financial_activity.rbi | 42 +- rbi/whop_sdk/resources/forum_posts.rbi | 1 - rbi/whop_sdk/resources/forums.rbi | 1 - rbi/whop_sdk/resources/invoices.rbi | 1 - rbi/whop_sdk/resources/leads.rbi | 1 - rbi/whop_sdk/resources/ledger_accounts.rbi | 1 - rbi/whop_sdk/resources/media.rbi | 67 + rbi/whop_sdk/resources/members.rbi | 1 - rbi/whop_sdk/resources/memberships.rbi | 1 - rbi/whop_sdk/resources/messages.rbi | 1 - rbi/whop_sdk/resources/notifications.rbi | 1 - rbi/whop_sdk/resources/payment_methods.rbi | 1 - rbi/whop_sdk/resources/payments.rbi | 1 - rbi/whop_sdk/resources/payout_accounts.rbi | 1 - rbi/whop_sdk/resources/payout_methods.rbi | 66 - rbi/whop_sdk/resources/payouts.rbi | 96 + rbi/whop_sdk/resources/payouts/methods.rbi | 76 + rbi/whop_sdk/resources/people.rbi | 86 + rbi/whop_sdk/resources/plans.rbi | 104 +- rbi/whop_sdk/resources/products.rbi | 217 +- rbi/whop_sdk/resources/promo_codes.rbi | 1 - rbi/whop_sdk/resources/reactions.rbi | 1 - rbi/whop_sdk/resources/referrals.rbi | 67 + .../resources/referrals/businesses.rbi | 122 + .../referrals/businesses/earnings.rbi | 67 + rbi/whop_sdk/resources/referrals/partners.rbi | 31 + rbi/whop_sdk/resources/refunds.rbi | 1 - .../resources/resolution_center_cases.rbi | 1 - rbi/whop_sdk/resources/reviews.rbi | 1 - rbi/whop_sdk/resources/setup_intents.rbi | 1 - rbi/whop_sdk/resources/shipments.rbi | 1 - rbi/whop_sdk/resources/social_accounts.rbi | 161 + rbi/whop_sdk/resources/stats.rbi | 143 + rbi/whop_sdk/resources/support_channels.rbi | 1 - rbi/whop_sdk/resources/swaps.rbi | 54 +- rbi/whop_sdk/resources/topups.rbi | 1 - rbi/whop_sdk/resources/transfers.rbi | 123 +- rbi/whop_sdk/resources/users.rbi | 38 +- rbi/whop_sdk/resources/verifications.rbi | 120 +- rbi/whop_sdk/resources/wallets.rbi | 55 - rbi/whop_sdk/resources/webhooks.rbi | 5 +- rbi/whop_sdk/resources/withdrawals.rbi | 3 +- rbi/whop_sdk/resources/workforce.rbi | 22 + rbi/whop_sdk/resources/workforce/bounties.rbi | 94 + sig/whop_sdk/client.rbs | 26 +- sig/whop_sdk/models.rbs | 122 +- sig/whop_sdk/models/account.rbs | 544 +- sig/whop_sdk/models/account_create_params.rbs | 8 +- sig/whop_sdk/models/account_list_params.rbs | 74 +- sig/whop_sdk/models/account_list_response.rbs | 62 - ...s => account_recommend_actions_params.rbs} | 15 +- .../account_recommend_actions_response.rbs | 129 + sig/whop_sdk/models/account_update_params.rbs | 343 + sig/whop_sdk/models/account_wallet.rbs | 42 - .../accounts/preference_retrieve_params.rbs | 25 + .../accounts/preference_retrieve_response.rbs | 110 + .../accounts/preference_update_params.rbs | 133 + .../accounts/preference_update_response.rbs | 110 + sig/whop_sdk/models/ad.rbs | 516 +- sig/whop_sdk/models/ad_budget_type.rbs | 14 - sig/whop_sdk/models/ad_campaign.rbs | 427 +- .../models/ad_campaign_create_params.rbs | 179 + ...rams.rbs => ad_campaign_delete_params.rbs} | 4 +- .../models/ad_campaign_delete_response.rbs | 5 + .../models/ad_campaign_list_params.rbs | 198 +- .../models/ad_campaign_list_response.rbs | 221 - sig/whop_sdk/models/ad_campaign_platform.rbs | 14 - .../models/ad_campaign_retrieve_params.rbs | 24 +- sig/whop_sdk/models/ad_campaign_status.rbs | 19 - .../models/ad_campaign_update_params.rbs | 94 +- sig/whop_sdk/models/ad_create_params.rbs | 751 ++ sig/whop_sdk/models/ad_delete_params.rbs | 20 + sig/whop_sdk/models/ad_delete_response.rbs | 5 + sig/whop_sdk/models/ad_group.rbs | 483 +- .../models/ad_group_create_params.rbs | 292 + sig/whop_sdk/models/ad_group_list_params.rbs | 199 +- .../models/ad_group_list_response.rbs | 236 - .../models/ad_group_retrieve_params.rbs | 24 +- sig/whop_sdk/models/ad_group_status.rbs | 19 - .../models/ad_group_update_params.rbs | 2559 +------ sig/whop_sdk/models/ad_list_params.rbs | 229 +- sig/whop_sdk/models/ad_list_response.rbs | 241 - sig/whop_sdk/models/ad_retrieve_params.rbs | 24 +- sig/whop_sdk/models/ad_update_params.rbs | 742 ++ sig/whop_sdk/models/app.rbs | 52 + sig/whop_sdk/models/app_create_params.rbs | 7 +- sig/whop_sdk/models/app_list_response.rbs | 10 + sig/whop_sdk/models/app_logs_params.rbs | 98 + sig/whop_sdk/models/app_logs_response.rbs | 162 + sig/whop_sdk/models/app_update_params.rbs | 10 + sig/whop_sdk/models/audience.rbs | 86 + .../models/audience_create_params.rbs | 88 + .../models/audience_delete_params.rbs | 23 + .../models/audience_delete_response.rbs | 13 + sig/whop_sdk/models/audience_list_params.rbs | 42 + .../models/authorized_user_create_params.rbs | 52 + sig/whop_sdk/models/bounty_create_params.rbs | 57 +- .../models/bounty_create_response.rbs | 3 +- sig/whop_sdk/models/bounty_list_params.rbs | 3 +- sig/whop_sdk/models/bounty_list_response.rbs | 3 +- .../models/bounty_retrieve_response.rbs | 3 +- sig/whop_sdk/models/card_brands.rbs | 2 + sig/whop_sdk/models/card_create_params.rbs | 85 + sig/whop_sdk/models/card_create_response.rbs | 200 + sig/whop_sdk/models/card_list_params.rbs | 32 + sig/whop_sdk/models/card_list_response.rbs | 214 + sig/whop_sdk/models/card_retrieve_params.rbs | 36 + .../models/card_retrieve_response.rbs | 200 + sig/whop_sdk/models/card_update_params.rbs | 164 + sig/whop_sdk/models/card_update_response.rbs | 200 + .../chat_message_created_webhook_event.rbs | 149 + .../chat_reaction_created_webhook_event.rbs | 154 + .../models/checkout_configuration.rbs | 5 - .../checkout_configuration_create_params.rbs | 871 +-- ...checkout_configuration_create_response.rbs | 196 + .../checkout_configuration_delete_params.rbs | 20 + .../checkout_configuration_list_params.rbs | 98 +- .../checkout_configuration_list_response.rbs | 158 +- ...eckout_configuration_retrieve_response.rbs | 196 + sig/whop_sdk/models/deposit_create_params.rbs | 12 +- .../models/deposit_create_response.rbs | 186 +- ...nce_params.rbs => deposit_list_params.rbs} | 4 +- sig/whop_sdk/models/deposit_list_response.rbs | 87 + ...ate_params.rbs => event_create_params.rbs} | 255 +- ...response.rbs => event_create_response.rbs} | 4 +- sig/whop_sdk/models/event_list_params.rbs | 68 + sig/whop_sdk/models/event_list_response.rbs | 231 + sig/whop_sdk/models/external_ad_status.rbs | 19 - .../models/financial_activity_list_params.rbs | 21 + .../financial_activity_list_response.rbs | 401 +- sig/whop_sdk/models/invoice_create_params.rbs | 10 + sig/whop_sdk/models/invoice_update_params.rbs | 5 + ..._account_funds_available_webhook_event.rbs | 418 ++ sig/whop_sdk/models/media_asset.rbs | 160 + sig/whop_sdk/models/media_generate_params.rbs | 99 + sig/whop_sdk/models/media_retrieve_params.rbs | 20 + ...ership_trial_ending_soon_webhook_event.rbs | 45 + sig/whop_sdk/models/payment.rbs | 109 + sig/whop_sdk/models/payment_create_params.rbs | 22 +- sig/whop_sdk/models/payment_list_response.rbs | 52 + sig/whop_sdk/models/payout_create_params.rbs | 50 + .../models/payout_create_response.rbs | 139 + .../models/payout_destination_category.rbs | 19 - sig/whop_sdk/models/payout_list_params.rbs | 70 + sig/whop_sdk/models/payout_list_response.rbs | 153 + .../payout_method_created_webhook_event.rbs | 29 +- .../models/payout_method_list_params.rbs | 46 - .../models/payout_method_list_response.rbs | 97 - .../payout_method_retrieve_response.rbs | 97 - .../models/payouts/method_list_params.rbs | 107 + .../models/payouts/method_list_response.rbs | 229 + sig/whop_sdk/models/person_list_params.rbs | 97 + sig/whop_sdk/models/person_list_response.rbs | 162 + .../models/person_retrieve_params.rbs | 42 + .../models/person_retrieve_response.rbs | 175 + sig/whop_sdk/models/plan.rbs | 90 +- .../models/plan_calculate_tax_params.rbs | 344 + .../models/plan_calculate_tax_response.rbs | 67 + sig/whop_sdk/models/plan_create_params.rbs | 24 +- sig/whop_sdk/models/plan_list_params.rbs | 12 +- sig/whop_sdk/models/plan_list_response.rbs | 10 +- sig/whop_sdk/models/product_create_params.rbs | 160 +- sig/whop_sdk/models/product_list_params.rbs | 101 +- sig/whop_sdk/models/product_update_params.rbs | 108 +- .../models/referral_referred_users_params.rbs | 63 + .../referral_referred_users_response.rbs | 140 + .../referrals/business_leaderboard_params.rbs | 46 + .../business_leaderboard_response.rbs | 221 + .../models/referrals/business_list_params.rbs | 176 + .../referrals/business_list_response.rbs | 267 + .../referrals/business_retrieve_params.rbs | 22 + .../referrals/business_retrieve_response.rbs | 677 ++ .../businesses/earning_list_params.rbs | 139 + .../businesses/earning_list_response.rbs | 288 + .../referrals/partner_create_params.rbs | 17 + .../referrals/partner_create_response.rbs | 21 + sig/whop_sdk/models/result_label_keys.rbs | 20 + sig/whop_sdk/models/setup_intent.rbs | 11 +- sig/whop_sdk/models/social_account.rbs | 74 + .../models/social_account_connect_params.rbs | 69 + .../social_account_connect_response.rbs | 13 + .../models/social_account_create_params.rbs | 43 + .../models/social_account_delete_params.rbs | 36 + .../models/social_account_delete_response.rbs | 5 + .../models/social_account_list_params.rbs | 152 + sig/whop_sdk/models/social_account_post.rbs | 111 + .../models/social_account_posts_params.rbs | 52 + .../models/social_account_posts_response.rbs | 37 + ...t_list_params.rbs => stat_list_params.rbs} | 4 +- sig/whop_sdk/models/stat_list_response.rbs | 72 + sig/whop_sdk/models/stat_retrieve_params.rbs | 211 + .../models/stat_retrieve_response.rbs | 81 + sig/whop_sdk/models/swap_create_response.rbs | 5 + sig/whop_sdk/models/swap_list_params.rbs | 23 + sig/whop_sdk/models/swap_list_response.rbs | 68 + sig/whop_sdk/models/swap_retrieve_params.rbs | 11 +- .../models/swap_retrieve_response.rbs | 5 + sig/whop_sdk/models/tax_identifier_type.rbs | 4 + .../models/transfer_create_params.rbs | 57 +- .../models/transfer_create_response.rbs | 366 + sig/whop_sdk/models/transfer_list_params.rbs | 119 +- .../models/transfer_list_response.rbs | 28 +- ...fer.rbs => transfer_retrieve_response.rbs} | 161 +- sig/whop_sdk/models/unwrap_webhook_event.rbs | 6 +- sig/whop_sdk/models/user.rbs | 203 +- sig/whop_sdk/models/user_balance.rbs | 171 + sig/whop_sdk/models/user_retrieve_params.rbs | 55 +- .../models/verification_create_params.rbs | 364 + .../models/verification_create_response.rbs | 333 + .../models/verification_list_params.rbs | 60 +- .../models/verification_list_response.rbs | 357 +- .../models/verification_retrieve_params.rbs | 11 +- .../models/verification_retrieve_response.rbs | 326 +- .../models/verification_update_params.rbs | 570 ++ .../models/verification_update_response.rbs | 333 + .../models/wallet_balance_response.rbs | 87 - sig/whop_sdk/models/wallet_list_response.rbs | 40 - sig/whop_sdk/models/wallet_send_response.rbs | 79 - sig/whop_sdk/models/webhook_event.rbs | 8 + sig/whop_sdk/models/withdrawal.rbs | 2 + .../models/workforce/bounty_list_params.rbs | 149 + .../workforce/bounty_retrieve_params.rbs | 22 + .../models/workforce/workforce_bounty.rbs | 232 + .../workforce/workforce_bounty_list_item.rbs | 227 + sig/whop_sdk/resources/accounts.rbs | 22 +- .../resources/accounts/preferences.rbs | 20 + sig/whop_sdk/resources/ad_campaigns.rbs | 58 +- sig/whop_sdk/resources/ad_groups.rbs | 90 +- sig/whop_sdk/resources/ads.rbs | 86 +- sig/whop_sdk/resources/apps.rbs | 16 + sig/whop_sdk/resources/audiences.rbs | 28 + sig/whop_sdk/resources/authorized_users.rbs | 1 + sig/whop_sdk/resources/bounties.rbs | 4 + sig/whop_sdk/resources/cards.rbs | 47 + .../resources/checkout_configurations.rbs | 32 +- sig/whop_sdk/resources/conversions.rbs | 29 - sig/whop_sdk/resources/deposits.rbs | 7 +- sig/whop_sdk/resources/events.rbs | 40 + sig/whop_sdk/resources/financial_activity.rbs | 3 + sig/whop_sdk/resources/media.rbs | 22 + sig/whop_sdk/resources/payout_methods.rbs | 21 - sig/whop_sdk/resources/payouts.rbs | 29 + sig/whop_sdk/resources/payouts/methods.rbs | 23 + sig/whop_sdk/resources/people.rbs | 28 + sig/whop_sdk/resources/plans.rbs | 14 +- sig/whop_sdk/resources/products.rbs | 50 +- sig/whop_sdk/resources/referrals.rbs | 21 + .../resources/referrals/businesses.rbs | 38 + .../referrals/businesses/earnings.rbs | 25 + sig/whop_sdk/resources/referrals/partners.rbs | 13 + sig/whop_sdk/resources/social_accounts.rbs | 52 + sig/whop_sdk/resources/stats.rbs | 39 + sig/whop_sdk/resources/swaps.rbs | 7 +- sig/whop_sdk/resources/transfers.rbs | 31 +- sig/whop_sdk/resources/users.rbs | 5 + sig/whop_sdk/resources/verifications.rbs | 24 +- sig/whop_sdk/resources/wallets.rbs | 23 - sig/whop_sdk/resources/webhooks.rbs | 6 +- sig/whop_sdk/resources/workforce.rbs | 9 + sig/whop_sdk/resources/workforce/bounties.rbs | 30 + test/whop_sdk/resource_namespaces.rb | 17 + .../resources/accounts/preferences_test.rb | 37 + test/whop_sdk/resources/accounts_test.rb | 128 +- test/whop_sdk/resources/ad_campaigns_test.rb | 320 +- test/whop_sdk/resources/ad_groups_test.rb | 381 +- test/whop_sdk/resources/ads_test.rb | 376 +- test/whop_sdk/resources/apps_test.rb | 31 + test/whop_sdk/resources/audiences_test.rb | 81 + test/whop_sdk/resources/cards_test.rb | 111 + .../resources/checkout_configurations_test.rb | 79 +- test/whop_sdk/resources/conversions_test.rb | 21 - test/whop_sdk/resources/deposits_test.rb | 28 +- test/whop_sdk/resources/events_test.rb | 57 + test/whop_sdk/resources/media_test.rb | 57 + test/whop_sdk/resources/payments_test.rb | 26 + .../whop_sdk/resources/payout_methods_test.rb | 60 - .../resources/payouts/methods_test.rb | 39 + test/whop_sdk/resources/payouts_test.rb | 66 + test/whop_sdk/resources/people_test.rb | 58 + test/whop_sdk/resources/plans_test.rb | 47 +- test/whop_sdk/resources/products_test.rb | 10 +- .../referrals/businesses/earnings_test.rb | 41 + .../resources/referrals/businesses_test.rb | 85 + .../resources/referrals/partners_test.rb | 22 + test/whop_sdk/resources/referrals_test.rb | 22 + test/whop_sdk/resources/setup_intents_test.rb | 3 +- .../resources/social_accounts_test.rb | 103 + test/whop_sdk/resources/stats_test.rb | 37 + test/whop_sdk/resources/swaps_test.rb | 22 +- test/whop_sdk/resources/transfers_test.rb | 48 +- test/whop_sdk/resources/users_test.rb | 28 +- test/whop_sdk/resources/verifications_test.rb | 93 +- test/whop_sdk/resources/wallets_test.rb | 60 - test/whop_sdk/resources/webhooks_test.rb | 2 +- .../resources/workforce/bounties_test.rb | 85 + test/whop_sdk/resources/workforce_test.rb | 6 + 843 files changed, 93794 insertions(+), 30550 deletions(-) delete mode 100644 lib/whop_sdk/models/account_list_response.rb create mode 100644 lib/whop_sdk/models/account_recommend_actions_params.rb create mode 100644 lib/whop_sdk/models/account_recommend_actions_response.rb delete mode 100644 lib/whop_sdk/models/account_wallet.rb create mode 100644 lib/whop_sdk/models/accounts/preference_retrieve_params.rb create mode 100644 lib/whop_sdk/models/accounts/preference_retrieve_response.rb create mode 100644 lib/whop_sdk/models/accounts/preference_update_params.rb create mode 100644 lib/whop_sdk/models/accounts/preference_update_response.rb delete mode 100644 lib/whop_sdk/models/ad_budget_type.rb create mode 100644 lib/whop_sdk/models/ad_campaign_create_params.rb rename lib/whop_sdk/models/{payout_method_retrieve_params.rb => ad_campaign_delete_params.rb} (78%) create mode 100644 lib/whop_sdk/models/ad_campaign_delete_response.rb delete mode 100644 lib/whop_sdk/models/ad_campaign_list_response.rb delete mode 100644 lib/whop_sdk/models/ad_campaign_platform.rb delete mode 100644 lib/whop_sdk/models/ad_campaign_status.rb create mode 100644 lib/whop_sdk/models/ad_create_params.rb create mode 100644 lib/whop_sdk/models/ad_delete_params.rb create mode 100644 lib/whop_sdk/models/ad_delete_response.rb create mode 100644 lib/whop_sdk/models/ad_group_create_params.rb delete mode 100644 lib/whop_sdk/models/ad_group_list_response.rb delete mode 100644 lib/whop_sdk/models/ad_group_status.rb delete mode 100644 lib/whop_sdk/models/ad_list_response.rb create mode 100644 lib/whop_sdk/models/ad_update_params.rb create mode 100644 lib/whop_sdk/models/app_logs_params.rb create mode 100644 lib/whop_sdk/models/app_logs_response.rb create mode 100644 lib/whop_sdk/models/audience.rb create mode 100644 lib/whop_sdk/models/audience_create_params.rb create mode 100644 lib/whop_sdk/models/audience_delete_params.rb create mode 100644 lib/whop_sdk/models/audience_delete_response.rb create mode 100644 lib/whop_sdk/models/audience_list_params.rb create mode 100644 lib/whop_sdk/models/card_create_params.rb create mode 100644 lib/whop_sdk/models/card_create_response.rb create mode 100644 lib/whop_sdk/models/card_list_params.rb create mode 100644 lib/whop_sdk/models/card_list_response.rb create mode 100644 lib/whop_sdk/models/card_retrieve_params.rb create mode 100644 lib/whop_sdk/models/card_retrieve_response.rb create mode 100644 lib/whop_sdk/models/card_update_params.rb create mode 100644 lib/whop_sdk/models/card_update_response.rb create mode 100644 lib/whop_sdk/models/chat_message_created_webhook_event.rb create mode 100644 lib/whop_sdk/models/chat_reaction_created_webhook_event.rb create mode 100644 lib/whop_sdk/models/checkout_configuration_create_response.rb create mode 100644 lib/whop_sdk/models/checkout_configuration_delete_params.rb create mode 100644 lib/whop_sdk/models/checkout_configuration_retrieve_response.rb delete mode 100644 lib/whop_sdk/models/conversion_create_response.rb rename lib/whop_sdk/models/{wallet_balance_params.rb => deposit_list_params.rb} (59%) create mode 100644 lib/whop_sdk/models/deposit_list_response.rb rename lib/whop_sdk/models/{conversion_create_params.rb => event_create_params.rb} (81%) create mode 100644 lib/whop_sdk/models/event_create_response.rb create mode 100644 lib/whop_sdk/models/event_list_params.rb create mode 100644 lib/whop_sdk/models/event_list_response.rb delete mode 100644 lib/whop_sdk/models/external_ad_status.rb create mode 100644 lib/whop_sdk/models/ledger_account_funds_available_webhook_event.rb create mode 100644 lib/whop_sdk/models/media_asset.rb create mode 100644 lib/whop_sdk/models/media_generate_params.rb create mode 100644 lib/whop_sdk/models/media_retrieve_params.rb create mode 100644 lib/whop_sdk/models/membership_trial_ending_soon_webhook_event.rb create mode 100644 lib/whop_sdk/models/payout_create_params.rb create mode 100644 lib/whop_sdk/models/payout_create_response.rb delete mode 100644 lib/whop_sdk/models/payout_destination_category.rb create mode 100644 lib/whop_sdk/models/payout_list_params.rb create mode 100644 lib/whop_sdk/models/payout_list_response.rb delete mode 100644 lib/whop_sdk/models/payout_method_list_params.rb delete mode 100644 lib/whop_sdk/models/payout_method_list_response.rb delete mode 100644 lib/whop_sdk/models/payout_method_retrieve_response.rb create mode 100644 lib/whop_sdk/models/payouts/method_list_params.rb create mode 100644 lib/whop_sdk/models/payouts/method_list_response.rb create mode 100644 lib/whop_sdk/models/person_list_params.rb create mode 100644 lib/whop_sdk/models/person_list_response.rb create mode 100644 lib/whop_sdk/models/person_retrieve_params.rb create mode 100644 lib/whop_sdk/models/person_retrieve_response.rb create mode 100644 lib/whop_sdk/models/plan_calculate_tax_params.rb create mode 100644 lib/whop_sdk/models/plan_calculate_tax_response.rb create mode 100644 lib/whop_sdk/models/referral_referred_users_params.rb create mode 100644 lib/whop_sdk/models/referral_referred_users_response.rb create mode 100644 lib/whop_sdk/models/referrals/business_leaderboard_params.rb create mode 100644 lib/whop_sdk/models/referrals/business_leaderboard_response.rb create mode 100644 lib/whop_sdk/models/referrals/business_list_params.rb create mode 100644 lib/whop_sdk/models/referrals/business_list_response.rb create mode 100644 lib/whop_sdk/models/referrals/business_retrieve_params.rb create mode 100644 lib/whop_sdk/models/referrals/business_retrieve_response.rb create mode 100644 lib/whop_sdk/models/referrals/businesses/earning_list_params.rb create mode 100644 lib/whop_sdk/models/referrals/businesses/earning_list_response.rb create mode 100644 lib/whop_sdk/models/referrals/partner_create_params.rb create mode 100644 lib/whop_sdk/models/referrals/partner_create_response.rb create mode 100644 lib/whop_sdk/models/social_account.rb create mode 100644 lib/whop_sdk/models/social_account_connect_params.rb create mode 100644 lib/whop_sdk/models/social_account_connect_response.rb create mode 100644 lib/whop_sdk/models/social_account_create_params.rb create mode 100644 lib/whop_sdk/models/social_account_delete_params.rb create mode 100644 lib/whop_sdk/models/social_account_delete_response.rb create mode 100644 lib/whop_sdk/models/social_account_list_params.rb create mode 100644 lib/whop_sdk/models/social_account_post.rb create mode 100644 lib/whop_sdk/models/social_account_posts_params.rb create mode 100644 lib/whop_sdk/models/social_account_posts_response.rb rename lib/whop_sdk/models/{wallet_list_params.rb => stat_list_params.rb} (75%) create mode 100644 lib/whop_sdk/models/stat_list_response.rb create mode 100644 lib/whop_sdk/models/stat_retrieve_params.rb create mode 100644 lib/whop_sdk/models/stat_retrieve_response.rb create mode 100644 lib/whop_sdk/models/swap_list_params.rb create mode 100644 lib/whop_sdk/models/swap_list_response.rb delete mode 100644 lib/whop_sdk/models/transfer.rb create mode 100644 lib/whop_sdk/models/transfer_create_response.rb create mode 100644 lib/whop_sdk/models/transfer_retrieve_response.rb create mode 100644 lib/whop_sdk/models/user_balance.rb create mode 100644 lib/whop_sdk/models/verification_create_params.rb create mode 100644 lib/whop_sdk/models/verification_create_response.rb create mode 100644 lib/whop_sdk/models/verification_update_params.rb create mode 100644 lib/whop_sdk/models/verification_update_response.rb delete mode 100644 lib/whop_sdk/models/wallet_balance_response.rb delete mode 100644 lib/whop_sdk/models/wallet_list_response.rb delete mode 100644 lib/whop_sdk/models/wallet_send_params.rb delete mode 100644 lib/whop_sdk/models/wallet_send_response.rb create mode 100644 lib/whop_sdk/models/workforce/bounty_list_params.rb create mode 100644 lib/whop_sdk/models/workforce/bounty_retrieve_params.rb create mode 100644 lib/whop_sdk/models/workforce/workforce_bounty.rb create mode 100644 lib/whop_sdk/models/workforce/workforce_bounty_list_item.rb create mode 100644 lib/whop_sdk/resources/accounts/preferences.rb create mode 100644 lib/whop_sdk/resources/audiences.rb create mode 100644 lib/whop_sdk/resources/cards.rb delete mode 100644 lib/whop_sdk/resources/conversions.rb create mode 100644 lib/whop_sdk/resources/events.rb create mode 100644 lib/whop_sdk/resources/media.rb delete mode 100644 lib/whop_sdk/resources/payout_methods.rb create mode 100644 lib/whop_sdk/resources/payouts.rb create mode 100644 lib/whop_sdk/resources/payouts/methods.rb create mode 100644 lib/whop_sdk/resources/people.rb create mode 100644 lib/whop_sdk/resources/referrals.rb create mode 100644 lib/whop_sdk/resources/referrals/businesses.rb create mode 100644 lib/whop_sdk/resources/referrals/businesses/earnings.rb create mode 100644 lib/whop_sdk/resources/referrals/partners.rb create mode 100644 lib/whop_sdk/resources/social_accounts.rb create mode 100644 lib/whop_sdk/resources/stats.rb delete mode 100644 lib/whop_sdk/resources/wallets.rb create mode 100644 lib/whop_sdk/resources/workforce.rb create mode 100644 lib/whop_sdk/resources/workforce/bounties.rb delete mode 100644 rbi/whop_sdk/models/account_list_response.rbi create mode 100644 rbi/whop_sdk/models/account_recommend_actions_params.rbi create mode 100644 rbi/whop_sdk/models/account_recommend_actions_response.rbi delete mode 100644 rbi/whop_sdk/models/account_wallet.rbi create mode 100644 rbi/whop_sdk/models/accounts/preference_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/accounts/preference_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/accounts/preference_update_params.rbi create mode 100644 rbi/whop_sdk/models/accounts/preference_update_response.rbi delete mode 100644 rbi/whop_sdk/models/ad_budget_type.rbi create mode 100644 rbi/whop_sdk/models/ad_campaign_create_params.rbi rename rbi/whop_sdk/models/{payout_method_retrieve_params.rbi => ad_campaign_delete_params.rbi} (81%) create mode 100644 rbi/whop_sdk/models/ad_campaign_delete_response.rbi delete mode 100644 rbi/whop_sdk/models/ad_campaign_list_response.rbi delete mode 100644 rbi/whop_sdk/models/ad_campaign_platform.rbi delete mode 100644 rbi/whop_sdk/models/ad_campaign_status.rbi create mode 100644 rbi/whop_sdk/models/ad_create_params.rbi create mode 100644 rbi/whop_sdk/models/ad_delete_params.rbi create mode 100644 rbi/whop_sdk/models/ad_delete_response.rbi create mode 100644 rbi/whop_sdk/models/ad_group_create_params.rbi delete mode 100644 rbi/whop_sdk/models/ad_group_list_response.rbi delete mode 100644 rbi/whop_sdk/models/ad_group_status.rbi delete mode 100644 rbi/whop_sdk/models/ad_list_response.rbi create mode 100644 rbi/whop_sdk/models/ad_update_params.rbi create mode 100644 rbi/whop_sdk/models/app_logs_params.rbi create mode 100644 rbi/whop_sdk/models/app_logs_response.rbi create mode 100644 rbi/whop_sdk/models/audience.rbi create mode 100644 rbi/whop_sdk/models/audience_create_params.rbi create mode 100644 rbi/whop_sdk/models/audience_delete_params.rbi create mode 100644 rbi/whop_sdk/models/audience_delete_response.rbi create mode 100644 rbi/whop_sdk/models/audience_list_params.rbi create mode 100644 rbi/whop_sdk/models/card_create_params.rbi create mode 100644 rbi/whop_sdk/models/card_create_response.rbi create mode 100644 rbi/whop_sdk/models/card_list_params.rbi create mode 100644 rbi/whop_sdk/models/card_list_response.rbi create mode 100644 rbi/whop_sdk/models/card_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/card_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/card_update_params.rbi create mode 100644 rbi/whop_sdk/models/card_update_response.rbi create mode 100644 rbi/whop_sdk/models/chat_message_created_webhook_event.rbi create mode 100644 rbi/whop_sdk/models/chat_reaction_created_webhook_event.rbi create mode 100644 rbi/whop_sdk/models/checkout_configuration_create_response.rbi create mode 100644 rbi/whop_sdk/models/checkout_configuration_delete_params.rbi create mode 100644 rbi/whop_sdk/models/checkout_configuration_retrieve_response.rbi rename rbi/whop_sdk/models/{wallet_balance_params.rbi => deposit_list_params.rbi} (70%) create mode 100644 rbi/whop_sdk/models/deposit_list_response.rbi rename rbi/whop_sdk/models/{conversion_create_params.rbi => event_create_params.rbi} (64%) rename rbi/whop_sdk/models/{conversion_create_response.rbi => event_create_response.rbi} (56%) create mode 100644 rbi/whop_sdk/models/event_list_params.rbi create mode 100644 rbi/whop_sdk/models/event_list_response.rbi delete mode 100644 rbi/whop_sdk/models/external_ad_status.rbi create mode 100644 rbi/whop_sdk/models/ledger_account_funds_available_webhook_event.rbi create mode 100644 rbi/whop_sdk/models/media_asset.rbi create mode 100644 rbi/whop_sdk/models/media_generate_params.rbi create mode 100644 rbi/whop_sdk/models/media_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/membership_trial_ending_soon_webhook_event.rbi create mode 100644 rbi/whop_sdk/models/payout_create_params.rbi create mode 100644 rbi/whop_sdk/models/payout_create_response.rbi delete mode 100644 rbi/whop_sdk/models/payout_destination_category.rbi create mode 100644 rbi/whop_sdk/models/payout_list_params.rbi create mode 100644 rbi/whop_sdk/models/payout_list_response.rbi delete mode 100644 rbi/whop_sdk/models/payout_method_list_params.rbi delete mode 100644 rbi/whop_sdk/models/payout_method_list_response.rbi delete mode 100644 rbi/whop_sdk/models/payout_method_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/payouts/method_list_params.rbi create mode 100644 rbi/whop_sdk/models/payouts/method_list_response.rbi create mode 100644 rbi/whop_sdk/models/person_list_params.rbi create mode 100644 rbi/whop_sdk/models/person_list_response.rbi create mode 100644 rbi/whop_sdk/models/person_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/person_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/plan_calculate_tax_params.rbi create mode 100644 rbi/whop_sdk/models/plan_calculate_tax_response.rbi create mode 100644 rbi/whop_sdk/models/referral_referred_users_params.rbi create mode 100644 rbi/whop_sdk/models/referral_referred_users_response.rbi create mode 100644 rbi/whop_sdk/models/referrals/business_leaderboard_params.rbi create mode 100644 rbi/whop_sdk/models/referrals/business_leaderboard_response.rbi create mode 100644 rbi/whop_sdk/models/referrals/business_list_params.rbi create mode 100644 rbi/whop_sdk/models/referrals/business_list_response.rbi create mode 100644 rbi/whop_sdk/models/referrals/business_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/referrals/business_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/referrals/businesses/earning_list_params.rbi create mode 100644 rbi/whop_sdk/models/referrals/businesses/earning_list_response.rbi create mode 100644 rbi/whop_sdk/models/referrals/partner_create_params.rbi create mode 100644 rbi/whop_sdk/models/referrals/partner_create_response.rbi create mode 100644 rbi/whop_sdk/models/social_account.rbi create mode 100644 rbi/whop_sdk/models/social_account_connect_params.rbi create mode 100644 rbi/whop_sdk/models/social_account_connect_response.rbi create mode 100644 rbi/whop_sdk/models/social_account_create_params.rbi create mode 100644 rbi/whop_sdk/models/social_account_delete_params.rbi create mode 100644 rbi/whop_sdk/models/social_account_delete_response.rbi create mode 100644 rbi/whop_sdk/models/social_account_list_params.rbi create mode 100644 rbi/whop_sdk/models/social_account_post.rbi create mode 100644 rbi/whop_sdk/models/social_account_posts_params.rbi create mode 100644 rbi/whop_sdk/models/social_account_posts_response.rbi rename rbi/whop_sdk/models/{wallet_list_params.rbi => stat_list_params.rbi} (79%) create mode 100644 rbi/whop_sdk/models/stat_list_response.rbi create mode 100644 rbi/whop_sdk/models/stat_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/stat_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/swap_list_params.rbi create mode 100644 rbi/whop_sdk/models/swap_list_response.rbi delete mode 100644 rbi/whop_sdk/models/transfer.rbi create mode 100644 rbi/whop_sdk/models/transfer_create_response.rbi create mode 100644 rbi/whop_sdk/models/transfer_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/user_balance.rbi create mode 100644 rbi/whop_sdk/models/verification_create_params.rbi create mode 100644 rbi/whop_sdk/models/verification_create_response.rbi create mode 100644 rbi/whop_sdk/models/verification_update_params.rbi create mode 100644 rbi/whop_sdk/models/verification_update_response.rbi delete mode 100644 rbi/whop_sdk/models/wallet_balance_response.rbi delete mode 100644 rbi/whop_sdk/models/wallet_list_response.rbi delete mode 100644 rbi/whop_sdk/models/wallet_send_params.rbi delete mode 100644 rbi/whop_sdk/models/wallet_send_response.rbi create mode 100644 rbi/whop_sdk/models/workforce/bounty_list_params.rbi create mode 100644 rbi/whop_sdk/models/workforce/bounty_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/workforce/workforce_bounty.rbi create mode 100644 rbi/whop_sdk/models/workforce/workforce_bounty_list_item.rbi create mode 100644 rbi/whop_sdk/resources/accounts/preferences.rbi create mode 100644 rbi/whop_sdk/resources/audiences.rbi create mode 100644 rbi/whop_sdk/resources/cards.rbi delete mode 100644 rbi/whop_sdk/resources/conversions.rbi create mode 100644 rbi/whop_sdk/resources/events.rbi create mode 100644 rbi/whop_sdk/resources/media.rbi delete mode 100644 rbi/whop_sdk/resources/payout_methods.rbi create mode 100644 rbi/whop_sdk/resources/payouts.rbi create mode 100644 rbi/whop_sdk/resources/payouts/methods.rbi create mode 100644 rbi/whop_sdk/resources/people.rbi create mode 100644 rbi/whop_sdk/resources/referrals.rbi create mode 100644 rbi/whop_sdk/resources/referrals/businesses.rbi create mode 100644 rbi/whop_sdk/resources/referrals/businesses/earnings.rbi create mode 100644 rbi/whop_sdk/resources/referrals/partners.rbi create mode 100644 rbi/whop_sdk/resources/social_accounts.rbi create mode 100644 rbi/whop_sdk/resources/stats.rbi delete mode 100644 rbi/whop_sdk/resources/wallets.rbi create mode 100644 rbi/whop_sdk/resources/workforce.rbi create mode 100644 rbi/whop_sdk/resources/workforce/bounties.rbi delete mode 100644 sig/whop_sdk/models/account_list_response.rbs rename sig/whop_sdk/models/{wallet_send_params.rbs => account_recommend_actions_params.rbs} (55%) create mode 100644 sig/whop_sdk/models/account_recommend_actions_response.rbs delete mode 100644 sig/whop_sdk/models/account_wallet.rbs create mode 100644 sig/whop_sdk/models/accounts/preference_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/accounts/preference_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/accounts/preference_update_params.rbs create mode 100644 sig/whop_sdk/models/accounts/preference_update_response.rbs delete mode 100644 sig/whop_sdk/models/ad_budget_type.rbs create mode 100644 sig/whop_sdk/models/ad_campaign_create_params.rbs rename sig/whop_sdk/models/{payout_method_retrieve_params.rbs => ad_campaign_delete_params.rbs} (80%) create mode 100644 sig/whop_sdk/models/ad_campaign_delete_response.rbs delete mode 100644 sig/whop_sdk/models/ad_campaign_list_response.rbs delete mode 100644 sig/whop_sdk/models/ad_campaign_platform.rbs delete mode 100644 sig/whop_sdk/models/ad_campaign_status.rbs create mode 100644 sig/whop_sdk/models/ad_create_params.rbs create mode 100644 sig/whop_sdk/models/ad_delete_params.rbs create mode 100644 sig/whop_sdk/models/ad_delete_response.rbs create mode 100644 sig/whop_sdk/models/ad_group_create_params.rbs delete mode 100644 sig/whop_sdk/models/ad_group_list_response.rbs delete mode 100644 sig/whop_sdk/models/ad_group_status.rbs delete mode 100644 sig/whop_sdk/models/ad_list_response.rbs create mode 100644 sig/whop_sdk/models/ad_update_params.rbs create mode 100644 sig/whop_sdk/models/app_logs_params.rbs create mode 100644 sig/whop_sdk/models/app_logs_response.rbs create mode 100644 sig/whop_sdk/models/audience.rbs create mode 100644 sig/whop_sdk/models/audience_create_params.rbs create mode 100644 sig/whop_sdk/models/audience_delete_params.rbs create mode 100644 sig/whop_sdk/models/audience_delete_response.rbs create mode 100644 sig/whop_sdk/models/audience_list_params.rbs create mode 100644 sig/whop_sdk/models/card_create_params.rbs create mode 100644 sig/whop_sdk/models/card_create_response.rbs create mode 100644 sig/whop_sdk/models/card_list_params.rbs create mode 100644 sig/whop_sdk/models/card_list_response.rbs create mode 100644 sig/whop_sdk/models/card_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/card_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/card_update_params.rbs create mode 100644 sig/whop_sdk/models/card_update_response.rbs create mode 100644 sig/whop_sdk/models/chat_message_created_webhook_event.rbs create mode 100644 sig/whop_sdk/models/chat_reaction_created_webhook_event.rbs create mode 100644 sig/whop_sdk/models/checkout_configuration_create_response.rbs create mode 100644 sig/whop_sdk/models/checkout_configuration_delete_params.rbs create mode 100644 sig/whop_sdk/models/checkout_configuration_retrieve_response.rbs rename sig/whop_sdk/models/{wallet_balance_params.rbs => deposit_list_params.rbs} (83%) create mode 100644 sig/whop_sdk/models/deposit_list_response.rbs rename sig/whop_sdk/models/{conversion_create_params.rbs => event_create_params.rbs} (65%) rename sig/whop_sdk/models/{conversion_create_response.rbs => event_create_response.rbs} (56%) create mode 100644 sig/whop_sdk/models/event_list_params.rbs create mode 100644 sig/whop_sdk/models/event_list_response.rbs delete mode 100644 sig/whop_sdk/models/external_ad_status.rbs create mode 100644 sig/whop_sdk/models/ledger_account_funds_available_webhook_event.rbs create mode 100644 sig/whop_sdk/models/media_asset.rbs create mode 100644 sig/whop_sdk/models/media_generate_params.rbs create mode 100644 sig/whop_sdk/models/media_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/membership_trial_ending_soon_webhook_event.rbs create mode 100644 sig/whop_sdk/models/payout_create_params.rbs create mode 100644 sig/whop_sdk/models/payout_create_response.rbs delete mode 100644 sig/whop_sdk/models/payout_destination_category.rbs create mode 100644 sig/whop_sdk/models/payout_list_params.rbs create mode 100644 sig/whop_sdk/models/payout_list_response.rbs delete mode 100644 sig/whop_sdk/models/payout_method_list_params.rbs delete mode 100644 sig/whop_sdk/models/payout_method_list_response.rbs delete mode 100644 sig/whop_sdk/models/payout_method_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/payouts/method_list_params.rbs create mode 100644 sig/whop_sdk/models/payouts/method_list_response.rbs create mode 100644 sig/whop_sdk/models/person_list_params.rbs create mode 100644 sig/whop_sdk/models/person_list_response.rbs create mode 100644 sig/whop_sdk/models/person_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/person_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/plan_calculate_tax_params.rbs create mode 100644 sig/whop_sdk/models/plan_calculate_tax_response.rbs create mode 100644 sig/whop_sdk/models/referral_referred_users_params.rbs create mode 100644 sig/whop_sdk/models/referral_referred_users_response.rbs create mode 100644 sig/whop_sdk/models/referrals/business_leaderboard_params.rbs create mode 100644 sig/whop_sdk/models/referrals/business_leaderboard_response.rbs create mode 100644 sig/whop_sdk/models/referrals/business_list_params.rbs create mode 100644 sig/whop_sdk/models/referrals/business_list_response.rbs create mode 100644 sig/whop_sdk/models/referrals/business_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/referrals/business_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/referrals/businesses/earning_list_params.rbs create mode 100644 sig/whop_sdk/models/referrals/businesses/earning_list_response.rbs create mode 100644 sig/whop_sdk/models/referrals/partner_create_params.rbs create mode 100644 sig/whop_sdk/models/referrals/partner_create_response.rbs create mode 100644 sig/whop_sdk/models/social_account.rbs create mode 100644 sig/whop_sdk/models/social_account_connect_params.rbs create mode 100644 sig/whop_sdk/models/social_account_connect_response.rbs create mode 100644 sig/whop_sdk/models/social_account_create_params.rbs create mode 100644 sig/whop_sdk/models/social_account_delete_params.rbs create mode 100644 sig/whop_sdk/models/social_account_delete_response.rbs create mode 100644 sig/whop_sdk/models/social_account_list_params.rbs create mode 100644 sig/whop_sdk/models/social_account_post.rbs create mode 100644 sig/whop_sdk/models/social_account_posts_params.rbs create mode 100644 sig/whop_sdk/models/social_account_posts_response.rbs rename sig/whop_sdk/models/{wallet_list_params.rbs => stat_list_params.rbs} (68%) create mode 100644 sig/whop_sdk/models/stat_list_response.rbs create mode 100644 sig/whop_sdk/models/stat_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/stat_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/swap_list_params.rbs create mode 100644 sig/whop_sdk/models/swap_list_response.rbs create mode 100644 sig/whop_sdk/models/transfer_create_response.rbs rename sig/whop_sdk/models/{transfer.rbs => transfer_retrieve_response.rbs} (54%) create mode 100644 sig/whop_sdk/models/user_balance.rbs create mode 100644 sig/whop_sdk/models/verification_create_params.rbs create mode 100644 sig/whop_sdk/models/verification_create_response.rbs create mode 100644 sig/whop_sdk/models/verification_update_params.rbs create mode 100644 sig/whop_sdk/models/verification_update_response.rbs delete mode 100644 sig/whop_sdk/models/wallet_balance_response.rbs delete mode 100644 sig/whop_sdk/models/wallet_list_response.rbs delete mode 100644 sig/whop_sdk/models/wallet_send_response.rbs create mode 100644 sig/whop_sdk/models/workforce/bounty_list_params.rbs create mode 100644 sig/whop_sdk/models/workforce/bounty_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/workforce/workforce_bounty.rbs create mode 100644 sig/whop_sdk/models/workforce/workforce_bounty_list_item.rbs create mode 100644 sig/whop_sdk/resources/accounts/preferences.rbs create mode 100644 sig/whop_sdk/resources/audiences.rbs create mode 100644 sig/whop_sdk/resources/cards.rbs delete mode 100644 sig/whop_sdk/resources/conversions.rbs create mode 100644 sig/whop_sdk/resources/events.rbs create mode 100644 sig/whop_sdk/resources/media.rbs delete mode 100644 sig/whop_sdk/resources/payout_methods.rbs create mode 100644 sig/whop_sdk/resources/payouts.rbs create mode 100644 sig/whop_sdk/resources/payouts/methods.rbs create mode 100644 sig/whop_sdk/resources/people.rbs create mode 100644 sig/whop_sdk/resources/referrals.rbs create mode 100644 sig/whop_sdk/resources/referrals/businesses.rbs create mode 100644 sig/whop_sdk/resources/referrals/businesses/earnings.rbs create mode 100644 sig/whop_sdk/resources/referrals/partners.rbs create mode 100644 sig/whop_sdk/resources/social_accounts.rbs create mode 100644 sig/whop_sdk/resources/stats.rbs delete mode 100644 sig/whop_sdk/resources/wallets.rbs create mode 100644 sig/whop_sdk/resources/workforce.rbs create mode 100644 sig/whop_sdk/resources/workforce/bounties.rbs create mode 100644 test/whop_sdk/resources/accounts/preferences_test.rb create mode 100644 test/whop_sdk/resources/audiences_test.rb create mode 100644 test/whop_sdk/resources/cards_test.rb delete mode 100644 test/whop_sdk/resources/conversions_test.rb create mode 100644 test/whop_sdk/resources/events_test.rb create mode 100644 test/whop_sdk/resources/media_test.rb delete mode 100644 test/whop_sdk/resources/payout_methods_test.rb create mode 100644 test/whop_sdk/resources/payouts/methods_test.rb create mode 100644 test/whop_sdk/resources/payouts_test.rb create mode 100644 test/whop_sdk/resources/people_test.rb create mode 100644 test/whop_sdk/resources/referrals/businesses/earnings_test.rb create mode 100644 test/whop_sdk/resources/referrals/businesses_test.rb create mode 100644 test/whop_sdk/resources/referrals/partners_test.rb create mode 100644 test/whop_sdk/resources/referrals_test.rb create mode 100644 test/whop_sdk/resources/social_accounts_test.rb create mode 100644 test/whop_sdk/resources/stats_test.rb delete mode 100644 test/whop_sdk/resources/wallets_test.rb create mode 100644 test/whop_sdk/resources/workforce/bounties_test.rb create mode 100644 test/whop_sdk/resources/workforce_test.rb diff --git a/.stats.yml b/.stats.yml index cd5b9cf9..330fae47 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 230 +configured_endpoints: 271 diff --git a/README.md b/README.md index 1c1ddca5..33b6d4d7 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=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) +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40whop%2Fmcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3aG9wL21jcCJdLCJlbnYiOnsiV0hPUF9BUElfS0VZIjoiTXkgQVBJIEtleSIsIldIT1BfV0VCSE9PS19TRUNSRVQiOiJNeSBXZWJob29rIEtleSIsIldIT1BfQVBQX0lEIjoiYXBwX3h4eHh4eHh4eHh4eHh4IiwiV0hPUF9BUElfVkVSU0lPTiI6IjIwMjYtMDctMDgtMSJ9fQ) +[![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-07-08-1%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 09f4c849..24d79ac6 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -63,40 +63,45 @@ require_relative "whop_sdk/models/account_link_create_params" require_relative "whop_sdk/models/account_link_create_response" require_relative "whop_sdk/models/account_list_params" -require_relative "whop_sdk/models/account_list_response" require_relative "whop_sdk/models/account_me_params" +require_relative "whop_sdk/models/account_recommend_actions_params" +require_relative "whop_sdk/models/account_recommend_actions_response" require_relative "whop_sdk/models/account_retrieve_params" +require_relative "whop_sdk/models/accounts/preference_retrieve_params" +require_relative "whop_sdk/models/accounts/preference_retrieve_response" +require_relative "whop_sdk/models/accounts/preference_update_params" +require_relative "whop_sdk/models/accounts/preference_update_response" require_relative "whop_sdk/models/account_social_link" require_relative "whop_sdk/models/account_update_params" -require_relative "whop_sdk/models/account_wallet" require_relative "whop_sdk/models/ad" -require_relative "whop_sdk/models/ad_budget_type" require_relative "whop_sdk/models/ad_campaign" +require_relative "whop_sdk/models/ad_campaign_create_params" +require_relative "whop_sdk/models/ad_campaign_delete_params" +require_relative "whop_sdk/models/ad_campaign_delete_response" require_relative "whop_sdk/models/ad_campaign_list_params" -require_relative "whop_sdk/models/ad_campaign_list_response" require_relative "whop_sdk/models/ad_campaign_pause_params" -require_relative "whop_sdk/models/ad_campaign_platform" require_relative "whop_sdk/models/ad_campaign_retrieve_params" -require_relative "whop_sdk/models/ad_campaign_status" require_relative "whop_sdk/models/ad_campaign_unpause_params" require_relative "whop_sdk/models/ad_campaign_update_params" +require_relative "whop_sdk/models/ad_create_params" +require_relative "whop_sdk/models/ad_delete_params" +require_relative "whop_sdk/models/ad_delete_response" require_relative "whop_sdk/models/ad_group" +require_relative "whop_sdk/models/ad_group_create_params" require_relative "whop_sdk/models/ad_group_delete_params" require_relative "whop_sdk/models/ad_group_delete_response" require_relative "whop_sdk/models/ad_group_list_params" -require_relative "whop_sdk/models/ad_group_list_response" require_relative "whop_sdk/models/ad_group_pause_params" require_relative "whop_sdk/models/ad_group_retrieve_params" -require_relative "whop_sdk/models/ad_group_status" require_relative "whop_sdk/models/ad_group_unpause_params" require_relative "whop_sdk/models/ad_group_update_params" require_relative "whop_sdk/models/ad_list_params" -require_relative "whop_sdk/models/ad_list_response" require_relative "whop_sdk/models/ad_pause_params" require_relative "whop_sdk/models/ad_report_retrieve_params" require_relative "whop_sdk/models/ad_report_retrieve_response" require_relative "whop_sdk/models/ad_retrieve_params" require_relative "whop_sdk/models/ad_unpause_params" +require_relative "whop_sdk/models/ad_update_params" require_relative "whop_sdk/models/affiliate" require_relative "whop_sdk/models/affiliate_archive_params" require_relative "whop_sdk/models/affiliate_archive_response" @@ -142,12 +147,19 @@ require_relative "whop_sdk/models/app_create_params" require_relative "whop_sdk/models/app_list_params" require_relative "whop_sdk/models/app_list_response" +require_relative "whop_sdk/models/app_logs_params" +require_relative "whop_sdk/models/app_logs_response" require_relative "whop_sdk/models/app_retrieve_params" require_relative "whop_sdk/models/app_statuses" require_relative "whop_sdk/models/app_type" require_relative "whop_sdk/models/app_update_params" require_relative "whop_sdk/models/app_view_type" require_relative "whop_sdk/models/assessment_question_types" +require_relative "whop_sdk/models/audience" +require_relative "whop_sdk/models/audience_create_params" +require_relative "whop_sdk/models/audience_delete_params" +require_relative "whop_sdk/models/audience_delete_response" +require_relative "whop_sdk/models/audience_list_params" require_relative "whop_sdk/models/authorized_user" require_relative "whop_sdk/models/authorized_user_create_params" require_relative "whop_sdk/models/authorized_user_delete_params" @@ -165,16 +177,29 @@ require_relative "whop_sdk/models/bounty_retrieve_response" require_relative "whop_sdk/models/cancel_options" require_relative "whop_sdk/models/card_brands" +require_relative "whop_sdk/models/card_create_params" +require_relative "whop_sdk/models/card_create_response" +require_relative "whop_sdk/models/card_list_params" +require_relative "whop_sdk/models/card_list_response" +require_relative "whop_sdk/models/card_retrieve_params" +require_relative "whop_sdk/models/card_retrieve_response" +require_relative "whop_sdk/models/card_update_params" +require_relative "whop_sdk/models/card_update_response" require_relative "whop_sdk/models/chat_channel" require_relative "whop_sdk/models/chat_channel_list_params" require_relative "whop_sdk/models/chat_channel_list_response" require_relative "whop_sdk/models/chat_channel_retrieve_params" require_relative "whop_sdk/models/chat_channel_update_params" +require_relative "whop_sdk/models/chat_message_created_webhook_event" +require_relative "whop_sdk/models/chat_reaction_created_webhook_event" require_relative "whop_sdk/models/checkout_configuration" require_relative "whop_sdk/models/checkout_configuration_create_params" +require_relative "whop_sdk/models/checkout_configuration_create_response" +require_relative "whop_sdk/models/checkout_configuration_delete_params" require_relative "whop_sdk/models/checkout_configuration_list_params" require_relative "whop_sdk/models/checkout_configuration_list_response" require_relative "whop_sdk/models/checkout_configuration_retrieve_params" +require_relative "whop_sdk/models/checkout_configuration_retrieve_response" require_relative "whop_sdk/models/checkout_font" require_relative "whop_sdk/models/checkout_modes" require_relative "whop_sdk/models/checkout_shape" @@ -193,8 +218,6 @@ require_relative "whop_sdk/models/company_token_transaction_retrieve_params" require_relative "whop_sdk/models/company_token_transaction_type" require_relative "whop_sdk/models/company_update_params" -require_relative "whop_sdk/models/conversion_create_params" -require_relative "whop_sdk/models/conversion_create_response" require_relative "whop_sdk/models/course" require_relative "whop_sdk/models/course_chapter" require_relative "whop_sdk/models/course_chapter_create_params" @@ -238,6 +261,8 @@ require_relative "whop_sdk/models/custom_cta" require_relative "whop_sdk/models/deposit_create_params" require_relative "whop_sdk/models/deposit_create_response" +require_relative "whop_sdk/models/deposit_list_params" +require_relative "whop_sdk/models/deposit_list_response" require_relative "whop_sdk/models/direction" require_relative "whop_sdk/models/dispute" require_relative "whop_sdk/models/dispute_alert_created_webhook_event" @@ -287,6 +312,10 @@ require_relative "whop_sdk/models/entry_list_response" require_relative "whop_sdk/models/entry_retrieve_params" require_relative "whop_sdk/models/entry_status" +require_relative "whop_sdk/models/event_create_params" +require_relative "whop_sdk/models/event_create_response" +require_relative "whop_sdk/models/event_list_params" +require_relative "whop_sdk/models/event_list_response" require_relative "whop_sdk/models/experience" require_relative "whop_sdk/models/experience_attach_params" require_relative "whop_sdk/models/experience_create_params" @@ -298,7 +327,6 @@ require_relative "whop_sdk/models/experience_list_response" require_relative "whop_sdk/models/experience_retrieve_params" require_relative "whop_sdk/models/experience_update_params" -require_relative "whop_sdk/models/external_ad_status" require_relative "whop_sdk/models/fee_markup_create_params" require_relative "whop_sdk/models/fee_markup_create_response" require_relative "whop_sdk/models/fee_markup_delete_params" @@ -359,11 +387,15 @@ require_relative "whop_sdk/models/lead_list_response" require_relative "whop_sdk/models/lead_retrieve_params" require_relative "whop_sdk/models/lead_update_params" +require_relative "whop_sdk/models/ledger_account_funds_available_webhook_event" require_relative "whop_sdk/models/ledger_account_retrieve_params" require_relative "whop_sdk/models/ledger_account_retrieve_response" require_relative "whop_sdk/models/lesson" require_relative "whop_sdk/models/lesson_types" require_relative "whop_sdk/models/lesson_visibilities" +require_relative "whop_sdk/models/media_asset" +require_relative "whop_sdk/models/media_generate_params" +require_relative "whop_sdk/models/media_retrieve_params" require_relative "whop_sdk/models/member_list_params" require_relative "whop_sdk/models/member_list_response" require_relative "whop_sdk/models/member_most_recent_actions" @@ -381,6 +413,7 @@ require_relative "whop_sdk/models/membership_resume_params" require_relative "whop_sdk/models/membership_retrieve_params" require_relative "whop_sdk/models/membership_status" +require_relative "whop_sdk/models/membership_trial_ending_soon_webhook_event" require_relative "whop_sdk/models/membership_uncancel_params" require_relative "whop_sdk/models/membership_update_params" require_relative "whop_sdk/models/member_statuses" @@ -420,13 +453,20 @@ require_relative "whop_sdk/models/payout_account_retrieve_params" require_relative "whop_sdk/models/payout_account_retrieve_response" require_relative "whop_sdk/models/payout_account_status_updated_webhook_event" -require_relative "whop_sdk/models/payout_destination_category" +require_relative "whop_sdk/models/payout_create_params" +require_relative "whop_sdk/models/payout_create_response" +require_relative "whop_sdk/models/payout_list_params" +require_relative "whop_sdk/models/payout_list_response" require_relative "whop_sdk/models/payout_method_created_webhook_event" -require_relative "whop_sdk/models/payout_method_list_params" -require_relative "whop_sdk/models/payout_method_list_response" -require_relative "whop_sdk/models/payout_method_retrieve_params" -require_relative "whop_sdk/models/payout_method_retrieve_response" +require_relative "whop_sdk/models/payouts/method_list_params" +require_relative "whop_sdk/models/payouts/method_list_response" +require_relative "whop_sdk/models/person_list_params" +require_relative "whop_sdk/models/person_list_response" +require_relative "whop_sdk/models/person_retrieve_params" +require_relative "whop_sdk/models/person_retrieve_response" require_relative "whop_sdk/models/plan" +require_relative "whop_sdk/models/plan_calculate_tax_params" +require_relative "whop_sdk/models/plan_calculate_tax_response" require_relative "whop_sdk/models/plan_create_params" require_relative "whop_sdk/models/plan_delete_params" require_relative "whop_sdk/models/plan_delete_response" @@ -462,6 +502,18 @@ require_relative "whop_sdk/models/reaction_retrieve_params" require_relative "whop_sdk/models/receipt_status" require_relative "whop_sdk/models/receipt_tax_behavior" +require_relative "whop_sdk/models/referral_referred_users_params" +require_relative "whop_sdk/models/referral_referred_users_response" +require_relative "whop_sdk/models/referrals/businesses/earning_list_params" +require_relative "whop_sdk/models/referrals/businesses/earning_list_response" +require_relative "whop_sdk/models/referrals/business_leaderboard_params" +require_relative "whop_sdk/models/referrals/business_leaderboard_response" +require_relative "whop_sdk/models/referrals/business_list_params" +require_relative "whop_sdk/models/referrals/business_list_response" +require_relative "whop_sdk/models/referrals/business_retrieve_params" +require_relative "whop_sdk/models/referrals/business_retrieve_response" +require_relative "whop_sdk/models/referrals/partner_create_params" +require_relative "whop_sdk/models/referrals/partner_create_response" require_relative "whop_sdk/models/refund_created_webhook_event" require_relative "whop_sdk/models/refund_list_params" require_relative "whop_sdk/models/refund_list_response" @@ -506,7 +558,21 @@ require_relative "whop_sdk/models/shipment_retrieve_params" require_relative "whop_sdk/models/shipment_status" require_relative "whop_sdk/models/shipment_substatus" +require_relative "whop_sdk/models/social_account" +require_relative "whop_sdk/models/social_account_connect_params" +require_relative "whop_sdk/models/social_account_connect_response" +require_relative "whop_sdk/models/social_account_create_params" +require_relative "whop_sdk/models/social_account_delete_params" +require_relative "whop_sdk/models/social_account_delete_response" +require_relative "whop_sdk/models/social_account_list_params" +require_relative "whop_sdk/models/social_account_post" +require_relative "whop_sdk/models/social_account_posts_params" +require_relative "whop_sdk/models/social_account_posts_response" require_relative "whop_sdk/models/social_link_websites" +require_relative "whop_sdk/models/stat_list_params" +require_relative "whop_sdk/models/stat_list_response" +require_relative "whop_sdk/models/stat_retrieve_params" +require_relative "whop_sdk/models/stat_retrieve_response" require_relative "whop_sdk/models/status" require_relative "whop_sdk/models/support_channel" require_relative "whop_sdk/models/support_channel_create_params" @@ -517,26 +583,32 @@ 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_list_params" +require_relative "whop_sdk/models/swap_list_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" require_relative "whop_sdk/models/topup_create_response" -require_relative "whop_sdk/models/transfer" require_relative "whop_sdk/models/transfer_create_params" +require_relative "whop_sdk/models/transfer_create_response" require_relative "whop_sdk/models/transfer_list_params" require_relative "whop_sdk/models/transfer_list_response" require_relative "whop_sdk/models/transfer_retrieve_params" +require_relative "whop_sdk/models/transfer_retrieve_response" require_relative "whop_sdk/models/unwrap_webhook_event" require_relative "whop_sdk/models/upload_status" require_relative "whop_sdk/models/user" +require_relative "whop_sdk/models/user_balance" 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_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_create_params" +require_relative "whop_sdk/models/verification_create_response" require_relative "whop_sdk/models/verification_error_code" require_relative "whop_sdk/models/verification_list_params" require_relative "whop_sdk/models/verification_list_response" @@ -544,14 +616,10 @@ require_relative "whop_sdk/models/verification_retrieve_response" require_relative "whop_sdk/models/verification_status" require_relative "whop_sdk/models/verification_succeeded_webhook_event" +require_relative "whop_sdk/models/verification_update_params" +require_relative "whop_sdk/models/verification_update_response" require_relative "whop_sdk/models/visibility" require_relative "whop_sdk/models/visibility_filter" -require_relative "whop_sdk/models/wallet_balance_params" -require_relative "whop_sdk/models/wallet_balance_response" -require_relative "whop_sdk/models/wallet_list_params" -require_relative "whop_sdk/models/wallet_list_response" -require_relative "whop_sdk/models/wallet_send_params" -require_relative "whop_sdk/models/wallet_send_response" require_relative "whop_sdk/models/webhook" require_relative "whop_sdk/models/webhook_create_params" require_relative "whop_sdk/models/webhook_create_response" @@ -577,10 +645,15 @@ require_relative "whop_sdk/models/withdrawal_speeds" require_relative "whop_sdk/models/withdrawal_status" require_relative "whop_sdk/models/withdrawal_updated_webhook_event" +require_relative "whop_sdk/models/workforce/bounty_list_params" +require_relative "whop_sdk/models/workforce/bounty_retrieve_params" +require_relative "whop_sdk/models/workforce/workforce_bounty" +require_relative "whop_sdk/models/workforce/workforce_bounty_list_item" require_relative "whop_sdk/models" require_relative "whop_sdk/resources/access_tokens" require_relative "whop_sdk/resources/account_links" require_relative "whop_sdk/resources/accounts" +require_relative "whop_sdk/resources/accounts/preferences" require_relative "whop_sdk/resources/ad_campaigns" require_relative "whop_sdk/resources/ad_groups" require_relative "whop_sdk/resources/ad_reports" @@ -590,13 +663,14 @@ require_relative "whop_sdk/resources/ai_chats" require_relative "whop_sdk/resources/app_builds" require_relative "whop_sdk/resources/apps" +require_relative "whop_sdk/resources/audiences" require_relative "whop_sdk/resources/authorized_users" require_relative "whop_sdk/resources/bounties" +require_relative "whop_sdk/resources/cards" require_relative "whop_sdk/resources/chat_channels" require_relative "whop_sdk/resources/checkout_configurations" require_relative "whop_sdk/resources/companies" require_relative "whop_sdk/resources/company_token_transactions" -require_relative "whop_sdk/resources/conversions" require_relative "whop_sdk/resources/course_chapters" require_relative "whop_sdk/resources/course_lesson_interactions" require_relative "whop_sdk/resources/course_lessons" @@ -608,6 +682,7 @@ require_relative "whop_sdk/resources/dm_channels" require_relative "whop_sdk/resources/dm_members" require_relative "whop_sdk/resources/entries" +require_relative "whop_sdk/resources/events" require_relative "whop_sdk/resources/experiences" require_relative "whop_sdk/resources/fee_markups" require_relative "whop_sdk/resources/files" @@ -617,6 +692,7 @@ require_relative "whop_sdk/resources/invoices" require_relative "whop_sdk/resources/leads" require_relative "whop_sdk/resources/ledger_accounts" +require_relative "whop_sdk/resources/media" require_relative "whop_sdk/resources/members" require_relative "whop_sdk/resources/memberships" require_relative "whop_sdk/resources/messages" @@ -624,23 +700,32 @@ require_relative "whop_sdk/resources/payment_methods" require_relative "whop_sdk/resources/payments" require_relative "whop_sdk/resources/payout_accounts" -require_relative "whop_sdk/resources/payout_methods" +require_relative "whop_sdk/resources/payouts" +require_relative "whop_sdk/resources/payouts/methods" +require_relative "whop_sdk/resources/people" require_relative "whop_sdk/resources/plans" require_relative "whop_sdk/resources/products" require_relative "whop_sdk/resources/promo_codes" require_relative "whop_sdk/resources/reactions" +require_relative "whop_sdk/resources/referrals" +require_relative "whop_sdk/resources/referrals/businesses" +require_relative "whop_sdk/resources/referrals/businesses/earnings" +require_relative "whop_sdk/resources/referrals/partners" require_relative "whop_sdk/resources/refunds" require_relative "whop_sdk/resources/resolution_center_cases" require_relative "whop_sdk/resources/reviews" require_relative "whop_sdk/resources/setup_intents" require_relative "whop_sdk/resources/shipments" +require_relative "whop_sdk/resources/social_accounts" +require_relative "whop_sdk/resources/stats" require_relative "whop_sdk/resources/support_channels" require_relative "whop_sdk/resources/swaps" require_relative "whop_sdk/resources/topups" require_relative "whop_sdk/resources/transfers" require_relative "whop_sdk/resources/users" require_relative "whop_sdk/resources/verifications" -require_relative "whop_sdk/resources/wallets" require_relative "whop_sdk/resources/webhooks" require_relative "whop_sdk/resources/withdrawals" +require_relative "whop_sdk/resources/workforce" +require_relative "whop_sdk/resources/workforce/bounties" require_relative "whop_sdk/helpers/verify_user_token" diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index d3045ac7..ee72f561 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -15,7 +15,7 @@ class Client < WhopSDK::Internal::Transport::BaseClient # Default max retry delay in seconds. DEFAULT_MAX_RETRY_DELAY = 8.0 - # A company API key, company scoped JWT, app API key, or user OAuth token. You + # An account API key, account scoped JWT, app API key, or user OAuth token. You # must prepend your key/token with the word `Bearer`, which will look like # `Bearer ***************************` # @return [String] @@ -46,252 +46,372 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [String, nil] attr_reader :user_token_jwks_url - # Apps + # An App is software you build on Whop. It can be a hosted web app served at + # `.whop.app` or an API integration installed as an experience, and it + # belongs to the account that owns its credentials, settings, builds, and runtime + # logs. + # + # Use the Apps API to manage app configuration and, for hosted apps, read server + # runtime logs for console output, uncaught exceptions, and failed requests. Logs + # are retained for 7 days and can be filtered by build, level, time window, and + # message text. # @return [WhopSDK::Resources::Apps] attr_reader :apps - # Invoices # @return [WhopSDK::Resources::Invoices] attr_reader :invoices - # Course lesson interactions # @return [WhopSDK::Resources::CourseLessonInteractions] attr_reader :course_lesson_interactions - # Products + # A Product is a digital good or service sold on Whop. Products may contain plans + # for pricing and/or experiences for content delivery. + # + # Use the Products API to create products, list products visible to your + # credentials, retrieve product details, update product metadata or merchandising + # fields, and delete products that should no longer be sold. # @return [WhopSDK::Resources::Products] attr_reader :products - # Companies + # A Social Account represents an external profile connected to a Whop account or + # user, such as a Facebook page or Instagram account. Connecting a social account + # lets Whop run [ads](/api-reference/beta/ads/ad) under that profile's identity + # and promote its existing posts. + # + # Use the Social Accounts API to list connected accounts, create a Whop-managed + # Facebook page, start an OAuth connection, disconnect a social account, and list + # a connected profile's posts. + # @return [WhopSDK::Resources::SocialAccounts] + attr_reader :social_accounts + + # An Audience represents a customer list uploaded to Whop for ad targeting. + # Audiences belong to an account and sync to supported ad platforms as custom + # audiences. + # + # Use the Audiences API to create audiences from CSV uploads, monitor processing + # status, and list or delete audiences for an account. Created audiences are + # usable for targeting after processing reaches `ready` or `partial`. + # @return [WhopSDK::Resources::Audiences] + attr_reader :audiences + + # A Media Asset is an AI-generated image or video created from a prompt and billed + # from an account balance. When generation finishes, the asset includes a file + # that can be attached anywhere Whop accepts files. + # + # Use the Media API to start a generation job and retrieve the asset while it + # processes or after it is ready. + # @return [WhopSDK::Resources::Media] + attr_reader :media + + # A Person represents a visitor or customer of an account, assembled from + # [pixel events](/api-reference/beta/events/event) and purchase activity — ad + # clicks, storefront visits, and checkouts. + # + # Use the People API to list the people of an account and retrieve a single + # person. + # @return [WhopSDK::Resources::People] + attr_reader :people + + # An Event records conversion or engagement activity for an account, such as page + # views, purchases, or leads. Each event ties the action to the + # [person](/api-reference/beta/people/person) who took it, so activity can be + # attributed to the ads and links that drove it. + # + # Use the Events API to send new tracking events and list the events recorded for + # a person. + # @return [WhopSDK::Resources::Events] + attr_reader :events + # @return [WhopSDK::Resources::Companies] attr_reader :companies - # Webhooks # @return [WhopSDK::Resources::Webhooks] attr_reader :webhooks + # A Plan defines how customers buy a product. It controls pricing, billing + # cadence, availability, tax behavior, checkout fields, and purchase visibility. + # + # Use the Plans API to create plans for products, list existing plans, retrieve or + # update plan configuration, calculate tax for checkout, and delete plans that + # should no longer be offered. # @return [WhopSDK::Resources::Plans] attr_reader :plans - # Entries # @return [WhopSDK::Resources::Entries] attr_reader :entries - # Forum posts # @return [WhopSDK::Resources::ForumPosts] attr_reader :forum_posts - # Transfers + # Transfers move value between identities on Whop. They are used for + # account-to-account money movement, user payouts inside Whop, crypto transfers, + # and claim links depending on the destination type. + # + # Use the Transfers API to create a transfer, list previous transfers, and + # retrieve a transfer by ID when reconciling money movement between accounts or + # users. # @return [WhopSDK::Resources::Transfers] attr_reader :transfers - # Ledger accounts # @return [WhopSDK::Resources::LedgerAccounts] attr_reader :ledger_accounts - # Memberships # @return [WhopSDK::Resources::Memberships] attr_reader :memberships - # Authorized users # @return [WhopSDK::Resources::AuthorizedUsers] attr_reader :authorized_users - # App builds # @return [WhopSDK::Resources::AppBuilds] attr_reader :app_builds - # Shipments # @return [WhopSDK::Resources::Shipments] attr_reader :shipments - # Checkout configurations + # A Checkout Configuration is a reusable checkout link owned by an account. In + # `payment` mode it sells a specific plan; in `setup` mode it collects and saves + # payment details without charging. Each configuration can also override which + # payment methods are accepted and how 3D Secure is enforced for that checkout. + # + # Use the Checkout Configurations API to create checkout links for an existing or + # inline plan, list configurations for an account, retrieve the configuration + # behind a checkout URL, and delete links that should no longer be used. # @return [WhopSDK::Resources::CheckoutConfigurations] attr_reader :checkout_configurations - # Messages # @return [WhopSDK::Resources::Messages] attr_reader :messages - # Chat channels # @return [WhopSDK::Resources::ChatChannels] attr_reader :chat_channels + # A User represents a person on Whop. Users have a public profile and can buy + # products, join accounts, and access experiences. + # + # Use the Users API to search for users, retrieve or update profiles, and check + # whether a user has access to an account, product, or experience. # @return [WhopSDK::Resources::Users] attr_reader :users - # Payments # @return [WhopSDK::Resources::Payments] attr_reader :payments - # Support channels # @return [WhopSDK::Resources::SupportChannels] attr_reader :support_channels - # Experiences # @return [WhopSDK::Resources::Experiences] attr_reader :experiences - # Reactions # @return [WhopSDK::Resources::Reactions] attr_reader :reactions - # Members # @return [WhopSDK::Resources::Members] attr_reader :members - # Forums # @return [WhopSDK::Resources::Forums] attr_reader :forums - # Promo codes # @return [WhopSDK::Resources::PromoCodes] attr_reader :promo_codes - # Courses # @return [WhopSDK::Resources::Courses] attr_reader :courses - # Course chapters # @return [WhopSDK::Resources::CourseChapters] attr_reader :course_chapters - # Course lessons # @return [WhopSDK::Resources::CourseLessons] attr_reader :course_lessons - # Reviews # @return [WhopSDK::Resources::Reviews] attr_reader :reviews - # Course students # @return [WhopSDK::Resources::CourseStudents] attr_reader :course_students - # Access tokens # @return [WhopSDK::Resources::AccessTokens] attr_reader :access_tokens - # Notifications # @return [WhopSDK::Resources::Notifications] attr_reader :notifications - # Disputes # @return [WhopSDK::Resources::Disputes] attr_reader :disputes - # Refunds # @return [WhopSDK::Resources::Refunds] attr_reader :refunds - # Withdrawals # @return [WhopSDK::Resources::Withdrawals] attr_reader :withdrawals - # Account links # @return [WhopSDK::Resources::AccountLinks] attr_reader :account_links + # An Account represents a person or business on Whop that can have its own + # profile, wallet, and account-scoped settings. Use accounts for customers, + # creators, merchants, sellers, or connected businesses your integration supports. + # + # Use the Accounts API to create accounts, list accounts visible to your + # credentials, retrieve or update an account, and retrieve the account associated + # with the current API key. # @return [WhopSDK::Resources::Accounts] attr_reader :accounts - # @return [WhopSDK::Resources::Wallets] - attr_reader :wallets - + # A Ledger Activity row is a single financial event on an account's ledger — a + # payment, withdrawal, refund, transfer, on-chain deposit, swap, or card + # transaction. Each row is derived from the underlying ledger lines and carries a + # typed `resource` and `source` so you can present and link the event without + # extra lookups. + # + # Use Ledger Activity to build a statement or transaction feed for an account or + # user. Reconcile against your own records with `amount` (signed, in the + # currency's smallest precision units) and `posted_at`, and use `available_at` to + # know when inflows became withdrawable. # @return [WhopSDK::Resources::FinancialActivity] attr_reader :financial_activity + # Stats represent aggregated activity for an account over time. They help you + # understand revenue, transactions, disputes, members, referrals, and advertising + # performance across reporting periods like days, weeks, or months. + # + # Use the Stats API to list available metrics and their filterable properties, + # then retrieve time-series values for a date range. + # @return [WhopSDK::Resources::Stats] + attr_reader :stats + + # Payouts represent money sent from an account or user balance to an external + # destination, such as a bank account, wallet, or other saved payout method. + # + # Use the Payouts API to create payouts from stablecoin accounts, list payout + # history for accounts or users, monitor payout statuses, and show expected + # arrival details for funds leaving Whop. + # @return [WhopSDK::Resources::Payouts] + attr_reader :payouts + + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + # @return [WhopSDK::Resources::Referrals] + attr_reader :referrals + + # Cards represent Whop-issued virtual payment cards that spend from an account or + # user balance. Cards can be assigned to cardholders and configured with spending + # limits for controlled spending. + # + # Use the Cards API to issue cards, list cards for an account or user, and + # retrieve active card details such as the card number and CVC. + # @return [WhopSDK::Resources::Cards] + attr_reader :cards + + # Swaps convert value between supported tokens, chains, or wallet destinations for + # an account. A swap quote describes the expected output, fees, and approval + # requirements before you create the swap. + # + # Use the Swaps API to quote a conversion, create the swap, list recent swaps, and + # retrieve status until the transaction completes. # @return [WhopSDK::Resources::Swaps] attr_reader :swaps + # Deposits describe ways to add funds to an account balance, including hosted + # deposit pages, bank deposit instructions, and supported crypto wallet addresses. + # + # Use the Deposits API to create deposit instructions for an account and retrieve + # existing bank deposit activity. # @return [WhopSDK::Resources::Deposits] attr_reader :deposits - # Setup intents # @return [WhopSDK::Resources::SetupIntents] attr_reader :setup_intents - # Payment methods # @return [WhopSDK::Resources::PaymentMethods] attr_reader :payment_methods - # Fee markups # @return [WhopSDK::Resources::FeeMarkups] attr_reader :fee_markups - # Payout methods - # @return [WhopSDK::Resources::PayoutMethods] - attr_reader :payout_methods - - # Verifications + # A Verification represents an identity review for a person or business. Accounts + # and users complete verification when Whop needs to confirm who they are before + # enabling payouts or compliance-sensitive workflows. + # + # Use the Verifications API to start or resume a hosted verification session, + # check review status, and submit requested details or documents. If + # `requested_information` contains items, submit answers with + # [Update Verification](/api-reference/beta/verifications/update-verification). # @return [WhopSDK::Resources::Verifications] attr_reader :verifications - # Leads # @return [WhopSDK::Resources::Leads] attr_reader :leads - # Topups # @return [WhopSDK::Resources::Topups] attr_reader :topups - # Files # @return [WhopSDK::Resources::Files] attr_reader :files - # Company token transactions # @return [WhopSDK::Resources::CompanyTokenTransactions] attr_reader :company_token_transactions - # Dm members # @return [WhopSDK::Resources::DmMembers] attr_reader :dm_members - # Ai chats # @return [WhopSDK::Resources::AIChats] attr_reader :ai_chats - # Dm channels # @return [WhopSDK::Resources::DmChannels] attr_reader :dm_channels - # Dispute alerts # @return [WhopSDK::Resources::DisputeAlerts] attr_reader :dispute_alerts - # Resolution center cases # @return [WhopSDK::Resources::ResolutionCenterCases] attr_reader :resolution_center_cases - # Payout accounts # @return [WhopSDK::Resources::PayoutAccounts] attr_reader :payout_accounts - # Affiliates # @return [WhopSDK::Resources::Affiliates] attr_reader :affiliates - # Bounties # @return [WhopSDK::Resources::Bounties] attr_reader :bounties - # Ad campaigns + # @return [WhopSDK::Resources::Workforce] + attr_reader :workforce + + # An Ad Campaign is the top-level container for paid ads on an ad network. It sets + # the platform, objective, and budget strategy shared by its + # [ad groups](/api-reference/beta/ad-groups/ad-group) and ads. + # + # Use the Ad Campaigns API to create campaigns, list campaigns for an account, + # retrieve or update campaign settings, and pause or resume campaign delivery. # @return [WhopSDK::Resources::AdCampaigns] attr_reader :ad_campaigns - # Ad groups + # An Ad Group sits inside an + # [ad campaign](/api-reference/beta/ad-campaigns/ad-campaign) and controls + # delivery for [ads](/api-reference/beta/ads/ad). It sets the audience, + # placements, schedule, budget, and optimization goal for its ads. + # + # Use the Ad Groups API to create ad groups in campaigns, list or retrieve + # targeting and delivery settings, update budgets or targeting, delete groups that + # should stop running, and pause or resume delivery. # @return [WhopSDK::Resources::AdGroups] attr_reader :ad_groups - # Ads + # An Ad is the individual creative unit delivered by an + # [ad group](/api-reference/beta/ad-groups/ad-group). It holds the copy, creative + # assets, and destination URL for one ad. + # + # Use the Ads API to list ads for an account, create ads inside ad groups, + # retrieve or update creative details, delete ads that should stop running, and + # pause or resume delivery. # @return [WhopSDK::Resources::Ads] attr_reader :ads - # Conversions - # @return [WhopSDK::Resources::Conversions] - attr_reader :conversions - - # Ad reports # @return [WhopSDK::Resources::AdReports] attr_reader :ad_reports @@ -306,7 +426,7 @@ class Client < WhopSDK::Internal::Transport::BaseClient # Creates and returns a new client for interacting with the API. # - # @param api_key [String, nil] A company API key, company scoped JWT, app API key, or user OAuth token. You + # @param api_key [String, nil] An account API key, account scoped JWT, app API key, or user OAuth token. You # must prepend your key/token with the word `Bearer`, which will look like # `Bearer ***************************` Defaults to `ENV["WHOP_API_KEY"]` # @@ -339,7 +459,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"), + version: ENV.fetch("WHOP_API_VERSION", "2026-07-08-1"), 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"], @@ -388,6 +508,11 @@ def initialize( @invoices = WhopSDK::Resources::Invoices.new(client: self) @course_lesson_interactions = WhopSDK::Resources::CourseLessonInteractions.new(client: self) @products = WhopSDK::Resources::Products.new(client: self) + @social_accounts = WhopSDK::Resources::SocialAccounts.new(client: self) + @audiences = WhopSDK::Resources::Audiences.new(client: self) + @media = WhopSDK::Resources::Media.new(client: self) + @people = WhopSDK::Resources::People.new(client: self) + @events = WhopSDK::Resources::Events.new(client: self) @companies = WhopSDK::Resources::Companies.new(client: self) @webhooks = WhopSDK::Resources::Webhooks.new(client: self) @plans = WhopSDK::Resources::Plans.new(client: self) @@ -422,14 +547,16 @@ def initialize( @withdrawals = WhopSDK::Resources::Withdrawals.new(client: self) @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) + @stats = WhopSDK::Resources::Stats.new(client: self) + @payouts = WhopSDK::Resources::Payouts.new(client: self) + @referrals = WhopSDK::Resources::Referrals.new(client: self) + @cards = WhopSDK::Resources::Cards.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) @payment_methods = WhopSDK::Resources::PaymentMethods.new(client: self) @fee_markups = WhopSDK::Resources::FeeMarkups.new(client: self) - @payout_methods = WhopSDK::Resources::PayoutMethods.new(client: self) @verifications = WhopSDK::Resources::Verifications.new(client: self) @leads = WhopSDK::Resources::Leads.new(client: self) @topups = WhopSDK::Resources::Topups.new(client: self) @@ -443,10 +570,10 @@ def initialize( @payout_accounts = WhopSDK::Resources::PayoutAccounts.new(client: self) @affiliates = WhopSDK::Resources::Affiliates.new(client: self) @bounties = WhopSDK::Resources::Bounties.new(client: self) + @workforce = WhopSDK::Resources::Workforce.new(client: self) @ad_campaigns = WhopSDK::Resources::AdCampaigns.new(client: self) @ad_groups = WhopSDK::Resources::AdGroups.new(client: self) @ads = WhopSDK::Resources::Ads.new(client: self) - @conversions = WhopSDK::Resources::Conversions.new(client: self) @ad_reports = WhopSDK::Resources::AdReports.new(client: self) end diff --git a/lib/whop_sdk/internal/type/union.rb b/lib/whop_sdk/internal/type/union.rb index 376c7adb..7b34b48a 100644 --- a/lib/whop_sdk/internal/type/union.rb +++ b/lib/whop_sdk/internal/type/union.rb @@ -8,11 +8,11 @@ module Type # @example # # `unwrap_webhook_event` is a `WhopSDK::UnwrapWebhookEvent` # case unwrap_webhook_event - # when WhopSDK::CourseLessonInteractionCompletedWebhookEvent + # when WhopSDK::ChatMessageCreatedWebhookEvent # puts(unwrap_webhook_event.id) - # when WhopSDK::DisputeCreatedWebhookEvent + # when WhopSDK::ChatReactionCreatedWebhookEvent # puts(unwrap_webhook_event.api_version) - # when WhopSDK::DisputeUpdatedWebhookEvent + # when WhopSDK::CourseLessonInteractionCompletedWebhookEvent # puts(unwrap_webhook_event.data) # else # puts(unwrap_webhook_event) @@ -20,11 +20,11 @@ module Type # # @example # case unwrap_webhook_event - # in {type: :"course_lesson_interaction.completed", id: id, api_version: api_version, data: data} + # in {type: :"chat.message.created", id: id, api_version: api_version, data: data} # puts(id) - # in {type: :"dispute.created", id: id, api_version: api_version, data: data} + # in {type: :"chat.reaction.created", id: id, api_version: api_version, data: data} # puts(api_version) - # in {type: :"dispute.updated", id: id, api_version: api_version, data: data} + # in {type: :"course_lesson_interaction.completed", id: id, api_version: api_version, data: data} # puts(data) # else # puts(unwrap_webhook_event) diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index 3d6b7cce..6df246fa 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -55,36 +55,42 @@ module WhopSDK AccountMeParams = WhopSDK::Models::AccountMeParams + AccountRecommendActionsParams = WhopSDK::Models::AccountRecommendActionsParams + AccountRetrieveParams = WhopSDK::Models::AccountRetrieveParams + Accounts = WhopSDK::Models::Accounts + AccountSocialLink = WhopSDK::Models::AccountSocialLink AccountUpdateParams = WhopSDK::Models::AccountUpdateParams - AccountWallet = WhopSDK::Models::AccountWallet - Ad = WhopSDK::Models::Ad - AdBudgetType = WhopSDK::Models::AdBudgetType - AdCampaign = WhopSDK::Models::AdCampaign + AdCampaignCreateParams = WhopSDK::Models::AdCampaignCreateParams + + AdCampaignDeleteParams = WhopSDK::Models::AdCampaignDeleteParams + AdCampaignListParams = WhopSDK::Models::AdCampaignListParams AdCampaignPauseParams = WhopSDK::Models::AdCampaignPauseParams - AdCampaignPlatform = WhopSDK::Models::AdCampaignPlatform - AdCampaignRetrieveParams = WhopSDK::Models::AdCampaignRetrieveParams - AdCampaignStatus = WhopSDK::Models::AdCampaignStatus - AdCampaignUnpauseParams = WhopSDK::Models::AdCampaignUnpauseParams AdCampaignUpdateParams = WhopSDK::Models::AdCampaignUpdateParams + AdCreateParams = WhopSDK::Models::AdCreateParams + + AdDeleteParams = WhopSDK::Models::AdDeleteParams + AdGroup = WhopSDK::Models::AdGroup + AdGroupCreateParams = WhopSDK::Models::AdGroupCreateParams + AdGroupDeleteParams = WhopSDK::Models::AdGroupDeleteParams AdGroupListParams = WhopSDK::Models::AdGroupListParams @@ -93,8 +99,6 @@ module WhopSDK AdGroupRetrieveParams = WhopSDK::Models::AdGroupRetrieveParams - AdGroupStatus = WhopSDK::Models::AdGroupStatus - AdGroupUnpauseParams = WhopSDK::Models::AdGroupUnpauseParams AdGroupUpdateParams = WhopSDK::Models::AdGroupUpdateParams @@ -109,6 +113,8 @@ module WhopSDK AdUnpauseParams = WhopSDK::Models::AdUnpauseParams + AdUpdateParams = WhopSDK::Models::AdUpdateParams + Affiliate = WhopSDK::Models::Affiliate AffiliateArchiveParams = WhopSDK::Models::AffiliateArchiveParams @@ -157,6 +163,8 @@ module WhopSDK AppListParams = WhopSDK::Models::AppListParams + AppLogsParams = WhopSDK::Models::AppLogsParams + AppRetrieveParams = WhopSDK::Models::AppRetrieveParams AppStatuses = WhopSDK::Models::AppStatuses @@ -169,6 +177,14 @@ module WhopSDK AssessmentQuestionTypes = WhopSDK::Models::AssessmentQuestionTypes + Audience = WhopSDK::Models::Audience + + AudienceCreateParams = WhopSDK::Models::AudienceCreateParams + + AudienceDeleteParams = WhopSDK::Models::AudienceDeleteParams + + AudienceListParams = WhopSDK::Models::AudienceListParams + AuthorizedUser = WhopSDK::Models::AuthorizedUser AuthorizedUserCreateParams = WhopSDK::Models::AuthorizedUserCreateParams @@ -193,6 +209,14 @@ module WhopSDK CardBrands = WhopSDK::Models::CardBrands + CardCreateParams = WhopSDK::Models::CardCreateParams + + CardListParams = WhopSDK::Models::CardListParams + + CardRetrieveParams = WhopSDK::Models::CardRetrieveParams + + CardUpdateParams = WhopSDK::Models::CardUpdateParams + ChatChannel = WhopSDK::Models::ChatChannel ChatChannelListParams = WhopSDK::Models::ChatChannelListParams @@ -201,10 +225,16 @@ module WhopSDK ChatChannelUpdateParams = WhopSDK::Models::ChatChannelUpdateParams + ChatMessageCreatedWebhookEvent = WhopSDK::Models::ChatMessageCreatedWebhookEvent + + ChatReactionCreatedWebhookEvent = WhopSDK::Models::ChatReactionCreatedWebhookEvent + CheckoutConfiguration = WhopSDK::Models::CheckoutConfiguration CheckoutConfigurationCreateParams = WhopSDK::Models::CheckoutConfigurationCreateParams + CheckoutConfigurationDeleteParams = WhopSDK::Models::CheckoutConfigurationDeleteParams + CheckoutConfigurationListParams = WhopSDK::Models::CheckoutConfigurationListParams CheckoutConfigurationRetrieveParams = WhopSDK::Models::CheckoutConfigurationRetrieveParams @@ -239,8 +269,6 @@ module WhopSDK CompanyUpdateParams = WhopSDK::Models::CompanyUpdateParams - ConversionCreateParams = WhopSDK::Models::ConversionCreateParams - Course = WhopSDK::Models::Course CourseChapter = WhopSDK::Models::CourseChapter @@ -304,6 +332,8 @@ module WhopSDK DepositCreateParams = WhopSDK::Models::DepositCreateParams + DepositListParams = WhopSDK::Models::DepositListParams + Direction = WhopSDK::Models::Direction Dispute = WhopSDK::Models::Dispute @@ -384,6 +414,10 @@ module WhopSDK EntryStatus = WhopSDK::Models::EntryStatus + EventCreateParams = WhopSDK::Models::EventCreateParams + + EventListParams = WhopSDK::Models::EventListParams + Experience = WhopSDK::Models::Experience ExperienceAttachParams = WhopSDK::Models::ExperienceAttachParams @@ -402,8 +436,6 @@ module WhopSDK ExperienceUpdateParams = WhopSDK::Models::ExperienceUpdateParams - ExternalAdStatus = WhopSDK::Models::ExternalAdStatus - FeeMarkupCreateParams = WhopSDK::Models::FeeMarkupCreateParams FeeMarkupDeleteParams = WhopSDK::Models::FeeMarkupDeleteParams @@ -498,6 +530,8 @@ module WhopSDK LeadUpdateParams = WhopSDK::Models::LeadUpdateParams + LedgerAccountFundsAvailableWebhookEvent = WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent + LedgerAccountRetrieveParams = WhopSDK::Models::LedgerAccountRetrieveParams Lesson = WhopSDK::Models::Lesson @@ -506,6 +540,12 @@ module WhopSDK LessonVisibilities = WhopSDK::Models::LessonVisibilities + MediaAsset = WhopSDK::Models::MediaAsset + + MediaGenerateParams = WhopSDK::Models::MediaGenerateParams + + MediaRetrieveParams = WhopSDK::Models::MediaRetrieveParams + MemberListParams = WhopSDK::Models::MemberListParams MemberMostRecentActions = WhopSDK::Models::MemberMostRecentActions @@ -535,6 +575,8 @@ module WhopSDK MembershipStatus = WhopSDK::Models::MembershipStatus + MembershipTrialEndingSoonWebhookEvent = WhopSDK::Models::MembershipTrialEndingSoonWebhookEvent + MembershipUncancelParams = WhopSDK::Models::MembershipUncancelParams MembershipUpdateParams = WhopSDK::Models::MembershipUpdateParams @@ -597,16 +639,22 @@ module WhopSDK PayoutAccountStatusUpdatedWebhookEvent = WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent - PayoutDestinationCategory = WhopSDK::Models::PayoutDestinationCategory + PayoutCreateParams = WhopSDK::Models::PayoutCreateParams + + PayoutListParams = WhopSDK::Models::PayoutListParams PayoutMethodCreatedWebhookEvent = WhopSDK::Models::PayoutMethodCreatedWebhookEvent - PayoutMethodListParams = WhopSDK::Models::PayoutMethodListParams + Payouts = WhopSDK::Models::Payouts + + PersonListParams = WhopSDK::Models::PersonListParams - PayoutMethodRetrieveParams = WhopSDK::Models::PayoutMethodRetrieveParams + PersonRetrieveParams = WhopSDK::Models::PersonRetrieveParams Plan = WhopSDK::Models::Plan + PlanCalculateTaxParams = WhopSDK::Models::PlanCalculateTaxParams + PlanCreateParams = WhopSDK::Models::PlanCreateParams PlanDeleteParams = WhopSDK::Models::PlanDeleteParams @@ -663,6 +711,10 @@ module WhopSDK ReceiptTaxBehavior = WhopSDK::Models::ReceiptTaxBehavior + ReferralReferredUsersParams = WhopSDK::Models::ReferralReferredUsersParams + + Referrals = WhopSDK::Models::Referrals + RefundCreatedWebhookEvent = WhopSDK::Models::RefundCreatedWebhookEvent RefundListParams = WhopSDK::Models::RefundListParams @@ -735,8 +787,26 @@ module WhopSDK ShipmentSubstatus = WhopSDK::Models::ShipmentSubstatus + SocialAccount = WhopSDK::Models::SocialAccount + + SocialAccountConnectParams = WhopSDK::Models::SocialAccountConnectParams + + SocialAccountCreateParams = WhopSDK::Models::SocialAccountCreateParams + + SocialAccountDeleteParams = WhopSDK::Models::SocialAccountDeleteParams + + SocialAccountListParams = WhopSDK::Models::SocialAccountListParams + + SocialAccountPost = WhopSDK::Models::SocialAccountPost + + SocialAccountPostsParams = WhopSDK::Models::SocialAccountPostsParams + SocialLinkWebsites = WhopSDK::Models::SocialLinkWebsites + StatListParams = WhopSDK::Models::StatListParams + + StatRetrieveParams = WhopSDK::Models::StatRetrieveParams + Status = WhopSDK::Models::Status SupportChannel = WhopSDK::Models::SupportChannel @@ -751,6 +821,8 @@ module WhopSDK SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + SwapListParams = WhopSDK::Models::SwapListParams + SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams TaxIdentifierType = WhopSDK::Models::TaxIdentifierType @@ -759,8 +831,6 @@ module WhopSDK TopupCreateParams = WhopSDK::Models::TopupCreateParams - Transfer = WhopSDK::Models::Transfer - TransferCreateParams = WhopSDK::Models::TransferCreateParams TransferListParams = WhopSDK::Models::TransferListParams @@ -773,6 +843,8 @@ module WhopSDK User = WhopSDK::Models::User + UserBalance = WhopSDK::Models::UserBalance + UserCheckAccessParams = WhopSDK::Models::UserCheckAccessParams UserListParams = WhopSDK::Models::UserListParams @@ -783,6 +855,8 @@ module WhopSDK UserUpdateParams = WhopSDK::Models::UserUpdateParams + VerificationCreateParams = WhopSDK::Models::VerificationCreateParams + VerificationErrorCode = WhopSDK::Models::VerificationErrorCode VerificationListParams = WhopSDK::Models::VerificationListParams @@ -793,16 +867,12 @@ module WhopSDK VerificationSucceededWebhookEvent = WhopSDK::Models::VerificationSucceededWebhookEvent + VerificationUpdateParams = WhopSDK::Models::VerificationUpdateParams + Visibility = WhopSDK::Models::Visibility VisibilityFilter = WhopSDK::Models::VisibilityFilter - WalletBalanceParams = WhopSDK::Models::WalletBalanceParams - - WalletListParams = WhopSDK::Models::WalletListParams - - WalletSendParams = WhopSDK::Models::WalletSendParams - Webhook = WhopSDK::Models::Webhook WebhookCreateParams = WhopSDK::Models::WebhookCreateParams @@ -844,4 +914,6 @@ module WhopSDK WithdrawalStatus = WhopSDK::Models::WithdrawalStatus WithdrawalUpdatedWebhookEvent = WhopSDK::Models::WithdrawalUpdatedWebhookEvent + + Workforce = WhopSDK::Models::Workforce end diff --git a/lib/whop_sdk/models/account.rb b/lib/whop_sdk/models/account.rb index 447d5e3f..d6f29d06 100644 --- a/lib/whop_sdk/models/account.rb +++ b/lib/whop_sdk/models/account.rb @@ -5,43 +5,63 @@ module Models # @see WhopSDK::Resources::Accounts#create class Account < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The ID of the account, which will look like biz\_******\******* + # Account ID, prefixed `biz_`. # # @return [String] required :id, String + # @!attribute balances + # + # @return [Array] + required :balances, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::Balance] } + # @!attribute banner_image_url - # The URL of the account banner image + # Account banner image URL. # # @return [String, nil] required :banner_image_url, String, nil?: true + # @!attribute business_address + # Account business address used to calculate tax, with `line1`, `line2`, `city`, + # `state`, `postal_code`, and `country`. `null` when no address is set. + # + # @return [Object, nil] + required :business_address, WhopSDK::Internal::Type::Unknown, nil?: true + # @!attribute business_type - # The high-level business category for the account + # High-level business category for the account. # # @return [String, nil] required :business_type, String, nil?: true + # @!attribute capabilities + # Payment rails enabled for this account, each `active`, `inactive`, or `pending` + # (onboarding or review in progress). Computed only on `retrieve` and `me` for + # callers with `company:balance:read` scope; `null` otherwise. + # + # @return [WhopSDK::Models::Account::Capabilities, nil] + required :capabilities, -> { WhopSDK::Account::Capabilities }, nil?: true + # @!attribute country - # The country the account is located in + # Country where the account is located. # # @return [String, nil] required :country, String, nil?: true # @!attribute created_at - # When the account was created, as an ISO 8601 timestamp + # When the account was created, as an ISO 8601 timestamp. # # @return [String] required :created_at, String # @!attribute description - # A promotional description for the account + # Account promotional description. # # @return [String, nil] required :description, String, nil?: true # @!attribute email - # The email address of the account owner + # Account owner email address. # # @return [String, nil] required :email, String, nil?: true @@ -52,104 +72,128 @@ class Account < WhopSDK::Internal::Type::BaseModel required :home_preferences, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute industry_group - # The industry group the account belongs to + # Account industry group. # # @return [String, nil] required :industry_group, String, nil?: true # @!attribute industry_type - # The specific industry vertical the account operates in + # Specific industry vertical for the account. # # @return [String, nil] required :industry_type, String, nil?: true # @!attribute invoice_prefix - # The prefix used for account invoices + # Prefix used for account invoices. # # @return [String, nil] required :invoice_prefix, String, nil?: true # @!attribute logo_url - # The URL of the account logo image + # Account logo image URL. # # @return [String, nil] required :logo_url, String, nil?: true # @!attribute metadata - # Arbitrary key/value metadata supplied when the account was created + # Arbitrary key/value metadata supplied at account creation. # # @return [Object] required :metadata, WhopSDK::Internal::Type::Unknown # @!attribute onboarding_type - # The type of onboarding the account has completed + # 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 + # Account Open Graph image URL. # # @return [String, nil] required :opengraph_image_url, String, nil?: true # @!attribute opengraph_image_variant - # The account Open Graph image variant + # 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 + # Business type details 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 + # Industry details 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 + # Parent account ID for connected accounts. # # @return [String, nil] required :parent_account_id, String, nil?: true + # @!attribute product_tax_code + # Tax classification code applied by default to the account's products, with `id`, + # `name`, and `product_type`. `null` when no default is set. + # + # @return [Object, nil] + required :product_tax_code, WhopSDK::Internal::Type::Unknown, nil?: true + + # @!attribute recommended_actions + # @deprecated + # + # DEPRECATED: Use the `GET /accounts/{account_id}/recommend_actions` endpoint + # instead. + # + # @return [Array, nil] + required :recommended_actions, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RecommendedAction] }, + nil?: true + # @!attribute require_2fa - # Whether the account requires authorized users to have two-factor authentication - # enabled + # Whether authorized users must enable two-factor authentication. # # @return [Boolean] required :require_2fa, WhopSDK::Internal::Type::Boolean + # @!attribute required_actions + # + # @return [Array, nil] + required :required_actions, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RequiredAction] }, + nil?: true + # @!attribute route - # The account's public route identifier + # Account public route identifier. # # @return [String] required :route, String # @!attribute send_customer_emails - # Whether Whop sends transactional emails to customers on behalf of this account + # Whether Whop sends transactional emails to customers on behalf of this account. # # @return [Boolean] required :send_customer_emails, WhopSDK::Internal::Type::Boolean # @!attribute show_joined_whops - # Whether the account appears in joined whops on other accounts + # 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 + # 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 + # Whether the account shows users in the user directory. # # @return [Boolean] required :show_user_directory, WhopSDK::Internal::Type::Boolean @@ -159,101 +203,765 @@ class Account < WhopSDK::Internal::Type::BaseModel # @return [Array] required :social_links, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AccountSocialLink] } + # @!attribute status + # Whether the account can operate on Whop: `active` or `suspended`. Computed only + # on `retrieve` and `me`; `null` otherwise. + # + # @return [String, nil] + required :status, String, nil?: true + # @!attribute store_page_config - # Store page display configuration for the account + # Account store page display configuration. # # @return [Object] required :store_page_config, WhopSDK::Internal::Type::Unknown # @!attribute target_audience - # The target audience for this account + # Target audience for this account. # # @return [String, nil] required :target_audience, String, nil?: true + # @!attribute tax_identifiers + # Account tax/VAT registrations, each with `id`, `tax_id_type`, and + # `tax_id_value`. Empty when none are set. + # + # @return [Array] + required :tax_identifiers, WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown] + + # @!attribute tax_remitted_by + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `null` until the account enrolls in the + # Whop tax service. + # + # @return [String, nil] + required :tax_remitted_by, String, nil?: true + # @!attribute title - # The display name of the account + # Account display name. # # @return [String] required :title, String + # @!attribute total_earned_usd + # Account lifetime sales, normalized to USD. Computed only on `retrieve` and `me` + # for callers with `stats:read` scope; `null` otherwise. + # + # @return [Float, nil] + required :total_earned_usd, Float, nil?: true + + # @!attribute total_usd + # Total USD value across balances with known exchange rates. Computed only on + # single-account reads (`retrieve` and `me`); `null` on list responses, writes, + # missing balance-read permission, or unavailable balance source. + # + # @return [String, nil] + required :total_usd, String, nil?: true + # @!attribute use_logo_as_opengraph_image_fallback - # Whether the account uses its logo as the fallback Open Graph image + # 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 verification + # Account identity verification status for the `individual` (KYC) and `business` + # (KYB) profiles. Each is `null` until created, otherwise a `status` of + # `not_started`, `pending`, `approved`, or `rejected`. + # + # @return [Object] + required :verification, WhopSDK::Internal::Type::Unknown + # @!attribute wallet - # The account's primary crypto wallet, or null if none has been provisioned + # Account primary crypto wallet, or `null` if none has been provisioned. # - # @return [WhopSDK::Models::AccountWallet, nil] - required :wallet, -> { WhopSDK::AccountWallet }, nil?: true + # @return [WhopSDK::Models::Account::Wallet, nil] + required :wallet, -> { WhopSDK::Account::Wallet }, nil?: true - # @!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:) + # @!method initialize(id:, balances:, banner_image_url:, business_address:, business_type:, capabilities:, 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:, product_tax_code:, recommended_actions:, require_2fa:, required_actions:, route:, send_customer_emails:, show_joined_whops:, show_reviews_dtc:, show_user_directory:, social_links:, status:, store_page_config:, target_audience:, tax_identifiers:, tax_remitted_by:, title:, total_earned_usd:, total_usd:, use_logo_as_opengraph_image_fallback:, verification:, 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 id [String] Account ID, prefixed `biz_`. # - # @param banner_image_url [String, nil] The URL of the account banner image + # @param balances [Array] # - # @param business_type [String, nil] The high-level business category for the account + # @param banner_image_url [String, nil] Account banner image URL. # - # @param country [String, nil] The country the account is located in + # @param business_address [Object, nil] Account business address used to calculate tax, with `line1`, `line2`, `city`, ` # - # @param created_at [String] When the account was created, as an ISO 8601 timestamp + # @param business_type [String, nil] High-level business category for the account. # - # @param description [String, nil] A promotional description for the account + # @param capabilities [WhopSDK::Models::Account::Capabilities, nil] Payment rails enabled for this account, each `active`, `inactive`, or `pending` # - # @param email [String, nil] The email address of the account owner + # @param country [String, nil] Country where the account is located. # - # @param home_preferences [Array] + # @param created_at [String] When the account was created, as an ISO 8601 timestamp. + # + # @param description [String, nil] Account promotional description. # - # @param industry_group [String, nil] The industry group the account belongs to + # @param email [String, nil] Account owner email address. # - # @param industry_type [String, nil] The specific industry vertical the account operates in + # @param home_preferences [Array] # - # @param invoice_prefix [String, nil] The prefix used for account invoices + # @param industry_group [String, nil] Account industry group. # - # @param logo_url [String, nil] The URL of the account logo image + # @param industry_type [String, nil] Specific industry vertical for the account. # - # @param metadata [Object] Arbitrary key/value metadata supplied when the account was created + # @param invoice_prefix [String, nil] Prefix used for account invoices. # - # @param onboarding_type [String, nil] The type of onboarding the account has completed + # @param logo_url [String, nil] Account logo image URL. # - # @param opengraph_image_url [String, nil] The URL of the account Open Graph image + # @param metadata [Object] Arbitrary key/value metadata supplied at account creation. # - # @param opengraph_image_variant [String, nil] The account Open Graph image variant + # @param onboarding_type [String, nil] Type of onboarding the account has completed. # - # @param other_business_description [String, nil] The description of the business type when business_type is other + # @param opengraph_image_url [String, nil] Account Open Graph image URL. # - # @param other_industry_description [String, nil] The description of the industry type when industry_type is other + # @param opengraph_image_variant [String, nil] Account Open Graph image variant. # - # @param parent_account_id [String, nil] The parent account ID for connected accounts + # @param other_business_description [String, nil] Business type details when business_type is `other`. # - # @param require_2fa [Boolean] Whether the account requires authorized users to have two-factor authentication + # @param other_industry_description [String, nil] Industry details when industry_type is `other`. # - # @param route [String] The account's public route identifier + # @param parent_account_id [String, nil] Parent account ID for connected accounts. # - # @param send_customer_emails [Boolean] Whether Whop sends transactional emails to customers on behalf of this account + # @param product_tax_code [Object, nil] Tax classification code applied by default to the account's products, with `id`, # - # @param show_joined_whops [Boolean] Whether the account appears in joined whops on other accounts + # @param recommended_actions [Array, nil] DEPRECATED: Use the `GET /accounts/{account_id}/recommend_actions` endpoint inst # - # @param show_reviews_dtc [Boolean] Whether reviews are displayed on direct-to-consumer product pages + # @param require_2fa [Boolean] Whether authorized users must enable two-factor authentication. # - # @param show_user_directory [Boolean] Whether the account shows users in the user directory + # @param required_actions [Array, nil] # - # @param social_links [Array] + # @param route [String] Account public route identifier. # - # @param store_page_config [Object] Store page display configuration for the account + # @param send_customer_emails [Boolean] Whether Whop sends transactional emails to customers on behalf of this account. # - # @param target_audience [String, nil] The target audience for this account + # @param show_joined_whops [Boolean] Whether the account appears in joined whops on other accounts. # - # @param title [String] The display name of the account + # @param show_reviews_dtc [Boolean] Whether reviews are displayed on direct-to-consumer product pages. # - # @param use_logo_as_opengraph_image_fallback [Boolean] Whether the account uses its logo as the fallback Open Graph image + # @param show_user_directory [Boolean] Whether the account shows users in the user directory. + # + # @param social_links [Array] # - # @param wallet [WhopSDK::Models::AccountWallet, nil] The account's primary crypto wallet, or null if none has been provisioned + # @param status [String, nil] Whether the account can operate on Whop: `active` or `suspended`. Computed only + # + # @param store_page_config [Object] Account store page display configuration. + # + # @param target_audience [String, nil] Target audience for this account. + # + # @param tax_identifiers [Array] Account tax/VAT registrations, each with `id`, `tax_id_type`, and `tax_id_value` + # + # @param tax_remitted_by [String, nil] Who calculates and remits tax for the account: `whop` (Whop calculates and remit + # + # @param title [String] Account display name. + # + # @param total_earned_usd [Float, nil] Account lifetime sales, normalized to USD. Computed only on `retrieve` and `me` + # + # @param total_usd [String, nil] Total USD value across balances with known exchange rates. Computed only on sing + # + # @param use_logo_as_opengraph_image_fallback [Boolean] Whether the account uses its logo as the fallback Open Graph image. + # + # @param verification [Object] Account identity verification status for the `individual` (KYC) and `business` ( + # + # @param wallet [WhopSDK::Models::Account::Wallet, nil] Account primary crypto wallet, or `null` if none has been provisioned. + + class Balance < WhopSDK::Internal::Type::BaseModel + # @!attribute balance + # Total amount held in native units, as a decimal string. + # + # @return [String] + required :balance, String + + # @!attribute breakdown + # Balance split into available, pending, and reserve amounts, as native-unit + # decimal strings. On-chain crypto is entirely available; good_funds and fiat cash + # can have pending or reserve portions. + # + # @return [Object] + required :breakdown, WhopSDK::Internal::Type::Unknown + + # @!attribute icon_url + # Holding icon URL. + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute name + # The holding's display name + # + # @return [String] + required :name, String + + # @!attribute price_usd + # USD price per unit, or `null` when no exchange rate is available. + # + # @return [Float, nil] + required :price_usd, Float, nil?: true + + # @!attribute symbol + # Holding display symbol, such as `USDT`, `cbBTC`, or `EUR`. + # + # @return [String] + required :symbol, String + + # @!attribute value_usd + # Holding USD value, or `null` when no exchange rate is available. + # + # @return [String, nil] + required :value_usd, String, nil?: true + + # @!method initialize(balance:, breakdown:, icon_url:, name:, price_usd:, symbol:, value_usd:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Account::Balance} for more details. + # + # Account holdings, each with USD value. Empty when `total_usd` is `null`. + # + # @param balance [String] Total amount held in native units, as a decimal string. + # + # @param breakdown [Object] Balance split into available, pending, and reserve amounts, as native-unit decim + # + # @param icon_url [String, nil] Holding icon URL. + # + # @param name [String] The holding's display name + # + # @param price_usd [Float, nil] USD price per unit, or `null` when no exchange rate is available. + # + # @param symbol [String] Holding display symbol, such as `USDT`, `cbBTC`, or `EUR`. + # + # @param value_usd [String, nil] Holding USD value, or `null` when no exchange rate is available. + end + + # @see WhopSDK::Models::Account#capabilities + class Capabilities < WhopSDK::Internal::Type::BaseModel + # @!attribute accept_bank_payments + # Bank payins: debits, transfers, and local bank rails + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::AcceptBankPayments] + required :accept_bank_payments, enum: -> { WhopSDK::Account::Capabilities::AcceptBankPayments } + + # @!attribute accept_bnpl_payments + # Buy-now-pay-later payins; requires approval + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::AcceptBnplPayments] + required :accept_bnpl_payments, enum: -> { WhopSDK::Account::Capabilities::AcceptBnplPayments } + + # @!attribute accept_card_payments + # Card payins, including Apple Pay and Google Pay + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::AcceptCardPayments] + required :accept_card_payments, enum: -> { WhopSDK::Account::Capabilities::AcceptCardPayments } + + # @!attribute bank_deposit + # Deposits by bank wire or ACH to the account's virtual bank account + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::BankDeposit] + required :bank_deposit, enum: -> { WhopSDK::Account::Capabilities::BankDeposit } + + # @!attribute card_deposit + # Balance top-ups by charging a stored payment method + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::CardDeposit] + required :card_deposit, enum: -> { WhopSDK::Account::Capabilities::CardDeposit } + + # @!attribute card_issuing + # Issuing Whop cards; requires card application approval + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::CardIssuing] + required :card_issuing, enum: -> { WhopSDK::Account::Capabilities::CardIssuing } + + # @!attribute crypto_deposit + # On-chain deposits to the account's crypto wallet + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::CryptoDeposit] + required :crypto_deposit, enum: -> { WhopSDK::Account::Capabilities::CryptoDeposit } + + # @!attribute crypto_payout + # On-chain payouts to a crypto wallet + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::CryptoPayout] + required :crypto_payout, enum: -> { WhopSDK::Account::Capabilities::CryptoPayout } + + # @!attribute instant_payout + # Instant payouts to an eligible payout destination + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::InstantPayout] + required :instant_payout, enum: -> { WhopSDK::Account::Capabilities::InstantPayout } + + # @!attribute standard_payout + # Standard payouts to an external payout destination + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::StandardPayout] + required :standard_payout, enum: -> { WhopSDK::Account::Capabilities::StandardPayout } + + # @!attribute transfer + # Transfers to other accounts + # + # @return [Symbol, WhopSDK::Models::Account::Capabilities::Transfer] + required :transfer, enum: -> { WhopSDK::Account::Capabilities::Transfer } + + # @!method initialize(accept_bank_payments:, accept_bnpl_payments:, accept_card_payments:, bank_deposit:, card_deposit:, card_issuing:, crypto_deposit:, crypto_payout:, instant_payout:, standard_payout:, transfer:) + # Payment rails enabled for this account, each `active`, `inactive`, or `pending` + # (onboarding or review in progress). Computed only on `retrieve` and `me` for + # callers with `company:balance:read` scope; `null` otherwise. + # + # @param accept_bank_payments [Symbol, WhopSDK::Models::Account::Capabilities::AcceptBankPayments] Bank payins: debits, transfers, and local bank rails + # + # @param accept_bnpl_payments [Symbol, WhopSDK::Models::Account::Capabilities::AcceptBnplPayments] Buy-now-pay-later payins; requires approval + # + # @param accept_card_payments [Symbol, WhopSDK::Models::Account::Capabilities::AcceptCardPayments] Card payins, including Apple Pay and Google Pay + # + # @param bank_deposit [Symbol, WhopSDK::Models::Account::Capabilities::BankDeposit] Deposits by bank wire or ACH to the account's virtual bank account + # + # @param card_deposit [Symbol, WhopSDK::Models::Account::Capabilities::CardDeposit] Balance top-ups by charging a stored payment method + # + # @param card_issuing [Symbol, WhopSDK::Models::Account::Capabilities::CardIssuing] Issuing Whop cards; requires card application approval + # + # @param crypto_deposit [Symbol, WhopSDK::Models::Account::Capabilities::CryptoDeposit] On-chain deposits to the account's crypto wallet + # + # @param crypto_payout [Symbol, WhopSDK::Models::Account::Capabilities::CryptoPayout] On-chain payouts to a crypto wallet + # + # @param instant_payout [Symbol, WhopSDK::Models::Account::Capabilities::InstantPayout] Instant payouts to an eligible payout destination + # + # @param standard_payout [Symbol, WhopSDK::Models::Account::Capabilities::StandardPayout] Standard payouts to an external payout destination + # + # @param transfer [Symbol, WhopSDK::Models::Account::Capabilities::Transfer] Transfers to other accounts + + # Bank payins: debits, transfers, and local bank rails + # + # @see WhopSDK::Models::Account::Capabilities#accept_bank_payments + module AcceptBankPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Buy-now-pay-later payins; requires approval + # + # @see WhopSDK::Models::Account::Capabilities#accept_bnpl_payments + module AcceptBnplPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Card payins, including Apple Pay and Google Pay + # + # @see WhopSDK::Models::Account::Capabilities#accept_card_payments + module AcceptCardPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Deposits by bank wire or ACH to the account's virtual bank account + # + # @see WhopSDK::Models::Account::Capabilities#bank_deposit + module BankDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Balance top-ups by charging a stored payment method + # + # @see WhopSDK::Models::Account::Capabilities#card_deposit + module CardDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Issuing Whop cards; requires card application approval + # + # @see WhopSDK::Models::Account::Capabilities#card_issuing + module CardIssuing + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # On-chain deposits to the account's crypto wallet + # + # @see WhopSDK::Models::Account::Capabilities#crypto_deposit + module CryptoDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # On-chain payouts to a crypto wallet + # + # @see WhopSDK::Models::Account::Capabilities#crypto_payout + module CryptoPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Instant payouts to an eligible payout destination + # + # @see WhopSDK::Models::Account::Capabilities#instant_payout + module InstantPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Standard payouts to an external payout destination + # + # @see WhopSDK::Models::Account::Capabilities#standard_payout + module StandardPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Transfers to other accounts + # + # @see WhopSDK::Models::Account::Capabilities#transfer + module Transfer + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + + class RecommendedAction < WhopSDK::Internal::Type::BaseModel + # @!attribute action + # The recommendation; new values may be added, so handle unknown actions + # gracefully + # + # @return [Symbol, WhopSDK::Models::Account::RecommendedAction::Action] + required :action, enum: -> { WhopSDK::Account::RecommendedAction::Action } + + # @!attribute blocked_capabilities + # + # @return [Array] + required :blocked_capabilities, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute cta + # The URL the call-to-action links to + # + # @return [String] + required :cta, String + + # @!attribute cta_label + # Button label + # + # @return [String] + required :cta_label, String + + # @!attribute description + # Supporting copy, or empty + # + # @return [String] + required :description, String + + # @!attribute icon_url + # Illustration icon URL, or `null` + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute impact_score + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + # + # @return [Integer, nil] + required :impact_score, Integer, nil?: true + + # @!attribute reasoning + # Why this action was recommended for this account, or `null` + # + # @return [String, nil] + required :reasoning, String, nil?: true + + # @!attribute status + # Always optional — never blocking + # + # @return [Symbol, WhopSDK::Models::Account::RecommendedAction::Status] + required :status, enum: -> { WhopSDK::Account::RecommendedAction::Status } + + # @!attribute title + # Headline for the recommendation + # + # @return [String] + required :title, String + + # @!method initialize(action:, blocked_capabilities:, cta:, cta_label:, description:, icon_url:, impact_score:, reasoning:, status:, title:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Account::RecommendedAction} for more details. + # + # Deprecated: use the `GET /accounts/{account_id}/recommend_actions` endpoint + # instead. Optional actions that unlock capabilities or grow the account, same + # shape as `required_actions`. Computed only on `retrieve` and `me`; `null` + # otherwise. + # + # @param action [Symbol, WhopSDK::Models::Account::RecommendedAction::Action] The recommendation; new values may be added, so handle unknown actions gracefull + # + # @param blocked_capabilities [Array] + # + # @param cta [String] The URL the call-to-action links to + # + # @param cta_label [String] Button label + # + # @param description [String] Supporting copy, or empty + # + # @param icon_url [String, nil] Illustration icon URL, or `null` + # + # @param impact_score [Integer, nil] Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # + # @param reasoning [String, nil] Why this action was recommended for this account, or `null` + # + # @param status [Symbol, WhopSDK::Models::Account::RecommendedAction::Status] Always optional — never blocking + # + # @param title [String] Headline for the recommendation + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + # + # @see WhopSDK::Models::Account::RecommendedAction#action + module Action + extend WhopSDK::Internal::Type::Enum + + THEME_BUSINESS = :theme_business + CREATE_PRODUCT = :create_product + CREATE_PLAN = :create_plan + VERIFY_IDENTITY = :verify_identity + CONNECT_AFFILIATE_PROGRAM = :connect_affiliate_program + CREATE_PROMOTION = :create_promotion + SETUP_TRACKING_PIXEL = :setup_tracking_pixel + MIGRATE_FROM_STRIPE = :migrate_from_stripe + ACCEPT_FIRST_PAYMENT = :accept_first_payment + LAUNCH_FIRST_AD = :launch_first_ad + INVITE_TEAM_MEMBER = :invite_team_member + ENABLE_TAX_COLLECTION = :enable_tax_collection + CREATE_CARD = :create_card + JOIN_WHOP_UNIVERSITY = :join_whop_university + APPLY_FOR_FINANCING = :apply_for_financing + + # @!method self.values + # @return [Array] + end + + # Always optional — never blocking + # + # @see WhopSDK::Models::Account::RecommendedAction#status + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL = :optional + + # @!method self.values + # @return [Array] + end + end + + class RequiredAction < WhopSDK::Internal::Type::BaseModel + # @!attribute action + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + # + # @return [Symbol, WhopSDK::Models::Account::RequiredAction::Action] + required :action, enum: -> { WhopSDK::Account::RequiredAction::Action } + + # @!attribute blocked_capabilities + # + # @return [Array] + required :blocked_capabilities, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute cta + # The URL the call-to-action links to, or null when there is no button + # + # @return [String, nil] + required :cta, String, nil?: true + + # @!attribute cta_label + # Button label, or empty when there is no button + # + # @return [String] + required :cta_label, String + + # @!attribute description + # Supporting copy, or empty + # + # @return [String] + required :description, String + + # @!attribute icon_url + # The URL of the action's illustration icon, or null if it has none + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute status + # required (act now) or pending (under review) + # + # @return [Symbol, WhopSDK::Models::Account::RequiredAction::Status] + required :status, enum: -> { WhopSDK::Account::RequiredAction::Status } + + # @!attribute title + # Headline for the action + # + # @return [String] + required :title, String + + # @!method initialize(action:, blocked_capabilities:, cta:, cta_label:, description:, icon_url:, status:, title:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Account::RequiredAction} for more details. + # + # Actions the account owner must take to unblock capabilities like payouts and + # card spend, ordered by display priority. Computed only on `retrieve` and `me` + # for callers with `company:balance:read` scope; `null` otherwise. + # + # @param action [Symbol, WhopSDK::Models::Account::RequiredAction::Action] What the holder must do; new values may be added, so handle unknown actions grac + # + # @param blocked_capabilities [Array] + # + # @param cta [String, nil] The URL the call-to-action links to, or null when there is no button + # + # @param cta_label [String] Button label, or empty when there is no button + # + # @param description [String] Supporting copy, or empty + # + # @param icon_url [String, nil] The URL of the action's illustration icon, or null if it has none + # + # @param status [Symbol, WhopSDK::Models::Account::RequiredAction::Status] required (act now) or pending (under review) + # + # @param title [String] Headline for the action + + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + # + # @see WhopSDK::Models::Account::RequiredAction#action + module Action + extend WhopSDK::Internal::Type::Enum + + DEPOSIT_FUNDS = :deposit_funds + SUBMIT_INFORMATION_REQUEST = :submit_information_request + VERIFY_IDENTITY = :verify_identity + CONNECT_FULFILLMENT_TRACKER = :connect_fulfillment_tracker + + # @!method self.values + # @return [Array] + end + + # required (act now) or pending (under review) + # + # @see WhopSDK::Models::Account::RequiredAction#status + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRED = :required + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::Account#wallet + class Wallet < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Wallet ID, prefixed `wallet_`. + # + # @return [String] + required :id, String + + # @!attribute address + # The on-chain address of the wallet + # + # @return [String] + required :address, String + + # @!attribute network + # The blockchain network the wallet lives on + # + # @return [Symbol, WhopSDK::Models::Account::Wallet::Network] + required :network, enum: -> { WhopSDK::Account::Wallet::Network } + + # @!method initialize(id:, address:, network:) + # Account primary crypto wallet, or `null` if none has been provisioned. + # + # @param id [String] Wallet ID, prefixed `wallet_`. + # + # @param address [String] The on-chain address of the wallet + # + # @param network [Symbol, WhopSDK::Models::Account::Wallet::Network] The blockchain network the wallet lives on + + # The blockchain network the wallet lives on + # + # @see WhopSDK::Models::Account::Wallet#network + module Network + extend WhopSDK::Internal::Type::Enum + + SOLANA = :solana + ETHEREUM = :ethereum + BITCOIN = :bitcoin + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/whop_sdk/models/account_create_params.rb b/lib/whop_sdk/models/account_create_params.rb index 3caec30a..efe5f5f0 100644 --- a/lib/whop_sdk/models/account_create_params.rb +++ b/lib/whop_sdk/models/account_create_params.rb @@ -20,7 +20,14 @@ class AccountCreateParams < WhopSDK::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] - # @!method initialize(email: nil, metadata: nil, request_options: {}) + # @!attribute title + # The display name of the account. Defaults to `metadata.external_id` or the + # owner's email when omitted. + # + # @return [String, nil] + optional :title, String + + # @!method initialize(email: nil, metadata: nil, title: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AccountCreateParams} for more details. # @@ -28,6 +35,8 @@ class AccountCreateParams < WhopSDK::Internal::Type::BaseModel # # @param metadata [Hash{Symbol=>Object}] Arbitrary key/value metadata to store on the account. # + # @param title [String] The display name of the account. Defaults to `metadata.external_id` or the owner + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/account_list_params.rb b/lib/whop_sdk/models/account_list_params.rb index 3c266896..2255077e 100644 --- a/lib/whop_sdk/models/account_list_params.rb +++ b/lib/whop_sdk/models/account_list_params.rb @@ -7,28 +7,77 @@ class AccountListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute page - # The page number to retrieve + # @!attribute after + # A cursor; returns accounts after this position. + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # A cursor; returns accounts before this position. + # + # @return [String, nil] + optional :before, String + + # @!attribute direction + # Sort direction. + # + # @return [Symbol, WhopSDK::Models::AccountListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::AccountListParams::Direction } + + # @!attribute first + # The number of accounts to return (default 10, max 50). # # @return [Integer, nil] - optional :page, Integer + optional :first, Integer - # @!attribute per - # The number of resources to return per page. There is a limit of 50 results per - # page. + # @!attribute last + # The number of accounts to return from the end of the range. # # @return [Integer, nil] - optional :per, Integer + optional :last, Integer + + # @!attribute order + # The field to sort accounts by. + # + # @return [Symbol, WhopSDK::Models::AccountListParams::Order, nil] + optional :order, enum: -> { WhopSDK::AccountListParams::Order } - # @!method initialize(page: nil, per: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AccountListParams} for more details. + # @!method initialize(after: nil, before: nil, direction: nil, first: nil, last: nil, order: nil, request_options: {}) + # @param after [String] A cursor; returns accounts after this position. + # + # @param before [String] A cursor; returns accounts before this position. # - # @param page [Integer] The page number to retrieve + # @param direction [Symbol, WhopSDK::Models::AccountListParams::Direction] Sort direction. # - # @param per [Integer] The number of resources to return per page. There is a limit of 50 results per p + # @param first [Integer] The number of accounts to return (default 10, max 50). + # + # @param last [Integer] The number of accounts to return from the end of the range. + # + # @param order [Symbol, WhopSDK::Models::AccountListParams::Order] The field to sort accounts by. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # The field to sort accounts by. + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT = :created_at + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/account_list_response.rb b/lib/whop_sdk/models/account_list_response.rb deleted file mode 100644 index 29d78cc1..00000000 --- a/lib/whop_sdk/models/account_list_response.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::Accounts#list - class AccountListResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute accounts - # - # @return [Array] - required :accounts, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account] } - - # @!attribute pagination - # - # @return [WhopSDK::Models::AccountListResponse::Pagination] - required :pagination, -> { WhopSDK::Models::AccountListResponse::Pagination } - - # @!method initialize(accounts:, pagination:) - # @param accounts [Array] - # @param pagination [WhopSDK::Models::AccountListResponse::Pagination] - - # @see WhopSDK::Models::AccountListResponse#pagination - class Pagination < WhopSDK::Internal::Type::BaseModel - # @!attribute current_page - # Current page number - # - # @return [Float] - required :current_page, Float - - # @!attribute next_page - # Next page number - # - # @return [Float, nil] - required :next_page, Float, nil?: true - - # @!attribute prev_page - # Previous page number - # - # @return [Float, nil] - required :prev_page, Float, nil?: true - - # @!attribute total_count - # Total number of records - # - # @return [Float] - required :total_count, Float - - # @!attribute total_pages - # Total number of pages - # - # @return [Float] - required :total_pages, Float - - # @!method initialize(current_page:, next_page:, prev_page:, total_count:, total_pages:) - # @param current_page [Float] Current page number - # - # @param next_page [Float, nil] Next page number - # - # @param prev_page [Float, nil] Previous page number - # - # @param total_count [Float] Total number of records - # - # @param total_pages [Float] Total number of pages - end - end - end -end diff --git a/lib/whop_sdk/models/account_recommend_actions_params.rb b/lib/whop_sdk/models/account_recommend_actions_params.rb new file mode 100644 index 00000000..d9a4f87f --- /dev/null +++ b/lib/whop_sdk/models/account_recommend_actions_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Accounts#recommend_actions + class AccountRecommendActionsParams < 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/account_recommend_actions_response.rb b/lib/whop_sdk/models/account_recommend_actions_response.rb new file mode 100644 index 00000000..3867fca0 --- /dev/null +++ b/lib/whop_sdk/models/account_recommend_actions_response.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Accounts#recommend_actions + class AccountRecommendActionsResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AccountRecommendActionsResponse::Data] } + + # @!method initialize(data:) + # @param data [Array] + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute action + # The recommendation; new values may be added, so handle unknown actions + # gracefully + # + # @return [Symbol, WhopSDK::Models::AccountRecommendActionsResponse::Data::Action] + required :action, enum: -> { WhopSDK::Models::AccountRecommendActionsResponse::Data::Action } + + # @!attribute blocked_capabilities + # + # @return [Array] + required :blocked_capabilities, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute cta + # The URL the call-to-action links to + # + # @return [String] + required :cta, String + + # @!attribute cta_label + # Button label + # + # @return [String] + required :cta_label, String + + # @!attribute description + # Supporting copy, or empty + # + # @return [String] + required :description, String + + # @!attribute icon_url + # Illustration icon URL, or `null` + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute impact_score + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + # + # @return [Integer, nil] + required :impact_score, Integer, nil?: true + + # @!attribute reasoning + # Why this action was recommended for this account, or `null` + # + # @return [String, nil] + required :reasoning, String, nil?: true + + # @!attribute status + # Always optional — never blocking + # + # @return [Symbol, WhopSDK::Models::AccountRecommendActionsResponse::Data::Status] + required :status, enum: -> { WhopSDK::Models::AccountRecommendActionsResponse::Data::Status } + + # @!attribute title + # Headline for the recommendation + # + # @return [String] + required :title, String + + # @!method initialize(action:, blocked_capabilities:, cta:, cta_label:, description:, icon_url:, impact_score:, reasoning:, status:, title:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AccountRecommendActionsResponse::Data} for more details. + # + # @param action [Symbol, WhopSDK::Models::AccountRecommendActionsResponse::Data::Action] The recommendation; new values may be added, so handle unknown actions gracefull + # + # @param blocked_capabilities [Array] + # + # @param cta [String] The URL the call-to-action links to + # + # @param cta_label [String] Button label + # + # @param description [String] Supporting copy, or empty + # + # @param icon_url [String, nil] Illustration icon URL, or `null` + # + # @param impact_score [Integer, nil] Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # + # @param reasoning [String, nil] Why this action was recommended for this account, or `null` + # + # @param status [Symbol, WhopSDK::Models::AccountRecommendActionsResponse::Data::Status] Always optional — never blocking + # + # @param title [String] Headline for the recommendation + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + # + # @see WhopSDK::Models::AccountRecommendActionsResponse::Data#action + module Action + extend WhopSDK::Internal::Type::Enum + + THEME_BUSINESS = :theme_business + CREATE_PRODUCT = :create_product + CREATE_PLAN = :create_plan + VERIFY_IDENTITY = :verify_identity + CONNECT_AFFILIATE_PROGRAM = :connect_affiliate_program + CREATE_PROMOTION = :create_promotion + SETUP_TRACKING_PIXEL = :setup_tracking_pixel + MIGRATE_FROM_STRIPE = :migrate_from_stripe + ACCEPT_FIRST_PAYMENT = :accept_first_payment + LAUNCH_FIRST_AD = :launch_first_ad + INVITE_TEAM_MEMBER = :invite_team_member + ENABLE_TAX_COLLECTION = :enable_tax_collection + CREATE_CARD = :create_card + JOIN_WHOP_UNIVERSITY = :join_whop_university + APPLY_FOR_FINANCING = :apply_for_financing + + # @!method self.values + # @return [Array] + end + + # Always optional — never blocking + # + # @see WhopSDK::Models::AccountRecommendActionsResponse::Data#status + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL = :optional + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/account_update_params.rb b/lib/whop_sdk/models/account_update_params.rb index a76efa16..72e4374a 100644 --- a/lib/whop_sdk/models/account_update_params.rb +++ b/lib/whop_sdk/models/account_update_params.rb @@ -31,50 +31,57 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :banner_image, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @!attribute business_address + # Account business address used to calculate tax. A complete address in a + # supported country is required when `tax_remitted_by` is `self`. + # + # @return [WhopSDK::Models::AccountUpdateParams::BusinessAddress, nil] + optional :business_address, -> { WhopSDK::AccountUpdateParams::BusinessAddress } + # @!attribute business_type - # The high-level business category for the account. + # High-level business category for the account. # # @return [String, nil] optional :business_type, String, nil?: true # @!attribute country - # The country the account is located in. + # Country where the account is located. # # @return [String, nil] optional :country, String, nil?: true # @!attribute description - # A promotional description for the account. + # Account promotional description. # # @return [String, nil] optional :description, String, nil?: true # @!attribute featured_affiliate_product_id - # The ID of the product to feature for affiliates. Pass null to clear. + # The ID of the product to feature for affiliates. Pass `null` to clear. # # @return [String, nil] optional :featured_affiliate_product_id, String, nil?: true # @!attribute home_preferences - # Preferences for the public business home page. + # Public account home page preferences. # # @return [Array, nil] optional :home_preferences, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute industry_group - # The industry group the account belongs to. + # Account industry group. # # @return [String, nil] optional :industry_group, String, nil?: true # @!attribute industry_type - # The specific industry vertical the account operates in. + # Specific industry vertical for the account. # # @return [String, nil] optional :industry_type, String, nil?: true # @!attribute invoice_prefix - # The prefix to use for account invoices. + # Prefix used for account invoices. # # @return [String, nil] optional :invoice_prefix, String, nil?: true @@ -121,6 +128,14 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :other_industry_description, String, nil?: true + # @!attribute product_tax_code_id + # ID of the tax classification code applied by default to the account's products. + # See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). + # + # @return [String, nil] + optional :product_tax_code_id, String, nil?: true + # @!attribute require_2fa # Whether the account requires authorized users to have two-factor authentication # enabled. @@ -166,7 +181,7 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]] # @!attribute store_page_config - # Store page display configuration for the account. + # Account store page display configuration. # # @return [Hash{Symbol=>Object}, nil] optional :store_page_config, @@ -179,6 +194,24 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :target_audience, String, nil?: true + # @!attribute tax_identifiers + # Account tax/VAT registrations to add or update. When `tax_remitted_by` is + # `self`, tax is calculated and collected only in the countries where the account + # holds a registration. + # + # @return [Array, nil] + optional :tax_identifiers, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AccountUpdateParams::TaxIdentifier] } + + # @!attribute tax_remitted_by + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `self` requires a `business_address` in a + # supported country. + # + # @return [Symbol, WhopSDK::Models::AccountUpdateParams::TaxRemittedBy, nil] + optional :tax_remitted_by, enum: -> { WhopSDK::AccountUpdateParams::TaxRemittedBy } + # @!attribute title # The display name of the account. # @@ -191,7 +224,7 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @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: {}) + # @!method initialize(account_id:, affiliate_application_required: nil, affiliate_instructions: nil, banner_image: nil, business_address: 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, product_tax_code_id: 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, tax_identifiers: nil, tax_remitted_by: 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. # @@ -203,21 +236,23 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param banner_image [Hash{Symbol=>Object}, nil] Attachment input for the account banner image. # - # @param business_type [String, nil] The high-level business category for the account. + # @param business_address [WhopSDK::Models::AccountUpdateParams::BusinessAddress] Account business address used to calculate tax. A complete address in a supporte # - # @param country [String, nil] The country the account is located in. + # @param business_type [String, nil] High-level business category for the account. # - # @param description [String, nil] A promotional description for the account. + # @param country [String, nil] Country where the account is located. # - # @param featured_affiliate_product_id [String, nil] The ID of the product to feature for affiliates. Pass null to clear. + # @param description [String, nil] Account promotional description. # - # @param home_preferences [Array] Preferences for the public business home page. + # @param featured_affiliate_product_id [String, nil] The ID of the product to feature for affiliates. Pass `null` to clear. # - # @param industry_group [String, nil] The industry group the account belongs to. + # @param home_preferences [Array] Public account home page preferences. # - # @param industry_type [String, nil] The specific industry vertical the account operates in. + # @param industry_group [String, nil] Account industry group. # - # @param invoice_prefix [String, nil] The prefix to use for account invoices. + # @param industry_type [String, nil] Specific industry vertical for the account. + # + # @param invoice_prefix [String, nil] Prefix used for account invoices. # # @param logo [Hash{Symbol=>Object}, nil] Attachment input for the account logo. # @@ -233,6 +268,8 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param other_industry_description [String, nil] The description of the industry type when industry_type is other. # + # @param product_tax_code_id [String, nil] ID of the tax classification code applied by default to the account's products. + # # @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. @@ -247,15 +284,229 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # # @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 store_page_config [Hash{Symbol=>Object}, nil] Account store page display configuration. # # @param target_audience [String, nil] The target audience for this account. # + # @param tax_identifiers [Array] Account tax/VAT registrations to add or update. When `tax_remitted_by` is `self` + # + # @param tax_remitted_by [Symbol, WhopSDK::Models::AccountUpdateParams::TaxRemittedBy] Who calculates and remits tax for the account: `whop` (Whop calculates and remit + # # @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}] + + class BusinessAddress < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # City name. + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Account business address used to calculate tax. A complete address in a + # supported country is required when `tax_remitted_by` is `self`. + # + # @param city [String, nil] City name. + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String, nil] Second line of the street address. + # + # @param postal_code [String, nil] Postal or ZIP code. + # + # @param state [String, nil] State, province, or region code, for example `CA`. + end + + class TaxIdentifier < WhopSDK::Internal::Type::BaseModel + # @!attribute tax_id_type + # Tax ID type, for example `eu_vat`, `gb_vat`, or `us_ein`. + # + # @return [Symbol, WhopSDK::Models::AccountUpdateParams::TaxIdentifier::TaxIDType] + required :tax_id_type, enum: -> { WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType } + + # @!attribute tax_id_value + # Tax ID value, for example `DE123456789`. + # + # @return [String] + required :tax_id_value, String + + # @!method initialize(tax_id_type:, tax_id_value:) + # @param tax_id_type [Symbol, WhopSDK::Models::AccountUpdateParams::TaxIdentifier::TaxIDType] Tax ID type, for example `eu_vat`, `gb_vat`, or `us_ein`. + # + # @param tax_id_value [String] Tax ID value, for example `DE123456789`. + + # Tax ID type, for example `eu_vat`, `gb_vat`, or `us_ein`. + # + # @see WhopSDK::Models::AccountUpdateParams::TaxIdentifier#tax_id_type + module TaxIDType + extend WhopSDK::Internal::Type::Enum + + AD_NRT = :ad_nrt + AO_TIN = :ao_tin + AR_CUIT = :ar_cuit + AL_TIN = :al_tin + AM_TIN = :am_tin + AW_TIN = :aw_tin + AU_ABN = :au_abn + AU_ARN = :au_arn + EU_VAT = :eu_vat + AZ_TIN = :az_tin + BS_TIN = :bs_tin + BH_VAT = :bh_vat + BD_BIN = :bd_bin + BB_TIN = :bb_tin + BY_TIN = :by_tin + BJ_IFU = :bj_ifu + BO_TIN = :bo_tin + BA_TIN = :ba_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + BG_UIC = :bg_uic + BF_IFU = :bf_ifu + KH_TIN = :kh_tin + CM_NIU = :cm_niu + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CV_NIF = :cv_nif + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CD_NIF = :cd_nif + CR_TIN = :cr_tin + HR_OIB = :hr_oib + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + SV_NIT = :sv_nit + ET_TIN = :et_tin + EU_OSS_VAT = :eu_oss_vat + GE_VAT = :ge_vat + GH_TIN = :gh_tin + DE_STN = :de_stn + GB_VAT = :gb_vat + GN_NIF = :gn_nif + HK_BR = :hk_br + HU_TIN = :hu_tin + IS_VAT = :is_vat + IN_GST = :in_gst + ID_NPWP = :id_npwp + IL_VAT = :il_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KZ_BIN = :kz_bin + KE_PIN = :ke_pin + KG_TIN = :kg_tin + LA_TIN = :la_tin + LI_UID = :li_uid + LI_VAT = :li_vat + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + MR_NIF = :mr_nif + MX_RFC = :mx_rfc + MD_VAT = :md_vat + ME_PIB = :me_pib + MA_VAT = :ma_vat + NP_PAN = :np_pan + NZ_GST = :nz_gst + NG_TIN = :ng_tin + MK_VAT = :mk_vat + NO_VAT = :no_vat + NO_VOEC = :no_voec + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SN_NINEA = :sn_ninea + RS_PIB = :rs_pib + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + ZA_VAT = :za_vat + KR_BRN = :kr_brn + ES_CIF = :es_cif + CH_UID = :ch_uid + CH_VAT = :ch_vat + TW_VAT = :tw_vat + TJ_TIN = :tj_tin + TZ_VAT = :tz_vat + TH_VAT = :th_vat + TR_TIN = :tr_tin + UG_TIN = :ug_tin + UA_VAT = :ua_vat + AE_TRN = :ae_trn + US_EIN = :us_ein + UY_RUC = :uy_ruc + UZ_TIN = :uz_tin + UZ_VAT = :uz_vat + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZM_TIN = :zm_tin + ZW_TIN = :zw_tin + SR_FIN = :sr_fin + + # @!method self.values + # @return [Array] + end + end + + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `self` requires a `business_address` in a + # supported country. + module TaxRemittedBy + extend WhopSDK::Internal::Type::Enum + + WHOP = :whop + SELF = :self + NONE = :none + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/account_wallet.rb b/lib/whop_sdk/models/account_wallet.rb deleted file mode 100644 index 3296f5d6..00000000 --- a/lib/whop_sdk/models/account_wallet.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - class AccountWallet < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The ID of the wallet, which will look like wallet\_******\******* - # - # @return [String] - required :id, String - - # @!attribute address - # The on-chain address of the wallet - # - # @return [String] - required :address, String - - # @!attribute network - # The blockchain network the wallet lives on - # - # @return [Symbol, WhopSDK::Models::AccountWallet::Network] - required :network, enum: -> { WhopSDK::AccountWallet::Network } - - # @!method initialize(id:, address:, network:) - # @param id [String] The ID of the wallet, which will look like wallet\_******\******* - # - # @param address [String] The on-chain address of the wallet - # - # @param network [Symbol, WhopSDK::Models::AccountWallet::Network] The blockchain network the wallet lives on - - # The blockchain network the wallet lives on - # - # @see WhopSDK::Models::AccountWallet#network - module Network - extend WhopSDK::Internal::Type::Enum - - SOLANA = :solana - ETHEREUM = :ethereum - BITCOIN = :bitcoin - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/whop_sdk/models/accounts/preference_retrieve_params.rb b/lib/whop_sdk/models/accounts/preference_retrieve_params.rb new file mode 100644 index 00000000..c1902080 --- /dev/null +++ b/lib/whop_sdk/models/accounts/preference_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Accounts + # @see WhopSDK::Resources::Accounts::Preferences#retrieve + class PreferenceRetrieveParams < 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 +end diff --git a/lib/whop_sdk/models/accounts/preference_retrieve_response.rb b/lib/whop_sdk/models/accounts/preference_retrieve_response.rb new file mode 100644 index 00000000..cbe4ff66 --- /dev/null +++ b/lib/whop_sdk/models/accounts/preference_retrieve_response.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Accounts + # @see WhopSDK::Resources::Accounts::Preferences#retrieve + class PreferenceRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute ads_payment_methods + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + # + # @return [WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods, nil] + required :ads_payment_methods, + -> { WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods }, + nil?: true + + # @!method initialize(ads_payment_methods:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceRetrieveResponse} for more details. + # + # @param ads_payment_methods [WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods, nil] How the account pays for Whop Ads spend. `primary` is charged first; `backup` co + + # @see WhopSDK::Models::Accounts::PreferenceRetrieveResponse#ads_payment_methods + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + # @!attribute backup + # + # @return [WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup, nil] + required :backup, + -> { WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup }, + nil?: true + + # @!attribute primary + # + # @return [WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary, nil] + required :primary, + -> { WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary }, + nil?: true + + # @!method initialize(backup:, primary:) + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + # + # @param backup [WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup, nil] + # @param primary [WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary, nil] + + # @see WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods#backup + class Backup < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + # + # @return [String] + required :id, String + + # @!attribute type + # The funding source kind: a Whop balance or a saved card. + # + # @return [Symbol, WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type] + required :type, + enum: -> { WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type } + + # @!method initialize(id:, type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup} + # for more details. + # + # @param id [String] The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a pay + # + # @param type [Symbol, WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type] The funding source kind: a Whop balance or a saved card. + + # The funding source kind: a Whop balance or a saved card. + # + # @see WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup#type + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE = :platform_balance + CARD = :card + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods#primary + class Primary < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + # + # @return [String] + required :id, String + + # @!attribute type + # The funding source kind: a Whop balance or a saved card. + # + # @return [Symbol, WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type] + required :type, + enum: -> { WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type } + + # @!method initialize(id:, type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary} + # for more details. + # + # @param id [String] The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a pay + # + # @param type [Symbol, WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type] The funding source kind: a Whop balance or a saved card. + + # The funding source kind: a Whop balance or a saved card. + # + # @see WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary#type + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE = :platform_balance + CARD = :card + + # @!method self.values + # @return [Array] + end + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/accounts/preference_update_params.rb b/lib/whop_sdk/models/accounts/preference_update_params.rb new file mode 100644 index 00000000..1ac61597 --- /dev/null +++ b/lib/whop_sdk/models/accounts/preference_update_params.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Accounts + # @see WhopSDK::Resources::Accounts::Preferences#update + class PreferenceUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute ads_payment_methods + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. + # + # @return [WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods, nil] + optional :ads_payment_methods, -> { WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods } + + # @!method initialize(account_id:, ads_payment_methods: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceUpdateParams} for more details. + # + # @param account_id [String] + # + # @param ads_payment_methods [WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods] How the account pays for Whop Ads spend. `primary` is charged first; `backup` co + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + # @!attribute primary + # + # @return [WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary] + required :primary, -> { WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary } + + # @!attribute backup + # Optional when the primary is `platform_balance`; omitting it removes any + # configured card. Required (as `platform_balance`) when the primary is `card`. + # + # @return [WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup, nil] + optional :backup, -> { WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup } + + # @!method initialize(primary:, backup: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods} for more + # details. + # + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. + # + # @param primary [WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary] + # + # @param backup [WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup] Optional when the primary is `platform_balance`; omitting it removes any configu + + # @see WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods#primary + class Primary < WhopSDK::Internal::Type::BaseModel + # @!attribute type + # The funding source kind. + # + # @return [Symbol, WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type] + required :type, enum: -> { WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type } + + # @!attribute id + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. Optional for `platform_balance` — defaults + # to the account's default Whop balance. Required for `card`. + # + # @return [String, nil] + optional :id, String + + # @!method initialize(type:, id: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary} + # for more details. + # + # @param type [Symbol, WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type] The funding source kind. + # + # @param id [String] The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a pay + + # The funding source kind. + # + # @see WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary#type + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE = :platform_balance + CARD = :card + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods#backup + class Backup < WhopSDK::Internal::Type::BaseModel + # @!attribute type + # The funding source kind. + # + # @return [Symbol, WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type] + required :type, enum: -> { WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type } + + # @!attribute id + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. Optional for `platform_balance` — defaults + # to the account's default Whop balance. Required for `card`. + # + # @return [String, nil] + optional :id, String + + # @!method initialize(type:, id: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup} + # for more details. + # + # Optional when the primary is `platform_balance`; omitting it removes any + # configured card. Required (as `platform_balance`) when the primary is `card`. + # + # @param type [Symbol, WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type] The funding source kind. + # + # @param id [String] The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a pay + + # The funding source kind. + # + # @see WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup#type + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE = :platform_balance + CARD = :card + + # @!method self.values + # @return [Array] + end + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/accounts/preference_update_response.rb b/lib/whop_sdk/models/accounts/preference_update_response.rb new file mode 100644 index 00000000..8b190b67 --- /dev/null +++ b/lib/whop_sdk/models/accounts/preference_update_response.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Accounts + # @see WhopSDK::Resources::Accounts::Preferences#update + class PreferenceUpdateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute ads_payment_methods + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + # + # @return [WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods, nil] + required :ads_payment_methods, + -> { WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods }, + nil?: true + + # @!method initialize(ads_payment_methods:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceUpdateResponse} for more details. + # + # @param ads_payment_methods [WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods, nil] How the account pays for Whop Ads spend. `primary` is charged first; `backup` co + + # @see WhopSDK::Models::Accounts::PreferenceUpdateResponse#ads_payment_methods + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + # @!attribute backup + # + # @return [WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup, nil] + required :backup, + -> { WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup }, + nil?: true + + # @!attribute primary + # + # @return [WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary, nil] + required :primary, + -> { WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary }, + nil?: true + + # @!method initialize(backup:, primary:) + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + # + # @param backup [WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup, nil] + # @param primary [WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary, nil] + + # @see WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods#backup + class Backup < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + # + # @return [String] + required :id, String + + # @!attribute type + # The funding source kind: a Whop balance or a saved card. + # + # @return [Symbol, WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type] + required :type, + enum: -> { WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type } + + # @!method initialize(id:, type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup} + # for more details. + # + # @param id [String] The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a pay + # + # @param type [Symbol, WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type] The funding source kind: a Whop balance or a saved card. + + # The funding source kind: a Whop balance or a saved card. + # + # @see WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup#type + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE = :platform_balance + CARD = :card + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods#primary + class Primary < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + # + # @return [String] + required :id, String + + # @!attribute type + # The funding source kind: a Whop balance or a saved card. + # + # @return [Symbol, WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type] + required :type, + enum: -> { WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type } + + # @!method initialize(id:, type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary} + # for more details. + # + # @param id [String] The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a pay + # + # @param type [Symbol, WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type] The funding source kind: a Whop balance or a saved card. + + # The funding source kind: a Whop balance or a saved card. + # + # @see WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary#type + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE = :platform_balance + CARD = :card + + # @!method self.values + # @return [Array] + end + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/ad.rb b/lib/whop_sdk/models/ad.rb index 18806d93..f515e672 100644 --- a/lib/whop_sdk/models/ad.rb +++ b/lib/whop_sdk/models/ad.rb @@ -2,155 +2,326 @@ module WhopSDK module Models - # @see WhopSDK::Resources::Ads#retrieve + # @see WhopSDK::Resources::Ads#create class Ad < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for this ad. + # Unique identifier for the ad. # # @return [String] required :id, String # @!attribute ad_campaign - # The ad campaign this ad belongs to. + # The ad campaign this ad belongs to, an object with an id. # # @return [WhopSDK::Models::Ad::AdCampaign] required :ad_campaign, -> { WhopSDK::Ad::AdCampaign } # @!attribute ad_group - # The parent ad group this ad belongs to. + # The ad group this ad belongs to, an object with an id. # # @return [WhopSDK::Models::Ad::AdGroup] required :ad_group, -> { WhopSDK::Ad::AdGroup } + # @!attribute added_to_carts + # Whop pixel-attributed add-to-cart events, last-click. + # + # @return [Float] + required :added_to_carts, Float + + # @!attribute call_to_action + # The call-to-action button shown on the ad. + # + # @return [Symbol, WhopSDK::Models::Ad::CallToAction, nil] + required :call_to_action, enum: -> { WhopSDK::Ad::CallToAction }, nil?: true + # @!attribute click_through_rate - # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # Clicks divided by impressions, between 0 and 1. # # @return [Float] required :click_through_rate, Float # @!attribute clicks - # Total clicks on this ad in the stats window. + # The number of clicks. # - # @return [Integer] - required :clicks, Integer + # @return [Float] + required :clicks, Float + + # @!attribute completed_registrations + # Whop pixel-attributed complete-registration events, last-click. + # + # @return [Float] + required :completed_registrations, Float + + # @!attribute contacts + # Whop pixel-attributed contact events, last-click. + # + # @return [Float] + required :contacts, Float + + # @!attribute cost_per_added_to_cart + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_added_to_cart, Float, nil?: true # @!attribute cost_per_click - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Spend divided by clicks; 0 when there are no clicks. # # @return [Float] required :cost_per_click, Float + # @!attribute cost_per_completed_registration + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_completed_registration, Float, nil?: true + + # @!attribute cost_per_contact + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_contact, Float, nil?: true + # @!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 + # Spend divided by attributed leads; null when leads are not a goal and none are # 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. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. # # @return [Float, nil] required :cost_per_result, Float, nil?: true + # @!attribute cost_per_schedule + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_schedule, Float, nil?: true + + # @!attribute cost_per_submitted_application + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_submitted_application, Float, nil?: true + + # @!attribute cost_per_viewed_content + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_viewed_content, Float, nil?: true + # @!attribute created_at - # When the ad was created. + # When the ad was created, as an ISO 8601 timestamp. # - # @return [Time] - required :created_at, Time + # @return [String] + required :created_at, String + + # @!attribute creatives + # + # @return [Array] + required :creatives, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative] } + + # @!attribute custom_conversions + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + # + # @return [Float] + required :custom_conversions, Float + + # @!attribute delivery_status + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + # + # @return [Symbol, WhopSDK::Models::Ad::DeliveryStatus] + required :delivery_status, enum: -> { WhopSDK::Ad::DeliveryStatus } + + # @!attribute descriptions + # + # @return [Array] + required :descriptions, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute frequency - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + # Platform-reported impressions divided by reach. # # @return [Float, nil] required :frequency, Float, nil?: true + # @!attribute headlines + # + # @return [Array] + required :headlines, WhopSDK::Internal::Type::ArrayOf[String] + # @!attribute impressions - # Total impressions (views) on this ad in the stats window. + # The number of impressions. # - # @return [Integer] - required :impressions, Integer + # @return [Float] + required :impressions, Float # @!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 lead_form + # The instant lead form on the ad (Meta lead ads), or null when the ad group's + # conversion_location is not an instant-form destination. An object with name, + # form_type (more_volume or higher_intent), an optional intro, questions, a + # privacy_policy, an optional completion screen, and phone_verification. + # + # @return [Object, nil] + required :lead_form, WhopSDK::Internal::Type::Unknown, nil?: true + + # @!attribute lead_form_id + # The Meta lead form the ad uses. Set when the ad references an existing form via + # lead_form_id, or once a form built from lead_form has been created on Meta at + # launch. + # + # @return [String, nil] + required :lead_form_id, String, nil?: true + # @!attribute leads - # Number of Whop pixel-attributed leads (last-click) in the stats window. + # Whop pixel-attributed leads, last-click. # - # @return [Integer] - required :leads, Integer + # @return [Float] + required :leads, Float + + # @!attribute messaging_config + # The click-to-message welcome copy, an object with message and keyword, or null + # when the ad has none. + # + # @return [Object, nil] + required :messaging_config, WhopSDK::Internal::Type::Unknown, nil?: true - # @!attribute platform - # The external ad platform this ad is running on (e.g., meta, tiktok). + # @!attribute multi_advertiser_ads + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. # - # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] - required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @return [Boolean] + required :multi_advertiser_ads, WhopSDK::Internal::Type::Boolean + + # @!attribute post_id + # The existing post this ad promotes (a Facebook post or Instagram media), or null + # when it uses uploaded creatives. + # + # @return [String, nil] + required :post_id, String, nil?: true + + # @!attribute post_source + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id) — or null when the ad uses uploaded creatives. + # + # @return [Symbol, WhopSDK::Models::Ad::PostSource, nil] + required :post_source, enum: -> { WhopSDK::Ad::PostSource }, nil?: true + + # @!attribute post_thumbnail_url + # Preview image of the existing post this ad promotes. Null for ads that use + # uploaded creatives, or until the post's media has been fetched from the network. + # + # @return [String, nil] + required :post_thumbnail_url, String, nil?: true + + # @!attribute primary_texts + # + # @return [Array] + required :primary_texts, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute purchase_value - # Total USD value of Whop pixel-attributed purchases in the stats window. + # USD value of pixel-attributed purchases. # # @return [Float] required :purchase_value, Float # @!attribute purchases - # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # Whop pixel-attributed purchases, last-click. # - # @return [Integer] - required :purchases, Integer + # @return [Float] + required :purchases, Float # @!attribute reach - # Unique users reached in the stats window (deduplicated by the platform). + # The number of unique people who saw this. + # + # @return [Float] + required :reach, Float + + # @!attribute result_event + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + # + # @return [Symbol, WhopSDK::Models::Ad::ResultEvent, nil] + required :result_event, enum: -> { WhopSDK::Ad::ResultEvent }, nil?: true + + # @!attribute result_event_name + # The merchant-defined event name when result_event is custom; null for the + # standard events. # - # @return [Integer] - required :reach, Integer + # @return [String, nil] + required :result_event_name, String, nil?: true # @!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. + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. # # @return [Float] required :return_on_ad_spend, Float + # @!attribute schedules + # Whop pixel-attributed schedule events, last-click. + # + # @return [Float] + required :schedules, Float + + # @!attribute social_accounts + # + # @return [Array] + required :social_accounts, WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown] + # @!attribute spend - # Amount charged in dollars in the stats window. + # The amount charged, in spend_currency. # # @return [Float] required :spend, Float # @!attribute spend_currency - # The available currencies on the platform + # The ISO 4217 currency code of all monetary metrics. # - # @return [Symbol, WhopSDK::Models::Currency, nil] - required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @return [String, nil] + required :spend_currency, String, nil?: true # @!attribute status - # Current delivery status of the ad. + # The delivery status of the ad. # - # @return [Symbol, WhopSDK::Models::ExternalAdStatus] - required :status, enum: -> { WhopSDK::ExternalAdStatus } + # @return [Symbol, WhopSDK::Models::Ad::Status] + required :status, enum: -> { WhopSDK::Ad::Status } + + # @!attribute submitted_applications + # Whop pixel-attributed submit-application events, last-click. + # + # @return [Float] + required :submitted_applications, Float # @!attribute title # The display title of the ad. Falls back to the creative set caption when unset. @@ -159,199 +330,456 @@ class Ad < WhopSDK::Internal::Type::BaseModel required :title, String, nil?: true # @!attribute unique_click_through_rate - # Unique click-through rate as a fraction of impressions (unique clicks / - # impressions, 0–1). + # Unique clicks divided by impressions, between 0 and 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. + # The number of unique clicks. # - # @return [Integer] - required :unique_clicks, Integer + # @return [Float] + required :unique_clicks, Float # @!attribute updated_at - # When the ad was last updated. + # When the ad was last updated, as an ISO 8601 timestamp. + # + # @return [String] + required :updated_at, String + + # @!attribute url + # The URL the ad links to. + # + # @return [String, nil] + required :url, String, nil?: true + + # @!attribute url_parameters + # Query parameters appended to the URL, as a string-to-string map. # - # @return [Time] - required :updated_at, Time + # @return [Object] + required :url_parameters, WhopSDK::Internal::Type::Unknown - # @!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:) + # @!attribute viewed_contents + # Whop pixel-attributed view-content events, last-click. + # + # @return [Float] + required :viewed_contents, Float + + # @!method initialize(id:, ad_campaign:, ad_group:, added_to_carts:, call_to_action:, click_through_rate:, clicks:, completed_registrations:, contacts:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, creatives:, custom_conversions:, delivery_status:, descriptions:, frequency:, headlines:, impressions:, issues:, lead_form:, lead_form_id:, leads:, messaging_config:, multi_advertiser_ads:, post_id:, post_source:, post_thumbnail_url:, primary_texts:, purchase_value:, purchases:, reach:, result_event:, result_event_name:, return_on_ad_spend:, schedules:, social_accounts:, spend:, spend_currency:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, url:, url_parameters:, viewed_contents:) # Some parameter documentations has been truncated, see {WhopSDK::Models::Ad} for # more details. # - # An ad belonging to an ad group. + # @param id [String] Unique identifier for the ad. + # + # @param ad_campaign [WhopSDK::Models::Ad::AdCampaign] The ad campaign this ad belongs to, an object with an id. + # + # @param ad_group [WhopSDK::Models::Ad::AdGroup] The ad group this ad belongs to, an object with an id. + # + # @param added_to_carts [Float] Whop pixel-attributed add-to-cart events, last-click. + # + # @param call_to_action [Symbol, WhopSDK::Models::Ad::CallToAction, nil] The call-to-action button shown on the ad. + # + # @param click_through_rate [Float] Clicks divided by impressions, between 0 and 1. + # + # @param clicks [Float] The number of clicks. + # + # @param completed_registrations [Float] Whop pixel-attributed complete-registration events, last-click. + # + # @param contacts [Float] Whop pixel-attributed contact events, last-click. + # + # @param cost_per_added_to_cart [Float, nil] Spend divided by attributed add-to-cart events; null when they are not the goal + # + # @param cost_per_click [Float] Spend divided by clicks; 0 when there are no clicks. + # + # @param cost_per_completed_registration [Float, nil] Spend divided by attributed complete-registration events; null when they are not + # + # @param cost_per_contact [Float, nil] Spend divided by attributed contact events; null when contacts are not the goal + # + # @param cost_per_lead [Float, nil] Spend divided by attributed leads; null when leads are not a goal and none are a + # + # @param cost_per_mille [Float] Spend per 1,000 impressions; 0 when there are no impressions. + # + # @param cost_per_purchase [Float, nil] Spend divided by attributed purchases; null when purchases are not a goal and no + # + # @param cost_per_result [Float, nil] Spend divided by Whop pixel-attributed results; null when nothing Whop-attributa + # + # @param cost_per_schedule [Float, nil] Spend divided by attributed schedule events; null when schedules are not the goa + # + # @param cost_per_submitted_application [Float, nil] Spend divided by attributed submit-application events; null when they are not th # - # @param id [String] The unique identifier for this ad. + # @param cost_per_viewed_content [Float, nil] Spend divided by attributed view-content events; null when they are not the goal # - # @param ad_campaign [WhopSDK::Models::Ad::AdCampaign] The ad campaign this ad belongs to. + # @param created_at [String] When the ad was created, as an ISO 8601 timestamp. # - # @param ad_group [WhopSDK::Models::Ad::AdGroup] The parent ad group this ad belongs to. + # @param creatives [Array] # - # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # @param custom_conversions [Float] Whop pixel-attributed custom (merchant-defined) conversion events, last-click, a # - # @param clicks [Integer] Total clicks on this ad in the stats window. + # @param delivery_status [Symbol, WhopSDK::Models::Ad::DeliveryStatus] The current delivery state, mirroring the Delivery column in the ads dashboard. # - # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # @param descriptions [Array] # - # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # @param frequency [Float, nil] Platform-reported impressions divided by reach. # - # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # @param headlines [Array] # - # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # @param impressions [Float] The number of impressions. # - # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # @param issues [Array] # - # @param created_at [Time] When the ad was created. + # @param lead_form [Object, nil] The instant lead form on the ad (Meta lead ads), or null when the ad group's con # - # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # @param lead_form_id [String, nil] The Meta lead form the ad uses. Set when the ad references an existing form via # - # @param impressions [Integer] Total impressions (views) on this ad in the stats window. + # @param leads [Float] Whop pixel-attributed leads, last-click. # - # @param issues [Array] Open platform issues affecting this ad, deduplicated per object. Empty when ther + # @param messaging_config [Object, nil] The click-to-message welcome copy, an object with message and keyword, or null w # - # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. + # @param multi_advertiser_ads [Boolean] Whether the ad can appear alongside other advertisers' ads in the same unit. Def # - # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this ad is running on (e.g., meta, tiktok). + # @param post_id [String, nil] The existing post this ad promotes (a Facebook post or Instagram media), or null # - # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # @param post_source [Symbol, WhopSDK::Models::Ad::PostSource, nil] Which network post_id refers to — facebook (a page post) or instagram (a media i # - # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # @param post_thumbnail_url [String, nil] Preview image of the existing post this ad promotes. Null for ads that use uploa # - # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # @param primary_texts [Array] # - # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # @param purchase_value [Float] USD value of pixel-attributed purchases. # - # @param spend [Float] Amount charged in dollars in the stats window. + # @param purchases [Float] Whop pixel-attributed purchases, last-click. # - # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param reach [Float] The number of unique people who saw this. # - # @param status [Symbol, WhopSDK::Models::ExternalAdStatus] Current delivery status of the ad. + # @param result_event [Symbol, WhopSDK::Models::Ad::ResultEvent, nil] The Whop pixel conversion event whose attributed count represents results — the + # + # @param result_event_name [String, nil] The merchant-defined event name when result_event is custom; null for the standa + # + # @param return_on_ad_spend [Float] Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # + # @param schedules [Float] Whop pixel-attributed schedule events, last-click. + # + # @param social_accounts [Array] + # + # @param spend [Float] The amount charged, in spend_currency. + # + # @param spend_currency [String, nil] The ISO 4217 currency code of all monetary metrics. + # + # @param status [Symbol, WhopSDK::Models::Ad::Status] The delivery status of the ad. + # + # @param submitted_applications [Float] Whop pixel-attributed submit-application events, last-click. # # @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_click_through_rate [Float, nil] Unique clicks divided by impressions, between 0 and 1. + # + # @param unique_clicks [Float] The number of unique clicks. + # + # @param updated_at [String] When the ad was last updated, as an ISO 8601 timestamp. + # + # @param url [String, nil] The URL the ad links to. # - # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. + # @param url_parameters [Object] Query parameters appended to the URL, as a string-to-string map. # - # @param updated_at [Time] When the ad was last updated. + # @param viewed_contents [Float] Whop pixel-attributed view-content events, last-click. # @see WhopSDK::Models::Ad#ad_campaign class AdCampaign < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for this ad campaign. + # The referenced entity's id. # # @return [String] required :id, String # @!method initialize(id:) - # The ad campaign this ad belongs to. + # The ad campaign this ad belongs to, an object with an id. # - # @param id [String] The unique identifier for this ad campaign. + # @param id [String] The referenced entity's id. end # @see WhopSDK::Models::Ad#ad_group class AdGroup < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for this ad group. + # The referenced entity's id. # # @return [String] required :id, String # @!method initialize(id:) - # The parent ad group this ad belongs to. + # The ad group this ad belongs to, an object with an id. # - # @param id [String] The unique identifier for this ad group. + # @param id [String] The referenced entity's id. 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 + # The call-to-action button shown on the ad. + # + # @see WhopSDK::Models::Ad#call_to_action + module CallToAction + extend WhopSDK::Internal::Type::Enum + + LEARN_MORE = :learn_more + SHOP_NOW = :shop_now + SIGN_UP = :sign_up + SUBSCRIBE = :subscribe + GET_STARTED = :get_started + BOOK_NOW = :book_now + APPLY_NOW = :apply_now + CONTACT_US = :contact_us + DOWNLOAD = :download + ORDER_NOW = :order_now + BUY_NOW = :buy_now + GET_QUOTE = :get_quote + MESSAGE_PAGE = :message_page + WHATSAPP_MESSAGE = :whatsapp_message + INSTAGRAM_MESSAGE = :instagram_message + CALL_NOW = :call_now + GET_DIRECTIONS = :get_directions + SEND_UPDATES = :send_updates + GET_OFFER = :get_offer + WATCH_MORE = :watch_more + LISTEN_NOW = :listen_now + PLAY_GAME = :play_game + OPEN_LINK = :open_link + NO_BUTTON = :no_button + GET_OFFER_VIEW = :get_offer_view + GET_EVENT_TICKETS = :get_event_tickets + SEE_MENU = :see_menu + REQUEST_TIME = :request_time + EVENT_RSVP = :event_rsvp + SEE_DETAILS = :see_details + VIEW_INSTAGRAM_PROFILE = :view_instagram_profile + + # @!method self.values + # @return [Array] + end - # @!attribute created_at - # When the issue was first reported. + class Creative < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The creative attachment's file id. # - # @return [Time] - required :created_at, Time + # @return [String] + required :id, String - # @!attribute resolution_status - # Current resolution status. + # @!attribute crop + # The saved crop window for this creative, in source image pixels. Null for the + # original asset or a format that has not been cropped. # - # @return [Symbol, WhopSDK::Models::Ad::Issue::ResolutionStatus] - required :resolution_status, enum: -> { WhopSDK::Ad::Issue::ResolutionStatus } + # @return [WhopSDK::Models::Ad::Creative::Crop, nil] + required :crop, -> { WhopSDK::Ad::Creative::Crop }, nil?: true - # @!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. + # @!attribute format_ + # The placement variant this asset covers, or null for the original asset. # - # @return [String, nil] - required :resource_id, String, nil?: true + # @return [Symbol, WhopSDK::Models::Ad::Creative::Format, nil] + required :format_, enum: -> { WhopSDK::Ad::Creative::Format }, api_name: :format, nil?: true - # @!attribute resource_type - # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. - # Pairs with `resourceId`. + # @!attribute media_type + # The kind of asset, image or video. # - # @return [String] - required :resource_type, String + # @return [String, nil] + required :media_type, String, nil?: true - # @!attribute subtype - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). + # @!attribute url + # CDN url of the asset. # # @return [String, nil] - required :subtype, String, nil?: true + required :url, String, nil?: true - # @!method initialize(category:, created_at:, resolution_status:, resource_id:, resource_type:, subtype:) + # @!method initialize(id:, crop:, format_:, media_type:, url:) # 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.). + # {WhopSDK::Models::Ad::Creative} for more details. # - # @param category [Symbol, WhopSDK::Models::Ad::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. + # The creative assets used by this ad. The original asset has a null format; + # square, vertical, and horizontal entries are placement-specific variants. # - # @param created_at [Time] When the issue was first reported. + # @param id [String] The creative attachment's file id. # - # @param resolution_status [Symbol, WhopSDK::Models::Ad::Issue::ResolutionStatus] Current resolution status. + # @param crop [WhopSDK::Models::Ad::Creative::Crop, nil] The saved crop window for this creative, in source image pixels. Null for the or # - # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N + # @param format_ [Symbol, WhopSDK::Models::Ad::Creative::Format, nil] The placement variant this asset covers, or null for the original asset. # - # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + # @param media_type [String, nil] The kind of asset, image or video. # - # @param subtype [String, nil] Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # @param url [String, nil] CDN url of the asset. + + # @see WhopSDK::Models::Ad::Creative#crop + class Crop < WhopSDK::Internal::Type::BaseModel + # @!attribute height + # Height of the crop window in source pixels. + # + # @return [Float] + required :height, Float + + # @!attribute width + # Width of the crop window in source pixels. + # + # @return [Float] + required :width, Float + + # @!attribute x + # Left edge of the crop window in source pixels. + # + # @return [Float] + required :x, Float + + # @!attribute y_ + # Top edge of the crop window in source pixels. + # + # @return [Float] + required :y_, Float, api_name: :y + + # @!method initialize(height:, width:, x:, y_:) + # The saved crop window for this creative, in source image pixels. Null for the + # original asset or a format that has not been cropped. + # + # @param height [Float] Height of the crop window in source pixels. + # + # @param width [Float] Width of the crop window in source pixels. + # + # @param x [Float] Left edge of the crop window in source pixels. + # + # @param y_ [Float] Top edge of the crop window in source pixels. + end - # Whop's canonical category that a raw platform issue is bucketed into. + # The placement variant this asset covers, or null for the original asset. # - # @see WhopSDK::Models::Ad::Issue#category - module Category + # @see WhopSDK::Models::Ad::Creative#format_ + module Format extend WhopSDK::Internal::Type::Enum - POLICY_REJECTION = :policy_rejection - CREATIVE_MEDIA = :creative_media - AUDIENCE_TARGETING = :audience_targeting - AD_VOLUME_LIMIT = :ad_volume_limit + SQUARE = :square + VERTICAL = :vertical + HORIZONTAL = :horizontal # @!method self.values # @return [Array] end + end - # Current resolution status. + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + # + # @see WhopSDK::Models::Ad#delivery_status + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + REJECTED = :rejected + IN_REVIEW = :in_review + DRAFT = :draft + CAMPAIGN_PAUSED = :campaign_paused + AD_GROUP_PAUSED = :ad_group_paused + PAUSED = :paused + PROCESSING = :processing + ISSUES = :issues + LEARNING_LIMITED = :learning_limited + LEARNING = :learning + ACTIVE = :active + + # @!method self.values + # @return [Array] + end + + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the issue. # - # @see WhopSDK::Models::Ad::Issue#resolution_status - module ResolutionStatus + # @return [String] + required :id, String + + # @!attribute message + # A description of what the issue is and how it can be resolved. + # + # @return [String] + required :message, String + + # @!attribute resource_id + # The ID of the campaign, ad group, or ad the issue is attached to. + # + # @return [String, nil] + required :resource_id, String, nil?: true + + # @!attribute resource_type + # The type of resource the issue is attached to. + # + # @return [Symbol, WhopSDK::Models::Ad::Issue::ResourceType] + required :resource_type, enum: -> { WhopSDK::Ad::Issue::ResourceType } + + # @!method initialize(id:, message:, resource_id:, resource_type:) + # Open issues affecting this ad. Empty when there are none. + # + # @param id [String] Unique identifier for the issue. + # + # @param message [String] A description of what the issue is and how it can be resolved. + # + # @param resource_id [String, nil] The ID of the campaign, ad group, or ad the issue is attached to. + # + # @param resource_type [Symbol, WhopSDK::Models::Ad::Issue::ResourceType] The type of resource the issue is attached to. + + # The type of resource the issue is attached to. + # + # @see WhopSDK::Models::Ad::Issue#resource_type + module ResourceType extend WhopSDK::Internal::Type::Enum - OPEN = :open - RESOLVED = :resolved - ACKNOWLEDGED = :acknowledged + AD_CAMPAIGN = :ad_campaign + AD_GROUP = :ad_group + AD = :ad # @!method self.values # @return [Array] end end + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id) — or null when the ad uses uploaded creatives. + # + # @see WhopSDK::Models::Ad#post_source + module PostSource + extend WhopSDK::Internal::Type::Enum + + FACEBOOK = :facebook + INSTAGRAM = :instagram + + # @!method self.values + # @return [Array] + end + + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + # + # @see WhopSDK::Models::Ad#result_event + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + PURCHASE = :purchase + LEAD = :lead + SCHEDULE = :schedule + SUBMIT_APPLICATION = :submit_application + CONTACT = :contact + COMPLETE_REGISTRATION = :complete_registration + VIEW_CONTENT = :view_content + ADD_TO_CART = :add_to_cart + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # The delivery status of the ad. + # + # @see WhopSDK::Models::Ad#status + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + PAUSED = :paused + IN_REVIEW = :in_review + REJECTED = :rejected + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/ad_budget_type.rb b/lib/whop_sdk/models/ad_budget_type.rb deleted file mode 100644 index 2174c20b..00000000 --- a/lib/whop_sdk/models/ad_budget_type.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # The budget type for an ad campaign or ad group. - module AdBudgetType - extend WhopSDK::Internal::Type::Enum - - DAILY = :daily - LIFETIME = :lifetime - - # @!method self.values - # @return [Array] - end - end -end diff --git a/lib/whop_sdk/models/ad_campaign.rb b/lib/whop_sdk/models/ad_campaign.rb index e8160765..fa377418 100644 --- a/lib/whop_sdk/models/ad_campaign.rb +++ b/lib/whop_sdk/models/ad_campaign.rb @@ -2,327 +2,610 @@ module WhopSDK module Models - # @see WhopSDK::Resources::AdCampaigns#retrieve + # @see WhopSDK::Resources::AdCampaigns#create class AdCampaign < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for this ad campaign. + # Unique identifier for the ad campaign. # # @return [String] required :id, String - # @!attribute budget - # Total budget in dollars. + # @!attribute added_to_carts + # Whop pixel-attributed add-to-cart events, last-click. + # + # @return [Float] + required :added_to_carts, Float + + # @!attribute bid_type + # The bidding strategy the campaign uses. + # + # @return [Symbol, WhopSDK::Models::AdCampaign::BidType, nil] + required :bid_type, enum: -> { WhopSDK::AdCampaign::BidType }, nil?: true + + # @!attribute budget_amount + # The campaign budget in USD. Null when budget is set at the ad group level (ABO). # # @return [Float, nil] - required :budget, Float, nil?: true + required :budget_amount, Float, nil?: true + + # @!attribute budget_optimization + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + # + # @return [Symbol, WhopSDK::Models::AdCampaign::BudgetOptimization, nil] + required :budget_optimization, enum: -> { WhopSDK::AdCampaign::BudgetOptimization }, nil?: true # @!attribute budget_type - # The budget type for an ad campaign or ad group. + # Whether the budget is spent per day or over the campaign's lifetime. # - # @return [Symbol, WhopSDK::Models::AdBudgetType, nil] - required :budget_type, enum: -> { WhopSDK::AdBudgetType }, nil?: true + # @return [Symbol, WhopSDK::Models::AdCampaign::BudgetType, nil] + required :budget_type, enum: -> { WhopSDK::AdCampaign::BudgetType }, nil?: true # @!attribute click_through_rate - # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # Clicks divided by impressions, between 0 and 1. # # @return [Float] required :click_through_rate, Float # @!attribute clicks - # Total clicks on the campaign's ads in the stats window. + # The number of clicks. # - # @return [Integer] - required :clicks, Integer + # @return [Float] + required :clicks, Float + + # @!attribute completed_registrations + # Whop pixel-attributed complete-registration events, last-click. + # + # @return [Float] + required :completed_registrations, Float + + # @!attribute contacts + # Whop pixel-attributed contact events, last-click. + # + # @return [Float] + required :contacts, Float + + # @!attribute cost_per_added_to_cart + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_added_to_cart, Float, nil?: true # @!attribute cost_per_click - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Spend divided by clicks; 0 when there are no clicks. # # @return [Float] required :cost_per_click, Float + # @!attribute cost_per_completed_registration + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_completed_registration, Float, nil?: true + + # @!attribute cost_per_contact + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_contact, Float, nil?: true + # @!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 + # Spend divided by attributed leads; null when leads are not a goal and none are # 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. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. # # @return [Float, nil] required :cost_per_result, Float, nil?: true + # @!attribute cost_per_schedule + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_schedule, Float, nil?: true + + # @!attribute cost_per_submitted_application + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_submitted_application, Float, nil?: true + + # @!attribute cost_per_viewed_content + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_viewed_content, Float, nil?: true + # @!attribute created_at - # When the ad campaign was created. + # When the campaign was created, as an ISO 8601 timestamp. + # + # @return [String] + required :created_at, String + + # @!attribute custom_conversions + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + # + # @return [Float] + required :custom_conversions, Float + + # @!attribute delivery_status + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. # - # @return [Time] - required :created_at, Time + # @return [Symbol, WhopSDK::Models::AdCampaign::DeliveryStatus] + required :delivery_status, enum: -> { WhopSDK::AdCampaign::DeliveryStatus } # @!attribute frequency - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + # Platform-reported impressions divided by reach. # # @return [Float, nil] required :frequency, Float, nil?: true # @!attribute impressions - # Total impressions (views) on the campaign's ads in the stats window. + # The number of impressions. # - # @return [Integer] - required :impressions, Integer + # @return [Float] + required :impressions, Float # @!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. + # Whop pixel-attributed leads, last-click. + # + # @return [Float] + required :leads, Float + + # @!attribute objective + # The goal the campaign optimizes toward. # - # @return [Integer] - required :leads, Integer + # @return [Symbol, WhopSDK::Models::AdCampaign::Objective, nil] + required :objective, enum: -> { WhopSDK::AdCampaign::Objective }, nil?: true + + # @!attribute optimization_goal + # The specific event the campaign optimizes for. If the campaign is CBO, then all + # ad groups will have the same optimization goal, which will be returned here. + # + # @return [String, nil] + required :optimization_goal, String, nil?: true # @!attribute platform - # The external ad platform this campaign is running on (e.g., meta, tiktok). + # The ad network the campaign runs on. # - # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] - required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @return [Symbol, WhopSDK::Models::AdCampaign::Platform] + required :platform, enum: -> { WhopSDK::AdCampaign::Platform } # @!attribute purchase_value - # Total USD value of Whop pixel-attributed purchases in the stats window. + # USD value of pixel-attributed purchases. # # @return [Float] required :purchase_value, Float # @!attribute purchases - # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # Whop pixel-attributed purchases, last-click. # - # @return [Integer] - required :purchases, Integer + # @return [Float] + required :purchases, Float # @!attribute reach - # Unique users reached in the stats window (deduplicated by the platform). + # The number of unique people who saw this. + # + # @return [Float] + required :reach, Float + + # @!attribute result_event + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + # + # @return [Symbol, WhopSDK::Models::AdCampaign::ResultEvent, nil] + required :result_event, enum: -> { WhopSDK::AdCampaign::ResultEvent }, nil?: true + + # @!attribute result_event_name + # The merchant-defined event name when result_event is custom; null for the + # standard events. # - # @return [Integer] - required :reach, Integer + # @return [String, nil] + required :result_event_name, String, nil?: true # @!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. + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. # # @return [Float] required :return_on_ad_spend, Float + # @!attribute schedules + # Whop pixel-attributed schedule events, last-click. + # + # @return [Float] + required :schedules, Float + + # @!attribute special_ad_categories + # + # @return [Array] + required :special_ad_categories, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory] } + # @!attribute spend - # Amount charged in dollars in the stats window. + # The amount charged, in spend_currency. # # @return [Float] required :spend, Float # @!attribute spend_currency - # The available currencies on the platform + # The ISO 4217 currency code of all monetary metrics. # - # @return [Symbol, WhopSDK::Models::Currency, nil] - required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @return [String, nil] + required :spend_currency, String, nil?: true # @!attribute status - # Current status of the campaign. + # The lifecycle status of the ad campaign. + # + # @return [Symbol, WhopSDK::Models::AdCampaign::Status] + required :status, enum: -> { WhopSDK::AdCampaign::Status } + + # @!attribute submitted_applications + # Whop pixel-attributed submit-application events, last-click. # - # @return [Symbol, WhopSDK::Models::AdCampaignStatus] - required :status, enum: -> { WhopSDK::AdCampaignStatus } + # @return [Float] + required :submitted_applications, Float # @!attribute title - # The campaign name shown in the Whop dashboard. + # The title of the ad campaign. # # @return [String] required :title, String # @!attribute unique_click_through_rate - # Unique click-through rate as a fraction of impressions (unique clicks / - # impressions, 0–1). + # Unique clicks divided by impressions, between 0 and 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. + # The number of unique clicks. # - # @return [Integer] - required :unique_clicks, Integer + # @return [Float] + required :unique_clicks, Float # @!attribute updated_at - # When the ad campaign was last updated. + # When the campaign was last updated, as an ISO 8601 timestamp. + # + # @return [String] + required :updated_at, String + + # @!attribute viewed_contents + # Whop pixel-attributed view-content events, last-click. # - # @return [Time] - required :updated_at, Time + # @return [Float] + required :viewed_contents, Float - # @!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:) + # @!method initialize(id:, added_to_carts:, bid_type:, budget_amount:, budget_optimization:, budget_type:, click_through_rate:, clicks:, completed_registrations:, contacts:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, custom_conversions:, delivery_status:, frequency:, impressions:, issues:, leads:, objective:, optimization_goal:, platform:, purchase_value:, purchases:, reach:, result_event:, result_event_name:, return_on_ad_spend:, schedules:, special_ad_categories:, spend:, spend_currency:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, viewed_contents:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdCampaign} for more details. # - # An advertising campaign running on an external platform or within Whop. + # @param id [String] Unique identifier for the ad campaign. + # + # @param added_to_carts [Float] Whop pixel-attributed add-to-cart events, last-click. + # + # @param bid_type [Symbol, WhopSDK::Models::AdCampaign::BidType, nil] The bidding strategy the campaign uses. + # + # @param budget_amount [Float, nil] The campaign budget in USD. Null when budget is set at the ad group level (ABO). # - # @param id [String] The unique identifier for this ad campaign. + # @param budget_optimization [Symbol, WhopSDK::Models::AdCampaign::BudgetOptimization, nil] Which level owns the budget — the campaign (CBO) or each ad group (ABO). # - # @param budget [Float, nil] Total budget in dollars. + # @param budget_type [Symbol, WhopSDK::Models::AdCampaign::BudgetType, nil] Whether the budget is spent per day or over the campaign's lifetime. # - # @param budget_type [Symbol, WhopSDK::Models::AdBudgetType, nil] The budget type for an ad campaign or ad group. + # @param click_through_rate [Float] Clicks divided by impressions, between 0 and 1. # - # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # @param clicks [Float] The number of clicks. # - # @param clicks [Integer] Total clicks on the campaign's ads in the stats window. + # @param completed_registrations [Float] Whop pixel-attributed complete-registration events, last-click. # - # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # @param contacts [Float] Whop pixel-attributed contact events, last-click. # - # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # @param cost_per_added_to_cart [Float, nil] Spend divided by attributed add-to-cart events; null when they are not the goal # - # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # @param cost_per_click [Float] Spend divided by clicks; 0 when there are no clicks. # - # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # @param cost_per_completed_registration [Float, nil] Spend divided by attributed complete-registration events; null when they are not # - # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # @param cost_per_contact [Float, nil] Spend divided by attributed contact events; null when contacts are not the goal # - # @param created_at [Time] When the ad campaign was created. + # @param cost_per_lead [Float, nil] Spend divided by attributed leads; null when leads are not a goal and none are a # - # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # @param cost_per_mille [Float] Spend per 1,000 impressions; 0 when there are no impressions. # - # @param impressions [Integer] Total impressions (views) on the campaign's ads in the stats window. + # @param cost_per_purchase [Float, nil] Spend divided by attributed purchases; null when purchases are not a goal and no # - # @param issues [Array] Open platform issues affecting this campaign and its descendant ad groups and ad + # @param cost_per_result [Float, nil] Spend divided by Whop pixel-attributed results; null when nothing Whop-attributa # - # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. + # @param cost_per_schedule [Float, nil] Spend divided by attributed schedule events; null when schedules are not the goa # - # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this campaign is running on (e.g., meta, tiktok). + # @param cost_per_submitted_application [Float, nil] Spend divided by attributed submit-application events; null when they are not th # - # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # @param cost_per_viewed_content [Float, nil] Spend divided by attributed view-content events; null when they are not the goal # - # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # @param created_at [String] When the campaign was created, as an ISO 8601 timestamp. # - # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # @param custom_conversions [Float] Whop pixel-attributed custom (merchant-defined) conversion events, last-click, a # - # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # @param delivery_status [Symbol, WhopSDK::Models::AdCampaign::DeliveryStatus] The current delivery state, mirroring the Delivery column in the ads dashboard. # - # @param spend [Float] Amount charged in dollars in the stats window. + # @param frequency [Float, nil] Platform-reported impressions divided by reach. # - # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param impressions [Float] The number of impressions. # - # @param status [Symbol, WhopSDK::Models::AdCampaignStatus] Current status of the campaign. + # @param issues [Array] # - # @param title [String] The campaign name shown in the Whop dashboard. + # @param leads [Float] Whop pixel-attributed leads, last-click. # - # @param unique_click_through_rate [Float, nil] Unique click-through rate as a fraction of impressions (unique clicks / impressi + # @param objective [Symbol, WhopSDK::Models::AdCampaign::Objective, nil] The goal the campaign optimizes toward. # - # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. + # @param optimization_goal [String, nil] The specific event the campaign optimizes for. If the campaign is CBO, then all # - # @param updated_at [Time] When the ad campaign was last updated. + # @param platform [Symbol, WhopSDK::Models::AdCampaign::Platform] The ad network the campaign runs on. + # + # @param purchase_value [Float] USD value of pixel-attributed purchases. + # + # @param purchases [Float] Whop pixel-attributed purchases, last-click. + # + # @param reach [Float] The number of unique people who saw this. + # + # @param result_event [Symbol, WhopSDK::Models::AdCampaign::ResultEvent, nil] The Whop pixel conversion event whose attributed count represents results — the + # + # @param result_event_name [String, nil] The merchant-defined event name when result_event is custom; null for the standa + # + # @param return_on_ad_spend [Float] Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # + # @param schedules [Float] Whop pixel-attributed schedule events, last-click. + # + # @param special_ad_categories [Array] + # + # @param spend [Float] The amount charged, in spend_currency. + # + # @param spend_currency [String, nil] The ISO 4217 currency code of all monetary metrics. + # + # @param status [Symbol, WhopSDK::Models::AdCampaign::Status] The lifecycle status of the ad campaign. + # + # @param submitted_applications [Float] Whop pixel-attributed submit-application events, last-click. + # + # @param title [String] The title of the ad campaign. + # + # @param unique_click_through_rate [Float, nil] Unique clicks divided by impressions, between 0 and 1. + # + # @param unique_clicks [Float] The number of unique clicks. + # + # @param updated_at [String] When the campaign was last updated, as an ISO 8601 timestamp. + # + # @param viewed_contents [Float] Whop pixel-attributed view-content events, last-click. - 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 + # The bidding strategy the campaign uses. + # + # @see WhopSDK::Models::AdCampaign#bid_type + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST = :minimum_cost + AVERAGE_TARGET = :average_target + MAXIMUM_TARGET = :maximum_target + + # @!method self.values + # @return [Array] + end + + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + # + # @see WhopSDK::Models::AdCampaign#budget_optimization + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + AD_CAMPAIGN = :ad_campaign + AD_GROUP = :ad_group + + # @!method self.values + # @return [Array] + end + + # Whether the budget is spent per day or over the campaign's lifetime. + # + # @see WhopSDK::Models::AdCampaign#budget_type + module BudgetType + extend WhopSDK::Internal::Type::Enum + + DAILY = :daily + LIFETIME = :lifetime + + # @!method self.values + # @return [Array] + end - # @!attribute created_at - # When the issue was first reported. + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + # + # @see WhopSDK::Models::AdCampaign#delivery_status + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + PAYMENT_FAILED = :payment_failed + ALL_ADS_REJECTED = :all_ads_rejected + DRAFT = :draft + NO_AD_GROUPS = :no_ad_groups + NO_ADS = :no_ads + PAUSED = :paused + PROCESSING = :processing + ISSUES = :issues + SCHEDULED = :scheduled + COMPLETED = :completed + AD_GROUPS_OFF = :ad_groups_off + ACTIVE = :active + + # @!method self.values + # @return [Array] + end + + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the issue. # - # @return [Time] - required :created_at, Time + # @return [String] + required :id, String - # @!attribute resolution_status - # Current resolution status. + # @!attribute message + # A description of what the issue is and how it can be resolved. # - # @return [Symbol, WhopSDK::Models::AdCampaign::Issue::ResolutionStatus] - required :resolution_status, enum: -> { WhopSDK::AdCampaign::Issue::ResolutionStatus } + # @return [String] + required :message, String # @!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. + # The ID of the campaign, ad group, or ad the issue is attached to. # # @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 - - # @!attribute subtype - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). + # The type of resource the issue is attached to. # - # @return [String, nil] - required :subtype, String, nil?: true + # @return [Symbol, WhopSDK::Models::AdCampaign::Issue::ResourceType] + required :resource_type, enum: -> { WhopSDK::AdCampaign::Issue::ResourceType } - # @!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 category [Symbol, WhopSDK::Models::AdCampaign::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. - # - # @param created_at [Time] When the issue was first reported. + # @!method initialize(id:, message:, resource_id:, resource_type:) + # Open issues affecting the campaign and its descendant ad groups and ads. # - # @param resolution_status [Symbol, WhopSDK::Models::AdCampaign::Issue::ResolutionStatus] Current resolution status. + # @param id [String] Unique identifier for the issue. # - # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N + # @param message [String] A description of what the issue is and how it can be resolved. # - # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + # @param resource_id [String, nil] The ID of the campaign, ad group, or ad the issue is attached to. # - # @param subtype [String, nil] Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # @param resource_type [Symbol, WhopSDK::Models::AdCampaign::Issue::ResourceType] The type of resource the issue is attached to. - # Whop's canonical category that a raw platform issue is bucketed into. + # The type of resource the issue is attached to. # - # @see WhopSDK::Models::AdCampaign::Issue#category - module Category + # @see WhopSDK::Models::AdCampaign::Issue#resource_type + module ResourceType extend WhopSDK::Internal::Type::Enum - POLICY_REJECTION = :policy_rejection - CREATIVE_MEDIA = :creative_media - AUDIENCE_TARGETING = :audience_targeting - AD_VOLUME_LIMIT = :ad_volume_limit + AD_CAMPAIGN = :ad_campaign + AD_GROUP = :ad_group + AD = :ad # @!method self.values # @return [Array] end + end - # Current resolution status. - # - # @see WhopSDK::Models::AdCampaign::Issue#resolution_status - module ResolutionStatus - extend WhopSDK::Internal::Type::Enum + # The goal the campaign optimizes toward. + # + # @see WhopSDK::Models::AdCampaign#objective + module Objective + extend WhopSDK::Internal::Type::Enum - OPEN = :open - RESOLVED = :resolved - ACKNOWLEDGED = :acknowledged + AWARENESS = :awareness + TRAFFIC = :traffic + ENGAGEMENT = :engagement + LEADS = :leads + SALES = :sales - # @!method self.values - # @return [Array] - end + # @!method self.values + # @return [Array] + end + + # The ad network the campaign runs on. + # + # @see WhopSDK::Models::AdCampaign#platform + module Platform + extend WhopSDK::Internal::Type::Enum + + META = :meta + + # @!method self.values + # @return [Array] + end + + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + # + # @see WhopSDK::Models::AdCampaign#result_event + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + PURCHASE = :purchase + LEAD = :lead + SCHEDULE = :schedule + SUBMIT_APPLICATION = :submit_application + CONTACT = :contact + COMPLETE_REGISTRATION = :complete_registration + VIEW_CONTENT = :view_content + ADD_TO_CART = :add_to_cart + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + + # Regulated categories the campaign is declared under. Ads in these categories are + # subject to extra targeting restrictions. Empty when none apply. + module SpecialAdCategory + extend WhopSDK::Internal::Type::Enum + + HOUSING = :housing + EMPLOYMENT = :employment + FINANCIAL_PRODUCTS = :financial_products + POLITICS = :politics + + # @!method self.values + # @return [Array] + end + + # The lifecycle status of the ad campaign. + # + # @see WhopSDK::Models::AdCampaign#status + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + PAUSED = :paused + INACTIVE = :inactive + STALE = :stale + PENDING_REFUND = :pending_refund + PAYMENT_FAILED = :payment_failed + DRAFT = :draft + IN_REVIEW = :in_review + FLAGGED = :flagged + IMPORTING = :importing + IMPORTED = :imported + + # @!method self.values + # @return [Array] end end end diff --git a/lib/whop_sdk/models/ad_campaign_create_params.rb b/lib/whop_sdk/models/ad_campaign_create_params.rb new file mode 100644 index 00000000..48fd511b --- /dev/null +++ b/lib/whop_sdk/models/ad_campaign_create_params.rb @@ -0,0 +1,194 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::AdCampaigns#create + class AdCampaignCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute objective + # The goal the campaign optimizes toward. + # + # @return [Symbol, WhopSDK::Models::AdCampaignCreateParams::Objective] + required :objective, enum: -> { WhopSDK::AdCampaignCreateParams::Objective } + + # @!attribute platform + # The ad network the campaign runs on. + # + # @return [Symbol, WhopSDK::Models::AdCampaignCreateParams::Platform] + required :platform, enum: -> { WhopSDK::AdCampaignCreateParams::Platform } + + # @!attribute title + # The title of the campaign. + # + # @return [String] + required :title, String + + # @!attribute account_id + # The account to create the campaign under. Defaults to the account-scoped key's + # own account. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute bid_type + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). CBO only. + # + # @return [Symbol, WhopSDK::Models::AdCampaignCreateParams::BidType, nil] + optional :bid_type, enum: -> { WhopSDK::AdCampaignCreateParams::BidType } + + # @!attribute budget_amount + # The campaign budget, in USD. Required for CBO (budget_optimization: + # ad_campaign); omit for ABO. + # + # @return [Float, nil] + optional :budget_amount, Float + + # @!attribute budget_optimization + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + # Defaults to ad_group. + # + # @return [Symbol, WhopSDK::Models::AdCampaignCreateParams::BudgetOptimization, nil] + optional :budget_optimization, enum: -> { WhopSDK::AdCampaignCreateParams::BudgetOptimization } + + # @!attribute budget_type + # Whether the budget is spent per day or over the campaign's lifetime. Defaults to + # daily. + # + # @return [Symbol, WhopSDK::Models::AdCampaignCreateParams::BudgetType, nil] + optional :budget_type, enum: -> { WhopSDK::AdCampaignCreateParams::BudgetType } + + # @!attribute desired_cost_per_result + # Target/cap cost per result in USD for average_target / maximum_target bidding. + # CBO only. + # + # @return [Float, nil] + optional :desired_cost_per_result, Float + + # @!attribute ends_at + # Campaign schedule end (ISO 8601). CBO only. + # + # @return [String, nil] + optional :ends_at, String + + # @!attribute special_ad_categories + # Regulated categories the campaign falls under. Ads in these categories are + # subject to extra targeting restrictions. + # + # @return [Array, nil] + optional :special_ad_categories, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaignCreateParams::SpecialAdCategory] } + + # @!attribute starts_at + # Campaign schedule start (ISO 8601). CBO only. + # + # @return [String, nil] + optional :starts_at, String + + # @!method initialize(objective:, platform:, title:, account_id: nil, bid_type: nil, budget_amount: nil, budget_optimization: nil, budget_type: nil, desired_cost_per_result: nil, ends_at: nil, special_ad_categories: nil, starts_at: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCampaignCreateParams} for more details. + # + # @param objective [Symbol, WhopSDK::Models::AdCampaignCreateParams::Objective] The goal the campaign optimizes toward. + # + # @param platform [Symbol, WhopSDK::Models::AdCampaignCreateParams::Platform] The ad network the campaign runs on. + # + # @param title [String] The title of the campaign. + # + # @param account_id [String] The account to create the campaign under. Defaults to the account-scoped key's o + # + # @param bid_type [Symbol, WhopSDK::Models::AdCampaignCreateParams::BidType] CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or maxi + # + # @param budget_amount [Float] The campaign budget, in USD. Required for CBO (budget_optimization: ad_campaign) + # + # @param budget_optimization [Symbol, WhopSDK::Models::AdCampaignCreateParams::BudgetOptimization] Which level owns the budget — the campaign (CBO) or each ad group (ABO). Default + # + # @param budget_type [Symbol, WhopSDK::Models::AdCampaignCreateParams::BudgetType] Whether the budget is spent per day or over the campaign's lifetime. Defaults to + # + # @param desired_cost_per_result [Float] Target/cap cost per result in USD for average_target / maximum_target bidding. C + # + # @param ends_at [String] Campaign schedule end (ISO 8601). CBO only. + # + # @param special_ad_categories [Array] Regulated categories the campaign falls under. Ads in these categories are subje + # + # @param starts_at [String] Campaign schedule start (ISO 8601). CBO only. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The goal the campaign optimizes toward. + module Objective + extend WhopSDK::Internal::Type::Enum + + AWARENESS = :awareness + TRAFFIC = :traffic + ENGAGEMENT = :engagement + LEADS = :leads + SALES = :sales + + # @!method self.values + # @return [Array] + end + + # The ad network the campaign runs on. + module Platform + extend WhopSDK::Internal::Type::Enum + + META = :meta + + # @!method self.values + # @return [Array] + end + + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). CBO only. + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST = :minimum_cost + AVERAGE_TARGET = :average_target + MAXIMUM_TARGET = :maximum_target + + # @!method self.values + # @return [Array] + end + + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + # Defaults to ad_group. + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + AD_CAMPAIGN = :ad_campaign + AD_GROUP = :ad_group + + # @!method self.values + # @return [Array] + end + + # Whether the budget is spent per day or over the campaign's lifetime. Defaults to + # daily. + module BudgetType + extend WhopSDK::Internal::Type::Enum + + DAILY = :daily + LIFETIME = :lifetime + + # @!method self.values + # @return [Array] + end + + module SpecialAdCategory + extend WhopSDK::Internal::Type::Enum + + HOUSING = :housing + EMPLOYMENT = :employment + FINANCIAL_PRODUCTS = :financial_products + POLITICS = :politics + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/payout_method_retrieve_params.rb b/lib/whop_sdk/models/ad_campaign_delete_params.rb similarity index 78% rename from lib/whop_sdk/models/payout_method_retrieve_params.rb rename to lib/whop_sdk/models/ad_campaign_delete_params.rb index 764a5a04..1a79a17e 100644 --- a/lib/whop_sdk/models/payout_method_retrieve_params.rb +++ b/lib/whop_sdk/models/ad_campaign_delete_params.rb @@ -2,8 +2,8 @@ module WhopSDK module Models - # @see WhopSDK::Resources::PayoutMethods#retrieve - class PayoutMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel + # @see WhopSDK::Resources::AdCampaigns#delete + class AdCampaignDeleteParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters diff --git a/lib/whop_sdk/models/ad_campaign_delete_response.rb b/lib/whop_sdk/models/ad_campaign_delete_response.rb new file mode 100644 index 00000000..50f16e4b --- /dev/null +++ b/lib/whop_sdk/models/ad_campaign_delete_response.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @type [WhopSDK::Internal::Type::Converter] + AdCampaignDeleteResponse = WhopSDK::Internal::Type::Boolean + end +end diff --git a/lib/whop_sdk/models/ad_campaign_list_params.rb b/lib/whop_sdk/models/ad_campaign_list_params.rb index 69dd7f1b..a95ddf94 100644 --- a/lib/whop_sdk/models/ad_campaign_list_params.rb +++ b/lib/whop_sdk/models/ad_campaign_list_params.rb @@ -7,101 +7,179 @@ class AdCampaignListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # @!attribute account_id + # The account the campaigns belong to. Defaults to the account-scoped key's own + # account. # # @return [String, nil] - optional :after, String, nil?: true + optional :account_id, String - # @!attribute before - # Returns the elements in the list that come before the specified cursor. + # @!attribute after + # Cursor to fetch the page after (from page_info.end_cursor). # # @return [String, nil] - optional :before, String, nil?: true + optional :after, String - # @!attribute company_id - # The unique identifier of the company to list ad campaigns for. + # @!attribute before + # Cursor to fetch the page before (from page_info.start_cursor). # # @return [String, nil] - optional :company_id, String, nil?: true + optional :before, String # @!attribute created_after - # Only return ad campaigns created after this timestamp. + # Only return campaigns 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 ad campaigns created before this timestamp. + # Only return campaigns created before this timestamp. # - # @return [Time, nil] - optional :created_before, Time, nil?: true + # @return [String, nil] + optional :created_before, String + + # @!attribute direction + # The sort direction. Defaults to desc. + # + # @return [Symbol, WhopSDK::Models::AdCampaignListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::AdCampaignListParams::Direction } # @!attribute first - # Returns the first _n_ elements from the list. + # The number of campaigns to return. # # @return [Integer, nil] - optional :first, Integer, nil?: true + optional :first, Integer # @!attribute last - # Returns the last _n_ elements from the list. + # The number of campaigns to return from the end of the range. # # @return [Integer, nil] - optional :last, Integer, nil?: true + optional :last, Integer + + # @!attribute order + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + # + # @return [Symbol, WhopSDK::Models::AdCampaignListParams::Order, nil] + optional :order, enum: -> { WhopSDK::AdCampaignListParams::Order } # @!attribute query - # Case-insensitive substring match against the campaign title or ID. + # Filter campaigns by a title or ID substring. # # @return [String, nil] - optional :query, String, nil?: true + optional :query, String # @!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. + # Start of the stats window. Defaults to all-time. # - # @return [Time, nil] - optional :stats_from, Time, nil?: true + # @return [String, nil] + optional :stats_from, String # @!attribute stats_to - # Inclusive end of the window for each campaign's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. Defaults to now. # - # @return [Time, nil] - optional :stats_to, Time, nil?: true + # @return [String, nil] + optional :stats_to, String # @!attribute status - # The status of an ad campaign. + # Only return campaigns with this status. + # + # @return [Symbol, WhopSDK::Models::AdCampaignListParams::Status, nil] + optional :status, enum: -> { WhopSDK::AdCampaignListParams::Status } + + # @!attribute time_zone + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. # - # @return [Symbol, WhopSDK::Models::AdCampaignStatus, nil] - optional :status, enum: -> { WhopSDK::AdCampaignStatus }, nil?: true + # @return [String, nil] + optional :time_zone, String - # @!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: {}) + # @!method initialize(account_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, time_zone: 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 account_id [String] The account the campaigns belong to. Defaults to the account-scoped key's own ac + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param created_after [String] Only return campaigns created after this timestamp. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param created_before [String] Only return campaigns created before this timestamp. # - # @param company_id [String, nil] The unique identifier of the company to list ad campaigns for. + # @param direction [Symbol, WhopSDK::Models::AdCampaignListParams::Direction] The sort direction. Defaults to desc. # - # @param created_after [Time, nil] Only return ad campaigns created after this timestamp. + # @param first [Integer] The number of campaigns to return. # - # @param created_before [Time, nil] Only return ad campaigns created before this timestamp. + # @param last [Integer] The number of campaigns to return from the end of the range. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param order [Symbol, WhopSDK::Models::AdCampaignListParams::Order] The field to sort by. Defaults to created_at. Stat columns (spend, impressions, # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param query [String] Filter campaigns by a title or ID substring. # - # @param query [String, nil] Case-insensitive substring match against the campaign title or ID. + # @param stats_from [String] Start of the stats window. Defaults to all-time. # - # @param stats_from [Time, nil] Inclusive start of the window for each campaign's metric fields (spend, impressi + # @param stats_to [String] End of the stats window. Defaults to now. # - # @param stats_to [Time, nil] Inclusive end of the window for each campaign's metric fields. Omit both statsFr + # @param status [Symbol, WhopSDK::Models::AdCampaignListParams::Status] Only return campaigns with this status. # - # @param status [Symbol, WhopSDK::Models::AdCampaignStatus, nil] The status of an ad campaign. + # @param time_zone [String] IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare s # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT = :created_at + UPDATED_AT = :updated_at + SPEND = :spend + IMPRESSIONS = :impressions + REACH = :reach + CLICKS = :clicks + UNIQUE_CLICKS = :unique_clicks + FREQUENCY = :frequency + CLICK_THROUGH_RATE = :click_through_rate + RESULTS = :results + COST_PER_MILLE = :cost_per_mille + COST_PER_CLICK = :cost_per_click + COST_PER_RESULT = :cost_per_result + RETURN_ON_AD_SPEND = :return_on_ad_spend + + # @!method self.values + # @return [Array] + end + + # Only return campaigns with this status. + module Status + extend WhopSDK::Internal::Type::Enum + + DRAFT = :draft + ACTIVE = :active + PAUSED = :paused + PAYMENT_FAILED = :payment_failed + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/ad_campaign_list_response.rb b/lib/whop_sdk/models/ad_campaign_list_response.rb deleted file mode 100644 index 1d1924dc..00000000 --- a/lib/whop_sdk/models/ad_campaign_list_response.rb +++ /dev/null @@ -1,329 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::AdCampaigns#list - class AdCampaignListResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for this ad campaign. - # - # @return [String] - required :id, String - - # @!attribute budget - # Total budget in dollars. - # - # @return [Float, nil] - required :budget, Float, nil?: true - - # @!attribute budget_type - # The budget type for an ad campaign or ad group. - # - # @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. - # - # @return [Symbol, WhopSDK::Models::AdCampaignStatus] - required :status, enum: -> { WhopSDK::AdCampaignStatus } - - # @!attribute title - # The campaign name shown in the Whop dashboard. - # - # @return [String] - required :title, String - - # @!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 campaign was last updated. - # - # @return [Time] - required :updated_at, Time - - # @!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. - # - # @param budget [Float, nil] Total budget in dollars. - # - # @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 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 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 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 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 - - # @!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 category [Symbol, WhopSDK::Models::AdCampaignListResponse::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. - # - # @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. - # - # @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_platform.rb b/lib/whop_sdk/models/ad_campaign_platform.rb deleted file mode 100644 index 17874abb..00000000 --- a/lib/whop_sdk/models/ad_campaign_platform.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # The platforms where an ad campaign can run. - module AdCampaignPlatform - extend WhopSDK::Internal::Type::Enum - - META = :meta - TIKTOK = :tiktok - - # @!method self.values - # @return [Array] - 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 747e7c02..1ec5f699 100644 --- a/lib/whop_sdk/models/ad_campaign_retrieve_params.rb +++ b/lib/whop_sdk/models/ad_campaign_retrieve_params.rb @@ -13,28 +13,31 @@ class AdCampaignRetrieveParams < WhopSDK::Internal::Type::BaseModel required :id, String # @!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. + # Start of the stats window. # - # @return [Time, nil] - optional :stats_from, Time, nil?: true + # @return [String, nil] + optional :stats_from, String # @!attribute stats_to - # Inclusive end of the window for the campaign's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. # - # @return [Time, nil] - optional :stats_to, Time, nil?: true + # @return [String, nil] + optional :stats_to, String - # @!method initialize(id:, stats_from: nil, stats_to: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdCampaignRetrieveParams} for more details. + # @!attribute time_zone + # IANA timezone the stats window is interpreted in. Defaults to UTC. # + # @return [String, nil] + optional :time_zone, String + + # @!method initialize(id:, stats_from: nil, stats_to: nil, time_zone: nil, request_options: {}) # @param id [String] # - # @param stats_from [Time, nil] Inclusive start of the window for the campaign's metric fields (spend, impressio + # @param stats_from [String] Start of the stats window. + # + # @param stats_to [String] End of the stats window. # - # @param stats_to [Time, nil] Inclusive end of the window for the campaign's metric fields. Omit both statsFro + # @param time_zone [String] IANA timezone the stats window is interpreted in. Defaults to UTC. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/whop_sdk/models/ad_campaign_status.rb b/lib/whop_sdk/models/ad_campaign_status.rb deleted file mode 100644 index 75e8629b..00000000 --- a/lib/whop_sdk/models/ad_campaign_status.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # The status of an ad campaign. - module AdCampaignStatus - extend WhopSDK::Internal::Type::Enum - - ACTIVE = :active - PAUSED = :paused - PAYMENT_FAILED = :payment_failed - DRAFT = :draft - IN_REVIEW = :in_review - FLAGGED = :flagged - - # @!method self.values - # @return [Array] - end - end -end diff --git a/lib/whop_sdk/models/ad_campaign_update_params.rb b/lib/whop_sdk/models/ad_campaign_update_params.rb index 803218a0..bcf303ba 100644 --- a/lib/whop_sdk/models/ad_campaign_update_params.rb +++ b/lib/whop_sdk/models/ad_campaign_update_params.rb @@ -12,22 +12,115 @@ class AdCampaignUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String - # @!attribute budget - # The campaign budget in dollars. The interpretation (daily or lifetime) follows - # the campaign's existing budget type. + # @!attribute bid_type + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). Switching to minimum_cost clears the cap amounts + # stored on the campaign's ad groups. CBO only. + # + # @return [Symbol, WhopSDK::Models::AdCampaignUpdateParams::BidType, nil] + optional :bid_type, enum: -> { WhopSDK::AdCampaignUpdateParams::BidType } + + # @!attribute budget_amount + # The campaign budget, in the account's currency. Interpreted as daily or lifetime + # per the campaign's existing budget type. # # @return [Float, nil] - optional :budget, Float, nil?: true + optional :budget_amount, Float + + # @!attribute budget_optimization + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). Only + # changeable before the campaign is live on Meta; switching to ad_campaign + # requires budget_amount in the same request, and switching to ad_group clears the + # campaign budget. + # + # @return [Symbol, WhopSDK::Models::AdCampaignUpdateParams::BudgetOptimization, nil] + optional :budget_optimization, enum: -> { WhopSDK::AdCampaignUpdateParams::BudgetOptimization } + + # @!attribute ends_at + # Campaign schedule end (ISO 8601). CBO only. + # + # @return [String, nil] + optional :ends_at, String + + # @!attribute starts_at + # Campaign schedule start (ISO 8601). CBO only. + # + # @return [String, nil] + optional :starts_at, String + + # @!attribute status + # Set to active to launch a draft campaign (moderates and pushes it live). + # Live-campaign pause and resume use the pause and unpause actions. + # + # @return [Symbol, WhopSDK::Models::AdCampaignUpdateParams::Status, nil] + optional :status, enum: -> { WhopSDK::AdCampaignUpdateParams::Status } - # @!method initialize(id:, budget: nil, request_options: {}) + # @!attribute title + # The name of the campaign. + # + # @return [String, nil] + optional :title, String + + # @!method initialize(id:, bid_type: nil, budget_amount: nil, budget_optimization: nil, ends_at: nil, starts_at: nil, status: nil, title: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdCampaignUpdateParams} for more details. # # @param id [String] # - # @param budget [Float, nil] The campaign budget in dollars. The interpretation (daily or lifetime) follows t + # @param bid_type [Symbol, WhopSDK::Models::AdCampaignUpdateParams::BidType] CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or maxi + # + # @param budget_amount [Float] The campaign budget, in the account's currency. Interpreted as daily or lifetime + # + # @param budget_optimization [Symbol, WhopSDK::Models::AdCampaignUpdateParams::BudgetOptimization] Which level owns the budget — the campaign (CBO) or each ad group (ABO). Only ch + # + # @param ends_at [String] Campaign schedule end (ISO 8601). CBO only. + # + # @param starts_at [String] Campaign schedule start (ISO 8601). CBO only. + # + # @param status [Symbol, WhopSDK::Models::AdCampaignUpdateParams::Status] Set to active to launch a draft campaign (moderates and pushes it live). Live-ca + # + # @param title [String] The name of the campaign. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). Switching to minimum_cost clears the cap amounts + # stored on the campaign's ad groups. CBO only. + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST = :minimum_cost + AVERAGE_TARGET = :average_target + MAXIMUM_TARGET = :maximum_target + + # @!method self.values + # @return [Array] + end + + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). Only + # changeable before the campaign is live on Meta; switching to ad_campaign + # requires budget_amount in the same request, and switching to ad_group clears the + # campaign budget. + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + AD_CAMPAIGN = :ad_campaign + AD_GROUP = :ad_group + + # @!method self.values + # @return [Array] + end + + # Set to active to launch a draft campaign (moderates and pushes it live). + # Live-campaign pause and resume use the pause and unpause actions. + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/ad_create_params.rb b/lib/whop_sdk/models/ad_create_params.rb new file mode 100644 index 00000000..05609950 --- /dev/null +++ b/lib/whop_sdk/models/ad_create_params.rb @@ -0,0 +1,660 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Ads#create + class AdCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute ad_group + # An inline ad group to create (same shape as POST /ad_groups, including + # ad_campaign_id). Creates the ad group and the ad together. Provide this OR + # ad_group_id. + # + # @return [Object, nil] + optional :ad_group, WhopSDK::Internal::Type::Unknown + + # @!attribute ad_group_id + # The existing ad group to create the ad in. Provide this OR ad_group, not both. + # + # @return [String, nil] + optional :ad_group_id, String + + # @!attribute call_to_action + # The call-to-action button shown on the ad. + # + # @return [Symbol, WhopSDK::Models::AdCreateParams::CallToAction, nil] + optional :call_to_action, enum: -> { WhopSDK::AdCreateParams::CallToAction } + + # @!attribute creatives + # The ad's creative assets. Each entry is an uploaded file id with an optional + # format; omit format for the original asset. + # + # @return [Array, nil] + optional :creatives, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCreateParams::Creative] } + + # @!attribute descriptions + # The description variants shown on the ad. + # + # @return [Array, nil] + optional :descriptions, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute headlines + # The headline variants shown on the ad. + # + # @return [Array, nil] + optional :headlines, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute lead_form + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + # + # @return [WhopSDK::Models::AdCreateParams::LeadForm, nil] + optional :lead_form, -> { WhopSDK::AdCreateParams::LeadForm } + + # @!attribute lead_form_id + # Use an existing Meta instant form instead of creating one — the form's Meta id, + # from a form already on the ad's Facebook page. Only allowed when the ad group's + # conversion_location is an instant-form destination. Mutually exclusive with + # lead_form. + # + # @return [String, nil] + optional :lead_form_id, String + + # @!attribute messaging_config + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + # + # @return [WhopSDK::Models::AdCreateParams::MessagingConfig, nil] + optional :messaging_config, -> { WhopSDK::AdCreateParams::MessagingConfig } + + # @!attribute multi_advertiser_ads + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + # + # @return [Boolean, nil] + optional :multi_advertiser_ads, WhopSDK::Internal::Type::Boolean + + # @!attribute post_id + # Promote an existing post instead of uploading creatives — a Facebook post or + # Instagram media id. Mutually exclusive with creatives. Pair with post_source. + # + # @return [String, nil] + optional :post_id, String + + # @!attribute post_source + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + # + # @return [Symbol, WhopSDK::Models::AdCreateParams::PostSource, nil] + optional :post_source, enum: -> { WhopSDK::AdCreateParams::PostSource } + + # @!attribute primary_texts + # The primary text variants shown in the ad body. + # + # @return [Array, nil] + optional :primary_texts, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute social_accounts + # The social accounts (Facebook page, Instagram profile) the ad runs under. + # + # @return [Array, nil] + optional :social_accounts, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCreateParams::SocialAccount] } + + # @!attribute title + # The display name of the ad. + # + # @return [String, nil] + optional :title, String + + # @!attribute url + # The URL the ad links to. + # + # @return [String, nil] + optional :url, String + + # @!attribute url_parameters + # Query parameters appended to the destination URL, as a string-to-string map. + # + # @return [Object, nil] + optional :url_parameters, WhopSDK::Internal::Type::Unknown + + # @!method initialize(ad_group: nil, ad_group_id: nil, call_to_action: nil, creatives: nil, descriptions: nil, headlines: nil, lead_form: nil, lead_form_id: nil, messaging_config: nil, multi_advertiser_ads: nil, post_id: nil, post_source: nil, primary_texts: nil, social_accounts: nil, title: nil, url: nil, url_parameters: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCreateParams} for more details. + # + # @param ad_group [Object] An inline ad group to create (same shape as POST /ad_groups, including ad_campai + # + # @param ad_group_id [String] The existing ad group to create the ad in. Provide this OR ad_group, not both. + # + # @param call_to_action [Symbol, WhopSDK::Models::AdCreateParams::CallToAction] The call-to-action button shown on the ad. + # + # @param creatives [Array] The ad's creative assets. Each entry is an uploaded file id with an optional for + # + # @param descriptions [Array] The description variants shown on the ad. + # + # @param headlines [Array] The headline variants shown on the ad. + # + # @param lead_form [WhopSDK::Models::AdCreateParams::LeadForm] Instant lead form for the ad. Only allowed when the ad group's conversion_locati + # + # @param lead_form_id [String] Use an existing Meta instant form instead of creating one — the form's Meta id, + # + # @param messaging_config [WhopSDK::Models::AdCreateParams::MessagingConfig] Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # + # @param multi_advertiser_ads [Boolean] Whether the ad can appear alongside other advertisers' ads in the same unit. Def + # + # @param post_id [String] Promote an existing post instead of uploading creatives — a Facebook post or Ins + # + # @param post_source [Symbol, WhopSDK::Models::AdCreateParams::PostSource] Which network post_id refers to — facebook (a page post) or instagram (a media i + # + # @param primary_texts [Array] The primary text variants shown in the ad body. + # + # @param social_accounts [Array] The social accounts (Facebook page, Instagram profile) the ad runs under. + # + # @param title [String] The display name of the ad. + # + # @param url [String] The URL the ad links to. + # + # @param url_parameters [Object] Query parameters appended to the destination URL, as a string-to-string map. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The call-to-action button shown on the ad. + module CallToAction + extend WhopSDK::Internal::Type::Enum + + APPLY_NOW = :apply_now + BOOK_NOW = :book_now + CALL_NOW = :call_now + CONTACT_US = :contact_us + DOWNLOAD = :download + GET_DIRECTIONS = :get_directions + GET_OFFER = :get_offer + GET_QUOTE = :get_quote + LEARN_MORE = :learn_more + LISTEN_NOW = :listen_now + MESSAGE_PAGE = :message_page + NO_BUTTON = :no_button + OPEN_LINK = :open_link + ORDER_NOW = :order_now + REQUEST_TIME = :request_time + SEE_DETAILS = :see_details + SEE_MENU = :see_menu + SEND_UPDATES = :send_updates + SHOP_NOW = :shop_now + SIGN_UP = :sign_up + SUBSCRIBE = :subscribe + WATCH_MORE = :watch_more + + # @!method self.values + # @return [Array] + end + + class Creative < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute crop + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + # + # @return [WhopSDK::Models::AdCreateParams::Creative::Crop, nil] + optional :crop, -> { WhopSDK::AdCreateParams::Creative::Crop } + + # @!attribute format_ + # + # @return [Symbol, WhopSDK::Models::AdCreateParams::Creative::Format, nil] + optional :format_, enum: -> { WhopSDK::AdCreateParams::Creative::Format }, api_name: :format + + # @!method initialize(id: nil, crop: nil, format_: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCreateParams::Creative} for more details. + # + # @param id [String] + # + # @param crop [WhopSDK::Models::AdCreateParams::Creative::Crop] The saved crop window for this creative, in source image pixels. Omit it for the + # + # @param format_ [Symbol, WhopSDK::Models::AdCreateParams::Creative::Format] + + # @see WhopSDK::Models::AdCreateParams::Creative#crop + class Crop < WhopSDK::Internal::Type::BaseModel + # @!attribute height + # + # @return [Float, nil] + optional :height, Float + + # @!attribute width + # + # @return [Float, nil] + optional :width, Float + + # @!attribute x + # + # @return [Float, nil] + optional :x, Float + + # @!attribute y_ + # + # @return [Float, nil] + optional :y_, Float, api_name: :y + + # @!method initialize(height: nil, width: nil, x: nil, y_: nil) + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + # + # @param height [Float] + # @param width [Float] + # @param x [Float] + # @param y_ [Float] + end + + # @see WhopSDK::Models::AdCreateParams::Creative#format_ + module Format + extend WhopSDK::Internal::Type::Enum + + SQUARE = :square + VERTICAL = :vertical + HORIZONTAL = :horizontal + + # @!method self.values + # @return [Array] + end + end + + class LeadForm < WhopSDK::Internal::Type::BaseModel + # @!attribute completion + # Optional completion screen shown after submission; url sets the follow-up + # website button. + # + # @return [WhopSDK::Models::AdCreateParams::LeadForm::Completion, nil] + optional :completion, -> { WhopSDK::AdCreateParams::LeadForm::Completion } + + # @!attribute disclaimer + # Optional custom consent disclaimer with checkboxes. + # + # @return [WhopSDK::Models::AdCreateParams::LeadForm::Disclaimer, nil] + optional :disclaimer, -> { WhopSDK::AdCreateParams::LeadForm::Disclaimer } + + # @!attribute form_type + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + # + # @return [Symbol, WhopSDK::Models::AdCreateParams::LeadForm::FormType, nil] + optional :form_type, enum: -> { WhopSDK::AdCreateParams::LeadForm::FormType } + + # @!attribute intro + # Optional intro screen shown before the questions. + # + # @return [WhopSDK::Models::AdCreateParams::LeadForm::Intro, nil] + optional :intro, -> { WhopSDK::AdCreateParams::LeadForm::Intro } + + # @!attribute name + # Internal name for the form. Auto-generated if omitted. + # + # @return [String, nil] + optional :name, String + + # @!attribute phone_verification + # Require SMS verification of the phone number (higher_intent forms). + # + # @return [Boolean, nil] + optional :phone_verification, WhopSDK::Internal::Type::Boolean + + # @!attribute privacy_policy + # Your privacy policy. url is required by Meta. + # + # @return [WhopSDK::Models::AdCreateParams::LeadForm::PrivacyPolicy, nil] + optional :privacy_policy, -> { WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy } + + # @!attribute questions + # The questions on the form. Standard prefill types need only a type; a custom + # question needs a label and a format (plus options for multiple_choice). Options + # carry an optional key and answer-routing logic. + # + # @return [Array, nil] + optional :questions, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCreateParams::LeadForm::Question] } + + # @!method initialize(completion: nil, disclaimer: nil, form_type: nil, intro: nil, name: nil, phone_verification: nil, privacy_policy: nil, questions: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCreateParams::LeadForm} for more details. + # + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + # + # @param completion [WhopSDK::Models::AdCreateParams::LeadForm::Completion] Optional completion screen shown after submission; url sets the follow-up websit + # + # @param disclaimer [WhopSDK::Models::AdCreateParams::LeadForm::Disclaimer] Optional custom consent disclaimer with checkboxes. + # + # @param form_type [Symbol, WhopSDK::Models::AdCreateParams::LeadForm::FormType] more_volume (default) is quickest to submit; higher_intent adds a confirmation s + # + # @param intro [WhopSDK::Models::AdCreateParams::LeadForm::Intro] Optional intro screen shown before the questions. + # + # @param name [String] Internal name for the form. Auto-generated if omitted. + # + # @param phone_verification [Boolean] Require SMS verification of the phone number (higher_intent forms). + # + # @param privacy_policy [WhopSDK::Models::AdCreateParams::LeadForm::PrivacyPolicy] Your privacy policy. url is required by Meta. + # + # @param questions [Array] The questions on the form. Standard prefill types need only a type; a custom que + + # @see WhopSDK::Models::AdCreateParams::LeadForm#completion + class Completion < WhopSDK::Internal::Type::BaseModel + # @!attribute button_text + # + # @return [String, nil] + optional :button_text, String + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute headline + # + # @return [String, nil] + optional :headline, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(button_text: nil, description: nil, headline: nil, url: nil) + # Optional completion screen shown after submission; url sets the follow-up + # website button. + # + # @param button_text [String] + # @param description [String] + # @param headline [String] + # @param url [String] + end + + # @see WhopSDK::Models::AdCreateParams::LeadForm#disclaimer + class Disclaimer < WhopSDK::Internal::Type::BaseModel + # @!attribute body + # + # @return [String, nil] + optional :body, String + + # @!attribute checkboxes + # + # @return [Array, nil] + optional :checkboxes, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox] } + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!method initialize(body: nil, checkboxes: nil, title: nil) + # Optional custom consent disclaimer with checkboxes. + # + # @param body [String] + # @param checkboxes [Array] + # @param title [String] + + class Checkbox < WhopSDK::Internal::Type::BaseModel + # @!attribute checked_by_default + # + # @return [Boolean, nil] + optional :checked_by_default, WhopSDK::Internal::Type::Boolean + + # @!attribute key + # + # @return [String, nil] + optional :key, String + + # @!attribute required + # + # @return [Boolean, nil] + optional :required, WhopSDK::Internal::Type::Boolean + + # @!attribute text + # + # @return [String, nil] + optional :text, String + + # @!method initialize(checked_by_default: nil, key: nil, required: nil, text: nil) + # @param checked_by_default [Boolean] + # @param key [String] + # @param required [Boolean] + # @param text [String] + end + end + + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + # + # @see WhopSDK::Models::AdCreateParams::LeadForm#form_type + module FormType + extend WhopSDK::Internal::Type::Enum + + MORE_VOLUME = :more_volume + HIGHER_INTENT = :higher_intent + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::AdCreateParams::LeadForm#intro + class Intro < WhopSDK::Internal::Type::BaseModel + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute headline + # + # @return [String, nil] + optional :headline, String + + # @!method initialize(description: nil, headline: nil) + # Optional intro screen shown before the questions. + # + # @param description [String] + # @param headline [String] + end + + # @see WhopSDK::Models::AdCreateParams::LeadForm#privacy_policy + class PrivacyPolicy < WhopSDK::Internal::Type::BaseModel + # @!attribute link_text + # + # @return [String, nil] + optional :link_text, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(link_text: nil, url: nil) + # Your privacy policy. url is required by Meta. + # + # @param link_text [String] + # @param url [String] + end + + class Question < WhopSDK::Internal::Type::BaseModel + # @!attribute format_ + # + # @return [Symbol, WhopSDK::Models::AdCreateParams::LeadForm::Question::Format, nil] + optional :format_, + enum: -> { + WhopSDK::AdCreateParams::LeadForm::Question::Format + }, + api_name: :format + + # @!attribute label + # + # @return [String, nil] + optional :label, String + + # @!attribute options + # + # @return [Array, nil] + optional :options, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCreateParams::LeadForm::Question::Option] } + + # @!attribute type + # + # @return [Symbol, WhopSDK::Models::AdCreateParams::LeadForm::Question::Type, nil] + optional :type, enum: -> { WhopSDK::AdCreateParams::LeadForm::Question::Type } + + # @!method initialize(format_: nil, label: nil, options: nil, type: nil) + # @param format_ [Symbol, WhopSDK::Models::AdCreateParams::LeadForm::Question::Format] + # @param label [String] + # @param options [Array] + # @param type [Symbol, WhopSDK::Models::AdCreateParams::LeadForm::Question::Type] + + # @see WhopSDK::Models::AdCreateParams::LeadForm::Question#format_ + module Format + extend WhopSDK::Internal::Type::Enum + + SHORT_ANSWER = :short_answer + MULTIPLE_CHOICE = :multiple_choice + APPOINTMENT = :appointment + + # @!method self.values + # @return [Array] + end + + class Option < WhopSDK::Internal::Type::BaseModel + # @!attribute key + # + # @return [String, nil] + optional :key, String + + # @!attribute logic + # + # @return [WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic, nil] + optional :logic, -> { WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic } + + # @!attribute value + # + # @return [String, nil] + optional :value, String + + # @!method initialize(key: nil, logic: nil, value: nil) + # @param key [String] + # @param logic [WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic] + # @param value [String] + + # @see WhopSDK::Models::AdCreateParams::LeadForm::Question::Option#logic + class Logic < WhopSDK::Internal::Type::BaseModel + # @!attribute action + # + # @return [Symbol, WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::Action, nil] + optional :action, enum: -> { WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action } + + # @!attribute target_end_page_index + # + # @return [Integer, nil] + optional :target_end_page_index, Integer + + # @!attribute target_question_index + # + # @return [Integer, nil] + optional :target_question_index, Integer + + # @!method initialize(action: nil, target_end_page_index: nil, target_question_index: nil) + # @param action [Symbol, WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::Action] + # @param target_end_page_index [Integer] + # @param target_question_index [Integer] + + # @see WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic#action + module Action + extend WhopSDK::Internal::Type::Enum + + GO_TO_QUESTION = :go_to_question + SUBMIT_FORM = :submit_form + CLOSE_FORM = :close_form + + # @!method self.values + # @return [Array] + end + end + end + + # @see WhopSDK::Models::AdCreateParams::LeadForm::Question#type + module Type + extend WhopSDK::Internal::Type::Enum + + EMAIL = :email + PHONE = :phone + FULL_NAME = :full_name + FIRST_NAME = :first_name + LAST_NAME = :last_name + CITY = :city + STATE = :state + ZIP = :zip + COUNTRY = :country + STREET_ADDRESS = :street_address + JOB_TITLE = :job_title + COMPANY_NAME = :company_name + WORK_EMAIL = :work_email + WORK_PHONE_NUMBER = :work_phone_number + DOB = :dob + GENDER = :gender + MARITAL_STATUS = :marital_status + RELATIONSHIP_STATUS = :relationship_status + MILITARY_STATUS = :military_status + DATE_TIME = :date_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + end + end + + class MessagingConfig < WhopSDK::Internal::Type::BaseModel + # @!attribute keyword + # + # @return [String, nil] + optional :keyword, String + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!method initialize(keyword: nil, message: nil) + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + # + # @param keyword [String] + # @param message [String] + end + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + module PostSource + extend WhopSDK::Internal::Type::Enum + + FACEBOOK = :facebook + INSTAGRAM = :instagram + + # @!method self.values + # @return [Array] + end + + class SocialAccount < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!method initialize(id: nil) + # @param id [String] + end + end + end +end diff --git a/lib/whop_sdk/models/ad_delete_params.rb b/lib/whop_sdk/models/ad_delete_params.rb new file mode 100644 index 00000000..d45aa3bb --- /dev/null +++ b/lib/whop_sdk/models/ad_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Ads#delete + class AdDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/ad_delete_response.rb b/lib/whop_sdk/models/ad_delete_response.rb new file mode 100644 index 00000000..7e91c7da --- /dev/null +++ b/lib/whop_sdk/models/ad_delete_response.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @type [WhopSDK::Internal::Type::Converter] + AdDeleteResponse = WhopSDK::Internal::Type::Boolean + end +end diff --git a/lib/whop_sdk/models/ad_group.rb b/lib/whop_sdk/models/ad_group.rb index 3ce4c2af..86a3f405 100644 --- a/lib/whop_sdk/models/ad_group.rb +++ b/lib/whop_sdk/models/ad_group.rb @@ -2,349 +2,749 @@ module WhopSDK module Models - # @see WhopSDK::Resources::AdGroups#retrieve + # @see WhopSDK::Resources::AdGroups#create class AdGroup < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for this ad group. + # Unique identifier for the ad group. # # @return [String] required :id, String # @!attribute ad_campaign - # The ad campaign this ad group belongs to. + # The ad campaign this ad group belongs to, an object with an id. # # @return [WhopSDK::Models::AdGroup::AdCampaign] required :ad_campaign, -> { WhopSDK::AdGroup::AdCampaign } - # @!attribute budget - # Budget amount in dollars. + # @!attribute added_to_carts + # Whop pixel-attributed add-to-cart events, last-click. + # + # @return [Float] + required :added_to_carts, Float + + # @!attribute audiences + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # + # @return [Object] + required :audiences, WhopSDK::Internal::Type::Unknown + + # @!attribute bid_type + # Bid strategy. + # + # @return [Symbol, WhopSDK::Models::AdGroup::BidType, nil] + required :bid_type, enum: -> { WhopSDK::AdGroup::BidType }, nil?: true + + # @!attribute budget_amount + # Ad-set budget; null when the campaign owns budget (CBO). # # @return [Float, nil] - required :budget, Float, nil?: true + required :budget_amount, Float, nil?: true # @!attribute budget_type - # The budget type for an ad campaign or ad group. + # Whether the budget is daily or lifetime. # - # @return [Symbol, WhopSDK::Models::AdBudgetType, nil] - required :budget_type, enum: -> { WhopSDK::AdBudgetType }, nil?: true + # @return [Symbol, WhopSDK::Models::AdGroup::BudgetType, nil] + required :budget_type, enum: -> { WhopSDK::AdGroup::BudgetType }, nil?: true # @!attribute click_through_rate - # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # Clicks divided by impressions, between 0 and 1. # # @return [Float] required :click_through_rate, Float # @!attribute clicks - # Total clicks on this ad group's ads in the stats window. + # The number of clicks. + # + # @return [Float] + required :clicks, Float + + # @!attribute completed_registrations + # Whop pixel-attributed complete-registration events, last-click. + # + # @return [Float] + required :completed_registrations, Float + + # @!attribute contacts + # Whop pixel-attributed contact events, last-click. + # + # @return [Float] + required :contacts, Float + + # @!attribute conversion_event + # The pixel event optimized for. A standard event, or any custom pixel event name. + # + # @return [Symbol, String, WhopSDK::Models::AdGroup::ConversionEvent, nil] + required :conversion_event, union: -> { WhopSDK::AdGroup::ConversionEvent }, nil?: true + + # @!attribute conversion_location + # Where results happen: website, profile (IG/FB), messaging (DM), on_ad + # (engagement), or the lead destinations (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). # - # @return [Integer] - required :clicks, Integer + # @return [Symbol, WhopSDK::Models::AdGroup::ConversionLocation, nil] + required :conversion_location, enum: -> { WhopSDK::AdGroup::ConversionLocation }, nil?: true + + # @!attribute cost_per_added_to_cart + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_added_to_cart, Float, nil?: true # @!attribute cost_per_click - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Spend divided by clicks; 0 when there are no clicks. # # @return [Float] required :cost_per_click, Float + # @!attribute cost_per_completed_registration + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_completed_registration, Float, nil?: true + + # @!attribute cost_per_contact + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_contact, Float, nil?: true + # @!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 + # Spend divided by attributed leads; null when leads are not a goal and none are # 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. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. # # @return [Float, nil] required :cost_per_result, Float, nil?: true + # @!attribute cost_per_schedule + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_schedule, Float, nil?: true + + # @!attribute cost_per_submitted_application + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + # + # @return [Float, nil] + required :cost_per_submitted_application, Float, nil?: true + + # @!attribute cost_per_viewed_content + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + # + # @return [Float, nil] + required :cost_per_viewed_content, Float, nil?: true + # @!attribute created_at - # When the ad group was created. + # When the ad group was created, ISO 8601. # - # @return [Time] - required :created_at, Time + # @return [String] + required :created_at, String + + # @!attribute custom_conversions + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + # + # @return [Float] + required :custom_conversions, Float + + # @!attribute delivery_status + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + # + # @return [Symbol, WhopSDK::Models::AdGroup::DeliveryStatus] + required :delivery_status, enum: -> { WhopSDK::AdGroup::DeliveryStatus } + + # @!attribute demographics + # Demographic targeting: automatic (Advantage+), age range, gender. + # + # @return [Object] + required :demographics, WhopSDK::Internal::Type::Unknown + + # @!attribute desired_cost_per_result + # Target/cap cost for average_target / maximum_target. + # + # @return [Float, nil] + required :desired_cost_per_result, Float, nil?: true + + # @!attribute devices + # Device targeting: platforms and operating systems. + # + # @return [Object] + required :devices, WhopSDK::Internal::Type::Unknown + + # @!attribute dynamic_creative + # Whether ads within this ad group have their creatives and copy dynamically AB + # tested. + # + # @return [Boolean] + required :dynamic_creative, WhopSDK::Internal::Type::Boolean + + # @!attribute ends_at + # Schedule end, ISO 8601. + # + # @return [String, nil] + required :ends_at, String, nil?: true # @!attribute frequency - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + # Platform-reported impressions divided by reach. # # @return [Float, nil] required :frequency, Float, nil?: true + # @!attribute frequency_cap + # Impression cap; only valid for reach optimization. + # + # @return [Object, nil] + required :frequency_cap, WhopSDK::Internal::Type::Unknown, nil?: true + # @!attribute impressions - # Total impressions (views) on this ad group's ads in the stats window. + # The number of impressions. # - # @return [Integer] - required :impressions, Integer + # @return [Float] + required :impressions, Float # @!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 languages + # + # @return [Array] + required :languages, WhopSDK::Internal::Type::ArrayOf[String] + # @!attribute leads - # Number of Whop pixel-attributed leads (last-click) in the stats window. + # Whop pixel-attributed leads, last-click. # - # @return [Integer] - required :leads, Integer + # @return [Float] + required :leads, Float + + # @!attribute message_apps + # + # @return [Array] + required :message_apps, WhopSDK::Internal::Type::ArrayOf[String] - # @!attribute platform - # The external ad platform this ad group is running on (e.g., meta, tiktok). + # @!attribute minimum_daily_spend + # Daily spend floor within the budget. # - # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] - required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @return [Float, nil] + required :minimum_daily_spend, Float, nil?: true + + # @!attribute optimization_goal + # What the ad group optimizes for. + # + # @return [String, nil] + required :optimization_goal, String, nil?: true + + # @!attribute placements + # + # @return [Array] + required :placements, WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown] # @!attribute purchase_value - # Total USD value of Whop pixel-attributed purchases in the stats window. + # USD value of pixel-attributed purchases. # # @return [Float] required :purchase_value, Float # @!attribute purchases - # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # Whop pixel-attributed purchases, last-click. # - # @return [Integer] - required :purchases, Integer + # @return [Float] + required :purchases, Float # @!attribute reach - # Unique users reached in the stats window (deduplicated by the platform). + # The number of unique people who saw this. + # + # @return [Float] + required :reach, Float + + # @!attribute regions + # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. + # US-CA), cities, zips. + # + # @return [Object] + required :regions, WhopSDK::Internal::Type::Unknown + + # @!attribute result_event + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + # + # @return [Symbol, WhopSDK::Models::AdGroup::ResultEvent, nil] + required :result_event, enum: -> { WhopSDK::AdGroup::ResultEvent }, nil?: true + + # @!attribute result_event_name + # The merchant-defined event name when result_event is custom; null for the + # standard events. # - # @return [Integer] - required :reach, Integer + # @return [String, nil] + required :result_event_name, String, nil?: true # @!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. + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. # # @return [Float] required :return_on_ad_spend, Float + # @!attribute schedules + # Whop pixel-attributed schedule events, last-click. + # + # @return [Float] + required :schedules, Float + # @!attribute spend - # Amount charged in dollars in the stats window. + # The amount charged, in spend_currency. # # @return [Float] required :spend, Float # @!attribute spend_currency - # The available currencies on the platform + # The ISO 4217 currency code of all monetary metrics. # - # @return [Symbol, WhopSDK::Models::Currency, nil] - required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @return [String, nil] + required :spend_currency, String, nil?: true + + # @!attribute starts_at + # Schedule start, ISO 8601. + # + # @return [String, nil] + required :starts_at, String, nil?: true # @!attribute status - # Current operational status of the ad group. + # Delivery status of the ad group. + # + # @return [Symbol, WhopSDK::Models::AdGroup::Status] + required :status, enum: -> { WhopSDK::AdGroup::Status } + + # @!attribute submitted_applications + # Whop pixel-attributed submit-application events, last-click. # - # @return [Symbol, WhopSDK::Models::AdGroupStatus] - required :status, enum: -> { WhopSDK::AdGroupStatus } + # @return [Float] + required :submitted_applications, Float # @!attribute title - # The ad group name shown in the Whop dashboard. + # The display title of the ad group. # # @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). + # Unique clicks divided by impressions, between 0 and 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. + # The number of unique clicks. # - # @return [Integer] - required :unique_clicks, Integer + # @return [Float] + required :unique_clicks, Float # @!attribute updated_at - # When the ad group was last updated. + # When the ad group was last updated, ISO 8601. # - # @return [Time] - required :updated_at, Time + # @return [String] + required :updated_at, String - # @!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:) + # @!attribute viewed_contents + # Whop pixel-attributed view-content events, last-click. + # + # @return [Float] + required :viewed_contents, Float + + # @!method initialize(id:, ad_campaign:, added_to_carts:, audiences:, bid_type:, budget_amount:, budget_type:, click_through_rate:, clicks:, completed_registrations:, contacts:, conversion_event:, conversion_location:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, custom_conversions:, delivery_status:, demographics:, desired_cost_per_result:, devices:, dynamic_creative:, ends_at:, frequency:, frequency_cap:, impressions:, issues:, languages:, leads:, message_apps:, minimum_daily_spend:, optimization_goal:, placements:, purchase_value:, purchases:, reach:, regions:, result_event:, result_event_name:, return_on_ad_spend:, schedules:, spend:, spend_currency:, starts_at:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, viewed_contents:) # Some parameter documentations has been truncated, see {WhopSDK::Models::AdGroup} # for more details. # - # An ad group belonging to an ad campaign. + # @param id [String] Unique identifier for the ad group. + # + # @param ad_campaign [WhopSDK::Models::AdGroup::AdCampaign] The ad campaign this ad group belongs to, an object with an id. # - # @param id [String] The unique identifier for this ad group. + # @param added_to_carts [Float] Whop pixel-attributed add-to-cart events, last-click. # - # @param ad_campaign [WhopSDK::Models::AdGroup::AdCampaign] The ad campaign this ad group belongs to. + # @param audiences [Object] Saved-audience targeting: { include, exclude } arrays of audience IDs. # - # @param budget [Float, nil] Budget amount in dollars. + # @param bid_type [Symbol, WhopSDK::Models::AdGroup::BidType, nil] Bid strategy. # - # @param budget_type [Symbol, WhopSDK::Models::AdBudgetType, nil] The budget type for an ad campaign or ad group. + # @param budget_amount [Float, nil] Ad-set budget; null when the campaign owns budget (CBO). # - # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # @param budget_type [Symbol, WhopSDK::Models::AdGroup::BudgetType, nil] Whether the budget is daily or lifetime. # - # @param clicks [Integer] Total clicks on this ad group's ads in the stats window. + # @param click_through_rate [Float] Clicks divided by impressions, between 0 and 1. # - # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # @param clicks [Float] The number of clicks. # - # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # @param completed_registrations [Float] Whop pixel-attributed complete-registration events, last-click. # - # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # @param contacts [Float] Whop pixel-attributed contact events, last-click. # - # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # @param conversion_event [Symbol, String, WhopSDK::Models::AdGroup::ConversionEvent, nil] The pixel event optimized for. A standard event, or any custom pixel event name. # - # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # @param conversion_location [Symbol, WhopSDK::Models::AdGroup::ConversionLocation, nil] Where results happen: website, profile (IG/FB), messaging (DM), on_ad (engagemen # - # @param created_at [Time] When the ad group was created. + # @param cost_per_added_to_cart [Float, nil] Spend divided by attributed add-to-cart events; null when they are not the goal # - # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # @param cost_per_click [Float] Spend divided by clicks; 0 when there are no clicks. # - # @param impressions [Integer] Total impressions (views) on this ad group's ads in the stats window. + # @param cost_per_completed_registration [Float, nil] Spend divided by attributed complete-registration events; null when they are not # - # @param issues [Array] Open platform issues affecting this ad group and its descendant ads, deduplicate + # @param cost_per_contact [Float, nil] Spend divided by attributed contact events; null when contacts are not the goal # - # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. + # @param cost_per_lead [Float, nil] Spend divided by attributed leads; null when leads are not a goal and none are a # - # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this ad group is running on (e.g., meta, tiktok). + # @param cost_per_mille [Float] Spend per 1,000 impressions; 0 when there are no impressions. # - # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # @param cost_per_purchase [Float, nil] Spend divided by attributed purchases; null when purchases are not a goal and no # - # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # @param cost_per_result [Float, nil] Spend divided by Whop pixel-attributed results; null when nothing Whop-attributa # - # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # @param cost_per_schedule [Float, nil] Spend divided by attributed schedule events; null when schedules are not the goa # - # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # @param cost_per_submitted_application [Float, nil] Spend divided by attributed submit-application events; null when they are not th # - # @param spend [Float] Amount charged in dollars in the stats window. + # @param cost_per_viewed_content [Float, nil] Spend divided by attributed view-content events; null when they are not the goal # - # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param created_at [String] When the ad group was created, ISO 8601. # - # @param status [Symbol, WhopSDK::Models::AdGroupStatus] Current operational status of the ad group. + # @param custom_conversions [Float] Whop pixel-attributed custom (merchant-defined) conversion events, last-click, a # - # @param title [String, nil] The ad group name shown in the Whop dashboard. + # @param delivery_status [Symbol, WhopSDK::Models::AdGroup::DeliveryStatus] The current delivery state, mirroring the Delivery column in the ads dashboard. # - # @param unique_click_through_rate [Float, nil] Unique click-through rate as a fraction of impressions (unique clicks / impressi + # @param demographics [Object] Demographic targeting: automatic (Advantage+), age range, gender. # - # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. + # @param desired_cost_per_result [Float, nil] Target/cap cost for average_target / maximum_target. # - # @param updated_at [Time] When the ad group was last updated. + # @param devices [Object] Device targeting: platforms and operating systems. + # + # @param dynamic_creative [Boolean] Whether ads within this ad group have their creatives and copy dynamically AB te + # + # @param ends_at [String, nil] Schedule end, ISO 8601. + # + # @param frequency [Float, nil] Platform-reported impressions divided by reach. + # + # @param frequency_cap [Object, nil] Impression cap; only valid for reach optimization. + # + # @param impressions [Float] The number of impressions. + # + # @param issues [Array] + # + # @param languages [Array] + # + # @param leads [Float] Whop pixel-attributed leads, last-click. + # + # @param message_apps [Array] + # + # @param minimum_daily_spend [Float, nil] Daily spend floor within the budget. + # + # @param optimization_goal [String, nil] What the ad group optimizes for. + # + # @param placements [Array] + # + # @param purchase_value [Float] USD value of pixel-attributed purchases. + # + # @param purchases [Float] Whop pixel-attributed purchases, last-click. + # + # @param reach [Float] The number of unique people who saw this. + # + # @param regions [Object] Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. US-CA + # + # @param result_event [Symbol, WhopSDK::Models::AdGroup::ResultEvent, nil] The Whop pixel conversion event whose attributed count represents results — the + # + # @param result_event_name [String, nil] The merchant-defined event name when result_event is custom; null for the standa + # + # @param return_on_ad_spend [Float] Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # + # @param schedules [Float] Whop pixel-attributed schedule events, last-click. + # + # @param spend [Float] The amount charged, in spend_currency. + # + # @param spend_currency [String, nil] The ISO 4217 currency code of all monetary metrics. + # + # @param starts_at [String, nil] Schedule start, ISO 8601. + # + # @param status [Symbol, WhopSDK::Models::AdGroup::Status] Delivery status of the ad group. + # + # @param submitted_applications [Float] Whop pixel-attributed submit-application events, last-click. + # + # @param title [String, nil] The display title of the ad group. + # + # @param unique_click_through_rate [Float, nil] Unique clicks divided by impressions, between 0 and 1. + # + # @param unique_clicks [Float] The number of unique clicks. + # + # @param updated_at [String] When the ad group was last updated, ISO 8601. + # + # @param viewed_contents [Float] Whop pixel-attributed view-content events, last-click. # @see WhopSDK::Models::AdGroup#ad_campaign class AdCampaign < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for this ad campaign. + # The referenced entity's id. # # @return [String] required :id, String # @!method initialize(id:) - # The ad campaign this ad group belongs to. + # The ad campaign this ad group belongs to, an object with an id. # - # @param id [String] The unique identifier for this ad campaign. + # @param id [String] The referenced entity's id. 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 + # Bid strategy. + # + # @see WhopSDK::Models::AdGroup#bid_type + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST = :minimum_cost + AVERAGE_TARGET = :average_target + MAXIMUM_TARGET = :maximum_target + + # @!method self.values + # @return [Array] + end + + # Whether the budget is daily or lifetime. + # + # @see WhopSDK::Models::AdGroup#budget_type + module BudgetType + extend WhopSDK::Internal::Type::Enum + + DAILY = :daily + LIFETIME = :lifetime + + # @!method self.values + # @return [Array] + end + + # The pixel event optimized for. A standard event, or any custom pixel event name. + # + # @see WhopSDK::Models::AdGroup#conversion_event + module ConversionEvent + extend WhopSDK::Internal::Type::Union + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::PURCHASE } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::ADD_TO_CART } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::INITIATED_CHECKOUT } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::ADD_PAYMENT_INFO } - # @!attribute created_at - # When the issue was first reported. + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::COMPLETE_REGISTRATION } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::LEAD } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::CONTENT_VIEW } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::SEARCH } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::CONTACT } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::CUSTOMIZE_PRODUCT } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::DONATE } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::FIND_LOCATION } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::SCHEDULE } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::START_TRIAL } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::SUBMIT_APPLICATION } + + variant const: -> { WhopSDK::Models::AdGroup::ConversionEvent::SUBSCRIBE } + + variant String + + # @!method self.variants + # @return [Array(Symbol, String)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(WhopSDK::AdGroup::ConversionEvent::TaggedSymbol, String) } + end + + # @!group + + PURCHASE = :purchase + ADD_TO_CART = :add_to_cart + INITIATED_CHECKOUT = :initiated_checkout + ADD_PAYMENT_INFO = :add_payment_info + COMPLETE_REGISTRATION = :complete_registration + LEAD = :lead + CONTENT_VIEW = :content_view + SEARCH = :search + CONTACT = :contact + CUSTOMIZE_PRODUCT = :customize_product + DONATE = :donate + FIND_LOCATION = :find_location + SCHEDULE = :schedule + START_TRIAL = :start_trial + SUBMIT_APPLICATION = :submit_application + SUBSCRIBE = :subscribe + + # @!endgroup + end + + # Where results happen: website, profile (IG/FB), messaging (DM), on_ad + # (engagement), or the lead destinations (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). + # + # @see WhopSDK::Models::AdGroup#conversion_location + module ConversionLocation + extend WhopSDK::Internal::Type::Enum + + WEBSITE = :website + PROFILE = :profile + MESSAGING = :messaging + ON_AD = :on_ad + INSTANT_FORMS = :instant_forms + INSTANT_FORMS_AND_MESSENGER = :instant_forms_and_messenger + WEBSITE_AND_INSTANT_FORMS = :website_and_instant_forms + + # @!method self.values + # @return [Array] + end + + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + # + # @see WhopSDK::Models::AdGroup#delivery_status + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + ALL_ADS_REJECTED = :all_ads_rejected + REJECTED = :rejected + DRAFT = :draft + NO_ADS = :no_ads + CAMPAIGN_PAUSED = :campaign_paused + PAUSED = :paused + PROCESSING = :processing + ISSUES = :issues + SCHEDULED = :scheduled + COMPLETED = :completed + ADS_OFF = :ads_off + LEARNING_LIMITED = :learning_limited + LEARNING = :learning + ACTIVE = :active + + # @!method self.values + # @return [Array] + end + + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the issue. # - # @return [Time] - required :created_at, Time + # @return [String] + required :id, String - # @!attribute resolution_status - # Current resolution status. + # @!attribute message + # A description of what the issue is and how it can be resolved. # - # @return [Symbol, WhopSDK::Models::AdGroup::Issue::ResolutionStatus] - required :resolution_status, enum: -> { WhopSDK::AdGroup::Issue::ResolutionStatus } + # @return [String] + required :message, String # @!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. + # The ID of the campaign, ad group, or ad the issue is attached to. # # @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 - - # @!attribute subtype - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). + # The type of resource the issue is attached to. # - # @return [String, nil] - required :subtype, String, nil?: true + # @return [Symbol, WhopSDK::Models::AdGroup::Issue::ResourceType] + required :resource_type, enum: -> { WhopSDK::AdGroup::Issue::ResourceType } - # @!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.). + # @!method initialize(id:, message:, resource_id:, resource_type:) + # Open issues affecting this ad group and its descendant ads. Empty when there are + # none. # - # @param category [Symbol, WhopSDK::Models::AdGroup::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. + # @param id [String] Unique identifier for the issue. # - # @param created_at [Time] When the issue was first reported. + # @param message [String] A description of what the issue is and how it can be resolved. # - # @param resolution_status [Symbol, WhopSDK::Models::AdGroup::Issue::ResolutionStatus] Current resolution status. + # @param resource_id [String, nil] The ID of the campaign, ad group, or ad the issue is attached to. # - # @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 + # @param resource_type [Symbol, WhopSDK::Models::AdGroup::Issue::ResourceType] The type of resource the issue is attached to. - # Whop's canonical category that a raw platform issue is bucketed into. + # The type of resource the issue is attached to. # - # @see WhopSDK::Models::AdGroup::Issue#category - module Category + # @see WhopSDK::Models::AdGroup::Issue#resource_type + module ResourceType extend WhopSDK::Internal::Type::Enum - POLICY_REJECTION = :policy_rejection - CREATIVE_MEDIA = :creative_media - AUDIENCE_TARGETING = :audience_targeting - AD_VOLUME_LIMIT = :ad_volume_limit + AD_CAMPAIGN = :ad_campaign + AD_GROUP = :ad_group + AD = :ad # @!method self.values # @return [Array] end + end - # Current resolution status. - # - # @see WhopSDK::Models::AdGroup::Issue#resolution_status - module ResolutionStatus - extend WhopSDK::Internal::Type::Enum + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + # + # @see WhopSDK::Models::AdGroup#result_event + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + PURCHASE = :purchase + LEAD = :lead + SCHEDULE = :schedule + SUBMIT_APPLICATION = :submit_application + CONTACT = :contact + COMPLETE_REGISTRATION = :complete_registration + VIEW_CONTENT = :view_content + ADD_TO_CART = :add_to_cart + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end - OPEN = :open - RESOLVED = :resolved - ACKNOWLEDGED = :acknowledged + # Delivery status of the ad group. + # + # @see WhopSDK::Models::AdGroup#status + module Status + extend WhopSDK::Internal::Type::Enum - # @!method self.values - # @return [Array] - end + ACTIVE = :active + PAUSED = :paused + REJECTED = :rejected + + # @!method self.values + # @return [Array] end end end diff --git a/lib/whop_sdk/models/ad_group_create_params.rb b/lib/whop_sdk/models/ad_group_create_params.rb new file mode 100644 index 00000000..ba3d9dad --- /dev/null +++ b/lib/whop_sdk/models/ad_group_create_params.rb @@ -0,0 +1,346 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::AdGroups#create + class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute ad_campaign_id + # The ad campaign to create the ad group in. + # + # @return [String] + required :ad_campaign_id, String + + # @!attribute audiences + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # Incompatible with demographics.automatic (Advantage+). + # + # @return [Object, nil] + optional :audiences, WhopSDK::Internal::Type::Unknown + + # @!attribute bid_type + # Bid strategy. + # + # @return [Symbol, WhopSDK::Models::AdGroupCreateParams::BidType, nil] + optional :bid_type, enum: -> { WhopSDK::AdGroupCreateParams::BidType } + + # @!attribute budget_amount + # Ad-set budget in dollars (ABO only; omit under CBO). + # + # @return [Float, nil] + optional :budget_amount, Float + + # @!attribute budget_type + # Whether the budget is daily or lifetime. + # + # @return [Symbol, WhopSDK::Models::AdGroupCreateParams::BudgetType, nil] + optional :budget_type, enum: -> { WhopSDK::AdGroupCreateParams::BudgetType } + + # @!attribute conversion_event + # The pixel event optimized for. A standard event, or any custom pixel event name. + # + # @return [Symbol, String, WhopSDK::Models::AdGroupCreateParams::ConversionEvent, nil] + optional :conversion_event, union: -> { WhopSDK::AdGroupCreateParams::ConversionEvent }, nil?: true + + # @!attribute conversion_location + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + # + # @return [Symbol, WhopSDK::Models::AdGroupCreateParams::ConversionLocation, nil] + optional :conversion_location, enum: -> { WhopSDK::AdGroupCreateParams::ConversionLocation } + + # @!attribute demographics + # Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + # + # @return [Object, nil] + optional :demographics, WhopSDK::Internal::Type::Unknown + + # @!attribute desired_cost_per_result + # Target/cap cost for average_target / maximum_target. + # + # @return [Float, nil] + optional :desired_cost_per_result, Float + + # @!attribute devices + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + # + # @return [Object, nil] + optional :devices, WhopSDK::Internal::Type::Unknown + + # @!attribute dynamic_creative + # Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; + # immutable afterward. + # + # @return [Boolean, nil] + optional :dynamic_creative, WhopSDK::Internal::Type::Boolean + + # @!attribute ends_at + # Schedule end, ISO 8601. + # + # @return [String, nil] + optional :ends_at, String + + # @!attribute frequency_cap + # { maximum_impressions, per_days } — only valid for reach optimization. + # + # @return [Object, nil] + optional :frequency_cap, WhopSDK::Internal::Type::Unknown + + # @!attribute languages + # Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all + # languages. + # + # @return [Array, nil] + optional :languages, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute message_apps + # Required when conversion_location is messaging: which apps to message on. + # Combinations map to the matching Meta destination. + # + # @return [Array, nil] + optional :message_apps, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdGroupCreateParams::MessageApp] } + + # @!attribute minimum_daily_spend + # Daily spend floor within the budget. + # + # @return [Float, nil] + optional :minimum_daily_spend, Float + + # @!attribute optimization_goal + # What the ad group optimizes for (e.g. conversions, link_clicks, reach). + # + # @return [String, nil] + optional :optimization_goal, String + + # @!attribute placements + # 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # target all of a platform's. + # + # Valid positions per platform: + # + # - `facebook`: `feed`, `right_hand_column`, `marketplace`, `search`, + # `profile_feed`, `notification`, `story`, `instream_video`, `facebook_reels`, + # `facebook_reels_overlay`, `biz_disco_feed` + # - `instagram`: `stream`, `story`, `explore`, `explore_home`, `reels`, + # `profile_feed`, `profile_reels`, `ig_search` + # - `messenger`: `story` + # - `audience_network`: `classic`, `rewarded_video` + # - `threads`: `threads_stream` + # - `whatsapp`: `status` + # + # @return [Object, nil] + optional :placements, WhopSDK::Internal::Type::Unknown + + # @!attribute regions + # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # + # @return [Object, nil] + optional :regions, WhopSDK::Internal::Type::Unknown + + # @!attribute starts_at + # Schedule start, ISO 8601. + # + # @return [String, nil] + optional :starts_at, String + + # @!attribute status + # Initial status (default: active). + # + # @return [Symbol, WhopSDK::Models::AdGroupCreateParams::Status, nil] + optional :status, enum: -> { WhopSDK::AdGroupCreateParams::Status } + + # @!attribute title + # The display name of the ad group. + # + # @return [String, nil] + optional :title, String + + # @!method initialize(ad_campaign_id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, devices: nil, dynamic_creative: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdGroupCreateParams} for more details. + # + # @param ad_campaign_id [String] The ad campaign to create the ad group in. + # + # @param audiences [Object] Saved-audience targeting: { include, exclude } arrays of audience IDs. Incompati + # + # @param bid_type [Symbol, WhopSDK::Models::AdGroupCreateParams::BidType] Bid strategy. + # + # @param budget_amount [Float] Ad-set budget in dollars (ABO only; omit under CBO). + # + # @param budget_type [Symbol, WhopSDK::Models::AdGroupCreateParams::BudgetType] Whether the budget is daily or lifetime. + # + # @param conversion_event [Symbol, String, WhopSDK::Models::AdGroupCreateParams::ConversionEvent, nil] The pixel event optimized for. A standard event, or any custom pixel event name. + # + # @param conversion_location [Symbol, WhopSDK::Models::AdGroupCreateParams::ConversionLocation] Where results happen: website (conversions), profile (IG/FB engagement), messagi + # + # @param demographics [Object] Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + # + # @param desired_cost_per_result [Float] Target/cap cost for average_target / maximum_target. + # + # @param devices [Object] Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + # + # @param dynamic_creative [Boolean] Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; immutab + # + # @param ends_at [String] Schedule end, ISO 8601. + # + # @param frequency_cap [Object] { maximum_impressions, per_days } — only valid for reach optimization. + # + # @param languages [Array] Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all language + # + # @param message_apps [Array] Required when conversion_location is messaging: which apps to message on. Combin + # + # @param minimum_daily_spend [Float] Daily spend floor within the budget. + # + # @param optimization_goal [String] What the ad group optimizes for (e.g. conversions, link_clicks, reach). + # + # @param placements [Object] 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # + # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), regions (states/pr + # + # @param starts_at [String] Schedule start, ISO 8601. + # + # @param status [Symbol, WhopSDK::Models::AdGroupCreateParams::Status] Initial status (default: active). + # + # @param title [String] The display name of the ad group. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Bid strategy. + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST = :minimum_cost + AVERAGE_TARGET = :average_target + MAXIMUM_TARGET = :maximum_target + + # @!method self.values + # @return [Array] + end + + # Whether the budget is daily or lifetime. + module BudgetType + extend WhopSDK::Internal::Type::Enum + + DAILY = :daily + LIFETIME = :lifetime + + # @!method self.values + # @return [Array] + end + + # The pixel event optimized for. A standard event, or any custom pixel event name. + module ConversionEvent + extend WhopSDK::Internal::Type::Union + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::PURCHASE } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::ADD_TO_CART } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::INITIATED_CHECKOUT } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::ADD_PAYMENT_INFO } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::COMPLETE_REGISTRATION } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::LEAD } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::CONTENT_VIEW } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::SEARCH } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::CONTACT } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::CUSTOMIZE_PRODUCT } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::DONATE } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::FIND_LOCATION } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::SCHEDULE } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::START_TRIAL } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::SUBMIT_APPLICATION } + + variant const: -> { WhopSDK::Models::AdGroupCreateParams::ConversionEvent::SUBSCRIBE } + + variant String + + # @!method self.variants + # @return [Array(Symbol, String)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol, String) } + end + + # @!group + + PURCHASE = :purchase + ADD_TO_CART = :add_to_cart + INITIATED_CHECKOUT = :initiated_checkout + ADD_PAYMENT_INFO = :add_payment_info + COMPLETE_REGISTRATION = :complete_registration + LEAD = :lead + CONTENT_VIEW = :content_view + SEARCH = :search + CONTACT = :contact + CUSTOMIZE_PRODUCT = :customize_product + DONATE = :donate + FIND_LOCATION = :find_location + SCHEDULE = :schedule + START_TRIAL = :start_trial + SUBMIT_APPLICATION = :submit_application + SUBSCRIBE = :subscribe + + # @!endgroup + end + + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + module ConversionLocation + extend WhopSDK::Internal::Type::Enum + + WEBSITE = :website + PROFILE = :profile + MESSAGING = :messaging + ON_AD = :on_ad + INSTANT_FORMS = :instant_forms + INSTANT_FORMS_AND_MESSENGER = :instant_forms_and_messenger + WEBSITE_AND_INSTANT_FORMS = :website_and_instant_forms + + # @!method self.values + # @return [Array] + end + + module MessageApp + extend WhopSDK::Internal::Type::Enum + + MESSENGER = :messenger + INSTAGRAM = :instagram + WHATSAPP = :whatsapp + + # @!method self.values + # @return [Array] + end + + # Initial status (default: active). + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + PAUSED = :paused + + # @!method self.values + # @return [Array] + 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 36853347..ff688fc2 100644 --- a/lib/whop_sdk/models/ad_group_list_params.rb +++ b/lib/whop_sdk/models/ad_group_list_params.rb @@ -7,126 +7,173 @@ 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. + # @!attribute account_id + # Account whose ad groups to list. Defaults to the authenticated account. # # @return [String, nil] - optional :ad_campaign_id, String, nil?: true + optional :account_id, String - # @!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. + # @!attribute ad_campaign_id + # Filter to ad groups in this campaign. # - # @return [Array, nil] - optional :ad_campaign_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + # @return [String, nil] + optional :ad_campaign_id, String # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # Cursor to fetch the page after (from page_info.end_cursor). # # @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. - # - # @return [String, nil] - optional :before, String, nil?: true - - # @!attribute campaign_id - # Filter by campaign. + # Cursor to fetch the page before (from page_info.start_cursor). # # @return [String, nil] - optional :campaign_id, String, nil?: true - - # @!attribute company_id - # Filter by company. Provide companyId or adCampaignIds. - # - # @return [String, nil] - optional :company_id, String, nil?: true + optional :before, String # @!attribute created_after # Only return ad groups 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 ad groups created before this timestamp. # - # @return [Time, nil] - optional :created_before, Time, nil?: true + # @return [String, nil] + optional :created_before, String + + # @!attribute direction + # The sort direction. Defaults to desc. + # + # @return [Symbol, WhopSDK::Models::AdGroupListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::AdGroupListParams::Direction } # @!attribute first - # Returns the first _n_ elements from the list. + # The number of ad groups to return. # # @return [Integer, nil] - optional :first, Integer, nil?: true + optional :first, Integer # @!attribute last - # Returns the last _n_ elements from the list. + # The number of ad groups to return from the end of the range. # # @return [Integer, nil] - optional :last, Integer, nil?: true + optional :last, Integer + + # @!attribute order + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + # + # @return [Symbol, WhopSDK::Models::AdGroupListParams::Order, nil] + optional :order, enum: -> { WhopSDK::AdGroupListParams::Order } # @!attribute query - # Case-insensitive substring match against the ad group name or ID. + # Filter ad groups by a title or ID substring. # # @return [String, nil] - optional :query, String, nil?: true + optional :query, String # @!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. + # Start of the stats window. Defaults to all-time. # - # @return [Time, nil] - optional :stats_from, Time, nil?: true + # @return [String, nil] + optional :stats_from, String # @!attribute stats_to - # Inclusive end of the window for each ad group's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. Defaults to now. # - # @return [Time, nil] - optional :stats_to, Time, nil?: true + # @return [String, nil] + optional :stats_to, String # @!attribute status - # The status of an external ad group. + # Filter to a status (active, paused, in_review, rejected). # - # @return [Symbol, WhopSDK::Models::AdGroupStatus, nil] - optional :status, enum: -> { WhopSDK::AdGroupStatus }, nil?: true + # @return [String, nil] + optional :status, String - # @!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: {}) + # @!attribute time_zone + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + # + # @return [String, nil] + optional :time_zone, String + + # @!method initialize(account_id: nil, ad_campaign_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, time_zone: 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 account_id [String] Account whose ad groups to list. Defaults to the authenticated account. # - # @param ad_campaign_ids [Array, nil] Only return ad groups belonging to these ad campaigns (max 100). Can be combined + # @param ad_campaign_id [String] Filter to ad groups in this campaign. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). # - # @param campaign_id [String, nil] Filter by campaign. + # @param created_after [String] Only return ad groups created after this timestamp. # - # @param company_id [String, nil] Filter by company. Provide companyId or adCampaignIds. + # @param created_before [String] Only return ad groups created before this timestamp. # - # @param created_after [Time, nil] Only return ad groups created after this timestamp. + # @param direction [Symbol, WhopSDK::Models::AdGroupListParams::Direction] The sort direction. Defaults to desc. # - # @param created_before [Time, nil] Only return ad groups created before this timestamp. + # @param first [Integer] The number of ad groups to return. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param last [Integer] The number of ad groups to return from the end of the range. # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param order [Symbol, WhopSDK::Models::AdGroupListParams::Order] The field to sort by. Defaults to created_at. Stat columns (spend, impressions, # - # @param query [String, nil] Case-insensitive substring match against the ad group name or ID. + # @param query [String] Filter ad groups by a title or ID substring. # - # @param stats_from [Time, nil] Inclusive start of the window for each ad group's metric fields (spend, impressi + # @param stats_from [String] Start of the stats window. Defaults to all-time. # - # @param stats_to [Time, nil] Inclusive end of the window for each ad group's metric fields. Omit both statsFr + # @param stats_to [String] End of the stats window. Defaults to now. # - # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. + # @param status [String] Filter to a status (active, paused, in_review, rejected). + # + # @param time_zone [String] IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare s # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT = :created_at + UPDATED_AT = :updated_at + SPEND = :spend + IMPRESSIONS = :impressions + REACH = :reach + CLICKS = :clicks + UNIQUE_CLICKS = :unique_clicks + FREQUENCY = :frequency + CLICK_THROUGH_RATE = :click_through_rate + RESULTS = :results + COST_PER_MILLE = :cost_per_mille + COST_PER_CLICK = :cost_per_click + COST_PER_RESULT = :cost_per_result + RETURN_ON_AD_SPEND = :return_on_ad_spend + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/ad_group_list_response.rb b/lib/whop_sdk/models/ad_group_list_response.rb deleted file mode 100644 index 6d4b3011..00000000 --- a/lib/whop_sdk/models/ad_group_list_response.rb +++ /dev/null @@ -1,351 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::AdGroups#list - class AdGroupListResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for this ad group. - # - # @return [String] - required :id, String - - # @!attribute ad_campaign - # The ad campaign this ad group belongs to. - # - # @return [WhopSDK::Models::AdGroupListResponse::AdCampaign] - required :ad_campaign, -> { WhopSDK::Models::AdGroupListResponse::AdCampaign } - - # @!attribute budget - # Budget amount in dollars. - # - # @return [Float, nil] - required :budget, Float, nil?: true - - # @!attribute budget_type - # The budget type for an ad campaign or ad group. - # - # @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. - # - # @return [Symbol, WhopSDK::Models::AdGroupStatus] - required :status, enum: -> { WhopSDK::AdGroupStatus } - - # @!attribute title - # 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:, 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. - # - # @param ad_campaign [WhopSDK::Models::AdGroupListResponse::AdCampaign] The ad campaign this ad group belongs to. - # - # @param budget [Float, nil] Budget amount in dollars. - # - # @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] 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. - - # @see WhopSDK::Models::AdGroupListResponse#ad_campaign - class AdCampaign < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for this ad campaign. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The ad campaign this ad group belongs to. - # - # @param id [String] The unique identifier for this ad campaign. - 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 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 - - # @!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 category [Symbol, WhopSDK::Models::AdGroupListResponse::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. - # - # @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. - # - # @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 ca03cbd0..62822acd 100644 --- a/lib/whop_sdk/models/ad_group_retrieve_params.rb +++ b/lib/whop_sdk/models/ad_group_retrieve_params.rb @@ -13,28 +13,31 @@ class AdGroupRetrieveParams < WhopSDK::Internal::Type::BaseModel required :id, String # @!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. + # Start of the stats window. # - # @return [Time, nil] - optional :stats_from, Time, nil?: true + # @return [String, nil] + optional :stats_from, String # @!attribute stats_to - # Inclusive end of the window for the ad group's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. # - # @return [Time, nil] - optional :stats_to, Time, nil?: true + # @return [String, nil] + optional :stats_to, String - # @!method initialize(id:, stats_from: nil, stats_to: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdGroupRetrieveParams} for more details. + # @!attribute time_zone + # IANA timezone the stats window is interpreted in. Defaults to UTC. # + # @return [String, nil] + optional :time_zone, String + + # @!method initialize(id:, stats_from: nil, stats_to: nil, time_zone: nil, request_options: {}) # @param id [String] # - # @param stats_from [Time, nil] Inclusive start of the window for the ad group's metric fields (spend, impressio + # @param stats_from [String] Start of the stats window. + # + # @param stats_to [String] End of the stats window. # - # @param stats_to [Time, nil] Inclusive end of the window for the ad group's metric fields. Omit both statsFro + # @param time_zone [String] IANA timezone the stats window is interpreted in. Defaults to UTC. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/whop_sdk/models/ad_group_status.rb b/lib/whop_sdk/models/ad_group_status.rb deleted file mode 100644 index 5f7e3666..00000000 --- a/lib/whop_sdk/models/ad_group_status.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # The status of an external ad group. - module AdGroupStatus - extend WhopSDK::Internal::Type::Enum - - ACTIVE = :active - PAUSED = :paused - INACTIVE = :inactive - IN_REVIEW = :in_review - REJECTED = :rejected - FLAGGED = :flagged - - # @!method self.values - # @return [Array] - end - end -end diff --git a/lib/whop_sdk/models/ad_group_update_params.rb b/lib/whop_sdk/models/ad_group_update_params.rb index 729a9f53..b2f0e2d7 100644 --- a/lib/whop_sdk/models/ad_group_update_params.rb +++ b/lib/whop_sdk/models/ad_group_update_params.rb @@ -12,3179 +12,324 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String - # @!attribute budget - # Budget amount in dollars. + # @!attribute audiences + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # Incompatible with demographics.automatic (Advantage+). + # + # @return [Object, nil] + optional :audiences, WhopSDK::Internal::Type::Unknown + + # @!attribute bid_type + # Bid strategy. + # + # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::BidType, nil] + optional :bid_type, enum: -> { WhopSDK::AdGroupUpdateParams::BidType } + + # @!attribute budget_amount + # Ad-set budget in dollars (ABO only; omit under CBO). # # @return [Float, nil] - optional :budget, Float, nil?: true + optional :budget_amount, Float # @!attribute budget_type - # The budget type for an ad campaign or ad group. + # Whether the budget is daily or lifetime. + # + # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::BudgetType, nil] + optional :budget_type, enum: -> { WhopSDK::AdGroupUpdateParams::BudgetType } + + # @!attribute conversion_event + # The pixel event optimized for. A standard event, or any custom pixel event name. + # + # @return [Symbol, String, WhopSDK::Models::AdGroupUpdateParams::ConversionEvent, nil] + optional :conversion_event, union: -> { WhopSDK::AdGroupUpdateParams::ConversionEvent }, nil?: true + + # @!attribute conversion_location + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. # - # @return [Symbol, WhopSDK::Models::AdBudgetType, nil] - optional :budget_type, enum: -> { WhopSDK::AdBudgetType }, nil?: true + # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::ConversionLocation, nil] + optional :conversion_location, enum: -> { WhopSDK::AdGroupUpdateParams::ConversionLocation } - # @!attribute config - # Unified ad group configuration (bidding, optimization, targeting). + # @!attribute demographics + # Demographic targeting: { automatic, minimum_age, maximum_age, gender }. # - # @return [WhopSDK::Models::AdGroupUpdateParams::Config, nil] - optional :config, -> { WhopSDK::AdGroupUpdateParams::Config }, nil?: true + # @return [Object, nil] + optional :demographics, WhopSDK::Internal::Type::Unknown - # @!attribute daily_budget - # Daily budget in dollars. + # @!attribute desired_cost_per_result + # Target/cap cost for average_target / maximum_target. # # @return [Float, nil] - optional :daily_budget, Float, nil?: true + optional :desired_cost_per_result, Float - # @!attribute name - # Human-readable ad group name. + # @!attribute devices + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + # + # @return [Object, nil] + optional :devices, WhopSDK::Internal::Type::Unknown + + # @!attribute ends_at + # Schedule end, ISO 8601. # # @return [String, nil] - optional :name, String, nil?: true + optional :ends_at, String + + # @!attribute frequency_cap + # { maximum_impressions, per_days } — only valid for reach optimization. + # + # @return [Object, nil] + optional :frequency_cap, WhopSDK::Internal::Type::Unknown + + # @!attribute languages + # Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all + # languages. + # + # @return [Array, nil] + optional :languages, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute message_apps + # Required when conversion_location is messaging: which apps to message on. + # Combinations map to the matching Meta destination. + # + # @return [Array, nil] + optional :message_apps, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdGroupUpdateParams::MessageApp] } + + # @!attribute minimum_daily_spend + # Daily spend floor within the budget. + # + # @return [Float, nil] + optional :minimum_daily_spend, Float + + # @!attribute optimization_goal + # What the ad group optimizes for (e.g. conversions, link_clicks, reach). + # + # @return [String, nil] + optional :optimization_goal, String + + # @!attribute placements + # 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # target all of a platform's. + # + # Valid positions per platform: + # + # - `facebook`: `feed`, `right_hand_column`, `marketplace`, `search`, + # `profile_feed`, `notification`, `story`, `instream_video`, `facebook_reels`, + # `facebook_reels_overlay`, `biz_disco_feed` + # - `instagram`: `stream`, `story`, `explore`, `explore_home`, `reels`, + # `profile_feed`, `profile_reels`, `ig_search` + # - `messenger`: `story` + # - `audience_network`: `classic`, `rewarded_video` + # - `threads`: `threads_stream` + # - `whatsapp`: `status` + # + # @return [Object, nil] + optional :placements, WhopSDK::Internal::Type::Unknown + + # @!attribute regions + # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # + # @return [Object, nil] + optional :regions, WhopSDK::Internal::Type::Unknown - # @!attribute platform_config - # Platform-specific ad group configuration. + # @!attribute starts_at + # Schedule start, ISO 8601. # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig, nil] - optional :platform_config, -> { WhopSDK::AdGroupUpdateParams::PlatformConfig }, nil?: true + # @return [String, nil] + optional :starts_at, String # @!attribute status - # The status of an external ad group. + # Initial status (default: active). # - # @return [Symbol, WhopSDK::Models::AdGroupStatus, nil] - optional :status, enum: -> { WhopSDK::AdGroupStatus }, nil?: true + # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::Status, nil] + optional :status, enum: -> { WhopSDK::AdGroupUpdateParams::Status } # @!attribute title - # Human-readable ad group title. + # The display name of the ad group. # # @return [String, nil] - optional :title, String, nil?: true + optional :title, String - # @!method initialize(id:, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, title: nil, request_options: {}) + # @!method initialize(id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, devices: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdGroupUpdateParams} for more details. + # # @param id [String] # - # @param budget [Float, nil] Budget amount in dollars. + # @param audiences [Object] Saved-audience targeting: { include, exclude } arrays of audience IDs. Incompati + # + # @param bid_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::BidType] Bid strategy. + # + # @param budget_amount [Float] Ad-set budget in dollars (ABO only; omit under CBO). + # + # @param budget_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::BudgetType] Whether the budget is daily or lifetime. + # + # @param conversion_event [Symbol, String, WhopSDK::Models::AdGroupUpdateParams::ConversionEvent, nil] The pixel event optimized for. A standard event, or any custom pixel event name. + # + # @param conversion_location [Symbol, WhopSDK::Models::AdGroupUpdateParams::ConversionLocation] Where results happen: website (conversions), profile (IG/FB engagement), messagi + # + # @param demographics [Object] Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + # + # @param desired_cost_per_result [Float] Target/cap cost for average_target / maximum_target. + # + # @param devices [Object] Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + # + # @param ends_at [String] Schedule end, ISO 8601. + # + # @param frequency_cap [Object] { maximum_impressions, per_days } — only valid for reach optimization. + # + # @param languages [Array] Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all language + # + # @param message_apps [Array] Required when conversion_location is messaging: which apps to message on. Combin # - # @param budget_type [Symbol, WhopSDK::Models::AdBudgetType, nil] The budget type for an ad campaign or ad group. + # @param minimum_daily_spend [Float] Daily spend floor within the budget. # - # @param config [WhopSDK::Models::AdGroupUpdateParams::Config, nil] Unified ad group configuration (bidding, optimization, targeting). + # @param optimization_goal [String] What the ad group optimizes for (e.g. conversions, link_clicks, reach). # - # @param daily_budget [Float, nil] Daily budget in dollars. + # @param placements [Object] 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to # - # @param name [String, nil] Human-readable ad group name. + # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), regions (states/pr # - # @param platform_config [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig, nil] Platform-specific ad group configuration. + # @param starts_at [String] Schedule start, ISO 8601. # - # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. + # @param status [Symbol, WhopSDK::Models::AdGroupUpdateParams::Status] Initial status (default: active). # - # @param title [String, nil] Human-readable ad group title. + # @param title [String] The display name of the ad group. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - class Config < WhopSDK::Internal::Type::BaseModel - # @!attribute bid_amount - # Bid cap amount in cents. Used when bid_strategy is bid_cap or cost_cap. - # - # @return [Integer, nil] - optional :bid_amount, Integer, nil?: true - - # @!attribute bid_strategy - # Bid strategy: lowest_cost, bid_cap, or cost_cap. - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::BidStrategy, nil] - optional :bid_strategy, enum: -> { WhopSDK::AdGroupUpdateParams::Config::BidStrategy }, nil?: true - - # @!attribute billing_event - # How you are billed (e.g., impressions, clicks). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::BillingEvent, nil] - optional :billing_event, enum: -> { WhopSDK::AdGroupUpdateParams::Config::BillingEvent }, nil?: true - - # @!attribute end_time - # Scheduled end time (ISO8601). Required for lifetime budgets. - # - # @return [String, nil] - optional :end_time, String, nil?: true - - # @!attribute frequency_cap - # Maximum number of times to show ads to each person in the frequency interval. - # - # @return [Integer, nil] - optional :frequency_cap, Integer, nil?: true - - # @!attribute frequency_cap_interval_days - # Number of days for the frequency cap interval. - # - # @return [Integer, nil] - optional :frequency_cap_interval_days, Integer, nil?: true - - # @!attribute optimization_goal - # What the ad group optimizes for (e.g., conversions, link_clicks, reach). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::OptimizationGoal, nil] - optional :optimization_goal, - enum: -> { WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal }, - nil?: true - - # @!attribute pacing - # Budget pacing: standard (even) or accelerated (fast). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::Pacing, nil] - optional :pacing, enum: -> { WhopSDK::AdGroupUpdateParams::Config::Pacing }, nil?: true - - # @!attribute start_time - # Scheduled start time (ISO8601). - # - # @return [String, nil] - optional :start_time, String, nil?: true - - # @!attribute targeting - # Audience targeting settings (demographics, geo, interests, audiences, devices). - # - # @return [WhopSDK::Models::AdGroupUpdateParams::Config::Targeting, nil] - optional :targeting, -> { WhopSDK::AdGroupUpdateParams::Config::Targeting }, nil?: true - - # @!method initialize(bid_amount: nil, bid_strategy: nil, billing_event: nil, end_time: nil, frequency_cap: nil, frequency_cap_interval_days: nil, optimization_goal: nil, pacing: nil, start_time: nil, targeting: nil) - # Unified ad group configuration (bidding, optimization, targeting). - # - # @param bid_amount [Integer, nil] Bid cap amount in cents. Used when bid_strategy is bid_cap or cost_cap. - # - # @param bid_strategy [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::BidStrategy, nil] Bid strategy: lowest_cost, bid_cap, or cost_cap. - # - # @param billing_event [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::BillingEvent, nil] How you are billed (e.g., impressions, clicks). - # - # @param end_time [String, nil] Scheduled end time (ISO8601). Required for lifetime budgets. - # - # @param frequency_cap [Integer, nil] Maximum number of times to show ads to each person in the frequency interval. - # - # @param frequency_cap_interval_days [Integer, nil] Number of days for the frequency cap interval. - # - # @param optimization_goal [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::OptimizationGoal, nil] What the ad group optimizes for (e.g., conversions, link_clicks, reach). - # - # @param pacing [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::Pacing, nil] Budget pacing: standard (even) or accelerated (fast). - # - # @param start_time [String, nil] Scheduled start time (ISO8601). - # - # @param targeting [WhopSDK::Models::AdGroupUpdateParams::Config::Targeting, nil] Audience targeting settings (demographics, geo, interests, audiences, devices). - - # Bid strategy: lowest_cost, bid_cap, or cost_cap. - # - # @see WhopSDK::Models::AdGroupUpdateParams::Config#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 - - # How you are billed (e.g., impressions, clicks). - # - # @see WhopSDK::Models::AdGroupUpdateParams::Config#billing_event - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - IMPRESSIONS = :impressions - CLICKS = :clicks - OPTIMIZED_CPM = :optimized_cpm - VIDEO_VIEWS = :video_views - - # @!method self.values - # @return [Array] - end - - # What the ad group optimizes for (e.g., conversions, link_clicks, reach). - # - # @see WhopSDK::Models::AdGroupUpdateParams::Config#optimization_goal - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum - - CONVERSIONS = :conversions - LINK_CLICKS = :link_clicks - LANDING_PAGE_VIEWS = :landing_page_views - REACH = :reach - IMPRESSIONS = :impressions - APP_INSTALLS = :app_installs - VIDEO_VIEWS = :video_views - LEAD_GENERATION = :lead_generation - VALUE = :value - PAGE_LIKES = :page_likes - CONVERSATIONS = :conversations - AD_RECALL_LIFT = :ad_recall_lift - TWO_SECOND_CONTINUOUS_VIDEO_VIEWS = :two_second_continuous_video_views - POST_ENGAGEMENT = :post_engagement - EVENT_RESPONSES = :event_responses - REMINDERS_SET = :reminders_set - QUALITY_LEAD = :quality_lead - - # @!method self.values - # @return [Array] - end - - # Budget pacing: standard (even) or accelerated (fast). - # - # @see WhopSDK::Models::AdGroupUpdateParams::Config#pacing - module Pacing - extend WhopSDK::Internal::Type::Enum - - STANDARD = :standard - ACCELERATED = :accelerated - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::Config#targeting - class Targeting < WhopSDK::Internal::Type::BaseModel - # @!attribute age_max - # Maximum age for demographic targeting. - # - # @return [Integer, nil] - optional :age_max, Integer, nil?: true - - # @!attribute age_min - # Minimum age for demographic targeting. - # - # @return [Integer, nil] - optional :age_min, Integer, nil?: true - - # @!attribute countries - # ISO 3166-1 alpha-2 country codes to target. - # - # @return [Array, nil] - optional :countries, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute device_platforms - # Device platforms to target. - # - # @return [Array, nil] - optional :device_platforms, - -> { - WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdGroupUpdateParams::Config::Targeting::DevicePlatform] - }, - nil?: true - - # @!attribute exclude_audience_ids - # Platform audience IDs to exclude. - # - # @return [Array, nil] - optional :exclude_audience_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute genders - # Genders to target. - # - # @return [Array, nil] - optional :genders, - -> { - WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender] - }, - nil?: true - - # @!attribute include_audience_ids - # Platform audience IDs to include. - # - # @return [Array, nil] - optional :include_audience_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute interest_ids - # Platform-specific interest IDs to target. - # - # @return [Array, nil] - optional :interest_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute languages - # Language codes to target. - # - # @return [Array, nil] - optional :languages, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute placement_type - # Placement strategy for ad delivery. - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::PlacementType, nil] - optional :placement_type, - enum: -> { WhopSDK::AdGroupUpdateParams::Config::Targeting::PlacementType }, - nil?: true - - # @!method initialize(age_max: nil, age_min: nil, countries: nil, device_platforms: nil, exclude_audience_ids: nil, genders: nil, include_audience_ids: nil, interest_ids: nil, languages: nil, placement_type: nil) - # Audience targeting settings (demographics, geo, interests, audiences, devices). - # - # @param age_max [Integer, nil] Maximum age for demographic targeting. - # - # @param age_min [Integer, nil] Minimum age for demographic targeting. - # - # @param countries [Array, nil] ISO 3166-1 alpha-2 country codes to target. - # - # @param device_platforms [Array, nil] Device platforms to target. - # - # @param exclude_audience_ids [Array, nil] Platform audience IDs to exclude. - # - # @param genders [Array, nil] Genders to target. - # - # @param include_audience_ids [Array, nil] Platform audience IDs to include. - # - # @param interest_ids [Array, nil] Platform-specific interest IDs to target. - # - # @param languages [Array, nil] Language codes to target. - # - # @param placement_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::PlacementType, nil] Placement strategy for ad delivery. - - # Device platform targeting options. - module DevicePlatform - extend WhopSDK::Internal::Type::Enum - - MOBILE = :mobile - DESKTOP = :desktop - - # @!method self.values - # @return [Array] - end + # Bid strategy. + module BidType + extend WhopSDK::Internal::Type::Enum - # Gender targeting options. - module Gender - extend WhopSDK::Internal::Type::Enum + MINIMUM_COST = :minimum_cost + AVERAGE_TARGET = :average_target + MAXIMUM_TARGET = :maximum_target - MALE = :male - FEMALE = :female - ALL = :all - - # @!method self.values - # @return [Array] - end - - # Placement strategy for ad delivery. - # - # @see WhopSDK::Models::AdGroupUpdateParams::Config::Targeting#placement_type - module PlacementType - extend WhopSDK::Internal::Type::Enum - - AUTOMATIC = :automatic - MANUAL = :manual - - # @!method self.values - # @return [Array] - end - end + # @!method self.values + # @return [Array] end - class PlatformConfig < WhopSDK::Internal::Type::BaseModel - # @!attribute meta - # Meta (Facebook/Instagram) ad set configuration. - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta, nil] - optional :meta, -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta }, nil?: true - - # @!attribute tiktok - # TikTok ad group configuration. - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok, nil] - optional :tiktok, -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok }, nil?: true - - # @!method initialize(meta: nil, tiktok: nil) - # Platform-specific ad group configuration. - # - # @param meta [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta, nil] Meta (Facebook/Instagram) ad set configuration. - # - # @param tiktok [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok, nil] TikTok ad group configuration. - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig#meta - class Meta < WhopSDK::Internal::Type::BaseModel - # @!attribute android_devices - # - # @return [Array, nil] - optional :android_devices, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute attribution_setting - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :attribution_setting, String, nil?: true - - # @!attribute attribution_spec - # Conversion attribution windows. - # - # @return [Array, nil] - optional :attribution_spec, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec] - }, - nil?: true - - # @!attribute audience_network_positions - # - # @return [Array, nil] - optional :audience_network_positions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute audience_type - # Audience type for retargeting. - # - # @return [String, nil] - optional :audience_type, String, nil?: true - - # @!attribute bid_amount - # Bid amount in cents. - # - # @return [Integer, nil] - optional :bid_amount, Integer, nil?: true - - # @!attribute bid_strategy - # Meta bid strategy. - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy, nil] - optional :bid_strategy, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy }, - nil?: true - - # @!attribute billing_event - # How you are billed on Meta. - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent, nil] - optional :billing_event, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent }, - nil?: true - - # @!attribute brand_safety_content_filter_levels - # - # @return [Array, nil] - optional :brand_safety_content_filter_levels, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute budget_remaining - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :budget_remaining, String, nil?: true - - # @!attribute cost_per_result_goal - # Represents signed double-precision fractional values as specified by - # [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). - # - # @return [Float, nil] - optional :cost_per_result_goal, Float, nil?: true - - # @!attribute created_time - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :created_time, String, nil?: true - - # @!attribute daily_budget - # Daily budget in cents. - # - # @return [Integer, nil] - optional :daily_budget, Integer, nil?: true - - # @!attribute daily_min_spend_target - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :daily_min_spend_target, String, nil?: true - - # @!attribute daily_spend_cap - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :daily_spend_cap, String, nil?: true - - # @!attribute destination_type - # Where ads in this ad set direct people. - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType, nil] - optional :destination_type, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType }, - nil?: true - - # @!attribute dsa_beneficiary - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :dsa_beneficiary, String, nil?: true - - # @!attribute dsa_payor - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :dsa_payor, String, nil?: true - - # @!attribute end_time - # End time (ISO8601). Required for lifetime budgets. - # - # @return [String, nil] - optional :end_time, String, nil?: true - - # @!attribute excluded_geo_locations - # Geo locations to exclude. - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations, nil] - optional :excluded_geo_locations, - -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations }, - nil?: true - - # @!attribute facebook_positions - # Facebook ad placements (feed, reels, stories, etc.). - # - # @return [Array, nil] - optional :facebook_positions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute frequency_control_count - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - # - # @return [Integer, nil] - optional :frequency_control_count, Integer, nil?: true - - # @!attribute frequency_control_days - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - # - # @return [Integer, nil] - optional :frequency_control_days, Integer, nil?: true - - # @!attribute frequency_control_type - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :frequency_control_type, String, nil?: true - - # @!attribute geo_cities - # - # @return [Array, nil] - optional :geo_cities, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity] - }, - nil?: true - - # @!attribute geo_locations - # Geo targeting (countries, regions, cities, zips). - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations, nil] - optional :geo_locations, - -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations }, - nil?: true - - # @!attribute geo_regions - # - # @return [Array, nil] - optional :geo_regions, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion] - }, - nil?: true - - # @!attribute geo_zips - # - # @return [Array, nil] - optional :geo_zips, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute instagram_actor_id - # Instagram account ID for this ad set. - # - # @return [String, nil] - optional :instagram_actor_id, String, nil?: true - - # @!attribute instagram_positions - # Instagram ad placements (stream, story, reels, etc.). - # - # @return [Array, nil] - optional :instagram_positions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute ios_devices - # - # @return [Array, nil] - optional :ios_devices, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute is_dynamic_creative - # Represents `true` or `false` values. - # - # @return [Boolean, nil] - optional :is_dynamic_creative, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute lead_conversion_location - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation, nil] - optional :lead_conversion_location, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation }, - nil?: true - - # @!attribute lead_form_config - # Configuration for a Meta lead gen instant form. - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig, nil] - optional :lead_form_config, - -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig }, - nil?: true - - # @!attribute lead_gen_form_id - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :lead_gen_form_id, String, nil?: true - - # @!attribute lifetime_budget - # Lifetime budget in cents. - # - # @return [Integer, nil] - optional :lifetime_budget, Integer, nil?: true - - # @!attribute lifetime_min_spend_target - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :lifetime_min_spend_target, String, nil?: true - - # @!attribute lifetime_spend_cap - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :lifetime_spend_cap, String, nil?: true - - # @!attribute location_types - # - # @return [Array, nil] - optional :location_types, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute messenger_positions - # - # @return [Array, nil] - optional :messenger_positions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute optimization_goal - # What this ad set optimizes for on Meta. - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal, nil] - optional :optimization_goal, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal }, - nil?: true - - # @!attribute page_id - # Facebook Page ID for this ad set. - # - # @return [String, nil] - optional :page_id, String, nil?: true - - # @!attribute pixel_id - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :pixel_id, String, nil?: true - - # @!attribute promoted_object - # The object this ad set promotes (pixel, page, etc.). - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject, nil] - optional :promoted_object, - -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject }, - nil?: true - - # @!attribute publisher_platforms - # Platforms to publish on (facebook, instagram, messenger, audience_network). - # - # @return [Array, nil] - optional :publisher_platforms, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute source_adset_id - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :source_adset_id, String, nil?: true - - # @!attribute start_time - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :start_time, String, nil?: true - - # @!attribute status - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::Status, nil] - optional :status, - enum: -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::Status - }, - nil?: true - - # @!attribute targeting_automation - # Advantage+ audience expansion settings. - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation, nil] - optional :targeting_automation, - -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation }, - nil?: true - - # @!attribute threads_positions - # - # @return [Array, nil] - optional :threads_positions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute updated_time - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :updated_time, String, nil?: true - - # @!attribute user_device - # - # @return [Array, nil] - optional :user_device, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute user_os - # - # @return [Array, nil] - optional :user_os, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute whatsapp_phone_number - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :whatsapp_phone_number, String, nil?: true - - # @!attribute whatsapp_positions - # - # @return [Array, nil] - optional :whatsapp_positions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!method initialize(android_devices: nil, attribution_setting: nil, attribution_spec: nil, audience_network_positions: nil, audience_type: nil, bid_amount: nil, bid_strategy: nil, billing_event: nil, brand_safety_content_filter_levels: nil, budget_remaining: nil, cost_per_result_goal: nil, created_time: nil, daily_budget: nil, daily_min_spend_target: nil, daily_spend_cap: nil, destination_type: nil, dsa_beneficiary: nil, dsa_payor: nil, end_time: nil, excluded_geo_locations: nil, facebook_positions: nil, frequency_control_count: nil, frequency_control_days: nil, frequency_control_type: nil, geo_cities: nil, geo_locations: nil, geo_regions: nil, geo_zips: nil, instagram_actor_id: nil, instagram_positions: nil, ios_devices: nil, is_dynamic_creative: nil, lead_conversion_location: nil, lead_form_config: nil, lead_gen_form_id: nil, lifetime_budget: nil, lifetime_min_spend_target: nil, lifetime_spend_cap: nil, location_types: nil, messenger_positions: nil, optimization_goal: nil, page_id: nil, pixel_id: nil, promoted_object: nil, publisher_platforms: nil, source_adset_id: nil, start_time: nil, status: nil, targeting_automation: nil, threads_positions: nil, updated_time: nil, user_device: nil, user_os: nil, whatsapp_phone_number: nil, whatsapp_positions: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta} for more details. - # - # Meta (Facebook/Instagram) ad set configuration. - # - # @param android_devices [Array, nil] - # - # @param attribution_setting [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param attribution_spec [Array, nil] Conversion attribution windows. - # - # @param audience_network_positions [Array, nil] - # - # @param audience_type [String, nil] Audience type for retargeting. - # - # @param bid_amount [Integer, nil] Bid amount in cents. - # - # @param bid_strategy [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy, nil] Meta bid strategy. - # - # @param billing_event [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent, nil] How you are billed on Meta. - # - # @param brand_safety_content_filter_levels [Array, nil] - # - # @param budget_remaining [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param cost_per_result_goal [Float, nil] Represents signed double-precision fractional values as specified by [IEEE 754]( - # - # @param created_time [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param daily_budget [Integer, nil] Daily budget in cents. - # - # @param daily_min_spend_target [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param daily_spend_cap [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param destination_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType, nil] Where ads in this ad set direct people. - # - # @param dsa_beneficiary [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param dsa_payor [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param end_time [String, nil] End time (ISO8601). Required for lifetime budgets. - # - # @param excluded_geo_locations [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations, nil] Geo locations to exclude. - # - # @param facebook_positions [Array, nil] Facebook ad placements (feed, reels, stories, etc.). - # - # @param frequency_control_count [Integer, nil] Represents non-fractional signed whole numeric values. Int can represent values - # - # @param frequency_control_days [Integer, nil] Represents non-fractional signed whole numeric values. Int can represent values - # - # @param frequency_control_type [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param geo_cities [Array, nil] - # - # @param geo_locations [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations, nil] Geo targeting (countries, regions, cities, zips). - # - # @param geo_regions [Array, nil] - # - # @param geo_zips [Array, nil] - # - # @param instagram_actor_id [String, nil] Instagram account ID for this ad set. - # - # @param instagram_positions [Array, nil] Instagram ad placements (stream, story, reels, etc.). - # - # @param ios_devices [Array, nil] - # - # @param is_dynamic_creative [Boolean, nil] Represents `true` or `false` values. - # - # @param lead_conversion_location [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation, nil] - # - # @param lead_form_config [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig, nil] Configuration for a Meta lead gen instant form. - # - # @param lead_gen_form_id [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param lifetime_budget [Integer, nil] Lifetime budget in cents. - # - # @param lifetime_min_spend_target [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param lifetime_spend_cap [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param location_types [Array, nil] - # - # @param messenger_positions [Array, nil] - # - # @param optimization_goal [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal, nil] What this ad set optimizes for on Meta. - # - # @param page_id [String, nil] Facebook Page ID for this ad set. - # - # @param pixel_id [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param promoted_object [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject, nil] The object this ad set promotes (pixel, page, etc.). - # - # @param publisher_platforms [Array, nil] Platforms to publish on (facebook, instagram, messenger, audience_network). - # - # @param source_adset_id [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param start_time [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param status [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::Status, nil] - # - # @param targeting_automation [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation, nil] Advantage+ audience expansion settings. - # - # @param threads_positions [Array, nil] - # - # @param updated_time [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param user_device [Array, nil] - # - # @param user_os [Array, nil] - # - # @param whatsapp_phone_number [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param whatsapp_positions [Array, nil] - - class AttributionSpec < WhopSDK::Internal::Type::BaseModel - # @!attribute event_type - # Attribution event type (e.g., CLICK_THROUGH, VIEW_THROUGH). - # - # @return [String] - required :event_type, String - - # @!attribute window_days - # Attribution window in days (1, 7, 28). - # - # @return [Integer] - required :window_days, Integer - - # @!method initialize(event_type:, window_days:) - # Meta conversion attribution window. - # - # @param event_type [String] Attribution event type (e.g., CLICK_THROUGH, VIEW_THROUGH). - # - # @param window_days [Integer] Attribution window in days (1, 7, 28). - end - - # Meta bid strategy. - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#bid_strategy - module BidStrategy - extend WhopSDK::Internal::Type::Enum - - LOWEST_COST_WITHOUT_CAP = :LOWEST_COST_WITHOUT_CAP - LOWEST_COST_WITH_BID_CAP = :LOWEST_COST_WITH_BID_CAP - COST_CAP = :COST_CAP - LOWEST_COST_WITH_MIN_ROAS = :LOWEST_COST_WITH_MIN_ROAS - - # @!method self.values - # @return [Array] - end - - # How you are billed on Meta. - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#billing_event - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - APP_INSTALLS = :APP_INSTALLS - CLICKS = :CLICKS - IMPRESSIONS = :IMPRESSIONS - LINK_CLICKS = :LINK_CLICKS - NONE = :NONE - OFFER_CLAIMS = :OFFER_CLAIMS - PAGE_LIKES = :PAGE_LIKES - POST_ENGAGEMENT = :POST_ENGAGEMENT - THRUPLAY = :THRUPLAY - PURCHASE = :PURCHASE - LISTING_INTERACTION = :LISTING_INTERACTION - - # @!method self.values - # @return [Array] - end - - # Where ads in this ad set direct people. - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#destination_type - module DestinationType - extend WhopSDK::Internal::Type::Enum - - UNDEFINED = :UNDEFINED - WEBSITE = :WEBSITE - APP = :APP - FACEBOOK = :FACEBOOK - MESSENGER = :MESSENGER - WHATSAPP = :WHATSAPP - INSTAGRAM_DIRECT = :INSTAGRAM_DIRECT - INSTAGRAM_PROFILE = :INSTAGRAM_PROFILE - PHONE_CALL = :PHONE_CALL - SHOP_AUTOMATIC = :SHOP_AUTOMATIC - APPLINKS_AUTOMATIC = :APPLINKS_AUTOMATIC - ON_AD = :ON_AD - ON_POST = :ON_POST - ON_VIDEO = :ON_VIDEO - ON_PAGE = :ON_PAGE - ON_EVENT = :ON_EVENT - MESSAGING_MESSENGER_WHATSAPP = :MESSAGING_MESSENGER_WHATSAPP - MESSAGING_INSTAGRAM_DIRECT_MESSENGER = :MESSAGING_INSTAGRAM_DIRECT_MESSENGER - MESSAGING_INSTAGRAM_DIRECT_WHATSAPP = :MESSAGING_INSTAGRAM_DIRECT_WHATSAPP - MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP = :MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP - INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE = :INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE - FACEBOOK_PAGE = :FACEBOOK_PAGE - INSTAGRAM_LIVE = :INSTAGRAM_LIVE - FACEBOOK_LIVE = :FACEBOOK_LIVE - IMAGINE = :IMAGINE - LEAD_FROM_IG_DIRECT = :LEAD_FROM_IG_DIRECT - LEAD_FROM_MESSENGER = :LEAD_FROM_MESSENGER - LEAD_FORM_MESSENGER = :LEAD_FORM_MESSENGER - WEBSITE_AND_LEAD_FORM = :WEBSITE_AND_LEAD_FORM - WEBSITE_AND_PHONE_CALL = :WEBSITE_AND_PHONE_CALL - BROADCAST_CHANNEL = :BROADCAST_CHANNEL - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#excluded_geo_locations - class ExcludedGeoLocations < WhopSDK::Internal::Type::BaseModel - # @!attribute cities - # City targets. - # - # @return [Array, nil] - optional :cities, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City] - }, - nil?: true - - # @!attribute countries - # ISO 3166-1 alpha-2 country codes. - # - # @return [Array, nil] - optional :countries, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute location_types - # Location types (home, recent, travel_in). - # - # @return [Array, nil] - optional :location_types, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute regions - # Region/state targets. - # - # @return [Array, nil] - optional :regions, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region] - }, - nil?: true - - # @!attribute zips - # Zip/postal code targets. - # - # @return [Array, nil] - optional :zips, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip] - }, - nil?: true - - # @!method initialize(cities: nil, countries: nil, location_types: nil, regions: nil, zips: nil) - # Geo locations to exclude. - # - # @param cities [Array, nil] City targets. - # - # @param countries [Array, nil] ISO 3166-1 alpha-2 country codes. - # - # @param location_types [Array, nil] Location types (home, recent, travel_in). - # - # @param regions [Array, nil] Region/state targets. - # - # @param zips [Array, nil] Zip/postal code targets. - - class City < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Meta geo target key/ID. - # - # @return [String] - required :key, String - - # @!attribute country - # Country code for this entry. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute name - # Display name. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute radius - # Radius in miles (cities only). - # - # @return [Integer, nil] - optional :radius, Integer, nil?: true - - # @!method initialize(key:, country: nil, name: nil, radius: nil) - # A Meta geo target entry (region, city, or zip). - # - # @param key [String] Meta geo target key/ID. - # - # @param country [String, nil] Country code for this entry. - # - # @param name [String, nil] Display name. - # - # @param radius [Integer, nil] Radius in miles (cities only). - end - - class Region < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Meta geo target key/ID. - # - # @return [String] - required :key, String - - # @!attribute country - # Country code for this entry. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute name - # Display name. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute radius - # Radius in miles (cities only). - # - # @return [Integer, nil] - optional :radius, Integer, nil?: true - - # @!method initialize(key:, country: nil, name: nil, radius: nil) - # A Meta geo target entry (region, city, or zip). - # - # @param key [String] Meta geo target key/ID. - # - # @param country [String, nil] Country code for this entry. - # - # @param name [String, nil] Display name. - # - # @param radius [Integer, nil] Radius in miles (cities only). - end - - class Zip < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Meta geo target key/ID. - # - # @return [String] - required :key, String - - # @!attribute country - # Country code for this entry. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute name - # Display name. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute radius - # Radius in miles (cities only). - # - # @return [Integer, nil] - optional :radius, Integer, nil?: true - - # @!method initialize(key:, country: nil, name: nil, radius: nil) - # A Meta geo target entry (region, city, or zip). - # - # @param key [String] Meta geo target key/ID. - # - # @param country [String, nil] Country code for this entry. - # - # @param name [String, nil] Display name. - # - # @param radius [Integer, nil] Radius in miles (cities only). - end - end - - class GeoCity < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Meta geo target key/ID. - # - # @return [String] - required :key, String - - # @!attribute country - # Country code for this entry. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute name - # Display name. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute radius - # Radius in miles (cities only). - # - # @return [Integer, nil] - optional :radius, Integer, nil?: true - - # @!method initialize(key:, country: nil, name: nil, radius: nil) - # A Meta geo target entry (region, city, or zip). - # - # @param key [String] Meta geo target key/ID. - # - # @param country [String, nil] Country code for this entry. - # - # @param name [String, nil] Display name. - # - # @param radius [Integer, nil] Radius in miles (cities only). - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#geo_locations - class GeoLocations < WhopSDK::Internal::Type::BaseModel - # @!attribute cities - # City targets. - # - # @return [Array, nil] - optional :cities, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City] - }, - nil?: true - - # @!attribute countries - # ISO 3166-1 alpha-2 country codes. - # - # @return [Array, nil] - optional :countries, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute location_types - # Location types (home, recent, travel_in). - # - # @return [Array, nil] - optional :location_types, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute regions - # Region/state targets. - # - # @return [Array, nil] - optional :regions, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region] - }, - nil?: true - - # @!attribute zips - # Zip/postal code targets. - # - # @return [Array, nil] - optional :zips, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip] - }, - nil?: true - - # @!method initialize(cities: nil, countries: nil, location_types: nil, regions: nil, zips: nil) - # Geo targeting (countries, regions, cities, zips). - # - # @param cities [Array, nil] City targets. - # - # @param countries [Array, nil] ISO 3166-1 alpha-2 country codes. - # - # @param location_types [Array, nil] Location types (home, recent, travel_in). - # - # @param regions [Array, nil] Region/state targets. - # - # @param zips [Array, nil] Zip/postal code targets. - - class City < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Meta geo target key/ID. - # - # @return [String] - required :key, String - - # @!attribute country - # Country code for this entry. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute name - # Display name. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute radius - # Radius in miles (cities only). - # - # @return [Integer, nil] - optional :radius, Integer, nil?: true - - # @!method initialize(key:, country: nil, name: nil, radius: nil) - # A Meta geo target entry (region, city, or zip). - # - # @param key [String] Meta geo target key/ID. - # - # @param country [String, nil] Country code for this entry. - # - # @param name [String, nil] Display name. - # - # @param radius [Integer, nil] Radius in miles (cities only). - end - - class Region < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Meta geo target key/ID. - # - # @return [String] - required :key, String - - # @!attribute country - # Country code for this entry. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute name - # Display name. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute radius - # Radius in miles (cities only). - # - # @return [Integer, nil] - optional :radius, Integer, nil?: true - - # @!method initialize(key:, country: nil, name: nil, radius: nil) - # A Meta geo target entry (region, city, or zip). - # - # @param key [String] Meta geo target key/ID. - # - # @param country [String, nil] Country code for this entry. - # - # @param name [String, nil] Display name. - # - # @param radius [Integer, nil] Radius in miles (cities only). - end - - class Zip < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Meta geo target key/ID. - # - # @return [String] - required :key, String - - # @!attribute country - # Country code for this entry. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute name - # Display name. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute radius - # Radius in miles (cities only). - # - # @return [Integer, nil] - optional :radius, Integer, nil?: true - - # @!method initialize(key:, country: nil, name: nil, radius: nil) - # A Meta geo target entry (region, city, or zip). - # - # @param key [String] Meta geo target key/ID. - # - # @param country [String, nil] Country code for this entry. - # - # @param name [String, nil] Display name. - # - # @param radius [Integer, nil] Radius in miles (cities only). - end - end - - class GeoRegion < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Meta geo target key/ID. - # - # @return [String] - required :key, String - - # @!attribute country - # Country code for this entry. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute name - # Display name. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute radius - # Radius in miles (cities only). - # - # @return [Integer, nil] - optional :radius, Integer, nil?: true - - # @!method initialize(key:, country: nil, name: nil, radius: nil) - # A Meta geo target entry (region, city, or zip). - # - # @param key [String] Meta geo target key/ID. - # - # @param country [String, nil] Country code for this entry. - # - # @param name [String, nil] Display name. - # - # @param radius [Integer, nil] Radius in miles (cities only). - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#lead_conversion_location - module LeadConversionLocation - extend WhopSDK::Internal::Type::Enum - - WEBSITE = :website - INSTANT_FORMS = :instant_forms - WEBSITE_AND_INSTANT_FORMS = :website_and_instant_forms - MESSENGER = :messenger - INSTAGRAM = :instagram - CALLS = :calls - APP = :app - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#lead_form_config - class LeadFormConfig < WhopSDK::Internal::Type::BaseModel - # @!attribute name - # Name of the lead form. - # - # @return [String] - required :name, String - - # @!attribute privacy_policy_url - # URL to your privacy policy. Required by Meta. - # - # @return [String] - required :privacy_policy_url, String - - # @!attribute questions - # Questions to ask on the form. - # - # @return [Array] - required :questions, - -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question] } - - # @!attribute background_image_source - # Background image source: from_ad or custom. - # - # @return [String, nil] - optional :background_image_source, String, nil?: true + # Whether the budget is daily or lifetime. + module BudgetType + extend WhopSDK::Internal::Type::Enum - # @!attribute background_image_url - # URL of custom background image. - # - # @return [String, nil] - optional :background_image_url, String, nil?: true + DAILY = :daily + LIFETIME = :lifetime - # @!attribute conditional_logic_enabled - # Whether conditional logic is enabled for questions. - # - # @return [Boolean, nil] - optional :conditional_logic_enabled, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute context_card_button_text - # CTA button text on the greeting card. - # - # @return [String, nil] - optional :context_card_button_text, String, nil?: true - - # @!attribute context_card_content - # Optional greeting card bullet points. - # - # @return [Array, nil] - optional :context_card_content, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute context_card_style - # Greeting layout: PARAGRAPH_STYLE or LIST_STYLE. - # - # @return [String, nil] - optional :context_card_style, String, nil?: true - - # @!attribute context_card_title - # Optional greeting card title. - # - # @return [String, nil] - optional :context_card_title, String, nil?: true - - # @!attribute custom_disclaimer_body - # Custom disclaimer body text. - # - # @return [String, nil] - optional :custom_disclaimer_body, String, nil?: true - - # @!attribute custom_disclaimer_checkboxes - # Consent checkboxes for the custom disclaimer. - # - # @return [Array, nil] - optional :custom_disclaimer_checkboxes, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox] - }, - nil?: true - - # @!attribute custom_disclaimer_title - # Custom disclaimer section title. - # - # @return [String, nil] - optional :custom_disclaimer_title, String, nil?: true - - # @!attribute form_type - # Form type: more_volume, higher_intent, or rich_creative. - # - # @return [String, nil] - optional :form_type, String, nil?: true - - # @!attribute messenger_enabled - # Enable Messenger follow-up after form submission. - # - # @return [Boolean, nil] - optional :messenger_enabled, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verification_enabled - # Require phone number verification via OTP (higher_intent only). - # - # @return [Boolean, nil] - optional :phone_verification_enabled, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute privacy_policy_link_text - # Custom link text for privacy policy (max 70 chars). - # - # @return [String, nil] - optional :privacy_policy_link_text, String, nil?: true - - # @!attribute question_page_custom_headline - # Custom headline for the questions page. - # - # @return [String, nil] - optional :question_page_custom_headline, String, nil?: true - - # @!attribute rich_creative_headline - # Headline for rich creative form intro. - # - # @return [String, nil] - optional :rich_creative_headline, String, nil?: true - - # @!attribute rich_creative_overview - # Overview description for rich creative form intro. - # - # @return [String, nil] - optional :rich_creative_overview, String, nil?: true - - # @!attribute rich_creative_url - # Uploaded image URL for rich creative form type. - # - # @return [String, nil] - optional :rich_creative_url, String, nil?: true - - # @!attribute thank_you_pages - # Thank you / ending pages (supports multiple for conditional routing). - # - # @return [Array, nil] - optional :thank_you_pages, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage] - }, - nil?: true - - # @!method initialize(name:, privacy_policy_url:, questions:, background_image_source: nil, background_image_url: nil, conditional_logic_enabled: nil, context_card_button_text: nil, context_card_content: nil, context_card_style: nil, context_card_title: nil, custom_disclaimer_body: nil, custom_disclaimer_checkboxes: nil, custom_disclaimer_title: nil, form_type: nil, messenger_enabled: nil, phone_verification_enabled: nil, privacy_policy_link_text: nil, question_page_custom_headline: nil, rich_creative_headline: nil, rich_creative_overview: nil, rich_creative_url: nil, thank_you_pages: nil) - # Configuration for a Meta lead gen instant form. - # - # @param name [String] Name of the lead form. - # - # @param privacy_policy_url [String] URL to your privacy policy. Required by Meta. - # - # @param questions [Array] Questions to ask on the form. - # - # @param background_image_source [String, nil] Background image source: from_ad or custom. - # - # @param background_image_url [String, nil] URL of custom background image. - # - # @param conditional_logic_enabled [Boolean, nil] Whether conditional logic is enabled for questions. - # - # @param context_card_button_text [String, nil] CTA button text on the greeting card. - # - # @param context_card_content [Array, nil] Optional greeting card bullet points. - # - # @param context_card_style [String, nil] Greeting layout: PARAGRAPH_STYLE or LIST_STYLE. - # - # @param context_card_title [String, nil] Optional greeting card title. - # - # @param custom_disclaimer_body [String, nil] Custom disclaimer body text. - # - # @param custom_disclaimer_checkboxes [Array, nil] Consent checkboxes for the custom disclaimer. - # - # @param custom_disclaimer_title [String, nil] Custom disclaimer section title. - # - # @param form_type [String, nil] Form type: more_volume, higher_intent, or rich_creative. - # - # @param messenger_enabled [Boolean, nil] Enable Messenger follow-up after form submission. - # - # @param phone_verification_enabled [Boolean, nil] Require phone number verification via OTP (higher_intent only). - # - # @param privacy_policy_link_text [String, nil] Custom link text for privacy policy (max 70 chars). - # - # @param question_page_custom_headline [String, nil] Custom headline for the questions page. - # - # @param rich_creative_headline [String, nil] Headline for rich creative form intro. - # - # @param rich_creative_overview [String, nil] Overview description for rich creative form intro. - # - # @param rich_creative_url [String, nil] Uploaded image URL for rich creative form type. - # - # @param thank_you_pages [Array, nil] Thank you / ending pages (supports multiple for conditional routing). - - class Question < WhopSDK::Internal::Type::BaseModel - # @!attribute type - # Question type (EMAIL, FULL_NAME, PHONE, CUSTOM, DATE_TIME, etc.). - # - # @return [String] - required :type, String - - # @!attribute conditional_questions_group_id - # Group ID for conditional question routing. - # - # @return [String, nil] - optional :conditional_questions_group_id, String, nil?: true - - # @!attribute dependent_conditional_questions - # Questions shown conditionally based on this question's answer. - # - # @return [Array, nil] - optional :dependent_conditional_questions, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion] - }, - nil?: true - - # @!attribute inline_context - # Helper text shown below the question. - # - # @return [String, nil] - optional :inline_context, String, nil?: true - - # @!attribute key - # Unique key for this question. - # - # @return [String, nil] - optional :key, String, nil?: true - - # @!attribute label - # Custom label for CUSTOM questions. - # - # @return [String, nil] - optional :label, String, nil?: true - - # @!attribute options - # Answer options for multiple choice CUSTOM questions. - # - # @return [Array, nil] - optional :options, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option] - }, - nil?: true - - # @!attribute question_format - # UI hint: short_answer, multiple_choice, or appointment. - # - # @return [String, nil] - optional :question_format, String, nil?: true - - # @!method initialize(type:, conditional_questions_group_id: nil, dependent_conditional_questions: nil, inline_context: nil, key: nil, label: nil, options: nil, question_format: nil) - # A question on a Meta lead gen form. - # - # @param type [String] Question type (EMAIL, FULL_NAME, PHONE, CUSTOM, DATE_TIME, etc.). - # - # @param conditional_questions_group_id [String, nil] Group ID for conditional question routing. - # - # @param dependent_conditional_questions [Array, nil] Questions shown conditionally based on this question's answer. - # - # @param inline_context [String, nil] Helper text shown below the question. - # - # @param key [String, nil] Unique key for this question. - # - # @param label [String, nil] Custom label for CUSTOM questions. - # - # @param options [Array, nil] Answer options for multiple choice CUSTOM questions. - # - # @param question_format [String, nil] UI hint: short_answer, multiple_choice, or appointment. - - class DependentConditionalQuestion < WhopSDK::Internal::Type::BaseModel - # @!attribute type - # Question type (EMAIL, FULL_NAME, PHONE, CUSTOM, DATE_TIME, etc.). - # - # @return [String] - required :type, String - - # @!attribute inline_context - # Helper text shown below the question. - # - # @return [String, nil] - optional :inline_context, String, nil?: true - - # @!attribute key - # Unique key for this question. - # - # @return [String, nil] - optional :key, String, nil?: true - - # @!attribute label - # Custom label for CUSTOM questions. - # - # @return [String, nil] - optional :label, String, nil?: true - - # @!attribute options - # Answer options for multiple choice questions. - # - # @return [Array, nil] - optional :options, - -> do - WhopSDK::Internal::Type::ArrayOf[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option - ] - end, - nil?: true - - # @!method initialize(type:, inline_context: nil, key: nil, label: nil, options: nil) - # A dependent conditional question (non-recursive to avoid schema recursion). - # - # @param type [String] Question type (EMAIL, FULL_NAME, PHONE, CUSTOM, DATE_TIME, etc.). - # - # @param inline_context [String, nil] Helper text shown below the question. - # - # @param key [String, nil] Unique key for this question. - # - # @param label [String, nil] Custom label for CUSTOM questions. - # - # @param options [Array, nil] Answer options for multiple choice questions. - - class Option < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Unique key for this option. - # - # @return [String] - required :key, String - - # @!attribute value - # Display text for this option. - # - # @return [String] - required :value, String - - # @!attribute logic - # Conditional logic routing for this answer option. - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic, nil] - optional :logic, - -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic - }, - nil?: true - - # @!method initialize(key:, value:, logic: nil) - # An answer option for a multiple choice lead form question. - # - # @param key [String] Unique key for this option. - # - # @param value [String] Display text for this option. - # - # @param logic [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic, nil] Conditional logic routing for this answer option. - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option#logic - class Logic < WhopSDK::Internal::Type::BaseModel - # @!attribute type - # Logic type: go_to_question, submit_form, or close_form. - # - # @return [String] - required :type, String - - # @!attribute target_end_page_index - # Index of the end page to route to (for submit_form type). - # - # @return [Integer, nil] - optional :target_end_page_index, Integer, nil?: true - - # @!attribute target_question_index - # Index of the question to route to (for go_to_question type). - # - # @return [Integer, nil] - optional :target_question_index, Integer, nil?: true - - # @!method initialize(type:, target_end_page_index: nil, target_question_index: nil) - # Conditional logic routing for this answer option. - # - # @param type [String] Logic type: go_to_question, submit_form, or close_form. - # - # @param target_end_page_index [Integer, nil] Index of the end page to route to (for submit_form type). - # - # @param target_question_index [Integer, nil] Index of the question to route to (for go_to_question type). - end - end - end - - class Option < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Unique key for this option. - # - # @return [String] - required :key, String - - # @!attribute value - # Display text for this option. - # - # @return [String] - required :value, String - - # @!attribute logic - # Conditional logic routing for this answer option. - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic, nil] - optional :logic, - -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic - }, - nil?: true - - # @!method initialize(key:, value:, logic: nil) - # An answer option for a multiple choice lead form question. - # - # @param key [String] Unique key for this option. - # - # @param value [String] Display text for this option. - # - # @param logic [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic, nil] Conditional logic routing for this answer option. - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option#logic - class Logic < WhopSDK::Internal::Type::BaseModel - # @!attribute type - # Logic type: go_to_question, submit_form, or close_form. - # - # @return [String] - required :type, String - - # @!attribute target_end_page_index - # Index of the end page to route to (for submit_form type). - # - # @return [Integer, nil] - optional :target_end_page_index, Integer, nil?: true - - # @!attribute target_question_index - # Index of the question to route to (for go_to_question type). - # - # @return [Integer, nil] - optional :target_question_index, Integer, nil?: true - - # @!method initialize(type:, target_end_page_index: nil, target_question_index: nil) - # Conditional logic routing for this answer option. - # - # @param type [String] Logic type: go_to_question, submit_form, or close_form. - # - # @param target_end_page_index [Integer, nil] Index of the end page to route to (for submit_form type). - # - # @param target_question_index [Integer, nil] Index of the question to route to (for go_to_question type). - end - end - end - - class CustomDisclaimerCheckbox < WhopSDK::Internal::Type::BaseModel - # @!attribute key - # Unique key for this checkbox. - # - # @return [String] - required :key, String - - # @!attribute text - # Label text for the checkbox. - # - # @return [String] - required :text, String - - # @!attribute is_checked_by_default - # Whether the checkbox is checked by default. - # - # @return [Boolean, nil] - optional :is_checked_by_default, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute is_required - # Whether the checkbox must be checked to submit. - # - # @return [Boolean, nil] - optional :is_required, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!method initialize(key:, text:, is_checked_by_default: nil, is_required: nil) - # A consent checkbox for the custom disclaimer section. - # - # @param key [String] Unique key for this checkbox. - # - # @param text [String] Label text for the checkbox. - # - # @param is_checked_by_default [Boolean, nil] Whether the checkbox is checked by default. - # - # @param is_required [Boolean, nil] Whether the checkbox must be checked to submit. - end - - class ThankYouPage < WhopSDK::Internal::Type::BaseModel - # @!attribute body - # Body text for this ending page. - # - # @return [String, nil] - optional :body, String, nil?: true - - # @!attribute business_phone - # Business phone number for call CTA. - # - # @return [String, nil] - optional :business_phone, String, nil?: true - - # @!attribute button_text - # Custom button text. - # - # @return [String, nil] - optional :button_text, String, nil?: true - - # @!attribute button_type - # CTA button type: VIEW_WEBSITE, CALL_BUSINESS, DOWNLOAD. - # - # @return [String, nil] - optional :button_type, String, nil?: true - - # @!attribute conditional_question_group_id - # Question group ID for conditional routing to this page. - # - # @return [String, nil] - optional :conditional_question_group_id, String, nil?: true - - # @!attribute enable_messenger - # Enable Messenger follow-up. - # - # @return [Boolean, nil] - optional :enable_messenger, WhopSDK::Internal::Type::Boolean, nil?: true + # @!method self.values + # @return [Array] + end - # @!attribute gated_file_url - # Uploaded file URL for gated content download. - # - # @return [String, nil] - optional :gated_file_url, String, nil?: true + # The pixel event optimized for. A standard event, or any custom pixel event name. + module ConversionEvent + extend WhopSDK::Internal::Type::Union - # @!attribute link - # URL the button links to. - # - # @return [String, nil] - optional :link, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::PURCHASE } - # @!attribute name - # Internal name for this ending page. - # - # @return [String, nil] - optional :name, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::ADD_TO_CART } - # @!attribute title - # Headline for this ending page. - # - # @return [String, nil] - optional :title, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::INITIATED_CHECKOUT } - # @!method initialize(body: nil, business_phone: nil, button_text: nil, button_type: nil, conditional_question_group_id: nil, enable_messenger: nil, gated_file_url: nil, link: nil, name: nil, title: nil) - # A thank-you / ending page for a Meta lead gen form. - # - # @param body [String, nil] Body text for this ending page. - # - # @param business_phone [String, nil] Business phone number for call CTA. - # - # @param button_text [String, nil] Custom button text. - # - # @param button_type [String, nil] CTA button type: VIEW_WEBSITE, CALL_BUSINESS, DOWNLOAD. - # - # @param conditional_question_group_id [String, nil] Question group ID for conditional routing to this page. - # - # @param enable_messenger [Boolean, nil] Enable Messenger follow-up. - # - # @param gated_file_url [String, nil] Uploaded file URL for gated content download. - # - # @param link [String, nil] URL the button links to. - # - # @param name [String, nil] Internal name for this ending page. - # - # @param title [String, nil] Headline for this ending page. - end - end + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::ADD_PAYMENT_INFO } - # What this ad set optimizes for on Meta. - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#optimization_goal - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::COMPLETE_REGISTRATION } - NONE = :NONE - APP_INSTALLS = :APP_INSTALLS - AD_RECALL_LIFT = :AD_RECALL_LIFT - ENGAGED_USERS = :ENGAGED_USERS - EVENT_RESPONSES = :EVENT_RESPONSES - IMPRESSIONS = :IMPRESSIONS - LEAD_GENERATION = :LEAD_GENERATION - QUALITY_LEAD = :QUALITY_LEAD - LINK_CLICKS = :LINK_CLICKS - OFFSITE_CONVERSIONS = :OFFSITE_CONVERSIONS - PAGE_LIKES = :PAGE_LIKES - POST_ENGAGEMENT = :POST_ENGAGEMENT - QUALITY_CALL = :QUALITY_CALL - REACH = :REACH - LANDING_PAGE_VIEWS = :LANDING_PAGE_VIEWS - VISIT_INSTAGRAM_PROFILE = :VISIT_INSTAGRAM_PROFILE - VALUE = :VALUE - THRUPLAY = :THRUPLAY - DERIVED_EVENTS = :DERIVED_EVENTS - APP_INSTALLS_AND_OFFSITE_CONVERSIONS = :APP_INSTALLS_AND_OFFSITE_CONVERSIONS - CONVERSATIONS = :CONVERSATIONS - IN_APP_VALUE = :IN_APP_VALUE - MESSAGING_PURCHASE_CONVERSION = :MESSAGING_PURCHASE_CONVERSION - SUBSCRIBERS = :SUBSCRIBERS - REMINDERS_SET = :REMINDERS_SET - MEANINGFUL_CALL_ATTEMPT = :MEANINGFUL_CALL_ATTEMPT - PROFILE_VISIT = :PROFILE_VISIT - PROFILE_AND_PAGE_ENGAGEMENT = :PROFILE_AND_PAGE_ENGAGEMENT - TWO_SECOND_CONTINUOUS_VIDEO_VIEWS = :TWO_SECOND_CONTINUOUS_VIDEO_VIEWS - ENGAGED_REACH = :ENGAGED_REACH - ENGAGED_PAGE_VIEWS = :ENGAGED_PAGE_VIEWS - MESSAGING_DEEP_CONVERSATION_AND_FOLLOW = :MESSAGING_DEEP_CONVERSATION_AND_FOLLOW - ADVERTISER_SILOED_VALUE = :ADVERTISER_SILOED_VALUE - AUTOMATIC_OBJECTIVE = :AUTOMATIC_OBJECTIVE - MESSAGING_APPOINTMENT_CONVERSION = :MESSAGING_APPOINTMENT_CONVERSION + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::LEAD } - # @!method self.values - # @return [Array] - end + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::CONTENT_VIEW } - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#promoted_object - class PromotedObject < WhopSDK::Internal::Type::BaseModel - # @!attribute custom_conversion_id - # Custom conversion rule ID (numeric, from Meta Events Manager). - # - # @return [String, nil] - optional :custom_conversion_id, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::SEARCH } - # @!attribute custom_event_str - # Pixel event name, used when custom_event_type is OTHER. - # - # @return [String, nil] - optional :custom_event_str, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::CONTACT } - # @!attribute custom_event_type - # Custom event type (e.g., PURCHASE, COMPLETE_REGISTRATION, OTHER). - # - # @return [String, nil] - optional :custom_event_type, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::CUSTOMIZE_PRODUCT } - # @!attribute page_id - # Facebook Page ID. - # - # @return [String, nil] - optional :page_id, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::DONATE } - # @!attribute pixel_id - # Meta Pixel ID for conversion tracking. - # - # @return [String, nil] - optional :pixel_id, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::FIND_LOCATION } - # @!attribute whatsapp_phone_number - # WhatsApp phone number for messaging campaigns. - # - # @return [String, nil] - optional :whatsapp_phone_number, String, nil?: true + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::SCHEDULE } - # @!method initialize(custom_conversion_id: nil, custom_event_str: nil, custom_event_type: nil, page_id: nil, pixel_id: nil, whatsapp_phone_number: nil) - # The object this ad set promotes (pixel, page, etc.). - # - # @param custom_conversion_id [String, nil] Custom conversion rule ID (numeric, from Meta Events Manager). - # - # @param custom_event_str [String, nil] Pixel event name, used when custom_event_type is OTHER. - # - # @param custom_event_type [String, nil] Custom event type (e.g., PURCHASE, COMPLETE_REGISTRATION, OTHER). - # - # @param page_id [String, nil] Facebook Page ID. - # - # @param pixel_id [String, nil] Meta Pixel ID for conversion tracking. - # - # @param whatsapp_phone_number [String, nil] WhatsApp phone number for messaging campaigns. - end + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::START_TRIAL } - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#status - module Status - extend WhopSDK::Internal::Type::Enum + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::SUBMIT_APPLICATION } - ACTIVE = :ACTIVE - PAUSED = :PAUSED + variant const: -> { WhopSDK::Models::AdGroupUpdateParams::ConversionEvent::SUBSCRIBE } - # @!method self.values - # @return [Array] - end + variant String - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta#targeting_automation - class TargetingAutomation < WhopSDK::Internal::Type::BaseModel - # @!attribute advantage_audience - # 0 = off (use exact targeting), 1 = on (let Meta expand audience). - # - # @return [Integer, nil] - optional :advantage_audience, Integer, nil?: true + # @!method self.variants + # @return [Array(Symbol, String)] - # @!method initialize(advantage_audience: nil) - # Advantage+ audience expansion settings. - # - # @param advantage_audience [Integer, nil] 0 = off (use exact targeting), 1 = on (let Meta expand audience). - end + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol, String) } end - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig#tiktok - class Tiktok < WhopSDK::Internal::Type::BaseModel - # @!attribute actions - # - # @return [Array, nil] - optional :actions, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action] - }, - nil?: true - - # @!attribute age_groups - # - # @return [Array, nil] - optional :age_groups, - -> { - WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup] - }, - nil?: true - - # @!attribute app_id - # App ID for app promotion campaigns. - # - # @return [String, nil] - optional :app_id, String, nil?: true - - # @!attribute attribution_event_count - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount, nil] - optional :attribution_event_count, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount }, - nil?: true - - # @!attribute audience_ids - # - # @return [Array, nil] - optional :audience_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute audience_rule - # Represents untyped JSON - # - # @return [Hash{Symbol=>Object}, nil] - optional :audience_rule, - WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], - nil?: true - - # @!attribute audience_type - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType, nil] - optional :audience_type, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType }, - nil?: true - - # @!attribute bid_price - # Bid price (cost per result for Cost Cap). - # - # @return [Float, nil] - optional :bid_price, Float, nil?: true - - # @!attribute bid_type - # Bidding strategy (BID_TYPE_NO_BID, BID_TYPE_CUSTOM). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType, nil] - optional :bid_type, - enum: -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType - }, - nil?: true - - # @!attribute billing_event - # How you are billed on TikTok (CPC, CPM, OCPM, CPV). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent, nil] - optional :billing_event, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent }, - nil?: true - - # @!attribute brand_safety_type - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType, nil] - optional :brand_safety_type, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType }, - nil?: true - - # @!attribute budget_mode - # Budget mode (BUDGET_MODE_DAY, BUDGET_MODE_TOTAL, - # BUDGET_MODE_DYNAMIC_DAILY_BUDGET). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode, nil] - optional :budget_mode, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode }, - nil?: true - - # @!attribute carrier_ids - # - # @return [Array, nil] - optional :carrier_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute category_exclusion_ids - # - # @return [Array, nil] - optional :category_exclusion_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute click_attribution_window - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow, nil] - optional :click_attribution_window, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow }, - nil?: true - - # @!attribute comment_disabled - # Represents `true` or `false` values. - # - # @return [Boolean, nil] - optional :comment_disabled, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute contextual_tag_ids - # - # @return [Array, nil] - optional :contextual_tag_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute conversion_bid_price - # Target cost per conversion for oCPM. - # - # @return [Float, nil] - optional :conversion_bid_price, Float, nil?: true - - # @!attribute creative_material_mode - # Creative delivery strategy. - # - # @return [String, nil] - optional :creative_material_mode, String, nil?: true - - # @!attribute dayparting - # Ad delivery schedule (48x7 character string). - # - # @return [String, nil] - optional :dayparting, String, nil?: true - - # @!attribute deep_funnel_event_source - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :deep_funnel_event_source, String, nil?: true - - # @!attribute deep_funnel_event_source_id - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :deep_funnel_event_source_id, String, nil?: true - - # @!attribute deep_funnel_optimization_status - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus, nil] - optional :deep_funnel_optimization_status, - enum: -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus - }, - nil?: true - - # @!attribute device_model_ids - # - # @return [Array, nil] - optional :device_model_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute device_price_ranges - # - # @return [Array, nil] - optional :device_price_ranges, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute engaged_view_attribution_window - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow, nil] - optional :engaged_view_attribution_window, - enum: -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow - }, - nil?: true - - # @!attribute excluded_audience_ids - # - # @return [Array, nil] - optional :excluded_audience_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute excluded_location_ids - # TikTok location/region IDs to exclude. - # - # @return [Array, nil] - optional :excluded_location_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute frequency - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - # - # @return [Integer, nil] - optional :frequency, Integer, nil?: true - - # @!attribute frequency_schedule - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - # - # @return [Integer, nil] - optional :frequency_schedule, Integer, nil?: true - - # @!attribute gender - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender, nil] - optional :gender, - enum: -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender - }, - nil?: true - - # @!attribute identity_authorized_bc_id - # Business Center ID for BC_AUTH_TT identity. - # - # @return [String, nil] - optional :identity_authorized_bc_id, String, nil?: true - - # @!attribute identity_id - # TikTok identity ID for the ad group. - # - # @return [String, nil] - optional :identity_id, String, nil?: true - - # @!attribute identity_type - # Identity type (AUTH_CODE, TT_USER, BC_AUTH_TT). - # - # @return [String, nil] - optional :identity_type, String, nil?: true - - # @!attribute instant_form_config - # Instant form configuration for lead generation campaigns. - # - # @return [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig, nil] - optional :instant_form_config, - -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig }, - nil?: true - - # @!attribute instant_form_id - # TikTok instant form ID (set automatically when instant_form_config is provided). - # - # @return [String, nil] - optional :instant_form_id, String, nil?: true - - # @!attribute interest_category_ids - # - # @return [Array, nil] - optional :interest_category_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute interest_keyword_ids - # - # @return [Array, nil] - optional :interest_keyword_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute inventory_filter_enabled - # Represents `true` or `false` values. - # - # @return [Boolean, nil] - optional :inventory_filter_enabled, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute ios14_targeting - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting, nil] - optional :ios14_targeting, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting }, - nil?: true - - # @!attribute isp_ids - # - # @return [Array, nil] - optional :isp_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute languages - # - # @return [Array, nil] - optional :languages, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute location_ids - # TikTok location/region IDs for geo targeting. - # - # @return [Array, nil] - optional :location_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute min_android_version - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :min_android_version, String, nil?: true - - # @!attribute min_ios_version - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :min_ios_version, String, nil?: true - - # @!attribute network_types - # - # @return [Array, nil] - optional :network_types, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute operating_systems - # - # @return [Array, nil] - optional :operating_systems, - -> { - WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperatingSystem] - }, - nil?: true - - # @!attribute operation_status - # Initial status (ENABLE, DISABLE). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus, nil] - optional :operation_status, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus }, - nil?: true - - # @!attribute optimization_event - # Conversion event (e.g., COMPLETE_PAYMENT). - # - # @return [String, nil] - optional :optimization_event, String, nil?: true - - # @!attribute optimization_goal - # What this ad group optimizes for on TikTok. - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal, nil] - optional :optimization_goal, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal }, - nil?: true - - # @!attribute pacing - # Budget pacing (PACING_MODE_SMOOTH, PACING_MODE_FAST). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing, nil] - optional :pacing, - enum: -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing - }, - nil?: true - - # @!attribute pangle_audience_package_exclude_ids - # - # @return [Array, nil] - optional :pangle_audience_package_exclude_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute pangle_audience_package_include_ids - # - # @return [Array, nil] - optional :pangle_audience_package_include_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute pangle_block_app_ids - # - # @return [Array, nil] - optional :pangle_block_app_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute pixel_id - # TikTok Pixel ID for conversion tracking. - # - # @return [String, nil] - optional :pixel_id, String, nil?: true - - # @!attribute placement_type - # Placement strategy (PLACEMENT_TYPE_AUTOMATIC, PLACEMENT_TYPE_NORMAL). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType, nil] - optional :placement_type, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType }, - nil?: true - - # @!attribute placements - # Placements (PLACEMENT_TIKTOK, PLACEMENT_PANGLE, etc.). - # - # @return [Array, nil] - optional :placements, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute product_set_id - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :product_set_id, String, nil?: true - - # @!attribute product_source - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource, nil] - optional :product_source, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource }, - nil?: true - - # @!attribute promotion_type - # Promotion type (optimization location). - # - # @return [String, nil] - optional :promotion_type, String, nil?: true - - # @!attribute schedule_end_time - # Schedule end time (UTC, YYYY-MM-DD HH:MM:SS). - # - # @return [String, nil] - optional :schedule_end_time, String, nil?: true - - # @!attribute schedule_start_time - # Schedule start time (UTC, YYYY-MM-DD HH:MM:SS). - # - # @return [String, nil] - optional :schedule_start_time, String, nil?: true - - # @!attribute schedule_type - # Schedule type (SCHEDULE_START_END, SCHEDULE_FROM_NOW). - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType, nil] - optional :schedule_type, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType }, - nil?: true - - # @!attribute secondary_optimization_event - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :secondary_optimization_event, String, nil?: true - - # @!attribute shopping_ads_retargeting_actions_days - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - # - # @return [Integer, nil] - optional :shopping_ads_retargeting_actions_days, Integer, nil?: true - - # @!attribute shopping_ads_retargeting_type - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType, nil] - optional :shopping_ads_retargeting_type, - enum: -> { - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType - }, - nil?: true - - # @!attribute spending_power - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower, nil] - optional :spending_power, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower }, - nil?: true - - # @!attribute tiktok_subplacements - # TikTok subplacements (IN_FEED, SEARCH_FEED, etc.). - # - # @return [Array, nil] - optional :tiktok_subplacements, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute vertical_sensitivity_id - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - # - # @return [String, nil] - optional :vertical_sensitivity_id, String, nil?: true - - # @!attribute video_download_disabled - # Represents `true` or `false` values. - # - # @return [Boolean, nil] - optional :video_download_disabled, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute video_user_actions - # - # @return [Array, nil] - optional :video_user_actions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute view_attribution_window - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow, nil] - optional :view_attribution_window, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow }, - nil?: true - - # @!method initialize(actions: nil, age_groups: nil, app_id: nil, attribution_event_count: nil, audience_ids: nil, audience_rule: nil, audience_type: nil, bid_price: nil, bid_type: nil, billing_event: nil, brand_safety_type: nil, budget_mode: nil, carrier_ids: nil, category_exclusion_ids: nil, click_attribution_window: nil, comment_disabled: nil, contextual_tag_ids: nil, conversion_bid_price: nil, creative_material_mode: nil, dayparting: nil, deep_funnel_event_source: nil, deep_funnel_event_source_id: nil, deep_funnel_optimization_status: nil, device_model_ids: nil, device_price_ranges: nil, engaged_view_attribution_window: nil, excluded_audience_ids: nil, excluded_location_ids: nil, frequency: nil, frequency_schedule: nil, gender: nil, identity_authorized_bc_id: nil, identity_id: nil, identity_type: nil, instant_form_config: nil, instant_form_id: nil, interest_category_ids: nil, interest_keyword_ids: nil, inventory_filter_enabled: nil, ios14_targeting: nil, isp_ids: nil, languages: nil, location_ids: nil, min_android_version: nil, min_ios_version: nil, network_types: nil, operating_systems: nil, operation_status: nil, optimization_event: nil, optimization_goal: nil, pacing: nil, pangle_audience_package_exclude_ids: nil, pangle_audience_package_include_ids: nil, pangle_block_app_ids: nil, pixel_id: nil, placement_type: nil, placements: nil, product_set_id: nil, product_source: nil, promotion_type: nil, schedule_end_time: nil, schedule_start_time: nil, schedule_type: nil, secondary_optimization_event: nil, shopping_ads_retargeting_actions_days: nil, shopping_ads_retargeting_type: nil, spending_power: nil, tiktok_subplacements: nil, vertical_sensitivity_id: nil, video_download_disabled: nil, video_user_actions: nil, view_attribution_window: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok} for more details. - # - # TikTok ad group configuration. - # - # @param actions [Array, nil] - # - # @param age_groups [Array, nil] - # - # @param app_id [String, nil] App ID for app promotion campaigns. - # - # @param attribution_event_count [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount, nil] - # - # @param audience_ids [Array, nil] - # - # @param audience_rule [Hash{Symbol=>Object}, nil] Represents untyped JSON - # - # @param audience_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType, nil] - # - # @param bid_price [Float, nil] Bid price (cost per result for Cost Cap). - # - # @param bid_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType, nil] Bidding strategy (BID_TYPE_NO_BID, BID_TYPE_CUSTOM). - # - # @param billing_event [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent, nil] How you are billed on TikTok (CPC, CPM, OCPM, CPV). - # - # @param brand_safety_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType, nil] - # - # @param budget_mode [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode, nil] Budget mode (BUDGET_MODE_DAY, BUDGET_MODE_TOTAL, BUDGET_MODE_DYNAMIC_DAILY_BUDGE - # - # @param carrier_ids [Array, nil] - # - # @param category_exclusion_ids [Array, nil] - # - # @param click_attribution_window [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow, nil] - # - # @param comment_disabled [Boolean, nil] Represents `true` or `false` values. - # - # @param contextual_tag_ids [Array, nil] - # - # @param conversion_bid_price [Float, nil] Target cost per conversion for oCPM. - # - # @param creative_material_mode [String, nil] Creative delivery strategy. - # - # @param dayparting [String, nil] Ad delivery schedule (48x7 character string). - # - # @param deep_funnel_event_source [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param deep_funnel_event_source_id [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param deep_funnel_optimization_status [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus, nil] - # - # @param device_model_ids [Array, nil] - # - # @param device_price_ranges [Array, nil] - # - # @param engaged_view_attribution_window [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow, nil] - # - # @param excluded_audience_ids [Array, nil] - # - # @param excluded_location_ids [Array, nil] TikTok location/region IDs to exclude. - # - # @param frequency [Integer, nil] Represents non-fractional signed whole numeric values. Int can represent values - # - # @param frequency_schedule [Integer, nil] Represents non-fractional signed whole numeric values. Int can represent values - # - # @param gender [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender, nil] - # - # @param identity_authorized_bc_id [String, nil] Business Center ID for BC_AUTH_TT identity. - # - # @param identity_id [String, nil] TikTok identity ID for the ad group. - # - # @param identity_type [String, nil] Identity type (AUTH_CODE, TT_USER, BC_AUTH_TT). - # - # @param instant_form_config [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig, nil] Instant form configuration for lead generation campaigns. - # - # @param instant_form_id [String, nil] TikTok instant form ID (set automatically when instant_form_config is provided). - # - # @param interest_category_ids [Array, nil] - # - # @param interest_keyword_ids [Array, nil] - # - # @param inventory_filter_enabled [Boolean, nil] Represents `true` or `false` values. - # - # @param ios14_targeting [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting, nil] - # - # @param isp_ids [Array, nil] - # - # @param languages [Array, nil] - # - # @param location_ids [Array, nil] TikTok location/region IDs for geo targeting. - # - # @param min_android_version [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param min_ios_version [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param network_types [Array, nil] - # - # @param operating_systems [Array, nil] - # - # @param operation_status [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus, nil] Initial status (ENABLE, DISABLE). - # - # @param optimization_event [String, nil] Conversion event (e.g., COMPLETE_PAYMENT). - # - # @param optimization_goal [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal, nil] What this ad group optimizes for on TikTok. - # - # @param pacing [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing, nil] Budget pacing (PACING_MODE_SMOOTH, PACING_MODE_FAST). - # - # @param pangle_audience_package_exclude_ids [Array, nil] - # - # @param pangle_audience_package_include_ids [Array, nil] - # - # @param pangle_block_app_ids [Array, nil] - # - # @param pixel_id [String, nil] TikTok Pixel ID for conversion tracking. - # - # @param placement_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType, nil] Placement strategy (PLACEMENT_TYPE_AUTOMATIC, PLACEMENT_TYPE_NORMAL). - # - # @param placements [Array, nil] Placements (PLACEMENT_TIKTOK, PLACEMENT_PANGLE, etc.). - # - # @param product_set_id [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param product_source [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource, nil] - # - # @param promotion_type [String, nil] Promotion type (optimization location). - # - # @param schedule_end_time [String, nil] Schedule end time (UTC, YYYY-MM-DD HH:MM:SS). - # - # @param schedule_start_time [String, nil] Schedule start time (UTC, YYYY-MM-DD HH:MM:SS). - # - # @param schedule_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType, nil] Schedule type (SCHEDULE_START_END, SCHEDULE_FROM_NOW). - # - # @param secondary_optimization_event [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param shopping_ads_retargeting_actions_days [Integer, nil] Represents non-fractional signed whole numeric values. Int can represent values - # - # @param shopping_ads_retargeting_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType, nil] - # - # @param spending_power [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower, nil] - # - # @param tiktok_subplacements [Array, nil] TikTok subplacements (IN_FEED, SEARCH_FEED, etc.). - # - # @param vertical_sensitivity_id [String, nil] Represents textual data as UTF-8 character sequences. This type is most often us - # - # @param video_download_disabled [Boolean, nil] Represents `true` or `false` values. - # - # @param video_user_actions [Array, nil] - # - # @param view_attribution_window [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow, nil] - - class Action < WhopSDK::Internal::Type::BaseModel - # @!attribute action_category_ids - # Behavioral category IDs. Use /tool/action_category/ to list them. - # - # @return [Array, nil] - optional :action_category_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute action_period - # Lookback window in days. TikTok accepts 7, 15, 30, 60, 90, or 180. - # - # @return [Integer, nil] - optional :action_period, Integer, nil?: true - - # @!attribute action_scene - # The category of TikTok content a behavioral targeting rule applies to. See - # docs/tiktok_api/ad_group.md § actions. - # - # @return [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene, nil] - optional :action_scene, - enum: -> { WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene }, - nil?: true - - # @!attribute video_user_actions - # Specific video interactions (WATCHED_TO_END, LIKED, COMMENTED, SHARED, FOLLOWED, - # PROFILE_VISITED). - # - # @return [Array, nil] - optional :video_user_actions, - -> { - WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction] - }, - nil?: true - - # @!method initialize(action_category_ids: nil, action_period: nil, action_scene: nil, video_user_actions: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action} for more - # details. - # - # A single TikTok behavioral targeting entry. One category of past user behavior - # (what they did, over what window, on which kind of content). See - # docs/tiktok_api/ad_group.md § actions. - # - # @param action_category_ids [Array, nil] Behavioral category IDs. Use /tool/action_category/ to list them. - # - # @param action_period [Integer, nil] Lookback window in days. TikTok accepts 7, 15, 30, 60, 90, or 180. - # - # @param action_scene [Symbol, WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene, nil] The category of TikTok content a behavioral targeting rule applies to. See docs/ - # - # @param video_user_actions [Array, nil] Specific video interactions (WATCHED_TO_END, LIKED, COMMENTED, SHARED, FOLLOWED, - - # The category of TikTok content a behavioral targeting rule applies to. See - # docs/tiktok_api/ad_group.md § actions. - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action#action_scene - module ActionScene - extend WhopSDK::Internal::Type::Enum - - VIDEO_RELATED = :VIDEO_RELATED - CREATOR_RELATED = :CREATOR_RELATED - HASHTAG_RELATED = :HASHTAG_RELATED - LIVE_RELATED = :LIVE_RELATED - - # @!method self.values - # @return [Array] - end - - # Specific past video interactions used for behavioral targeting. See - # docs/tiktok_api/ad_group.md § actions.video_user_actions. - module VideoUserAction - extend WhopSDK::Internal::Type::Enum - - WATCHED_TO_END = :WATCHED_TO_END - LIKED = :LIKED - COMMENTED = :COMMENTED - SHARED = :SHARED - FOLLOWED = :FOLLOWED - PROFILE_VISITED = :PROFILE_VISITED - - # @!method self.values - # @return [Array] - end - end - - # Age groups targetable on TikTok. See docs/tiktok_api/ad_group.md § age_groups. - module AgeGroup - extend WhopSDK::Internal::Type::Enum - - AGE_13_17 = :AGE_13_17 - AGE_18_24 = :AGE_18_24 - AGE_25_34 = :AGE_25_34 - AGE_35_44 = :AGE_35_44 - AGE_45_54 = :AGE_45_54 - AGE_55_100 = :AGE_55_100 - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#attribution_event_count - module AttributionEventCount - extend WhopSDK::Internal::Type::Enum - - UNSET = :UNSET - EVERY = :EVERY - ONCE = :ONCE - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#audience_type - module AudienceType - extend WhopSDK::Internal::Type::Enum - - NORMAL = :NORMAL - SMART_INTERESTS_BEHAVIORS = :SMART_INTERESTS_BEHAVIORS - - # @!method self.values - # @return [Array] - end - - # Bidding strategy (BID_TYPE_NO_BID, BID_TYPE_CUSTOM). - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#bid_type - module BidType - extend WhopSDK::Internal::Type::Enum - - BID_TYPE_NO_BID = :BID_TYPE_NO_BID - BID_TYPE_CUSTOM = :BID_TYPE_CUSTOM - - # @!method self.values - # @return [Array] - end - - # How you are billed on TikTok (CPC, CPM, OCPM, CPV). - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#billing_event - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - CPC = :CPC - CPM = :CPM - OCPM = :OCPM - CPV = :CPV - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#brand_safety_type - module BrandSafetyType - extend WhopSDK::Internal::Type::Enum - - NO_BRAND_SAFETY = :NO_BRAND_SAFETY - STANDARD_INVENTORY = :STANDARD_INVENTORY - LIMITED_INVENTORY = :LIMITED_INVENTORY - FULL_INVENTORY = :FULL_INVENTORY - EXPANDED_INVENTORY = :EXPANDED_INVENTORY - - # @!method self.values - # @return [Array] - end - - # Budget mode (BUDGET_MODE_DAY, BUDGET_MODE_TOTAL, - # BUDGET_MODE_DYNAMIC_DAILY_BUDGET). - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#budget_mode - module BudgetMode - extend WhopSDK::Internal::Type::Enum - - BUDGET_MODE_DAY = :BUDGET_MODE_DAY - BUDGET_MODE_TOTAL = :BUDGET_MODE_TOTAL - BUDGET_MODE_DYNAMIC_DAILY_BUDGET = :BUDGET_MODE_DYNAMIC_DAILY_BUDGET - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#click_attribution_window - module ClickAttributionWindow - extend WhopSDK::Internal::Type::Enum - - OFF = :OFF - ONE_DAY = :ONE_DAY - SEVEN_DAYS = :SEVEN_DAYS - FOURTEEN_DAYS = :FOURTEEN_DAYS - TWENTY_EIGHT_DAYS = :TWENTY_EIGHT_DAYS - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#deep_funnel_optimization_status - module DeepFunnelOptimizationStatus - extend WhopSDK::Internal::Type::Enum - - ON = :ON - OFF = :OFF - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#engaged_view_attribution_window - module EngagedViewAttributionWindow - extend WhopSDK::Internal::Type::Enum - - OFF = :OFF - ONE_DAY = :ONE_DAY - SEVEN_DAYS = :SEVEN_DAYS - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#gender - module Gender - extend WhopSDK::Internal::Type::Enum - - GENDER_UNLIMITED = :GENDER_UNLIMITED - GENDER_MALE = :GENDER_MALE - GENDER_FEMALE = :GENDER_FEMALE - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#instant_form_config - class InstantFormConfig < WhopSDK::Internal::Type::BaseModel - # @!attribute privacy_policy_url - # URL to your privacy policy. - # - # @return [String] - required :privacy_policy_url, String - - # @!attribute questions - # Form questions (at least one required). - # - # @return [Array] - required :questions, - -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question] } - - # @!attribute button_text - # Submit button text. - # - # @return [String, nil] - optional :button_text, String, nil?: true - - # @!attribute greeting - # Greeting text shown at the top of the form. - # - # @return [String, nil] - optional :greeting, String, nil?: true - - # @!attribute name - # Form name. Auto-generated if omitted. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!method initialize(privacy_policy_url:, questions:, button_text: nil, greeting: nil, name: nil) - # Instant form configuration for lead generation campaigns. - # - # @param privacy_policy_url [String] URL to your privacy policy. - # - # @param questions [Array] Form questions (at least one required). - # - # @param button_text [String, nil] Submit button text. - # - # @param greeting [String, nil] Greeting text shown at the top of the form. - # - # @param name [String, nil] Form name. Auto-generated if omitted. - - class Question < WhopSDK::Internal::Type::BaseModel - # @!attribute field_type - # Question type (EMAIL, PHONE_NUMBER, NAME, CUSTOM). - # - # @return [String] - required :field_type, String - - # @!attribute label - # Custom label for the question. - # - # @return [String, nil] - optional :label, String, nil?: true - - # @!method initialize(field_type:, label: nil) - # A question for a TikTok instant form. - # - # @param field_type [String] Question type (EMAIL, PHONE_NUMBER, NAME, CUSTOM). - # - # @param label [String, nil] Custom label for the question. - end - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#ios14_targeting - module Ios14Targeting - extend WhopSDK::Internal::Type::Enum - - UNSET = :UNSET - IOS14_MINUS = :IOS14_MINUS - IOS14_PLUS = :IOS14_PLUS - ALL = :ALL - - # @!method self.values - # @return [Array] - end - - # Device operating systems targetable on TikTok. See docs/tiktok_api/ad_group.md § - # operating_systems. - module OperatingSystem - extend WhopSDK::Internal::Type::Enum - - ANDROID = :ANDROID - IOS = :IOS - - # @!method self.values - # @return [Array] - end - - # Initial status (ENABLE, DISABLE). - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#operation_status - module OperationStatus - extend WhopSDK::Internal::Type::Enum - - ENABLE = :ENABLE - DISABLE = :DISABLE - - # @!method self.values - # @return [Array] - end - - # What this ad group optimizes for on TikTok. - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#optimization_goal - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum - - CLICK = :CLICK - CONVERT = :CONVERT - INSTALL = :INSTALL - IN_APP_EVENT = :IN_APP_EVENT - REACH = :REACH - SHOW = :SHOW - VIDEO_VIEW = :VIDEO_VIEW - ENGAGED_VIEW = :ENGAGED_VIEW - ENGAGED_VIEW_FIFTEEN = :ENGAGED_VIEW_FIFTEEN - LEAD_GENERATION = :LEAD_GENERATION - PREFERRED_LEAD = :PREFERRED_LEAD - CONVERSATION = :CONVERSATION - FOLLOWERS = :FOLLOWERS - PROFILE_VIEWS = :PROFILE_VIEWS - PAGE_VISIT = :PAGE_VISIT - VALUE = :VALUE - AUTOMATIC_VALUE_OPTIMIZATION = :AUTOMATIC_VALUE_OPTIMIZATION - TRAFFIC_LANDING_PAGE_VIEW = :TRAFFIC_LANDING_PAGE_VIEW - DESTINATION_VISIT = :DESTINATION_VISIT - MT_LIVE_ROOM = :MT_LIVE_ROOM - PRODUCT_CLICK_IN_LIVE = :PRODUCT_CLICK_IN_LIVE - - # @!method self.values - # @return [Array] - end - - # Budget pacing (PACING_MODE_SMOOTH, PACING_MODE_FAST). - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#pacing - module Pacing - extend WhopSDK::Internal::Type::Enum - - PACING_MODE_SMOOTH = :PACING_MODE_SMOOTH - PACING_MODE_FAST = :PACING_MODE_FAST - - # @!method self.values - # @return [Array] - end - - # Placement strategy (PLACEMENT_TYPE_AUTOMATIC, PLACEMENT_TYPE_NORMAL). - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#placement_type - module PlacementType - extend WhopSDK::Internal::Type::Enum - - PLACEMENT_TYPE_AUTOMATIC = :PLACEMENT_TYPE_AUTOMATIC - PLACEMENT_TYPE_NORMAL = :PLACEMENT_TYPE_NORMAL - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#product_source - module ProductSource - extend WhopSDK::Internal::Type::Enum - - CATALOG = :CATALOG - STORE = :STORE - SHOWCASE = :SHOWCASE - - # @!method self.values - # @return [Array] - end - - # Schedule type (SCHEDULE_START_END, SCHEDULE_FROM_NOW). - # - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#schedule_type - module ScheduleType - extend WhopSDK::Internal::Type::Enum - - SCHEDULE_START_END = :SCHEDULE_START_END - SCHEDULE_FROM_NOW = :SCHEDULE_FROM_NOW - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#shopping_ads_retargeting_type - module ShoppingAdsRetargetingType - extend WhopSDK::Internal::Type::Enum - - OFF = :OFF - LAB1 = :LAB1 - LAB2 = :LAB2 - LAB3 = :LAB3 - LAB4 = :LAB4 - LAB5 = :LAB5 + # @!group + + PURCHASE = :purchase + ADD_TO_CART = :add_to_cart + INITIATED_CHECKOUT = :initiated_checkout + ADD_PAYMENT_INFO = :add_payment_info + COMPLETE_REGISTRATION = :complete_registration + LEAD = :lead + CONTENT_VIEW = :content_view + SEARCH = :search + CONTACT = :contact + CUSTOMIZE_PRODUCT = :customize_product + DONATE = :donate + FIND_LOCATION = :find_location + SCHEDULE = :schedule + START_TRIAL = :start_trial + SUBMIT_APPLICATION = :submit_application + SUBSCRIBE = :subscribe + + # @!endgroup + end - # @!method self.values - # @return [Array] - end + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + module ConversionLocation + extend WhopSDK::Internal::Type::Enum + + WEBSITE = :website + PROFILE = :profile + MESSAGING = :messaging + ON_AD = :on_ad + INSTANT_FORMS = :instant_forms + INSTANT_FORMS_AND_MESSENGER = :instant_forms_and_messenger + WEBSITE_AND_INSTANT_FORMS = :website_and_instant_forms + + # @!method self.values + # @return [Array] + end - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#spending_power - module SpendingPower - extend WhopSDK::Internal::Type::Enum + module MessageApp + extend WhopSDK::Internal::Type::Enum - ALL = :ALL - HIGH = :HIGH + MESSENGER = :messenger + INSTAGRAM = :instagram + WHATSAPP = :whatsapp - # @!method self.values - # @return [Array] - end + # @!method self.values + # @return [Array] + end - # @see WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok#view_attribution_window - module ViewAttributionWindow - extend WhopSDK::Internal::Type::Enum + # Initial status (default: active). + module Status + extend WhopSDK::Internal::Type::Enum - OFF = :OFF - ONE_DAY = :ONE_DAY - SEVEN_DAYS = :SEVEN_DAYS + ACTIVE = :active + PAUSED = :paused - # @!method self.values - # @return [Array] - end - end + # @!method self.values + # @return [Array] end end end diff --git a/lib/whop_sdk/models/ad_list_params.rb b/lib/whop_sdk/models/ad_list_params.rb index 2236de15..7f5198ae 100644 --- a/lib/whop_sdk/models/ad_list_params.rb +++ b/lib/whop_sdk/models/ad_list_params.rb @@ -7,199 +7,190 @@ 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. + # @!attribute account_id + # The account the ads belong to. Defaults to the account-scoped key's own account. # # @return [String, nil] - optional :ad_campaign_id, String, nil?: true + optional :account_id, String - # @!attribute ad_campaign_ids - # Only return ads belonging to these ad campaigns (max 100). Can be combined with - # companyId or used on its own. + # @!attribute ad_campaign_id + # Only return ads in this ad campaign. # - # @return [Array, nil] - optional :ad_campaign_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + # @return [String, nil] + optional :ad_campaign_id, String # @!attribute ad_group_id - # Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or - # company_id. + # Only return ads in this ad group. # # @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 + optional :ad_group_id, String # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # Cursor to fetch the page after (from page_info.end_cursor). # # @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. - # - # @return [String, nil] - optional :before, String, nil?: true - - # @!attribute campaign_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, ad_campaign_id, or - # company_id. + # Cursor to fetch the page before (from page_info.start_cursor). # # @return [String, nil] - optional :company_id, String, nil?: true + optional :before, String # @!attribute created_after # Only return ads 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 ads 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. Defaults to desc. # - # @return [Symbol, WhopSDK::Models::Direction, nil] - optional :direction, enum: -> { WhopSDK::Direction }, nil?: true + # @return [Symbol, WhopSDK::Models::AdListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::AdListParams::Direction } # @!attribute first - # Returns the first _n_ elements from the list. + # The number of ads to return. # # @return [Integer, nil] - optional :first, Integer, nil?: true + optional :first, Integer # @!attribute last - # Returns the last _n_ elements from the list. + # The number of ads to return from the end of the range. # # @return [Integer, nil] - optional :last, Integer, nil?: true + optional :last, Integer # @!attribute order - # The fields ad resources can be ordered by. + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. # # @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. Deprecated — use AdOrder. - # - # @return [Symbol, WhopSDK::Models::AdListParams::OrderBy, nil] - optional :order_by, enum: -> { WhopSDK::AdListParams::OrderBy }, nil?: true - - # @!attribute order_direction - # The direction of the sort. - # - # @return [Symbol, WhopSDK::Models::Direction, nil] - optional :order_direction, enum: -> { WhopSDK::Direction }, nil?: true + optional :order, enum: -> { WhopSDK::AdListParams::Order } # @!attribute query - # Case-insensitive substring match against the ad title or ID. + # Filter ads by a title or ID substring. # # @return [String, nil] - optional :query, String, nil?: true + optional :query, String # @!attribute stats_from - # 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. + # Start of the stats window. Defaults to all-time. # - # @return [Time, nil] - optional :stats_from, Time, nil?: true + # @return [String, nil] + optional :stats_from, String # @!attribute stats_to - # 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. + # End of the stats window. Defaults to now. # - # @return [Time, nil] - optional :stats_to, Time, nil?: true + # @return [String, nil] + optional :stats_to, String # @!attribute status - # The status of an external ad. + # Only return ads with this status. # - # @return [Symbol, WhopSDK::Models::ExternalAdStatus, nil] - optional :status, enum: -> { WhopSDK::ExternalAdStatus }, nil?: true + # @return [Symbol, WhopSDK::Models::AdListParams::Status, nil] + optional :status, enum: -> { WhopSDK::AdListParams::Status } - # @!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: {}) + # @!attribute time_zone + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + # + # @return [String, nil] + optional :time_zone, String + + # @!method initialize(account_id: nil, ad_campaign_id: nil, ad_group_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, time_zone: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdListParams} for more details. # - # @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 account_id [String] The account the ads belong to. Defaults to the account-scoped key's own account. # - # @param ad_group_id [String, nil] Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or compa + # @param ad_campaign_id [String] Only return ads in this ad campaign. # - # @param ad_group_ids [Array, nil] Only return ads belonging to these ad groups (max 100). Can be combined with com + # @param ad_group_id [String] Only return ads in this ad group. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). # - # @param campaign_id [String, nil] Filter by campaign. + # @param created_after [String] Only return ads created after this timestamp. # - # @param company_id [String, nil] Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or compan + # @param created_before [String] Only return ads created before this timestamp. # - # @param created_after [Time, nil] Only return ads created after this timestamp. + # @param direction [Symbol, WhopSDK::Models::AdListParams::Direction] The sort direction. Defaults to desc. # - # @param created_before [Time, nil] Only return ads created before this timestamp. + # @param first [Integer] The number of ads to return. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param last [Integer] The number of ads to return from the end of the range. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param order [Symbol, WhopSDK::Models::AdListParams::Order] The field to sort by. Defaults to created_at. Stat columns (spend, impressions, # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param query [String] Filter ads by a title or ID substring. # - # @param order [Symbol, WhopSDK::Models::AdListParams::Order, nil] The fields ad resources can be ordered by. + # @param stats_from [String] Start of the stats window. Defaults to all-time. # - # @param order_by [Symbol, WhopSDK::Models::AdListParams::OrderBy, nil] Columns that the listAds query can sort by. Deprecated — use AdOrder. + # @param stats_to [String] End of the stats window. Defaults to now. # - # @param order_direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param status [Symbol, WhopSDK::Models::AdListParams::Status] Only return ads with this status. # - # @param query [String, nil] Case-insensitive substring match against the ad title or ID. - # - # @param stats_from [Time, nil] Inclusive start of the window for each ad's metric fields (spend, impressions, … - # - # @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 time_zone [String] IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare s # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - # The fields ad resources can be ordered by. + # The sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. module Order extend WhopSDK::Internal::Type::Enum CREATED_AT = :created_at + UPDATED_AT = :updated_at SPEND = :spend + IMPRESSIONS = :impressions + REACH = :reach + CLICKS = :clicks + UNIQUE_CLICKS = :unique_clicks + FREQUENCY = :frequency + CLICK_THROUGH_RATE = :click_through_rate + RESULTS = :results + COST_PER_MILLE = :cost_per_mille + COST_PER_CLICK = :cost_per_click + COST_PER_RESULT = :cost_per_result 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 + # Only return ads with this status. + module Status extend WhopSDK::Internal::Type::Enum - SPEND = :spend - RETURN_ON_AD_SPEND = :return_on_ad_spend - ROAS = :roas + ACTIVE = :active + PAUSED = :paused + IN_REVIEW = :in_review + REJECTED = :rejected # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/ad_list_response.rb b/lib/whop_sdk/models/ad_list_response.rb deleted file mode 100644 index cd2c173d..00000000 --- a/lib/whop_sdk/models/ad_list_response.rb +++ /dev/null @@ -1,357 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::Ads#list - class AdListResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for this ad. - # - # @return [String] - required :id, String - - # @!attribute ad_campaign - # The ad campaign this ad belongs to. - # - # @return [WhopSDK::Models::AdListResponse::AdCampaign] - required :ad_campaign, -> { WhopSDK::Models::AdListResponse::AdCampaign } - - # @!attribute ad_group - # The parent ad group this ad belongs to. - # - # @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. - # - # @return [Symbol, WhopSDK::Models::ExternalAdStatus] - required :status, enum: -> { WhopSDK::ExternalAdStatus } - - # @!attribute title - # The display title of the ad. Falls back to the creative set caption when unset. - # - # @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:, 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. - # - # @param ad_campaign [WhopSDK::Models::AdListResponse::AdCampaign] The ad campaign this ad belongs to. - # - # @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 - class AdCampaign < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for this ad campaign. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The ad campaign this ad belongs to. - # - # @param id [String] The unique identifier for this ad campaign. - end - - # @see WhopSDK::Models::AdListResponse#ad_group - class AdGroup < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for this ad group. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The parent ad group this ad belongs to. - # - # @param id [String] The unique identifier for this ad group. - 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 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 - - # @!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 category [Symbol, WhopSDK::Models::AdListResponse::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. - # - # @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. - # - # @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_retrieve_params.rb b/lib/whop_sdk/models/ad_retrieve_params.rb index 6d542ca0..5adddda6 100644 --- a/lib/whop_sdk/models/ad_retrieve_params.rb +++ b/lib/whop_sdk/models/ad_retrieve_params.rb @@ -13,28 +13,31 @@ class AdRetrieveParams < WhopSDK::Internal::Type::BaseModel required :id, String # @!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. + # Start of the stats window. # - # @return [Time, nil] - optional :stats_from, Time, nil?: true + # @return [String, nil] + optional :stats_from, String # @!attribute stats_to - # Inclusive end of the window for the ad's metric fields. Omit both statsFrom and - # statsTo for all-time stats. + # End of the stats window. # - # @return [Time, nil] - optional :stats_to, Time, nil?: true + # @return [String, nil] + optional :stats_to, String - # @!method initialize(id:, stats_from: nil, stats_to: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdRetrieveParams} for more details. + # @!attribute time_zone + # IANA timezone the stats window is interpreted in. Defaults to UTC. # + # @return [String, nil] + optional :time_zone, String + + # @!method initialize(id:, stats_from: nil, stats_to: nil, time_zone: nil, request_options: {}) # @param id [String] # - # @param stats_from [Time, nil] Inclusive start of the window for the ad's metric fields (spend, impressions, …) + # @param stats_from [String] Start of the stats window. + # + # @param stats_to [String] End of the stats window. # - # @param stats_to [Time, nil] Inclusive end of the window for the ad's metric fields. Omit both statsFrom and + # @param time_zone [String] IANA timezone the stats window is interpreted in. Defaults to UTC. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/whop_sdk/models/ad_update_params.rb b/lib/whop_sdk/models/ad_update_params.rb new file mode 100644 index 00000000..3153f33c --- /dev/null +++ b/lib/whop_sdk/models/ad_update_params.rb @@ -0,0 +1,650 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Ads#update + class AdUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute call_to_action + # The call-to-action button shown on the ad. + # + # @return [Symbol, WhopSDK::Models::AdUpdateParams::CallToAction, nil] + optional :call_to_action, enum: -> { WhopSDK::AdUpdateParams::CallToAction } + + # @!attribute creatives + # The ad's creative assets. Each entry is an uploaded file id with an optional + # format; omit format for the original asset. Replaces a live ad's creative on the + # platform. + # + # @return [Array, nil] + optional :creatives, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdUpdateParams::Creative] } + + # @!attribute descriptions + # The description variants shown on the ad. + # + # @return [Array, nil] + optional :descriptions, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute headlines + # The headline variants shown on the ad. + # + # @return [Array, nil] + optional :headlines, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute lead_form + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + # + # @return [WhopSDK::Models::AdUpdateParams::LeadForm, nil] + optional :lead_form, -> { WhopSDK::AdUpdateParams::LeadForm } + + # @!attribute lead_form_id + # Use an existing Meta instant form instead of creating one — the form's Meta id, + # from a form already on the ad's Facebook page. Only allowed when the ad group's + # conversion_location is an instant-form destination. Mutually exclusive with + # lead_form. Replaces a stored lead_form. + # + # @return [String, nil] + optional :lead_form_id, String + + # @!attribute messaging_config + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + # + # @return [WhopSDK::Models::AdUpdateParams::MessagingConfig, nil] + optional :messaging_config, -> { WhopSDK::AdUpdateParams::MessagingConfig } + + # @!attribute multi_advertiser_ads + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + # + # @return [Boolean, nil] + optional :multi_advertiser_ads, WhopSDK::Internal::Type::Boolean + + # @!attribute post_id + # Promote an existing post instead of uploading creatives — a Facebook post or + # Instagram media id. Mutually exclusive with creatives. Pair with post_source. + # + # @return [String, nil] + optional :post_id, String + + # @!attribute post_source + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + # + # @return [Symbol, WhopSDK::Models::AdUpdateParams::PostSource, nil] + optional :post_source, enum: -> { WhopSDK::AdUpdateParams::PostSource } + + # @!attribute primary_texts + # The primary text variants shown in the ad body. + # + # @return [Array, nil] + optional :primary_texts, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute social_accounts + # The social accounts the ad runs under. + # + # @return [Array, nil] + optional :social_accounts, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdUpdateParams::SocialAccount] } + + # @!attribute title + # The display name of the ad. + # + # @return [String, nil] + optional :title, String + + # @!attribute url + # The URL the ad links to. + # + # @return [String, nil] + optional :url, String + + # @!attribute url_parameters + # Query parameters appended to the destination URL, as a string-to-string map. + # + # @return [Object, nil] + optional :url_parameters, WhopSDK::Internal::Type::Unknown + + # @!method initialize(id:, call_to_action: nil, creatives: nil, descriptions: nil, headlines: nil, lead_form: nil, lead_form_id: nil, messaging_config: nil, multi_advertiser_ads: nil, post_id: nil, post_source: nil, primary_texts: nil, social_accounts: nil, title: nil, url: nil, url_parameters: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdUpdateParams} for more details. + # + # @param id [String] + # + # @param call_to_action [Symbol, WhopSDK::Models::AdUpdateParams::CallToAction] The call-to-action button shown on the ad. + # + # @param creatives [Array] The ad's creative assets. Each entry is an uploaded file id with an optional for + # + # @param descriptions [Array] The description variants shown on the ad. + # + # @param headlines [Array] The headline variants shown on the ad. + # + # @param lead_form [WhopSDK::Models::AdUpdateParams::LeadForm] Instant lead form for the ad. Only allowed when the ad group's conversion_locati + # + # @param lead_form_id [String] Use an existing Meta instant form instead of creating one — the form's Meta id, + # + # @param messaging_config [WhopSDK::Models::AdUpdateParams::MessagingConfig] Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # + # @param multi_advertiser_ads [Boolean] Whether the ad can appear alongside other advertisers' ads in the same unit. Def + # + # @param post_id [String] Promote an existing post instead of uploading creatives — a Facebook post or Ins + # + # @param post_source [Symbol, WhopSDK::Models::AdUpdateParams::PostSource] Which network post_id refers to — facebook (a page post) or instagram (a media i + # + # @param primary_texts [Array] The primary text variants shown in the ad body. + # + # @param social_accounts [Array] The social accounts the ad runs under. + # + # @param title [String] The display name of the ad. + # + # @param url [String] The URL the ad links to. + # + # @param url_parameters [Object] Query parameters appended to the destination URL, as a string-to-string map. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The call-to-action button shown on the ad. + module CallToAction + extend WhopSDK::Internal::Type::Enum + + APPLY_NOW = :apply_now + BOOK_NOW = :book_now + CALL_NOW = :call_now + CONTACT_US = :contact_us + DOWNLOAD = :download + GET_DIRECTIONS = :get_directions + GET_OFFER = :get_offer + GET_QUOTE = :get_quote + LEARN_MORE = :learn_more + LISTEN_NOW = :listen_now + MESSAGE_PAGE = :message_page + NO_BUTTON = :no_button + OPEN_LINK = :open_link + ORDER_NOW = :order_now + REQUEST_TIME = :request_time + SEE_DETAILS = :see_details + SEE_MENU = :see_menu + SEND_UPDATES = :send_updates + SHOP_NOW = :shop_now + SIGN_UP = :sign_up + SUBSCRIBE = :subscribe + WATCH_MORE = :watch_more + + # @!method self.values + # @return [Array] + end + + class Creative < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute crop + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + # + # @return [WhopSDK::Models::AdUpdateParams::Creative::Crop, nil] + optional :crop, -> { WhopSDK::AdUpdateParams::Creative::Crop } + + # @!attribute format_ + # + # @return [Symbol, WhopSDK::Models::AdUpdateParams::Creative::Format, nil] + optional :format_, enum: -> { WhopSDK::AdUpdateParams::Creative::Format }, api_name: :format + + # @!method initialize(id: nil, crop: nil, format_: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdUpdateParams::Creative} for more details. + # + # @param id [String] + # + # @param crop [WhopSDK::Models::AdUpdateParams::Creative::Crop] The saved crop window for this creative, in source image pixels. Omit it for the + # + # @param format_ [Symbol, WhopSDK::Models::AdUpdateParams::Creative::Format] + + # @see WhopSDK::Models::AdUpdateParams::Creative#crop + class Crop < WhopSDK::Internal::Type::BaseModel + # @!attribute height + # + # @return [Float, nil] + optional :height, Float + + # @!attribute width + # + # @return [Float, nil] + optional :width, Float + + # @!attribute x + # + # @return [Float, nil] + optional :x, Float + + # @!attribute y_ + # + # @return [Float, nil] + optional :y_, Float, api_name: :y + + # @!method initialize(height: nil, width: nil, x: nil, y_: nil) + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + # + # @param height [Float] + # @param width [Float] + # @param x [Float] + # @param y_ [Float] + end + + # @see WhopSDK::Models::AdUpdateParams::Creative#format_ + module Format + extend WhopSDK::Internal::Type::Enum + + SQUARE = :square + VERTICAL = :vertical + HORIZONTAL = :horizontal + + # @!method self.values + # @return [Array] + end + end + + class LeadForm < WhopSDK::Internal::Type::BaseModel + # @!attribute completion + # Optional completion screen shown after submission; url sets the follow-up + # website button. + # + # @return [WhopSDK::Models::AdUpdateParams::LeadForm::Completion, nil] + optional :completion, -> { WhopSDK::AdUpdateParams::LeadForm::Completion } + + # @!attribute disclaimer + # Optional custom consent disclaimer with checkboxes. + # + # @return [WhopSDK::Models::AdUpdateParams::LeadForm::Disclaimer, nil] + optional :disclaimer, -> { WhopSDK::AdUpdateParams::LeadForm::Disclaimer } + + # @!attribute form_type + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + # + # @return [Symbol, WhopSDK::Models::AdUpdateParams::LeadForm::FormType, nil] + optional :form_type, enum: -> { WhopSDK::AdUpdateParams::LeadForm::FormType } + + # @!attribute intro + # Optional intro screen shown before the questions. + # + # @return [WhopSDK::Models::AdUpdateParams::LeadForm::Intro, nil] + optional :intro, -> { WhopSDK::AdUpdateParams::LeadForm::Intro } + + # @!attribute name + # Internal name for the form. Auto-generated if omitted. + # + # @return [String, nil] + optional :name, String + + # @!attribute phone_verification + # Require SMS verification of the phone number (higher_intent forms). + # + # @return [Boolean, nil] + optional :phone_verification, WhopSDK::Internal::Type::Boolean + + # @!attribute privacy_policy + # Your privacy policy. url is required by Meta. + # + # @return [WhopSDK::Models::AdUpdateParams::LeadForm::PrivacyPolicy, nil] + optional :privacy_policy, -> { WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy } + + # @!attribute questions + # The questions on the form. Standard prefill types need only a type; a custom + # question needs a label and a format (plus options for multiple_choice). Options + # carry an optional key and answer-routing logic. + # + # @return [Array, nil] + optional :questions, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdUpdateParams::LeadForm::Question] } + + # @!method initialize(completion: nil, disclaimer: nil, form_type: nil, intro: nil, name: nil, phone_verification: nil, privacy_policy: nil, questions: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdUpdateParams::LeadForm} for more details. + # + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + # + # @param completion [WhopSDK::Models::AdUpdateParams::LeadForm::Completion] Optional completion screen shown after submission; url sets the follow-up websit + # + # @param disclaimer [WhopSDK::Models::AdUpdateParams::LeadForm::Disclaimer] Optional custom consent disclaimer with checkboxes. + # + # @param form_type [Symbol, WhopSDK::Models::AdUpdateParams::LeadForm::FormType] more_volume (default) is quickest to submit; higher_intent adds a confirmation s + # + # @param intro [WhopSDK::Models::AdUpdateParams::LeadForm::Intro] Optional intro screen shown before the questions. + # + # @param name [String] Internal name for the form. Auto-generated if omitted. + # + # @param phone_verification [Boolean] Require SMS verification of the phone number (higher_intent forms). + # + # @param privacy_policy [WhopSDK::Models::AdUpdateParams::LeadForm::PrivacyPolicy] Your privacy policy. url is required by Meta. + # + # @param questions [Array] The questions on the form. Standard prefill types need only a type; a custom que + + # @see WhopSDK::Models::AdUpdateParams::LeadForm#completion + class Completion < WhopSDK::Internal::Type::BaseModel + # @!attribute button_text + # + # @return [String, nil] + optional :button_text, String + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute headline + # + # @return [String, nil] + optional :headline, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(button_text: nil, description: nil, headline: nil, url: nil) + # Optional completion screen shown after submission; url sets the follow-up + # website button. + # + # @param button_text [String] + # @param description [String] + # @param headline [String] + # @param url [String] + end + + # @see WhopSDK::Models::AdUpdateParams::LeadForm#disclaimer + class Disclaimer < WhopSDK::Internal::Type::BaseModel + # @!attribute body + # + # @return [String, nil] + optional :body, String + + # @!attribute checkboxes + # + # @return [Array, nil] + optional :checkboxes, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox] } + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!method initialize(body: nil, checkboxes: nil, title: nil) + # Optional custom consent disclaimer with checkboxes. + # + # @param body [String] + # @param checkboxes [Array] + # @param title [String] + + class Checkbox < WhopSDK::Internal::Type::BaseModel + # @!attribute checked_by_default + # + # @return [Boolean, nil] + optional :checked_by_default, WhopSDK::Internal::Type::Boolean + + # @!attribute key + # + # @return [String, nil] + optional :key, String + + # @!attribute required + # + # @return [Boolean, nil] + optional :required, WhopSDK::Internal::Type::Boolean + + # @!attribute text + # + # @return [String, nil] + optional :text, String + + # @!method initialize(checked_by_default: nil, key: nil, required: nil, text: nil) + # @param checked_by_default [Boolean] + # @param key [String] + # @param required [Boolean] + # @param text [String] + end + end + + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + # + # @see WhopSDK::Models::AdUpdateParams::LeadForm#form_type + module FormType + extend WhopSDK::Internal::Type::Enum + + MORE_VOLUME = :more_volume + HIGHER_INTENT = :higher_intent + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::AdUpdateParams::LeadForm#intro + class Intro < WhopSDK::Internal::Type::BaseModel + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute headline + # + # @return [String, nil] + optional :headline, String + + # @!method initialize(description: nil, headline: nil) + # Optional intro screen shown before the questions. + # + # @param description [String] + # @param headline [String] + end + + # @see WhopSDK::Models::AdUpdateParams::LeadForm#privacy_policy + class PrivacyPolicy < WhopSDK::Internal::Type::BaseModel + # @!attribute link_text + # + # @return [String, nil] + optional :link_text, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(link_text: nil, url: nil) + # Your privacy policy. url is required by Meta. + # + # @param link_text [String] + # @param url [String] + end + + class Question < WhopSDK::Internal::Type::BaseModel + # @!attribute format_ + # + # @return [Symbol, WhopSDK::Models::AdUpdateParams::LeadForm::Question::Format, nil] + optional :format_, + enum: -> { + WhopSDK::AdUpdateParams::LeadForm::Question::Format + }, + api_name: :format + + # @!attribute label + # + # @return [String, nil] + optional :label, String + + # @!attribute options + # + # @return [Array, nil] + optional :options, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdUpdateParams::LeadForm::Question::Option] } + + # @!attribute type + # + # @return [Symbol, WhopSDK::Models::AdUpdateParams::LeadForm::Question::Type, nil] + optional :type, enum: -> { WhopSDK::AdUpdateParams::LeadForm::Question::Type } + + # @!method initialize(format_: nil, label: nil, options: nil, type: nil) + # @param format_ [Symbol, WhopSDK::Models::AdUpdateParams::LeadForm::Question::Format] + # @param label [String] + # @param options [Array] + # @param type [Symbol, WhopSDK::Models::AdUpdateParams::LeadForm::Question::Type] + + # @see WhopSDK::Models::AdUpdateParams::LeadForm::Question#format_ + module Format + extend WhopSDK::Internal::Type::Enum + + SHORT_ANSWER = :short_answer + MULTIPLE_CHOICE = :multiple_choice + APPOINTMENT = :appointment + + # @!method self.values + # @return [Array] + end + + class Option < WhopSDK::Internal::Type::BaseModel + # @!attribute key + # + # @return [String, nil] + optional :key, String + + # @!attribute logic + # + # @return [WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic, nil] + optional :logic, -> { WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic } + + # @!attribute value + # + # @return [String, nil] + optional :value, String + + # @!method initialize(key: nil, logic: nil, value: nil) + # @param key [String] + # @param logic [WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic] + # @param value [String] + + # @see WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option#logic + class Logic < WhopSDK::Internal::Type::BaseModel + # @!attribute action + # + # @return [Symbol, WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::Action, nil] + optional :action, enum: -> { WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action } + + # @!attribute target_end_page_index + # + # @return [Integer, nil] + optional :target_end_page_index, Integer + + # @!attribute target_question_index + # + # @return [Integer, nil] + optional :target_question_index, Integer + + # @!method initialize(action: nil, target_end_page_index: nil, target_question_index: nil) + # @param action [Symbol, WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::Action] + # @param target_end_page_index [Integer] + # @param target_question_index [Integer] + + # @see WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic#action + module Action + extend WhopSDK::Internal::Type::Enum + + GO_TO_QUESTION = :go_to_question + SUBMIT_FORM = :submit_form + CLOSE_FORM = :close_form + + # @!method self.values + # @return [Array] + end + end + end + + # @see WhopSDK::Models::AdUpdateParams::LeadForm::Question#type + module Type + extend WhopSDK::Internal::Type::Enum + + EMAIL = :email + PHONE = :phone + FULL_NAME = :full_name + FIRST_NAME = :first_name + LAST_NAME = :last_name + CITY = :city + STATE = :state + ZIP = :zip + COUNTRY = :country + STREET_ADDRESS = :street_address + JOB_TITLE = :job_title + COMPANY_NAME = :company_name + WORK_EMAIL = :work_email + WORK_PHONE_NUMBER = :work_phone_number + DOB = :dob + GENDER = :gender + MARITAL_STATUS = :marital_status + RELATIONSHIP_STATUS = :relationship_status + MILITARY_STATUS = :military_status + DATE_TIME = :date_time + CUSTOM = :custom + + # @!method self.values + # @return [Array] + end + end + end + + class MessagingConfig < WhopSDK::Internal::Type::BaseModel + # @!attribute keyword + # + # @return [String, nil] + optional :keyword, String + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!method initialize(keyword: nil, message: nil) + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + # + # @param keyword [String] + # @param message [String] + end + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + module PostSource + extend WhopSDK::Internal::Type::Enum + + FACEBOOK = :facebook + INSTAGRAM = :instagram + + # @!method self.values + # @return [Array] + end + + class SocialAccount < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!method initialize(id: nil) + # @param id [String] + end + end + end +end diff --git a/lib/whop_sdk/models/app.rb b/lib/whop_sdk/models/app.rb index e6fa5be1..84256b00 100644 --- a/lib/whop_sdk/models/app.rb +++ b/lib/whop_sdk/models/app.rb @@ -80,6 +80,13 @@ class App < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :experience_path, String, nil?: true + # @!attribute hosted_url + # The full canonical URL where this app's hosted web build is served. Null if the + # app has not claimed a route. + # + # @return [String, nil] + required :hosted_url, String, nil?: true + # @!attribute icon # The icon image for this app, displayed on the app store, product pages, # checkout, and as the default icon for experiences using this app. @@ -109,6 +116,13 @@ class App < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :origin, String, nil?: true + # @!attribute production_web_build + # The approved app build currently served to users on web. Null if no production + # build is deployed for web. + # + # @return [WhopSDK::Models::App::ProductionWebBuild, nil] + required :production_web_build, -> { WhopSDK::App::ProductionWebBuild }, nil?: true + # @!attribute redirect_uris # The whitelisted OAuth callback URLs that users are redirected to after # authorizing the app. @@ -124,6 +138,21 @@ class App < WhopSDK::Internal::Type::BaseModel required :requested_permissions, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::App::RequestedPermission] } + # @!attribute route + # The unique subdomain route where this app's hosted web builds are served, such + # as 'myapp' for myapp.whop.app. Null if the app has not claimed a route. + # + # @return [String, nil] + required :route, String, nil?: true + + # @!attribute secrets + # The app's secrets as an object of string values. Encrypted at rest and injected + # into the app's hosted server runtime as environment bindings. Requires the + # 'developer:update_app' permission. + # + # @return [Hash{Symbol=>Object}, nil] + required :secrets, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @!attribute skills_path # The URL path template for a specific view of this app, appended to the base # domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is @@ -154,7 +183,7 @@ class App < WhopSDK::Internal::Type::BaseModel # @return [Boolean] required :verified, WhopSDK::Internal::Type::Boolean - # @!method initialize(id:, api_key:, app_type:, base_url:, company:, creator:, dashboard_path:, description:, discover_path:, domain_id:, experience_path:, icon:, name:, openapi_path:, origin:, redirect_uris:, requested_permissions:, skills_path:, stats:, status:, verified:) + # @!method initialize(id:, api_key:, app_type:, base_url:, company:, creator:, dashboard_path:, description:, discover_path:, domain_id:, experience_path:, hosted_url:, icon:, name:, openapi_path:, origin:, production_web_build:, redirect_uris:, requested_permissions:, route:, secrets:, skills_path:, stats:, status:, verified:) # Some parameter documentations has been truncated, see {WhopSDK::Models::App} for # more details. # @@ -183,6 +212,8 @@ class App < WhopSDK::Internal::Type::BaseModel # # @param experience_path [String, nil] The URL path template for a specific view of this app, appended to the base doma # + # @param hosted_url [String, nil] The full canonical URL where this app's hosted web build is served. Null if the + # # @param icon [WhopSDK::Models::App::Icon, nil] The icon image for this app, displayed on the app store, product pages, checkout # # @param name [String] The display name of this app shown on the app store and in experience navigation @@ -191,10 +222,16 @@ class App < WhopSDK::Internal::Type::BaseModel # # @param origin [String, nil] The full origin URL for this app's proxied domain (e.g., 'https://myapp.apps.who # + # @param production_web_build [WhopSDK::Models::App::ProductionWebBuild, nil] The approved app build currently served to users on web. Null if no production b + # # @param redirect_uris [Array] The whitelisted OAuth callback URLs that users are redirected to after authorizi # # @param requested_permissions [Array] The list of permissions this app requests when installed, including both require # + # @param route [String, nil] The unique subdomain route where this app's hosted web builds are served, such a + # + # @param secrets [Hash{Symbol=>Object}, nil] The app's secrets as an object of string values. Encrypted at rest and injected + # # @param skills_path [String, nil] The URL path template for a specific view of this app, appended to the base doma # # @param stats [WhopSDK::Models::App::Stats, nil] Aggregate usage statistics for this app, including daily, weekly, and monthly ac @@ -305,6 +342,49 @@ class Icon < WhopSDK::Internal::Type::BaseModel # @param url [String, nil] A pre-optimized URL for rendering this attachment on the client. This should be end + # @see WhopSDK::Models::App#production_web_build + class ProductionWebBuild < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the app build. + # + # @return [String] + required :id, String + + # @!attribute checksum + # A SHA-256 hash of the uploaded build file, generated by the client and used to + # verify file integrity. + # + # @return [String] + required :checksum, String + + # @!attribute file_url + # A URL to download the app build as a .zip archive. + # + # @return [String] + required :file_url, String + + # @!attribute status + # The current review status of this build. + # + # @return [Symbol, WhopSDK::Models::AppBuildStatuses] + required :status, enum: -> { WhopSDK::AppBuildStatuses } + + # @!method initialize(id:, checksum:, file_url:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::App::ProductionWebBuild} for more details. + # + # The approved app build currently served to users on web. Null if no production + # build is deployed for web. + # + # @param id [String] The unique identifier for the app build. + # + # @param checksum [String] A SHA-256 hash of the uploaded build file, generated by the client and used to v + # + # @param file_url [String] A URL to download the app build as a .zip archive. + # + # @param status [Symbol, WhopSDK::Models::AppBuildStatuses] The current review status of this build. + end + class RequestedPermission < WhopSDK::Internal::Type::BaseModel # @!attribute is_required # Whether the action is required for the app to function. diff --git a/lib/whop_sdk/models/app_build_create_params.rb b/lib/whop_sdk/models/app_build_create_params.rb index 79e50dc5..95cc17b8 100644 --- a/lib/whop_sdk/models/app_build_create_params.rb +++ b/lib/whop_sdk/models/app_build_create_params.rb @@ -10,7 +10,7 @@ class AppBuildCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute attachment # The build file to upload. For iOS and Android, this should be a .zip archive # containing a main_js_bundle.hbc file and an optional assets folder. For web, - # this should be a JavaScript file. + # this should be a JavaScript file or a .zip archive of the hosted site. # # @return [WhopSDK::Models::AppBuildCreateParams::Attachment] required :attachment, -> { WhopSDK::AppBuildCreateParams::Attachment } @@ -78,7 +78,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel # @!method initialize(id:) # The build file to upload. For iOS and Android, this should be a .zip archive # containing a main_js_bundle.hbc file and an optional assets folder. For web, - # this should be a JavaScript file. + # this should be a JavaScript file or a .zip archive of the hosted site. # # @param id [String] The ID of an existing file object. end diff --git a/lib/whop_sdk/models/app_create_params.rb b/lib/whop_sdk/models/app_create_params.rb index 592f9695..5bf9c9bb 100644 --- a/lib/whop_sdk/models/app_create_params.rb +++ b/lib/whop_sdk/models/app_create_params.rb @@ -40,7 +40,14 @@ class AppCreateParams < WhopSDK::Internal::Type::BaseModel # @return [Array, nil] optional :redirect_uris, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - # @!method initialize(company_id:, name:, base_url: nil, icon: nil, redirect_uris: nil, request_options: {}) + # @!attribute route + # The unique subdomain route where the app's hosted web builds are served, such as + # 'myapp' for myapp.whop.app. + # + # @return [String, nil] + optional :route, String, nil?: true + + # @!method initialize(company_id:, name:, base_url: nil, icon: nil, redirect_uris: nil, route: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AppCreateParams} for more details. # @@ -55,6 +62,8 @@ class AppCreateParams < WhopSDK::Internal::Type::BaseModel # # @param redirect_uris [Array, nil] The whitelisted OAuth callback URLs that users are redirected to after authorizi # + # @param route [String, nil] The unique subdomain route where the app's hosted web builds are served, such as + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] class Icon < WhopSDK::Internal::Type::BaseModel diff --git a/lib/whop_sdk/models/app_list_response.rb b/lib/whop_sdk/models/app_list_response.rb index f495bf1b..15554a88 100644 --- a/lib/whop_sdk/models/app_list_response.rb +++ b/lib/whop_sdk/models/app_list_response.rb @@ -74,6 +74,13 @@ class AppListResponse < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :experience_path, String, nil?: true + # @!attribute hosted_url + # The full canonical URL where this app's hosted web build is served. Null if the + # app has not claimed a route. + # + # @return [String, nil] + required :hosted_url, String, nil?: true + # @!attribute icon # The icon image for this app, displayed on the app store, product pages, # checkout, and as the default icon for experiences using this app. @@ -103,6 +110,13 @@ class AppListResponse < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :origin, String, nil?: true + # @!attribute route + # The unique subdomain route where this app's hosted web builds are served, such + # as 'myapp' for myapp.whop.app. Null if the app has not claimed a route. + # + # @return [String, nil] + required :route, String, nil?: true + # @!attribute skills_path # The URL path template for a specific view of this app, appended to the base # domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is @@ -126,7 +140,7 @@ class AppListResponse < WhopSDK::Internal::Type::BaseModel # @return [Boolean] required :verified, WhopSDK::Internal::Type::Boolean - # @!method initialize(id:, app_type:, base_url:, company:, creator:, dashboard_path:, description:, discover_path:, domain_id:, experience_path:, icon:, name:, openapi_path:, origin:, skills_path:, status:, verified:) + # @!method initialize(id:, app_type:, base_url:, company:, creator:, dashboard_path:, description:, discover_path:, domain_id:, experience_path:, hosted_url:, icon:, name:, openapi_path:, origin:, route:, skills_path:, status:, verified:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AppListResponse} for more details. # @@ -153,6 +167,8 @@ class AppListResponse < WhopSDK::Internal::Type::BaseModel # # @param experience_path [String, nil] The URL path template for a specific view of this app, appended to the base doma # + # @param hosted_url [String, nil] The full canonical URL where this app's hosted web build is served. Null if the + # # @param icon [WhopSDK::Models::AppListResponse::Icon, nil] The icon image for this app, displayed on the app store, product pages, checkout # # @param name [String] The display name of this app shown on the app store and in experience navigation @@ -161,6 +177,8 @@ class AppListResponse < WhopSDK::Internal::Type::BaseModel # # @param origin [String, nil] The full origin URL for this app's proxied domain (e.g., 'https://myapp.apps.who # + # @param route [String, nil] The unique subdomain route where this app's hosted web builds are served, such a + # # @param skills_path [String, nil] The URL path template for a specific view of this app, appended to the base doma # # @param status [Symbol, WhopSDK::Models::AppStatuses] The current visibility status of this app on the Whop app store. 'live' means pu diff --git a/lib/whop_sdk/models/app_logs_params.rb b/lib/whop_sdk/models/app_logs_params.rb new file mode 100644 index 00000000..a84be9a5 --- /dev/null +++ b/lib/whop_sdk/models/app_logs_params.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Apps#logs + class AppLogsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute after + # A cursor for fetching logs after a previous page. + # + # @return [String, nil] + optional :after, String + + # @!attribute app_build_id + # Only return logs from this build. + # + # @return [String, nil] + optional :app_build_id, String + + # @!attribute before + # A cursor for fetching logs before a later page. + # + # @return [String, nil] + optional :before, String + + # @!attribute created_after + # Start of the time window as an ISO 8601 timestamp. Defaults to 7 days before + # created_before. + # + # @return [Time, nil] + optional :created_after, Time + + # @!attribute created_before + # End of the time window as an ISO 8601 timestamp. Defaults to now. + # + # @return [Time, nil] + optional :created_before, Time + + # @!attribute first + # The number of log lines to return (max 500). + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute level + # Only return console lines of this level. + # + # @return [Symbol, WhopSDK::Models::AppLogsParams::Level, nil] + optional :level, enum: -> { WhopSDK::AppLogsParams::Level } + + # @!attribute query + # Only return logs whose message contains this text (case-insensitive). + # + # @return [String, nil] + optional :query, String + + # @!method initialize(id:, after: nil, app_build_id: nil, before: nil, created_after: nil, created_before: nil, first: nil, level: nil, query: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AppLogsParams} for more details. + # + # @param id [String] + # + # @param after [String] A cursor for fetching logs after a previous page. + # + # @param app_build_id [String] Only return logs from this build. + # + # @param before [String] A cursor for fetching logs before a later page. + # + # @param created_after [Time] Start of the time window as an ISO 8601 timestamp. Defaults to 7 days before cre + # + # @param created_before [Time] End of the time window as an ISO 8601 timestamp. Defaults to now. + # + # @param first [Integer] The number of log lines to return (max 500). + # + # @param level [Symbol, WhopSDK::Models::AppLogsParams::Level] Only return console lines of this level. + # + # @param query [String] Only return logs whose message contains this text (case-insensitive). + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Only return console lines of this level. + module Level + extend WhopSDK::Internal::Type::Enum + + LOG = :log + DEBUG = :debug + INFO = :info + WARN = :warn + ERROR = :error + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/app_logs_response.rb b/lib/whop_sdk/models/app_logs_response.rb new file mode 100644 index 00000000..c3a27c29 --- /dev/null +++ b/lib/whop_sdk/models/app_logs_response.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Apps#logs + class AppLogsResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AppLogsResponse::Data] } + + # @!attribute page_info + # + # @return [WhopSDK::Models::AppLogsResponse::PageInfo] + required :page_info, -> { WhopSDK::Models::AppLogsResponse::PageInfo } + + # @!method initialize(data:, page_info:) + # @param data [Array] + # @param page_info [WhopSDK::Models::AppLogsResponse::PageInfo] + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute app_build_id + # + # @return [String] + required :app_build_id, String + + # @!attribute app_id + # + # @return [String] + required :app_id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute level + # + # @return [String] + required :level, String + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute request_id + # + # @return [String] + required :request_id, String + + # @!attribute source + # + # @return [Symbol, WhopSDK::Models::AppLogsResponse::Data::Source] + required :source, enum: -> { WhopSDK::Models::AppLogsResponse::Data::Source } + + # @!attribute cpu_time_ms + # + # @return [Integer, nil] + optional :cpu_time_ms, Integer + + # @!attribute outcome + # + # @return [String, nil] + optional :outcome, String, nil?: true + + # @!attribute request_method + # + # @return [String, nil] + optional :request_method, String, nil?: true + + # @!attribute request_path + # + # @return [String, nil] + optional :request_path, String, nil?: true + + # @!attribute response_status + # + # @return [Integer, nil] + optional :response_status, Integer, nil?: true + + # @!attribute stack + # + # @return [String, nil] + optional :stack, String, nil?: true + + # @!attribute truncated + # + # @return [Boolean, nil] + optional :truncated, WhopSDK::Internal::Type::Boolean + + # @!attribute wall_time_ms + # + # @return [Integer, nil] + optional :wall_time_ms, Integer + + # @!method initialize(app_build_id:, app_id:, created_at:, level:, message:, request_id:, source:, cpu_time_ms: nil, outcome: nil, request_method: nil, request_path: nil, response_status: nil, stack: nil, truncated: nil, wall_time_ms: nil) + # @param app_build_id [String] + # @param app_id [String] + # @param created_at [Time] + # @param level [String] + # @param message [String] + # @param request_id [String] + # @param source [Symbol, WhopSDK::Models::AppLogsResponse::Data::Source] + # @param cpu_time_ms [Integer] + # @param outcome [String, nil] + # @param request_method [String, nil] + # @param request_path [String, nil] + # @param response_status [Integer, nil] + # @param stack [String, nil] + # @param truncated [Boolean] + # @param wall_time_ms [Integer] + + # @see WhopSDK::Models::AppLogsResponse::Data#source + module Source + extend WhopSDK::Internal::Type::Enum + + CONSOLE = :console + EXCEPTION = :exception + REQUEST = :request + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::AppLogsResponse#page_info + class PageInfo < WhopSDK::Internal::Type::BaseModel + # @!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 end_cursor + # + # @return [String, nil] + optional :end_cursor, String, nil?: true + + # @!attribute start_cursor + # + # @return [String, nil] + optional :start_cursor, String, nil?: true + + # @!method initialize(has_next_page:, has_previous_page:, end_cursor: nil, start_cursor: nil) + # @param has_next_page [Boolean] + # @param has_previous_page [Boolean] + # @param end_cursor [String, nil] + # @param start_cursor [String, nil] + end + end + end +end diff --git a/lib/whop_sdk/models/app_update_params.rb b/lib/whop_sdk/models/app_update_params.rb index 3bd7d155..474e938e 100644 --- a/lib/whop_sdk/models/app_update_params.rb +++ b/lib/whop_sdk/models/app_update_params.rb @@ -96,6 +96,22 @@ class AppUpdateParams < WhopSDK::Internal::Type::BaseModel -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AppUpdateParams::RequiredScope] }, nil?: true + # @!attribute route + # The unique subdomain route where the app's hosted web builds are served, such as + # 'myapp' for myapp.whop.app. + # + # @return [String, nil] + optional :route, String, nil?: true + + # @!attribute secrets + # Secrets to add or overwrite on the app, as an object of string values (e.g. + # {"MAIL_API_KEY": "..."}). Keys not included are left untouched. Pass null or an + # empty string as the value to delete a secret. Secrets are encrypted at rest and + # injected into the app's hosted server runtime as environment bindings. + # + # @return [Hash{Symbol=>Object}, nil] + optional :secrets, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @!attribute skills_path # The URL path to the skills directory of the app, such as '/assets/skills/'. # @@ -108,7 +124,7 @@ class AppUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::AppStatuses, nil] optional :status, enum: -> { WhopSDK::AppStatuses }, nil?: true - # @!method initialize(id:, app_store_description: nil, app_type: nil, base_url: nil, dashboard_path: nil, description: nil, discover_path: nil, experience_path: nil, icon: nil, name: nil, oauth_client_type: nil, openapi_path: nil, redirect_uris: nil, required_scopes: nil, skills_path: nil, status: nil, request_options: {}) + # @!method initialize(id:, app_store_description: nil, app_type: nil, base_url: nil, dashboard_path: nil, description: nil, discover_path: nil, experience_path: nil, icon: nil, name: nil, oauth_client_type: nil, openapi_path: nil, redirect_uris: nil, required_scopes: nil, route: nil, secrets: nil, skills_path: nil, status: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AppUpdateParams} for more details. # @@ -140,6 +156,10 @@ class AppUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param required_scopes [Array, nil] The permission scopes the app will request from users when they install it. # + # @param route [String, nil] The unique subdomain route where the app's hosted web builds are served, such as + # + # @param secrets [Hash{Symbol=>Object}, nil] Secrets to add or overwrite on the app, as an object of string values (e.g. {"MA + # # @param skills_path [String, nil] The URL path to the skills directory of the app, such as '/assets/skills/'. # # @param status [Symbol, WhopSDK::Models::AppStatuses, nil] The status of an experience interface diff --git a/lib/whop_sdk/models/audience.rb b/lib/whop_sdk/models/audience.rb new file mode 100644 index 00000000..b3cf411d --- /dev/null +++ b/lib/whop_sdk/models/audience.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Audiences#create + class Audience < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Audience ID, prefixed `adaud_`. + # + # @return [String] + required :id, String + + # @!attribute created_at + # Unix timestamp when the audience was created. + # + # @return [Float] + required :created_at, Float + + # @!attribute error_message + # Processing error message. `null` unless processing is partial or failed. + # + # @return [String, nil] + required :error_message, String, nil?: true + + # @!attribute matched_rows + # Rows successfully uploaded to connected ad accounts. + # + # @return [Float] + required :matched_rows, Float + + # @!attribute name + # Audience display name. + # + # @return [String] + required :name, String + + # @!attribute platform_audience_ids + # + # @return [Array] + required :platform_audience_ids, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute processed_rows + # Rows processed from the uploaded CSV. + # + # @return [Float] + required :processed_rows, Float + + # @!attribute progress_percent + # Processing progress from 0 to 100. + # + # @return [Float] + required :progress_percent, Float + + # @!attribute status + # Current state of the audience import. `syncing` means Whop is sending matched + # rows to connected ad accounts. When status is `partial` or `failed`, + # `error_message` explains what went wrong. + # + # @return [Symbol, WhopSDK::Models::Audience::Status] + required :status, enum: -> { WhopSDK::Audience::Status } + + # @!attribute total_rows + # Total rows detected in the uploaded CSV. + # + # @return [Float] + required :total_rows, Float + + # @!attribute updated_at + # Unix timestamp when the audience was last updated. + # + # @return [Float] + required :updated_at, Float + + # @!method initialize(id:, created_at:, error_message:, matched_rows:, name:, platform_audience_ids:, processed_rows:, progress_percent:, status:, total_rows:, updated_at:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Audience} for more details. + # + # @param id [String] Audience ID, prefixed `adaud_`. + # + # @param created_at [Float] Unix timestamp when the audience was created. + # + # @param error_message [String, nil] Processing error message. `null` unless processing is partial or failed. + # + # @param matched_rows [Float] Rows successfully uploaded to connected ad accounts. + # + # @param name [String] Audience display name. + # + # @param platform_audience_ids [Array] + # + # @param processed_rows [Float] Rows processed from the uploaded CSV. + # + # @param progress_percent [Float] Processing progress from 0 to 100. + # + # @param status [Symbol, WhopSDK::Models::Audience::Status] Current state of the audience import. `syncing` means Whop is sending matched ro + # + # @param total_rows [Float] Total rows detected in the uploaded CSV. + # + # @param updated_at [Float] Unix timestamp when the audience was last updated. + + # Current state of the audience import. `syncing` means Whop is sending matched + # rows to connected ad accounts. When status is `partial` or `failed`, + # `error_message` explains what went wrong. + # + # @see WhopSDK::Models::Audience#status + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING = :pending + PROCESSING = :processing + SYNCING = :syncing + READY = :ready + PARTIAL = :partial + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/audience_create_params.rb b/lib/whop_sdk/models/audience_create_params.rb new file mode 100644 index 00000000..7036a979 --- /dev/null +++ b/lib/whop_sdk/models/audience_create_params.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Audiences#create + class AudienceCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # Account ID, prefixed `biz_`. + # + # @return [String] + required :account_id, String + + # @!attribute column_mapping + # Maps supported identity fields to CSV column headers. Map at least one of + # `email` or `phone`. + # + # @return [WhopSDK::Models::AudienceCreateParams::ColumnMapping] + required :column_mapping, -> { WhopSDK::AudienceCreateParams::ColumnMapping } + + # @!attribute file_id + # Direct upload ID from the standard media upload endpoint. + # + # @return [String] + required :file_id, String + + # @!attribute name + # Audience display name. + # + # @return [String] + required :name, String + + # @!method initialize(account_id:, column_mapping:, file_id:, name:, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AudienceCreateParams} for more details. + # + # @param account_id [String] Account ID, prefixed `biz_`. + # + # @param column_mapping [WhopSDK::Models::AudienceCreateParams::ColumnMapping] Maps supported identity fields to CSV column headers. Map at least one of `email + # + # @param file_id [String] Direct upload ID from the standard media upload endpoint. + # + # @param name [String] Audience display name. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class ColumnMapping < WhopSDK::Internal::Type::BaseModel + # @!attribute country + # CSV header for ISO 3166-1 alpha-2 country codes, such as `US`. + # + # @return [String, nil] + optional :country, String + + # @!attribute email + # CSV header for email addresses. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # CSV header for first names. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # CSV header for last names. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone + # CSV header for phone numbers. + # + # @return [String, nil] + optional :phone, String + + # @!method initialize(country: nil, email: nil, first_name: nil, last_name: nil, phone: nil) + # Maps supported identity fields to CSV column headers. Map at least one of + # `email` or `phone`. + # + # @param country [String] CSV header for ISO 3166-1 alpha-2 country codes, such as `US`. + # + # @param email [String] CSV header for email addresses. + # + # @param first_name [String] CSV header for first names. + # + # @param last_name [String] CSV header for last names. + # + # @param phone [String] CSV header for phone numbers. + end + end + end +end diff --git a/lib/whop_sdk/models/audience_delete_params.rb b/lib/whop_sdk/models/audience_delete_params.rb new file mode 100644 index 00000000..3012ed5c --- /dev/null +++ b/lib/whop_sdk/models/audience_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Audiences#delete + class AudienceDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute audience_id + # + # @return [String] + required :audience_id, String + + # @!method initialize(audience_id:, request_options: {}) + # @param audience_id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/audience_delete_response.rb b/lib/whop_sdk/models/audience_delete_response.rb new file mode 100644 index 00000000..d9601127 --- /dev/null +++ b/lib/whop_sdk/models/audience_delete_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Audiences#delete + class AudienceDeleteResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute success + # + # @return [Boolean] + required :success, WhopSDK::Internal::Type::Boolean + + # @!method initialize(success:) + # @param success [Boolean] + end + end +end diff --git a/lib/whop_sdk/models/audience_list_params.rb b/lib/whop_sdk/models/audience_list_params.rb new file mode 100644 index 00000000..23e65857 --- /dev/null +++ b/lib/whop_sdk/models/audience_list_params.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Audiences#list + class AudienceListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # Account ID, prefixed `biz_`. + # + # @return [String] + required :account_id, String + + # @!attribute after + # Cursor for the next page of audiences. + # + # @return [String, nil] + optional :after, String + + # @!attribute audience_id + # Audience ID, prefixed `adaud_`, used to filter the response to one audience. + # + # @return [String, nil] + optional :audience_id, String + + # @!attribute first + # Number of audiences to return. Defaults to 20; maximum 100. + # + # @return [Integer, nil] + optional :first, Integer + + # @!method initialize(account_id:, after: nil, audience_id: nil, first: nil, request_options: {}) + # @param account_id [String] Account ID, prefixed `biz_`. + # + # @param after [String] Cursor for the next page of audiences. + # + # @param audience_id [String] Audience ID, prefixed `adaud_`, used to filter the response to one audience. + # + # @param first [Integer] Number of audiences to return. Defaults to 20; maximum 100. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/authorized_user_create_params.rb b/lib/whop_sdk/models/authorized_user_create_params.rb index 62f4ee43..e455684c 100644 --- a/lib/whop_sdk/models/authorized_user_create_params.rb +++ b/lib/whop_sdk/models/authorized_user_create_params.rb @@ -26,13 +26,19 @@ class AuthorizedUserCreateParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :user_id, String + # @!attribute elevation + # Re-authentication proof required to perform this sensitive action. + # + # @return [WhopSDK::Models::AuthorizedUserCreateParams::Elevation, nil] + optional :elevation, -> { WhopSDK::AuthorizedUserCreateParams::Elevation }, nil?: true + # @!attribute send_emails # Whether to send notification emails to the user on creation. # # @return [Boolean, nil] optional :send_emails, WhopSDK::Internal::Type::Boolean, nil?: true - # @!method initialize(company_id:, role:, user_id:, send_emails: nil, request_options: {}) + # @!method initialize(company_id:, role:, user_id:, elevation: nil, send_emails: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AuthorizedUserCreateParams} for more details. # @@ -42,9 +48,72 @@ class AuthorizedUserCreateParams < WhopSDK::Internal::Type::BaseModel # # @param user_id [String] The ID of the user to add as an authorized user. # + # @param elevation [WhopSDK::Models::AuthorizedUserCreateParams::Elevation, nil] Re-authentication proof required to perform this sensitive action. + # # @param send_emails [Boolean, nil] Whether to send notification emails to the user on creation. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class Elevation < WhopSDK::Internal::Type::BaseModel + # @!attribute authenticator_data + # The WebAuthn authenticator data (base64). + # + # @return [String, nil] + optional :authenticator_data, String, nil?: true + + # @!attribute client_data_json + # The WebAuthn client data JSON (base64). + # + # @return [String, nil] + optional :client_data_json, String, nil?: true + + # @!attribute credential_id + # The WebAuthn credential ID (base64). + # + # @return [String, nil] + optional :credential_id, String, nil?: true + + # @!attribute email_code + # The 6-digit code emailed to the user. + # + # @return [String, nil] + optional :email_code, String, nil?: true + + # @!attribute signature + # The WebAuthn signature (base64). + # + # @return [String, nil] + optional :signature, String, nil?: true + + # @!attribute totp_code + # The 6-digit code from the authenticator app or SMS. + # + # @return [String, nil] + optional :totp_code, String, nil?: true + + # @!attribute use_finance_session + # Reuse an existing elevated session (for SMS/email 2FA users). + # + # @return [Boolean, nil] + optional :use_finance_session, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!method initialize(authenticator_data: nil, client_data_json: nil, credential_id: nil, email_code: nil, signature: nil, totp_code: nil, use_finance_session: nil) + # Re-authentication proof required to perform this sensitive action. + # + # @param authenticator_data [String, nil] The WebAuthn authenticator data (base64). + # + # @param client_data_json [String, nil] The WebAuthn client data JSON (base64). + # + # @param credential_id [String, nil] The WebAuthn credential ID (base64). + # + # @param email_code [String, nil] The 6-digit code emailed to the user. + # + # @param signature [String, nil] The WebAuthn signature (base64). + # + # @param totp_code [String, nil] The 6-digit code from the authenticator app or SMS. + # + # @param use_finance_session [Boolean, nil] Reuse an existing elevated session (for SMS/email 2FA users). + end end end end diff --git a/lib/whop_sdk/models/bounty_create_params.rb b/lib/whop_sdk/models/bounty_create_params.rb index 0f03e17c..26410835 100644 --- a/lib/whop_sdk/models/bounty_create_params.rb +++ b/lib/whop_sdk/models/bounty_create_params.rb @@ -9,7 +9,8 @@ class BountyCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute base_unit_amount # The amount paid to each approved submission. The total bounty pool funded is - # this amount times accepted_submissions_limit. + # this amount times accepted_submissions_limit, and must be at least 5 in the + # bounty's currency. # # @return [Float] required :base_unit_amount, Float @@ -34,7 +35,8 @@ class BountyCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute accepted_submissions_limit # The number of submissions that can be approved before the bounty closes. - # Defaults to 1. + # Defaults to 1. The total pool (base_unit_amount times this limit) must be at + # least 5 in the bounty's currency. # # @return [Integer, nil] optional :accepted_submissions_limit, Integer, nil?: true @@ -46,6 +48,13 @@ class BountyCreateParams < WhopSDK::Internal::Type::BaseModel # @return [Array, nil] optional :allowed_country_codes, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + # @!attribute business_goal_type + # What the poster is trying to accomplish with a workforce bounty. Used for + # product taxonomy and analytics, separate from the bounty's implementation type. + # + # @return [Symbol, WhopSDK::Models::BountyCreateParams::BusinessGoalType, nil] + optional :business_goal_type, enum: -> { WhopSDK::BountyCreateParams::BusinessGoalType }, nil?: true + # @!attribute experience_id # An optional experience to scope the bounty to. # @@ -74,7 +83,27 @@ class BountyCreateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :post_title, String, nil?: true - # @!method initialize(base_unit_amount:, currency:, description:, title:, accepted_submissions_limit: nil, allowed_country_codes: nil, experience_id: nil, origin_account_id: nil, post_markdown_content: nil, post_title: nil, request_options: {}) + # @!attribute scheduled_frequency + # How often a scheduled bounty republishes a new bounty. + # + # @return [Symbol, WhopSDK::Models::BountyCreateParams::ScheduledFrequency, nil] + optional :scheduled_frequency, enum: -> { WhopSDK::BountyCreateParams::ScheduledFrequency }, nil?: true + + # @!attribute scheduled_publish_at + # When to publish the bounty. When provided, the bounty is created as a hidden + # draft and published at this time instead of immediately. Must be in the future. + # + # @return [Time, nil] + optional :scheduled_publish_at, Time, nil?: true + + # @!attribute scheduled_timezone + # The IANA timezone used for recurring occurrences. Required when + # scheduled_publish_at is provided. + # + # @return [String, nil] + optional :scheduled_timezone, String, nil?: true + + # @!method initialize(base_unit_amount:, currency:, description:, title:, accepted_submissions_limit: nil, allowed_country_codes: nil, business_goal_type: nil, experience_id: nil, origin_account_id: nil, post_markdown_content: nil, post_title: nil, scheduled_frequency: nil, scheduled_publish_at: nil, scheduled_timezone: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::BountyCreateParams} for more details. # @@ -90,6 +119,8 @@ class BountyCreateParams < WhopSDK::Internal::Type::BaseModel # # @param allowed_country_codes [Array, nil] The ISO3166 country codes where this bounty should be visible. Empty means globa # + # @param business_goal_type [Symbol, WhopSDK::Models::BountyCreateParams::BusinessGoalType, nil] What the poster is trying to accomplish with a workforce bounty. Used for produc + # # @param experience_id [String, nil] An optional experience to scope the bounty to. # # @param origin_account_id [String, nil] The user (user*\*) or company (biz*\*) tag whose balance funds this bounty pool. @@ -99,7 +130,43 @@ class BountyCreateParams < WhopSDK::Internal::Type::BaseModel # # @param post_title [String, nil] Optional title for the anchor forum post. Falls back to the bounty title when om # + # @param scheduled_frequency [Symbol, WhopSDK::Models::BountyCreateParams::ScheduledFrequency, nil] How often a scheduled bounty republishes a new bounty. + # + # @param scheduled_publish_at [Time, nil] When to publish the bounty. When provided, the bounty is created as a hidden dra + # + # @param scheduled_timezone [String, nil] The IANA timezone used for recurring occurrences. Required when scheduled_publis + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # What the poster is trying to accomplish with a workforce bounty. Used for + # product taxonomy and analytics, separate from the bounty's implementation type. + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + CLIPPING = :clipping + POST_ENGAGEMENT = :post_engagement + OWNED_ACCOUNT_GROWTH = :owned_account_growth + UGC_CONTENT = :ugc_content + LOCAL_ACTIVATION = :local_activation + OTHER = :other + + # @!method self.values + # @return [Array] + end + + # How often a scheduled bounty republishes a new bounty. + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + ONCE = :once + HOURLY = :hourly + DAILY = :daily + WEEKLY = :weekly + MONTHLY = :monthly + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/bounty_create_response.rb b/lib/whop_sdk/models/bounty_create_response.rb index 13ee5d09..c51e12c4 100644 --- a/lib/whop_sdk/models/bounty_create_response.rb +++ b/lib/whop_sdk/models/bounty_create_response.rb @@ -117,6 +117,7 @@ module Status PUBLISHED = :published ARCHIVED = :archived + SCHEDULED = :scheduled # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/bounty_list_params.rb b/lib/whop_sdk/models/bounty_list_params.rb index 1b676326..026b770c 100644 --- a/lib/whop_sdk/models/bounty_list_params.rb +++ b/lib/whop_sdk/models/bounty_list_params.rb @@ -76,6 +76,7 @@ module Status PUBLISHED = :published ARCHIVED = :archived + SCHEDULED = :scheduled # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/bounty_list_response.rb b/lib/whop_sdk/models/bounty_list_response.rb index 972b7a2e..6c9250da 100644 --- a/lib/whop_sdk/models/bounty_list_response.rb +++ b/lib/whop_sdk/models/bounty_list_response.rb @@ -117,6 +117,7 @@ module Status PUBLISHED = :published ARCHIVED = :archived + SCHEDULED = :scheduled # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/bounty_retrieve_response.rb b/lib/whop_sdk/models/bounty_retrieve_response.rb index 48e7bf1b..09787dde 100644 --- a/lib/whop_sdk/models/bounty_retrieve_response.rb +++ b/lib/whop_sdk/models/bounty_retrieve_response.rb @@ -117,6 +117,7 @@ module Status PUBLISHED = :published ARCHIVED = :archived + SCHEDULED = :scheduled # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/card_brands.rb b/lib/whop_sdk/models/card_brands.rb index d18744d7..5c195af8 100644 --- a/lib/whop_sdk/models/card_brands.rb +++ b/lib/whop_sdk/models/card_brands.rb @@ -45,6 +45,7 @@ module CardBrands HIPERCARD = :hipercard JCBLANKAPAY = :jcblankapay CMI = :cmi + AURA = :aura UNKNOWN = :unknown # @!method self.values diff --git a/lib/whop_sdk/models/card_create_params.rb b/lib/whop_sdk/models/card_create_params.rb new file mode 100644 index 00000000..1e6a85c1 --- /dev/null +++ b/lib/whop_sdk/models/card_create_params.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Cards#create + class CardCreateParams < 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 assigned_user_id + # The company member (a user\_ identifier) to assign the card to. Required for + # company (business) card issuing accounts. + # + # @return [String, nil] + optional :assigned_user_id, String + + # @!attribute name + # A display name for the card. + # + # @return [String, nil] + optional :name, String + + # @!attribute spend_limit + # Spending limit amount, in dollars. + # + # @return [Float, nil] + optional :spend_limit, Float + + # @!attribute spend_limit_frequency + # The spending limit window. + # + # @return [Symbol, WhopSDK::Models::CardCreateParams::SpendLimitFrequency, nil] + optional :spend_limit_frequency, enum: -> { WhopSDK::CardCreateParams::SpendLimitFrequency } + + # @!attribute transaction_limit + # Per-transaction limit amount, in dollars. + # + # @return [Float, nil] + optional :transaction_limit, Float + + # @!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, assigned_user_id: nil, name: nil, spend_limit: nil, spend_limit_frequency: nil, transaction_limit: nil, user_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CardCreateParams} for more details. + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param assigned_user_id [String] The company member (a user\_ identifier) to assign the card to. Required for + # comp + # + # @param name [String] A display name for the card. + # + # @param spend_limit [Float] Spending limit amount, in dollars. + # + # @param spend_limit_frequency [Symbol, WhopSDK::Models::CardCreateParams::SpendLimitFrequency] The spending limit window. + # + # @param transaction_limit [Float] Per-transaction limit amount, in dollars. + # + # @param user_id [String] The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The spending limit window. + module SpendLimitFrequency + extend WhopSDK::Internal::Type::Enum + + DAILY = :daily + WEEKLY = :weekly + MONTHLY = :monthly + ONE_TIME = :one_time + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/card_create_response.rb b/lib/whop_sdk/models/card_create_response.rb new file mode 100644 index 00000000..da44bf51 --- /dev/null +++ b/lib/whop_sdk/models/card_create_response.rb @@ -0,0 +1,277 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Cards#create + class CardCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Card ID, prefixed `icrd_`. + # + # @return [String] + required :id, String + + # @!attribute billing + # The billing address. + # + # @return [WhopSDK::Models::CardCreateResponse::Billing, nil] + required :billing, -> { WhopSDK::Models::CardCreateResponse::Billing }, nil?: true + + # @!attribute canceled_at + # When the card was canceled. + # + # @return [Time, nil] + required :canceled_at, Time, nil?: true + + # @!attribute created_at + # When the card was created. + # + # @return [Time, nil] + required :created_at, Time, nil?: true + + # @!attribute expiration_month + # Card expiration month. + # + # @return [String, nil] + required :expiration_month, String, nil?: true + + # @!attribute expiration_year + # Card expiration year. + # + # @return [String, nil] + required :expiration_year, String, nil?: true + + # @!attribute last4 + # Last four digits of the card number. `null` for pending invitation cards. + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!attribute limit + # The spending limit configuration. + # + # @return [WhopSDK::Models::CardCreateResponse::Limit, nil] + required :limit, -> { WhopSDK::Models::CardCreateResponse::Limit }, nil?: true + + # @!attribute name + # Card display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::CardCreateResponse::Object] + required :object, enum: -> { WhopSDK::Models::CardCreateResponse::Object } + + # @!attribute spent_last_month + # Total spend in the last 30 days, in cents. + # + # @return [Integer, nil] + required :spent_last_month, Integer, nil?: true + + # @!attribute status + # The card status. + # + # @return [Symbol, WhopSDK::Models::CardCreateResponse::Status, nil] + required :status, enum: -> { WhopSDK::Models::CardCreateResponse::Status }, nil?: true + + # @!attribute type + # The card type. + # + # @return [Symbol, WhopSDK::Models::CardCreateResponse::Type, nil] + required :type, enum: -> { WhopSDK::Models::CardCreateResponse::Type }, nil?: true + + # @!attribute user_id + # Cardholder user ID, prefixed `user_`, when assigned. + # + # @return [String, nil] + required :user_id, String, nil?: true + + # @!attribute secrets + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + # + # @return [WhopSDK::Models::CardCreateResponse::Secrets, nil] + optional :secrets, -> { WhopSDK::Models::CardCreateResponse::Secrets }, nil?: true + + # @!method initialize(id:, billing:, canceled_at:, created_at:, expiration_month:, expiration_year:, last4:, limit:, name:, object:, spent_last_month:, status:, type:, user_id:, secrets: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CardCreateResponse} for more details. + # + # @param id [String] Card ID, prefixed `icrd_`. + # + # @param billing [WhopSDK::Models::CardCreateResponse::Billing, nil] The billing address. + # + # @param canceled_at [Time, nil] When the card was canceled. + # + # @param created_at [Time, nil] When the card was created. + # + # @param expiration_month [String, nil] Card expiration month. + # + # @param expiration_year [String, nil] Card expiration year. + # + # @param last4 [String, nil] Last four digits of the card number. `null` for pending invitation cards. + # + # @param limit [WhopSDK::Models::CardCreateResponse::Limit, nil] The spending limit configuration. + # + # @param name [String, nil] Card display name. + # + # @param object [Symbol, WhopSDK::Models::CardCreateResponse::Object] + # + # @param spent_last_month [Integer, nil] Total spend in the last 30 days, in cents. + # + # @param status [Symbol, WhopSDK::Models::CardCreateResponse::Status, nil] The card status. + # + # @param type [Symbol, WhopSDK::Models::CardCreateResponse::Type, nil] The card type. + # + # @param user_id [String, nil] Cardholder user ID, prefixed `user_`, when assigned. + # + # @param secrets [WhopSDK::Models::CardCreateResponse::Secrets, nil] Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + + # @see WhopSDK::Models::CardCreateResponse#billing + class Billing < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # Billing city. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country_code + # Billing country code. + # + # @return [String, nil] + required :country_code, String, nil?: true + + # @!attribute line1 + # Street address line 1. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # Street address line 2. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # Billing postal code. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute region + # Billing region or state. + # + # @return [String, nil] + required :region, String, nil?: true + + # @!method initialize(city:, country_code:, line1:, line2:, postal_code:, region:) + # The billing address. + # + # @param city [String, nil] Billing city. + # + # @param country_code [String, nil] Billing country code. + # + # @param line1 [String, nil] Street address line 1. + # + # @param line2 [String, nil] Street address line 2. + # + # @param postal_code [String, nil] Billing postal code. + # + # @param region [String, nil] Billing region or state. + end + + # @see WhopSDK::Models::CardCreateResponse#limit + class Limit < WhopSDK::Internal::Type::BaseModel + # @!attribute amount + # The limit amount in dollars. + # + # @return [Float] + required :amount, Float + + # @!attribute frequency + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + # + # @return [String] + required :frequency, String + + # @!method initialize(amount:, frequency:) + # The spending limit configuration. + # + # @param amount [Float] The limit amount in dollars. + # + # @param frequency [String] Limit window, for example `per24HourPeriod` or `perAuthorization`. + end + + # @see WhopSDK::Models::CardCreateResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + CARD = :card + + # @!method self.values + # @return [Array] + end + + # The card status. + # + # @see WhopSDK::Models::CardCreateResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + FROZEN = :frozen + CANCELED = :canceled + INVITED = :invited + + # @!method self.values + # @return [Array] + end + + # The card type. + # + # @see WhopSDK::Models::CardCreateResponse#type + module Type + extend WhopSDK::Internal::Type::Enum + + VIRTUAL = :virtual + PHYSICAL = :physical + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::CardCreateResponse#secrets + class Secrets < WhopSDK::Internal::Type::BaseModel + # @!attribute card_number + # Full card number. + # + # @return [String] + required :card_number, String + + # @!attribute cvc + # Card verification code. + # + # @return [String] + required :cvc, String + + # @!attribute name_on_card + # Cardholder name printed on the card. + # + # @return [String, nil] + required :name_on_card, String, nil?: true + + # @!method initialize(card_number:, cvc:, name_on_card:) + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + # + # @param card_number [String] Full card number. + # + # @param cvc [String] Card verification code. + # + # @param name_on_card [String, nil] Cardholder name printed on the card. + end + end + end +end diff --git a/lib/whop_sdk/models/card_list_params.rb b/lib/whop_sdk/models/card_list_params.rb new file mode 100644 index 00000000..c85b957b --- /dev/null +++ b/lib/whop_sdk/models/card_list_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Cards#list + class CardListParams < 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 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, user_id: nil, request_options: {}) + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @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/card_list_response.rb b/lib/whop_sdk/models/card_list_response.rb new file mode 100644 index 00000000..194da82e --- /dev/null +++ b/lib/whop_sdk/models/card_list_response.rb @@ -0,0 +1,287 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Cards#list + class CardListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::CardListResponse::Data] } + + # @!method initialize(data:) + # @param data [Array] + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Card ID, prefixed `icrd_`. + # + # @return [String] + required :id, String + + # @!attribute billing + # The billing address. + # + # @return [WhopSDK::Models::CardListResponse::Data::Billing, nil] + required :billing, -> { WhopSDK::Models::CardListResponse::Data::Billing }, nil?: true + + # @!attribute canceled_at + # When the card was canceled. + # + # @return [Time, nil] + required :canceled_at, Time, nil?: true + + # @!attribute created_at + # When the card was created. + # + # @return [Time, nil] + required :created_at, Time, nil?: true + + # @!attribute expiration_month + # Card expiration month. + # + # @return [String, nil] + required :expiration_month, String, nil?: true + + # @!attribute expiration_year + # Card expiration year. + # + # @return [String, nil] + required :expiration_year, String, nil?: true + + # @!attribute last4 + # Last four digits of the card number. `null` for pending invitation cards. + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!attribute limit + # The spending limit configuration. + # + # @return [WhopSDK::Models::CardListResponse::Data::Limit, nil] + required :limit, -> { WhopSDK::Models::CardListResponse::Data::Limit }, nil?: true + + # @!attribute name + # Card display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::CardListResponse::Data::Object] + required :object, enum: -> { WhopSDK::Models::CardListResponse::Data::Object } + + # @!attribute spent_last_month + # Total spend in the last 30 days, in cents. + # + # @return [Integer, nil] + required :spent_last_month, Integer, nil?: true + + # @!attribute status + # The card status. + # + # @return [Symbol, WhopSDK::Models::CardListResponse::Data::Status, nil] + required :status, enum: -> { WhopSDK::Models::CardListResponse::Data::Status }, nil?: true + + # @!attribute type + # The card type. + # + # @return [Symbol, WhopSDK::Models::CardListResponse::Data::Type, nil] + required :type, enum: -> { WhopSDK::Models::CardListResponse::Data::Type }, nil?: true + + # @!attribute user_id + # Cardholder user ID, prefixed `user_`, when assigned. + # + # @return [String, nil] + required :user_id, String, nil?: true + + # @!attribute secrets + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + # + # @return [WhopSDK::Models::CardListResponse::Data::Secrets, nil] + optional :secrets, -> { WhopSDK::Models::CardListResponse::Data::Secrets }, nil?: true + + # @!method initialize(id:, billing:, canceled_at:, created_at:, expiration_month:, expiration_year:, last4:, limit:, name:, object:, spent_last_month:, status:, type:, user_id:, secrets: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CardListResponse::Data} for more details. + # + # @param id [String] Card ID, prefixed `icrd_`. + # + # @param billing [WhopSDK::Models::CardListResponse::Data::Billing, nil] The billing address. + # + # @param canceled_at [Time, nil] When the card was canceled. + # + # @param created_at [Time, nil] When the card was created. + # + # @param expiration_month [String, nil] Card expiration month. + # + # @param expiration_year [String, nil] Card expiration year. + # + # @param last4 [String, nil] Last four digits of the card number. `null` for pending invitation cards. + # + # @param limit [WhopSDK::Models::CardListResponse::Data::Limit, nil] The spending limit configuration. + # + # @param name [String, nil] Card display name. + # + # @param object [Symbol, WhopSDK::Models::CardListResponse::Data::Object] + # + # @param spent_last_month [Integer, nil] Total spend in the last 30 days, in cents. + # + # @param status [Symbol, WhopSDK::Models::CardListResponse::Data::Status, nil] The card status. + # + # @param type [Symbol, WhopSDK::Models::CardListResponse::Data::Type, nil] The card type. + # + # @param user_id [String, nil] Cardholder user ID, prefixed `user_`, when assigned. + # + # @param secrets [WhopSDK::Models::CardListResponse::Data::Secrets, nil] Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + + # @see WhopSDK::Models::CardListResponse::Data#billing + class Billing < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # Billing city. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country_code + # Billing country code. + # + # @return [String, nil] + required :country_code, String, nil?: true + + # @!attribute line1 + # Street address line 1. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # Street address line 2. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # Billing postal code. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute region + # Billing region or state. + # + # @return [String, nil] + required :region, String, nil?: true + + # @!method initialize(city:, country_code:, line1:, line2:, postal_code:, region:) + # The billing address. + # + # @param city [String, nil] Billing city. + # + # @param country_code [String, nil] Billing country code. + # + # @param line1 [String, nil] Street address line 1. + # + # @param line2 [String, nil] Street address line 2. + # + # @param postal_code [String, nil] Billing postal code. + # + # @param region [String, nil] Billing region or state. + end + + # @see WhopSDK::Models::CardListResponse::Data#limit + class Limit < WhopSDK::Internal::Type::BaseModel + # @!attribute amount + # The limit amount in dollars. + # + # @return [Float] + required :amount, Float + + # @!attribute frequency + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + # + # @return [String] + required :frequency, String + + # @!method initialize(amount:, frequency:) + # The spending limit configuration. + # + # @param amount [Float] The limit amount in dollars. + # + # @param frequency [String] Limit window, for example `per24HourPeriod` or `perAuthorization`. + end + + # @see WhopSDK::Models::CardListResponse::Data#object + module Object + extend WhopSDK::Internal::Type::Enum + + CARD = :card + + # @!method self.values + # @return [Array] + end + + # The card status. + # + # @see WhopSDK::Models::CardListResponse::Data#status + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + FROZEN = :frozen + CANCELED = :canceled + INVITED = :invited + + # @!method self.values + # @return [Array] + end + + # The card type. + # + # @see WhopSDK::Models::CardListResponse::Data#type + module Type + extend WhopSDK::Internal::Type::Enum + + VIRTUAL = :virtual + PHYSICAL = :physical + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::CardListResponse::Data#secrets + class Secrets < WhopSDK::Internal::Type::BaseModel + # @!attribute card_number + # Full card number. + # + # @return [String] + required :card_number, String + + # @!attribute cvc + # Card verification code. + # + # @return [String] + required :cvc, String + + # @!attribute name_on_card + # Cardholder name printed on the card. + # + # @return [String, nil] + required :name_on_card, String, nil?: true + + # @!method initialize(card_number:, cvc:, name_on_card:) + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + # + # @param card_number [String] Full card number. + # + # @param cvc [String] Card verification code. + # + # @param name_on_card [String, nil] Cardholder name printed on the card. + end + end + end + end +end diff --git a/lib/whop_sdk/models/card_retrieve_params.rb b/lib/whop_sdk/models/card_retrieve_params.rb new file mode 100644 index 00000000..d4e0a02a --- /dev/null +++ b/lib/whop_sdk/models/card_retrieve_params.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Cards#retrieve + class CardRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute card_id + # + # @return [String] + required :card_id, String + + # @!attribute account_id + # The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute user_id + # The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @return [String, nil] + optional :user_id, String + + # @!method initialize(card_id:, account_id: nil, user_id: nil, request_options: {}) + # @param card_id [String] + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @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/card_retrieve_response.rb b/lib/whop_sdk/models/card_retrieve_response.rb new file mode 100644 index 00000000..56e20ac5 --- /dev/null +++ b/lib/whop_sdk/models/card_retrieve_response.rb @@ -0,0 +1,277 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Cards#retrieve + class CardRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Card ID, prefixed `icrd_`. + # + # @return [String] + required :id, String + + # @!attribute billing + # The billing address. + # + # @return [WhopSDK::Models::CardRetrieveResponse::Billing, nil] + required :billing, -> { WhopSDK::Models::CardRetrieveResponse::Billing }, nil?: true + + # @!attribute canceled_at + # When the card was canceled. + # + # @return [Time, nil] + required :canceled_at, Time, nil?: true + + # @!attribute created_at + # When the card was created. + # + # @return [Time, nil] + required :created_at, Time, nil?: true + + # @!attribute expiration_month + # Card expiration month. + # + # @return [String, nil] + required :expiration_month, String, nil?: true + + # @!attribute expiration_year + # Card expiration year. + # + # @return [String, nil] + required :expiration_year, String, nil?: true + + # @!attribute last4 + # Last four digits of the card number. `null` for pending invitation cards. + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!attribute limit + # The spending limit configuration. + # + # @return [WhopSDK::Models::CardRetrieveResponse::Limit, nil] + required :limit, -> { WhopSDK::Models::CardRetrieveResponse::Limit }, nil?: true + + # @!attribute name + # Card display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::CardRetrieveResponse::Object] + required :object, enum: -> { WhopSDK::Models::CardRetrieveResponse::Object } + + # @!attribute spent_last_month + # Total spend in the last 30 days, in cents. + # + # @return [Integer, nil] + required :spent_last_month, Integer, nil?: true + + # @!attribute status + # The card status. + # + # @return [Symbol, WhopSDK::Models::CardRetrieveResponse::Status, nil] + required :status, enum: -> { WhopSDK::Models::CardRetrieveResponse::Status }, nil?: true + + # @!attribute type + # The card type. + # + # @return [Symbol, WhopSDK::Models::CardRetrieveResponse::Type, nil] + required :type, enum: -> { WhopSDK::Models::CardRetrieveResponse::Type }, nil?: true + + # @!attribute user_id + # Cardholder user ID, prefixed `user_`, when assigned. + # + # @return [String, nil] + required :user_id, String, nil?: true + + # @!attribute secrets + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + # + # @return [WhopSDK::Models::CardRetrieveResponse::Secrets, nil] + optional :secrets, -> { WhopSDK::Models::CardRetrieveResponse::Secrets }, nil?: true + + # @!method initialize(id:, billing:, canceled_at:, created_at:, expiration_month:, expiration_year:, last4:, limit:, name:, object:, spent_last_month:, status:, type:, user_id:, secrets: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CardRetrieveResponse} for more details. + # + # @param id [String] Card ID, prefixed `icrd_`. + # + # @param billing [WhopSDK::Models::CardRetrieveResponse::Billing, nil] The billing address. + # + # @param canceled_at [Time, nil] When the card was canceled. + # + # @param created_at [Time, nil] When the card was created. + # + # @param expiration_month [String, nil] Card expiration month. + # + # @param expiration_year [String, nil] Card expiration year. + # + # @param last4 [String, nil] Last four digits of the card number. `null` for pending invitation cards. + # + # @param limit [WhopSDK::Models::CardRetrieveResponse::Limit, nil] The spending limit configuration. + # + # @param name [String, nil] Card display name. + # + # @param object [Symbol, WhopSDK::Models::CardRetrieveResponse::Object] + # + # @param spent_last_month [Integer, nil] Total spend in the last 30 days, in cents. + # + # @param status [Symbol, WhopSDK::Models::CardRetrieveResponse::Status, nil] The card status. + # + # @param type [Symbol, WhopSDK::Models::CardRetrieveResponse::Type, nil] The card type. + # + # @param user_id [String, nil] Cardholder user ID, prefixed `user_`, when assigned. + # + # @param secrets [WhopSDK::Models::CardRetrieveResponse::Secrets, nil] Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + + # @see WhopSDK::Models::CardRetrieveResponse#billing + class Billing < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # Billing city. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country_code + # Billing country code. + # + # @return [String, nil] + required :country_code, String, nil?: true + + # @!attribute line1 + # Street address line 1. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # Street address line 2. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # Billing postal code. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute region + # Billing region or state. + # + # @return [String, nil] + required :region, String, nil?: true + + # @!method initialize(city:, country_code:, line1:, line2:, postal_code:, region:) + # The billing address. + # + # @param city [String, nil] Billing city. + # + # @param country_code [String, nil] Billing country code. + # + # @param line1 [String, nil] Street address line 1. + # + # @param line2 [String, nil] Street address line 2. + # + # @param postal_code [String, nil] Billing postal code. + # + # @param region [String, nil] Billing region or state. + end + + # @see WhopSDK::Models::CardRetrieveResponse#limit + class Limit < WhopSDK::Internal::Type::BaseModel + # @!attribute amount + # The limit amount in dollars. + # + # @return [Float] + required :amount, Float + + # @!attribute frequency + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + # + # @return [String] + required :frequency, String + + # @!method initialize(amount:, frequency:) + # The spending limit configuration. + # + # @param amount [Float] The limit amount in dollars. + # + # @param frequency [String] Limit window, for example `per24HourPeriod` or `perAuthorization`. + end + + # @see WhopSDK::Models::CardRetrieveResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + CARD = :card + + # @!method self.values + # @return [Array] + end + + # The card status. + # + # @see WhopSDK::Models::CardRetrieveResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + FROZEN = :frozen + CANCELED = :canceled + INVITED = :invited + + # @!method self.values + # @return [Array] + end + + # The card type. + # + # @see WhopSDK::Models::CardRetrieveResponse#type + module Type + extend WhopSDK::Internal::Type::Enum + + VIRTUAL = :virtual + PHYSICAL = :physical + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::CardRetrieveResponse#secrets + class Secrets < WhopSDK::Internal::Type::BaseModel + # @!attribute card_number + # Full card number. + # + # @return [String] + required :card_number, String + + # @!attribute cvc + # Card verification code. + # + # @return [String] + required :cvc, String + + # @!attribute name_on_card + # Cardholder name printed on the card. + # + # @return [String, nil] + required :name_on_card, String, nil?: true + + # @!method initialize(card_number:, cvc:, name_on_card:) + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + # + # @param card_number [String] Full card number. + # + # @param cvc [String] Card verification code. + # + # @param name_on_card [String, nil] Cardholder name printed on the card. + end + end + end +end diff --git a/lib/whop_sdk/models/card_update_params.rb b/lib/whop_sdk/models/card_update_params.rb new file mode 100644 index 00000000..1dc5a842 --- /dev/null +++ b/lib/whop_sdk/models/card_update_params.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Cards#update + class CardUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute card_id + # + # @return [String] + required :card_id, String + + # @!attribute account_id + # The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute billing + # New billing address. Requires line1, city, region, postal_code, and + # country_code. + # + # @return [WhopSDK::Models::CardUpdateParams::Billing, nil] + optional :billing, -> { WhopSDK::CardUpdateParams::Billing } + + # @!attribute canceled + # Pass `true` to permanently cancel the card. A canceled card cannot be + # uncanceled. Cannot be combined with other fields. + # + # @return [Boolean, nil] + optional :canceled, WhopSDK::Internal::Type::Boolean + + # @!attribute frozen + # Pass `true` to freeze the card, `false` to unfreeze it. + # + # @return [Boolean, nil] + optional :frozen, WhopSDK::Internal::Type::Boolean + + # @!attribute name + # A display name for the card. + # + # @return [String, nil] + optional :name, String + + # @!attribute pin + # New 4-digit PIN. Can only be set on a card assigned to the acting user. + # + # @return [String, nil] + optional :pin, String + + # @!attribute remove_limit + # Pass `true` to remove the spending limit (make the card unlimited). + # + # @return [Boolean, nil] + optional :remove_limit, WhopSDK::Internal::Type::Boolean + + # @!attribute spend_limit + # Spending limit amount, in dollars. + # + # @return [Float, nil] + optional :spend_limit, Float + + # @!attribute spend_limit_frequency + # The spending limit window. + # + # @return [Symbol, WhopSDK::Models::CardUpdateParams::SpendLimitFrequency, nil] + optional :spend_limit_frequency, enum: -> { WhopSDK::CardUpdateParams::SpendLimitFrequency } + + # @!attribute transaction_limit + # Per-transaction limit amount, in dollars. + # + # @return [Float, nil] + optional :transaction_limit, Float + + # @!attribute user_id + # The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @return [String, nil] + optional :user_id, String + + # @!method initialize(card_id:, account_id: nil, billing: nil, canceled: nil, frozen: nil, name: nil, pin: nil, remove_limit: nil, spend_limit: nil, spend_limit_frequency: nil, transaction_limit: nil, user_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CardUpdateParams} for more details. + # + # @param card_id [String] + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param billing [WhopSDK::Models::CardUpdateParams::Billing] New billing address. Requires line1, city, region, postal_code, and country_code + # + # @param canceled [Boolean] Pass `true` to permanently cancel the card. A canceled card cannot be uncanceled + # + # @param frozen [Boolean] Pass `true` to freeze the card, `false` to unfreeze it. + # + # @param name [String] A display name for the card. + # + # @param pin [String] New 4-digit PIN. Can only be set on a card assigned to the acting user. + # + # @param remove_limit [Boolean] Pass `true` to remove the spending limit (make the card unlimited). + # + # @param spend_limit [Float] Spending limit amount, in dollars. + # + # @param spend_limit_frequency [Symbol, WhopSDK::Models::CardUpdateParams::SpendLimitFrequency] The spending limit window. + # + # @param transaction_limit [Float] Per-transaction limit amount, in dollars. + # + # @param user_id [String] The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class Billing < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # Billing city. + # + # @return [String] + required :city, String + + # @!attribute country_code + # Billing country code, ISO 3166-1 alpha-2. + # + # @return [String] + required :country_code, String + + # @!attribute line1 + # Street address line 1. + # + # @return [String] + required :line1, String + + # @!attribute postal_code + # Billing postal code. + # + # @return [String] + required :postal_code, String + + # @!attribute region + # Billing region or state. + # + # @return [String] + required :region, String + + # @!attribute line2 + # Street address line 2. + # + # @return [String, nil] + optional :line2, String + + # @!method initialize(city:, country_code:, line1:, postal_code:, region:, line2: nil) + # New billing address. Requires line1, city, region, postal_code, and + # country_code. + # + # @param city [String] Billing city. + # + # @param country_code [String] Billing country code, ISO 3166-1 alpha-2. + # + # @param line1 [String] Street address line 1. + # + # @param postal_code [String] Billing postal code. + # + # @param region [String] Billing region or state. + # + # @param line2 [String] Street address line 2. + end + + # The spending limit window. + module SpendLimitFrequency + extend WhopSDK::Internal::Type::Enum + + DAILY = :daily + WEEKLY = :weekly + MONTHLY = :monthly + ONE_TIME = :one_time + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/card_update_response.rb b/lib/whop_sdk/models/card_update_response.rb new file mode 100644 index 00000000..5f364d87 --- /dev/null +++ b/lib/whop_sdk/models/card_update_response.rb @@ -0,0 +1,277 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Cards#update + class CardUpdateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Card ID, prefixed `icrd_`. + # + # @return [String] + required :id, String + + # @!attribute billing + # The billing address. + # + # @return [WhopSDK::Models::CardUpdateResponse::Billing, nil] + required :billing, -> { WhopSDK::Models::CardUpdateResponse::Billing }, nil?: true + + # @!attribute canceled_at + # When the card was canceled. + # + # @return [Time, nil] + required :canceled_at, Time, nil?: true + + # @!attribute created_at + # When the card was created. + # + # @return [Time, nil] + required :created_at, Time, nil?: true + + # @!attribute expiration_month + # Card expiration month. + # + # @return [String, nil] + required :expiration_month, String, nil?: true + + # @!attribute expiration_year + # Card expiration year. + # + # @return [String, nil] + required :expiration_year, String, nil?: true + + # @!attribute last4 + # Last four digits of the card number. `null` for pending invitation cards. + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!attribute limit + # The spending limit configuration. + # + # @return [WhopSDK::Models::CardUpdateResponse::Limit, nil] + required :limit, -> { WhopSDK::Models::CardUpdateResponse::Limit }, nil?: true + + # @!attribute name + # Card display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::CardUpdateResponse::Object] + required :object, enum: -> { WhopSDK::Models::CardUpdateResponse::Object } + + # @!attribute spent_last_month + # Total spend in the last 30 days, in cents. + # + # @return [Integer, nil] + required :spent_last_month, Integer, nil?: true + + # @!attribute status + # The card status. + # + # @return [Symbol, WhopSDK::Models::CardUpdateResponse::Status, nil] + required :status, enum: -> { WhopSDK::Models::CardUpdateResponse::Status }, nil?: true + + # @!attribute type + # The card type. + # + # @return [Symbol, WhopSDK::Models::CardUpdateResponse::Type, nil] + required :type, enum: -> { WhopSDK::Models::CardUpdateResponse::Type }, nil?: true + + # @!attribute user_id + # Cardholder user ID, prefixed `user_`, when assigned. + # + # @return [String, nil] + required :user_id, String, nil?: true + + # @!attribute secrets + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + # + # @return [WhopSDK::Models::CardUpdateResponse::Secrets, nil] + optional :secrets, -> { WhopSDK::Models::CardUpdateResponse::Secrets }, nil?: true + + # @!method initialize(id:, billing:, canceled_at:, created_at:, expiration_month:, expiration_year:, last4:, limit:, name:, object:, spent_last_month:, status:, type:, user_id:, secrets: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CardUpdateResponse} for more details. + # + # @param id [String] Card ID, prefixed `icrd_`. + # + # @param billing [WhopSDK::Models::CardUpdateResponse::Billing, nil] The billing address. + # + # @param canceled_at [Time, nil] When the card was canceled. + # + # @param created_at [Time, nil] When the card was created. + # + # @param expiration_month [String, nil] Card expiration month. + # + # @param expiration_year [String, nil] Card expiration year. + # + # @param last4 [String, nil] Last four digits of the card number. `null` for pending invitation cards. + # + # @param limit [WhopSDK::Models::CardUpdateResponse::Limit, nil] The spending limit configuration. + # + # @param name [String, nil] Card display name. + # + # @param object [Symbol, WhopSDK::Models::CardUpdateResponse::Object] + # + # @param spent_last_month [Integer, nil] Total spend in the last 30 days, in cents. + # + # @param status [Symbol, WhopSDK::Models::CardUpdateResponse::Status, nil] The card status. + # + # @param type [Symbol, WhopSDK::Models::CardUpdateResponse::Type, nil] The card type. + # + # @param user_id [String, nil] Cardholder user ID, prefixed `user_`, when assigned. + # + # @param secrets [WhopSDK::Models::CardUpdateResponse::Secrets, nil] Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + + # @see WhopSDK::Models::CardUpdateResponse#billing + class Billing < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # Billing city. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country_code + # Billing country code. + # + # @return [String, nil] + required :country_code, String, nil?: true + + # @!attribute line1 + # Street address line 1. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # Street address line 2. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # Billing postal code. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute region + # Billing region or state. + # + # @return [String, nil] + required :region, String, nil?: true + + # @!method initialize(city:, country_code:, line1:, line2:, postal_code:, region:) + # The billing address. + # + # @param city [String, nil] Billing city. + # + # @param country_code [String, nil] Billing country code. + # + # @param line1 [String, nil] Street address line 1. + # + # @param line2 [String, nil] Street address line 2. + # + # @param postal_code [String, nil] Billing postal code. + # + # @param region [String, nil] Billing region or state. + end + + # @see WhopSDK::Models::CardUpdateResponse#limit + class Limit < WhopSDK::Internal::Type::BaseModel + # @!attribute amount + # The limit amount in dollars. + # + # @return [Float] + required :amount, Float + + # @!attribute frequency + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + # + # @return [String] + required :frequency, String + + # @!method initialize(amount:, frequency:) + # The spending limit configuration. + # + # @param amount [Float] The limit amount in dollars. + # + # @param frequency [String] Limit window, for example `per24HourPeriod` or `perAuthorization`. + end + + # @see WhopSDK::Models::CardUpdateResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + CARD = :card + + # @!method self.values + # @return [Array] + end + + # The card status. + # + # @see WhopSDK::Models::CardUpdateResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + FROZEN = :frozen + CANCELED = :canceled + INVITED = :invited + + # @!method self.values + # @return [Array] + end + + # The card type. + # + # @see WhopSDK::Models::CardUpdateResponse#type + module Type + extend WhopSDK::Internal::Type::Enum + + VIRTUAL = :virtual + PHYSICAL = :physical + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::CardUpdateResponse#secrets + class Secrets < WhopSDK::Internal::Type::BaseModel + # @!attribute card_number + # Full card number. + # + # @return [String] + required :card_number, String + + # @!attribute cvc + # Card verification code. + # + # @return [String] + required :cvc, String + + # @!attribute name_on_card + # Cardholder name printed on the card. + # + # @return [String, nil] + required :name_on_card, String, nil?: true + + # @!method initialize(card_number:, cvc:, name_on_card:) + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + # + # @param card_number [String] Full card number. + # + # @param cvc [String] Card verification code. + # + # @param name_on_card [String, nil] Cardholder name printed on the card. + end + end + end +end diff --git a/lib/whop_sdk/models/chat_message_created_webhook_event.rb b/lib/whop_sdk/models/chat_message_created_webhook_event.rb new file mode 100644 index 00000000..911857a5 --- /dev/null +++ b/lib/whop_sdk/models/chat_message_created_webhook_event.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class ChatMessageCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique ID for every single webhook request + # + # @return [String] + required :id, String + + # @!attribute api_version + # The API version for this webhook + # + # @return [Symbol, :v1] + required :api_version, const: :v1 + + # @!attribute data + # + # @return [WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data] + required :data, -> { WhopSDK::ChatMessageCreatedWebhookEvent::Data } + + # @!attribute timestamp + # The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @return [Time] + required :timestamp, Time + + # @!attribute type + # The webhook event type + # + # @return [Symbol, :"chat.message.created"] + required :type, const: :"chat.message.created" + + # @!attribute company_id + # The company ID that this webhook event is associated with + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!method initialize(id:, data:, timestamp:, company_id: nil, api_version: :v1, type: :"chat.message.created") + # @param id [String] A unique ID for every single webhook request + # + # @param data [WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data] + # + # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @param company_id [String, nil] The company ID that this webhook event is associated with + # + # @param api_version [Symbol, :v1] The API version for this webhook + # + # @param type [Symbol, :"chat.message.created"] The webhook event type + + # @see WhopSDK::Models::ChatMessageCreatedWebhookEvent#data + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute audience + # + # @return [WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience] + required :audience, -> { WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience } + + # @!attribute channel + # + # @return [WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel] + required :channel, -> { WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel } + + # @!attribute message + # A message sent within an experience chat, direct message, or group chat. + # + # @return [WhopSDK::Models::Message] + required :message, -> { WhopSDK::Message } + + # @!attribute reason + # + # @return [String] + required :reason, String + + # @!method initialize(audience:, channel:, message:, reason:) + # @param audience [WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience] + # + # @param channel [WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel] + # + # @param message [WhopSDK::Models::Message] A message sent within an experience chat, direct message, or group chat. + # + # @param reason [String] + + # @see WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data#audience + class Audience < WhopSDK::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience::Type] + required :type, enum: -> { WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::Type } + + # @!attribute user_ids + # + # @return [Array, nil] + optional :user_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(type:, user_ids: nil) + # @param type [Symbol, WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience::Type] + # @param user_ids [Array, nil] + + # @see WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience#type + module Type + extend WhopSDK::Internal::Type::Enum + + CHANNEL = :channel + USERS = :users + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data#channel + class Channel < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel::Type] + required :type, enum: -> { WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type } + + # @!attribute experience_id + # + # @return [String, nil] + optional :experience_id, String, nil?: true + + # @!method initialize(id:, type:, experience_id: nil) + # @param id [String] + # @param type [Symbol, WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel::Type] + # @param experience_id [String, nil] + + # @see WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel#type + module Type + extend WhopSDK::Internal::Type::Enum + + CHAT = :chat + DIRECT_MESSAGE = :direct_message + SUPPORT = :support + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/chat_reaction_created_webhook_event.rb b/lib/whop_sdk/models/chat_reaction_created_webhook_event.rb new file mode 100644 index 00000000..8f1b540f --- /dev/null +++ b/lib/whop_sdk/models/chat_reaction_created_webhook_event.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class ChatReactionCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique ID for every single webhook request + # + # @return [String] + required :id, String + + # @!attribute api_version + # The API version for this webhook + # + # @return [Symbol, :v1] + required :api_version, const: :v1 + + # @!attribute data + # + # @return [WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data] + required :data, -> { WhopSDK::ChatReactionCreatedWebhookEvent::Data } + + # @!attribute timestamp + # The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @return [Time] + required :timestamp, Time + + # @!attribute type + # The webhook event type + # + # @return [Symbol, :"chat.reaction.created"] + required :type, const: :"chat.reaction.created" + + # @!attribute company_id + # The company ID that this webhook event is associated with + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!method initialize(id:, data:, timestamp:, company_id: nil, api_version: :v1, type: :"chat.reaction.created") + # @param id [String] A unique ID for every single webhook request + # + # @param data [WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data] + # + # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @param company_id [String, nil] The company ID that this webhook event is associated with + # + # @param api_version [Symbol, :v1] The API version for this webhook + # + # @param type [Symbol, :"chat.reaction.created"] The webhook event type + + # @see WhopSDK::Models::ChatReactionCreatedWebhookEvent#data + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute audience + # + # @return [WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience] + required :audience, -> { WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience } + + # @!attribute channel + # + # @return [WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel] + required :channel, -> { WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel } + + # @!attribute message + # A message sent within an experience chat, direct message, or group chat. + # + # @return [WhopSDK::Models::Message] + required :message, -> { WhopSDK::Message } + + # @!attribute reaction + # A single reaction left by a user on a feed post, such as a like or emoji. + # + # @return [WhopSDK::Models::Reaction] + required :reaction, -> { WhopSDK::Reaction } + + # @!attribute reason + # + # @return [String] + required :reason, String + + # @!method initialize(audience:, channel:, message:, reaction:, reason:) + # @param audience [WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience] + # + # @param channel [WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel] + # + # @param message [WhopSDK::Models::Message] A message sent within an experience chat, direct message, or group chat. + # + # @param reaction [WhopSDK::Models::Reaction] A single reaction left by a user on a feed post, such as a like or emoji. + # + # @param reason [String] + + # @see WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data#audience + class Audience < WhopSDK::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience::Type] + required :type, enum: -> { WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::Type } + + # @!attribute user_ids + # + # @return [Array, nil] + optional :user_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(type:, user_ids: nil) + # @param type [Symbol, WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience::Type] + # @param user_ids [Array, nil] + + # @see WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience#type + module Type + extend WhopSDK::Internal::Type::Enum + + CHANNEL = :channel + USERS = :users + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data#channel + class Channel < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel::Type] + required :type, enum: -> { WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type } + + # @!attribute experience_id + # + # @return [String, nil] + optional :experience_id, String, nil?: true + + # @!method initialize(id:, type:, experience_id: nil) + # @param id [String] + # @param type [Symbol, WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel::Type] + # @param experience_id [String, nil] + + # @see WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel#type + module Type + extend WhopSDK::Internal::Type::Enum + + CHAT = :chat + DIRECT_MESSAGE = :direct_message + SUPPORT = :support + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/checkout_configuration.rb b/lib/whop_sdk/models/checkout_configuration.rb index 93098a5c..3e5742b5 100644 --- a/lib/whop_sdk/models/checkout_configuration.rb +++ b/lib/whop_sdk/models/checkout_configuration.rb @@ -15,13 +15,6 @@ class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :affiliate_code, String, nil?: true - # @!attribute allow_promo_codes - # Whether the checkout configuration allows promo codes. When false, the promo - # code input is hidden and promo codes are rejected. - # - # @return [Boolean] - required :allow_promo_codes, WhopSDK::Internal::Type::Boolean - # @!attribute company_id # The ID of the company to use for the checkout configuration # @@ -75,7 +68,7 @@ class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :redirect_url, String, nil?: true - # @!method initialize(id:, affiliate_code:, allow_promo_codes:, company_id:, currency:, metadata:, mode:, payment_method_configuration:, plan:, purchase_url:, redirect_url:) + # @!method initialize(id:, affiliate_code:, company_id:, currency:, metadata:, mode:, payment_method_configuration:, plan:, purchase_url:, redirect_url:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::CheckoutConfiguration} for more details. # @@ -87,8 +80,6 @@ class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel # # @param affiliate_code [String, nil] The affiliate code to use for the checkout configuration # - # @param allow_promo_codes [Boolean] Whether the checkout configuration allows promo codes. When false, the promo cod - # # @param company_id [String] The ID of the company to use for the checkout configuration # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform @@ -163,8 +154,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel 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. + # Number of days between recurring charges, such as 30 for monthly or 365 for + # annual. `null` for one-time plans. # # @return [Integer, nil] required :billing_period, Integer, nil?: true @@ -177,8 +168,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel required :currency, enum: -> { WhopSDK::Currency } # @!attribute expiration_days - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # Access duration in days for expiration-based plans, such as 365 for a one-year + # pass. # # @return [Integer, nil] required :expiration_days, Integer, nil?: true @@ -199,8 +190,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel required :plan_type, enum: -> { WhopSDK::PlanType } # @!attribute release_method - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. + # Sales method for this plan: `buy_now` for immediate purchase or `waitlist` for + # waitlist-based access. # # @return [Symbol, WhopSDK::Models::ReleaseMethod] required :release_method, enum: -> { WhopSDK::ReleaseMethod } @@ -219,9 +210,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel required :three_ds_level, enum: -> { WhopSDK::CheckoutConfiguration::Plan::ThreeDSLevel }, 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. + # Free trial days before first renewal charge. `null` if no trial is configured or + # the user has already used a trial for this plan. # # @return [Integer, nil] required :trial_period_days, Integer, nil?: true @@ -243,23 +233,23 @@ class Plan < WhopSDK::Internal::Type::BaseModel # # @param adaptive_pricing_enabled [Boolean] Whether the creator has turned on adaptive pricing for this plan. Raw setting — # - # @param billing_period [Integer, nil] The number of days between each recurring charge. Null for one-time plans. For e + # @param billing_period [Integer, nil] Number of days between recurring charges, such as 30 for monthly or 365 for annu # # @param currency [Symbol, WhopSDK::Models::Currency] The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary # - # @param expiration_days [Integer, nil] The number of days until the membership expires (for expiration-based plans). Fo + # @param expiration_days [Integer, nil] Access duration in days for expiration-based plans, such as 365 for a one-year p # # @param initial_price [Float] The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). # # @param plan_type [Symbol, WhopSDK::Models::PlanType] The billing model for this plan: 'renewal' for recurring subscriptions or 'one_t # - # @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::ReleaseMethod] Sales method for this plan: `buy_now` for immediate purchase or `waitlist` for w # # @param renewal_price [Float] The recurring price charged every billing_period in the plan's base_currency (e. # # @param three_ds_level [Symbol, WhopSDK::Models::CheckoutConfiguration::Plan::ThreeDSLevel, nil] The 3D Secure behavior for a plan. # - # @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 [Integer, nil] Free trial days before first renewal charge. `null` if no trial is configured or # # @param visibility [Symbol, WhopSDK::Models::Visibility] Controls whether the plan is visible to customers. When set to 'hidden', the pla diff --git a/lib/whop_sdk/models/checkout_configuration_create_params.rb b/lib/whop_sdk/models/checkout_configuration_create_params.rb index e6beb342..bb888202 100644 --- a/lib/whop_sdk/models/checkout_configuration_create_params.rb +++ b/lib/whop_sdk/models/checkout_configuration_create_params.rb @@ -7,1075 +7,332 @@ class CheckoutConfigurationCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute body - # Parameters for CreateCheckoutSession + # @!attribute affiliate_code + # Affiliate code to apply to the checkout. # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup] - required :body, union: -> { WhopSDK::CheckoutConfigurationCreateParams::Body } + # @return [String, nil] + optional :affiliate_code, String, nil?: true - # @!method initialize(body:, request_options: {}) - # @param body [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup] Parameters for CreateCheckoutSession + # @!attribute company_id + # Account ID, prefixed `biz_`. # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - - # Parameters for CreateCheckoutSession - module Body - extend WhopSDK::Internal::Type::Union - - # Autogenerated input type of CreateCheckoutSession - variant -> { WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan } - - # Autogenerated input type of CreateCheckoutSession - variant -> { WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID } - - # Autogenerated input type of CreateCheckoutSession - variant -> { WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup } - - class CreateCheckoutSessionInputModePaymentWithPlan < WhopSDK::Internal::Type::BaseModel - # @!attribute plan - # The plan attributes to create a new plan inline for this checkout configuration. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan] - required :plan, - -> { WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan } - - # @!attribute affiliate_code - # An affiliate tracking code to attribute the checkout to a specific affiliate. - # - # @return [String, nil] - optional :affiliate_code, String, nil?: true - - # @!attribute allow_promo_codes - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. - # - # @return [Boolean, nil] - optional :allow_promo_codes, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute checkout_styling - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling, nil] - optional :checkout_styling, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling - }, - nil?: true - - # @!attribute currency - # The available currencies on the platform - # - # @return [Symbol, WhopSDK::Models::Currency, nil] - optional :currency, enum: -> { WhopSDK::Currency }, nil?: true - - # @!attribute metadata - # Custom key-value metadata to attach to the checkout configuration. - # - # @return [Hash{Symbol=>Object}, nil] - optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true - - # @!attribute mode - # - # @return [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode, nil] - optional :mode, - enum: -> { WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode } - - # @!attribute payment_method_configuration - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration, nil] - optional :payment_method_configuration, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration - }, - nil?: true - - # @!attribute redirect_url - # The URL to redirect the user to after checkout is completed. - # - # @return [String, nil] - optional :redirect_url, String, nil?: true - - # @!attribute source_url - # The URL of the page where the checkout is being initiated from. - # - # @return [String, nil] - optional :source_url, String, nil?: true - - # @!method initialize(plan:, affiliate_code: nil, allow_promo_codes: nil, checkout_styling: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan} - # for more details. - # - # Autogenerated input type of CreateCheckoutSession - # - # @param plan [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan] The plan attributes to create a new plan inline for this checkout configuration. - # - # @param affiliate_code [String, nil] An affiliate tracking code to attribute the checkout to a specific affiliate. - # - # @param allow_promo_codes [Boolean, nil] Whether the checkout should show the promo code input field and accept promo cod - # - # @param checkout_styling [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling, nil] Checkout styling overrides for this session. Overrides plan and company defaults - # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform - # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value metadata to attach to the checkout configuration. - # - # @param mode [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode] - # - # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the checkout session. Only applies - # - # @param redirect_url [String, nil] The URL to redirect the user to after checkout is completed. - # - # @param source_url [String, nil] The URL of the page where the checkout is being initiated from. - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan#plan - class Plan < WhopSDK::Internal::Type::BaseModel - # @!attribute company_id - # The company the plan should be created for. - # - # @return [String] - required :company_id, String - - # @!attribute currency - # The respective currency identifier for the plan. - # - # @return [Symbol, WhopSDK::Models::Currency] - required :currency, enum: -> { WhopSDK::Currency } - - # @!attribute adaptive_pricing_enabled - # Whether this plan accepts local currency payments via adaptive pricing. - # - # @return [Boolean, nil] - optional :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute application_fee_amount - # The application fee amount collected by the platform from this connected - # account. Provided as a number in dollars (e.g., 5.00 for $5.00). Must be less - # than the total payment amount. Only valid for connected accounts with a parent - # company. - # - # @return [Float, nil] - optional :application_fee_amount, Float, nil?: true - - # @!attribute billing_period - # The interval in days at which the plan charges (renewal plans). For example, 30 - # for monthly billing. - # - # @return [Integer, nil] - optional :billing_period, Integer, nil?: true - - # @!attribute custom_fields - # An array of custom field objects. - # - # @return [Array, nil] - optional :custom_fields, - -> do - WhopSDK::Internal::Type::ArrayOf[ - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField - ] - end, - nil?: true - - # @!attribute description - # The description of the plan. - # - # @return [String, nil] - optional :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. - # - # @return [Integer, nil] - optional :expiration_days, Integer, nil?: true - - # @!attribute force_create_new_plan - # Whether to force the creation of a new plan even if one with the same attributes - # already exists. - # - # @return [Boolean, nil] - optional :force_create_new_plan, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute image - # An image for the plan. This will be visible on the product page to customers. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image, nil] - optional :image, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image - }, - nil?: true - - # @!attribute initial_price - # An additional amount charged upon first purchase. Provided as a number in - # dollars (e.g., 10.00 for $10.00). - # - # @return [Float, nil] - optional :initial_price, Float, nil?: true - - # @!attribute internal_notes - # A personal description or notes section for the business. - # - # @return [String, nil] - optional :internal_notes, String, 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) - # - # @return [Symbol, WhopSDK::Models::TaxType, nil] - optional :override_tax_type, enum: -> { WhopSDK::TaxType }, nil?: true - - # @!attribute payment_method_configuration - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration, nil] - optional :payment_method_configuration, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration - }, - nil?: true - - # @!attribute plan_type - # The type of plan that can be attached to a product - # - # @return [Symbol, WhopSDK::Models::PlanType, nil] - optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true - - # @!attribute product - # Pass this object to create a new product for this plan. We will use the product - # external identifier to find or create an existing product. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product, nil] - optional :product, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product - }, - nil?: true - - # @!attribute product_id - # The product the plan is related to. Either this or product is required. - # - # @return [String, nil] - optional :product_id, String, nil?: true - - # @!attribute release_method - # The methods of how a plan can be released. - # - # @return [Symbol, WhopSDK::Models::ReleaseMethod, nil] - optional :release_method, enum: -> { WhopSDK::ReleaseMethod }, nil?: true - - # @!attribute renewal_price - # The amount the customer is charged every billing period. Provided as a number in - # dollars (e.g., 9.99 for $9.99/period). - # - # @return [Float, nil] - optional :renewal_price, Float, nil?: true - - # @!attribute split_pay_required_payments - # The number of payments required before pausing the subscription. - # - # @return [Integer, nil] - optional :split_pay_required_payments, Integer, nil?: true - - # @!attribute stock - # The number of units available for purchase. If not provided, stock is unlimited. - # - # @return [Integer, nil] - optional :stock, Integer, nil?: true - - # @!attribute title - # The title of the plan. This will be visible on the product page to customers. - # - # @return [String, nil] - optional :title, String, nil?: true - - # @!attribute trial_period_days - # The number of free trial days added before a renewal plan. - # - # @return [Integer, nil] - optional :trial_period_days, Integer, nil?: true - - # @!attribute visibility - # Visibility of a resource - # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - - # @!method initialize(company_id:, currency:, adaptive_pricing_enabled: nil, application_fee_amount: nil, billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, force_create_new_plan: nil, image: nil, initial_price: nil, internal_notes: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, product: nil, product_id: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, title: nil, trial_period_days: nil, visibility: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan} - # for more details. - # - # The plan attributes to create a new plan inline for this checkout configuration. - # - # @param company_id [String] The company the plan should be created for. - # - # @param currency [Symbol, WhopSDK::Models::Currency] The respective currency identifier for the plan. - # - # @param adaptive_pricing_enabled [Boolean, nil] Whether this plan accepts local currency payments via adaptive pricing. - # - # @param application_fee_amount [Float, nil] The application fee amount collected by the platform from this connected account - # - # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). For example, 30 - # - # @param custom_fields [Array, nil] An array of custom field objects. - # - # @param description [String, nil] The description of the plan. - # - # @param expiration_days [Integer, nil] The number of days until the membership expires (for expiration-based plans). Fo - # - # @param force_create_new_plan [Boolean, nil] Whether to force the creation of a new plan even if one with the same attributes - # - # @param image [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image, nil] An image for the plan. This will be visible on the product page to customers. - # - # @param initial_price [Float, nil] An additional amount charged upon first purchase. Provided as a number in dollar - # - # @param internal_notes [String, nil] A personal description or notes section for the business. - # - # @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 payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla - # - # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product - # - # @param product [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product, nil] Pass this object to create a new product for this plan. We will use the product - # - # @param product_id [String, nil] The product the plan is related to. Either this or product is required. - # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod, nil] The methods of how a plan can be released. - # - # @param renewal_price [Float, nil] The amount the customer is charged every billing period. Provided as a number in - # - # @param split_pay_required_payments [Integer, nil] The number of payments required before pausing the subscription. - # - # @param stock [Integer, nil] The number of units available for purchase. If not provided, stock is unlimited. - # - # @param title [String, nil] The title of the plan. This will be visible on the product page to customers. - # - # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan. - # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource - - class CustomField < WhopSDK::Internal::Type::BaseModel - # @!attribute field_type - # The type of the custom field. - # - # @return [Symbol, :text] - required :field_type, const: :text - - # @!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 - - # @!attribute order - # The order of the field. - # - # @return [Integer, nil] - optional :order, Integer, nil?: true - - # @!attribute placeholder - # The placeholder value of the field. - # - # @return [String, nil] - optional :placeholder, String, nil?: true - - # @!attribute required - # Whether or not the field is required. - # - # @return [Boolean, nil] - optional :required, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!method initialize(name:, id: nil, order: nil, placeholder: nil, required: nil, field_type: :text) - # @param name [String] The name of the custom field. - # - # @param id [String, nil] The ID of the custom field (if being updated) - # - # @param order [Integer, nil] The order of the field. - # - # @param placeholder [String, nil] The placeholder value of the field. - # - # @param required [Boolean, nil] Whether or not the field is required. - # - # @param field_type [Symbol, :text] The type of the custom field. - end - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan#image - class Image < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The ID of an existing file object. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # An image for the plan. This will be visible on the product page to customers. - # - # @param id [String] The ID of an existing file object. - end - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::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, nil] - optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!method initialize(disabled:, enabled:, include_platform_defaults: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration} - # for more details. - # - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will 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 - end - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan#product - class Product < WhopSDK::Internal::Type::BaseModel - # @!attribute external_identifier - # A unique ID used to find or create a product. When provided during creation, we - # will look for an existing product with this external identifier — if found, it - # will be updated; otherwise, a new product will be created. - # - # @return [String] - required :external_identifier, String - - # @!attribute title - # The title of the product. - # - # @return [String] - required :title, String - - # @!attribute collect_shipping_address - # Whether or not to collect shipping information at checkout from the customer. - # - # @return [Boolean, nil] - optional :collect_shipping_address, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute custom_statement_descriptor - # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be - # between 5 and 22 characters, contain at least one letter, and not contain any of - # the following characters: <, >, \, ', " - # - # @return [String, nil] - optional :custom_statement_descriptor, String, nil?: true - - # @!attribute description - # A written description of the product. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute global_affiliate_percentage - # The percentage of the revenue that goes to the global affiliate program. - # - # @return [Float, nil] - optional :global_affiliate_percentage, Float, nil?: true - - # @!attribute global_affiliate_status - # The different statuses of the global affiliate program for a product. - # - # @return [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] - optional :global_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }, nil?: true - - # @!attribute headline - # The headline of the product. - # - # @return [String, nil] - optional :headline, String, nil?: true - - # @!attribute product_tax_code_id - # The ID of the product tax code to apply to this product. - # - # @return [String, nil] - optional :product_tax_code_id, String, nil?: true - - # @!attribute redirect_purchase_url - # The URL to redirect the customer to after a purchase. - # - # @return [String, nil] - optional :redirect_purchase_url, String, nil?: true - - # @!attribute route - # The route of the product. - # - # @return [String, nil] - optional :route, String, nil?: true - - # @!attribute visibility - # Visibility of a resource - # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - - # @!method initialize(external_identifier:, title:, collect_shipping_address: nil, custom_statement_descriptor: nil, description: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, visibility: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product} - # for more details. - # - # Pass this object to create a new product for this plan. We will use the product - # external identifier to find or create an existing product. - # - # @param external_identifier [String] A unique ID used to find or create a product. When provided during creation, we - # - # @param title [String] The title of the product. - # - # @param collect_shipping_address [Boolean, nil] Whether or not to collect shipping information at checkout from the customer. - # - # @param custom_statement_descriptor [String, nil] The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be - # betwee - # - # @param description [String, nil] A written description of the product. - # - # @param global_affiliate_percentage [Float, nil] The percentage of the revenue that goes to the global affiliate program. - # - # @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. - # - # @param headline [String, nil] The headline of the product. - # - # @param product_tax_code_id [String, nil] The ID of the product tax code to apply to this product. - # - # @param redirect_purchase_url [String, nil] The URL to redirect the customer to after a purchase. - # - # @param route [String, nil] The route of the product. - # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource - end - end - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan#checkout_styling - 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). - # - # @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::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling} - # for more details. - # - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - # - # @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 - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan#mode - module Mode - extend WhopSDK::Internal::Type::Enum - - PAYMENT = :payment - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan#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] } + # @return [String, nil] + optional :company_id, 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 - - # @!method initialize(disabled:, enabled:, include_platform_defaults: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration} - # for more details. - # - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will 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 - end - end - - class CreateCheckoutSessionInputModePaymentWithPlanID < WhopSDK::Internal::Type::BaseModel - # @!attribute plan_id - # The unique identifier of an existing plan to use for this checkout - # configuration. - # - # @return [String] - required :plan_id, String - - # @!attribute affiliate_code - # An affiliate tracking code to attribute the checkout to a specific affiliate. - # - # @return [String, nil] - optional :affiliate_code, String, nil?: true - - # @!attribute allow_promo_codes - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. - # - # @return [Boolean, nil] - optional :allow_promo_codes, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute checkout_styling - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling, nil] - optional :checkout_styling, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling - }, - nil?: true - - # @!attribute currency - # The available currencies on the platform - # - # @return [Symbol, WhopSDK::Models::Currency, nil] - optional :currency, enum: -> { WhopSDK::Currency }, nil?: true - - # @!attribute metadata - # Custom key-value metadata to attach to the checkout configuration. - # - # @return [Hash{Symbol=>Object}, nil] - optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true - - # @!attribute mode - # - # @return [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode, nil] - optional :mode, - enum: -> { WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode } - - # @!attribute payment_method_configuration - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration, nil] - optional :payment_method_configuration, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration - }, - nil?: true - - # @!attribute redirect_url - # The URL to redirect the user to after checkout is completed. - # - # @return [String, nil] - optional :redirect_url, String, nil?: true - - # @!attribute source_url - # The URL of the page where the checkout is being initiated from. - # - # @return [String, nil] - optional :source_url, String, nil?: true - - # @!method initialize(plan_id:, affiliate_code: nil, allow_promo_codes: nil, checkout_styling: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID} - # for more details. - # - # Autogenerated input type of CreateCheckoutSession - # - # @param plan_id [String] The unique identifier of an existing plan to use for this checkout configuration - # - # @param affiliate_code [String, nil] An affiliate tracking code to attribute the checkout to a specific affiliate. - # - # @param allow_promo_codes [Boolean, nil] Whether the checkout should show the promo code input field and accept promo cod - # - # @param checkout_styling [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling, nil] Checkout styling overrides for this session. Overrides plan and company defaults - # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform - # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value metadata to attach to the checkout configuration. - # - # @param mode [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode] - # - # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration, nil] The explicit payment method configuration for the checkout session. Only applies - # - # @param redirect_url [String, nil] The URL to redirect the user to after checkout is completed. - # - # @param source_url [String, nil] The URL of the page where the checkout is being initiated from. - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID#checkout_styling - 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). - # - # @return [String, nil] - optional :button_color, String, nil?: true + # @!attribute currency + # Currency used for setup-mode payment method availability. + # + # @return [String, nil] + optional :currency, 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 + # @!attribute metadata + # Custom key-value metadata copied to payments and memberships. + # + # @return [Object, nil] + optional :metadata, WhopSDK::Internal::Type::Unknown, 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::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling} - # for more details. - # - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - # - # @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 + # @!attribute mode + # Checkout mode: `payment` collects payment for a plan now; `setup` saves payment + # details without charging. Defaults to `payment`. + # + # @return [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Mode, nil] + optional :mode, enum: -> { WhopSDK::CheckoutConfigurationCreateParams::Mode } - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID#mode - module Mode - extend WhopSDK::Internal::Type::Enum + # @!attribute payment_method_configuration + # Payment method overrides for this checkout. `null` uses the plan or platform + # defaults. + # + # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::PaymentMethodConfiguration, nil] + optional :payment_method_configuration, + -> { WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration }, + nil?: true + + # @!attribute plan + # Plan attributes used to create or find a plan for this checkout configuration. + # Mutually exclusive with `plan_id`. + # + # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Plan, nil] + optional :plan, -> { WhopSDK::CheckoutConfigurationCreateParams::Plan }, nil?: true - PAYMENT = :payment + # @!attribute plan_id + # Existing plan ID, prefixed `plan_`. Mutually exclusive with `plan`. + # + # @return [String, nil] + optional :plan_id, String, nil?: true - # @!method self.values - # @return [Array] - end + # @!attribute redirect_url + # URL customers are sent to after checkout. + # + # @return [String, nil] + optional :redirect_url, String, nil?: true - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID#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 three_ds_level + # 3D Secure behavior for this checkout. + # + # @return [String, nil] + optional :three_ds_level, String, nil?: true - # @!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] } + # @!method initialize(affiliate_code: nil, company_id: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, plan: nil, plan_id: nil, redirect_url: nil, three_ds_level: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CheckoutConfigurationCreateParams} for more details. + # + # @param affiliate_code [String, nil] Affiliate code to apply to the checkout. + # + # @param company_id [String] Account ID, prefixed `biz_`. + # + # @param currency [String, nil] Currency used for setup-mode payment method availability. + # + # @param metadata [Object, nil] Custom key-value metadata copied to payments and memberships. + # + # @param mode [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Mode] Checkout mode: `payment` collects payment for a plan now; `setup` saves payment + # + # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateParams::PaymentMethodConfiguration, nil] Payment method overrides for this checkout. `null` uses the plan or platform def + # + # @param plan [WhopSDK::Models::CheckoutConfigurationCreateParams::Plan, nil] Plan attributes used to create or find a plan for this checkout configuration. M + # + # @param plan_id [String, nil] Existing plan ID, prefixed `plan_`. Mutually exclusive with `plan`. + # + # @param redirect_url [String, nil] URL customers are sent to after checkout. + # + # @param three_ds_level [String, nil] 3D Secure behavior for this checkout. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - # @!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 + # Checkout mode: `payment` collects payment for a plan now; `setup` saves payment + # details without charging. Defaults to `payment`. + module Mode + extend WhopSDK::Internal::Type::Enum - # @!method initialize(disabled:, enabled:, include_platform_defaults: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration} - # for more details. - # - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will 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 - end - end + PAYMENT = :payment + SETUP = :setup - class CreateCheckoutSessionInputModeSetup < WhopSDK::Internal::Type::BaseModel - # @!attribute company_id - # The unique identifier of the company to create the checkout configuration for. - # Only required in setup mode. - # - # @return [String] - required :company_id, String + # @!method self.values + # @return [Array] + end - # @!attribute mode - # - # @return [Symbol, :setup] - required :mode, const: :setup + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + # @!attribute disabled + # Payment methods explicitly disabled for checkout. + # + # @return [Array, nil] + optional :disabled, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute enabled + # Payment methods explicitly enabled for checkout. + # + # @return [Array, nil] + optional :enabled, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute include_platform_defaults + # Whether platform default payment methods are included. + # + # @return [Boolean, nil] + optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean + + # @!method initialize(disabled: nil, enabled: nil, include_platform_defaults: nil) + # Payment method overrides for this checkout. `null` uses the plan or platform + # defaults. + # + # @param disabled [Array] Payment methods explicitly disabled for checkout. + # + # @param enabled [Array] Payment methods explicitly enabled for checkout. + # + # @param include_platform_defaults [Boolean] Whether platform default payment methods are included. + end - # @!attribute allow_promo_codes - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. + class Plan < WhopSDK::Internal::Type::BaseModel + # @!attribute billing_period + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # + # @return [Integer, nil] + optional :billing_period, Integer, nil?: true + + # @!attribute company_id + # Account ID for the inline plan, prefixed `biz_`. Defaults to the account + # resolved from the request. + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute currency + # Three-letter ISO currency code for the plan's prices. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute description + # Customer-visible plan description. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute expiration_days + # Access duration in days for expiration-based plans. + # + # @return [Integer, nil] + optional :expiration_days, Integer, nil?: true + + # @!attribute force_create_new_plan + # Whether to create a new plan instead of reusing a matching one. + # + # @return [Boolean, nil] + optional :force_create_new_plan, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!attribute initial_price + # Initial purchase price in the plan currency. + # + # @return [Float, nil] + optional :initial_price, Float, nil?: true + + # @!attribute metadata + # Custom key-value metadata stored on the plan. + # + # @return [Object, nil] + optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true + + # @!attribute override_tax_type + # Tax classification override for this plan. + # + # @return [String, nil] + optional :override_tax_type, String, nil?: true + + # @!attribute payment_method_configuration + # Payment method overrides for the inline plan. `null` uses platform defaults. + # + # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration, nil] + optional :payment_method_configuration, + -> { WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration }, + nil?: true + + # @!attribute plan_type + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + # + # @return [String, nil] + optional :plan_type, String, nil?: true + + # @!attribute product_id + # Product ID the inline plan should belong to, prefixed `prod_`. + # + # @return [String, nil] + optional :product_id, String, nil?: true + + # @!attribute release_method + # Sales method for the plan, such as `buy_now` or `waitlist`. + # + # @return [String, nil] + optional :release_method, String, nil?: true + + # @!attribute renewal_price + # Recurring price charged each billing period. + # + # @return [Float, nil] + optional :renewal_price, Float, nil?: true + + # @!attribute stock + # Units available for purchase. + # + # @return [Integer, nil] + optional :stock, Integer, nil?: true + + # @!attribute title + # Plan display name shown to customers. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!attribute trial_period_days + # Free trial days before the first renewal charge. + # + # @return [Integer, nil] + optional :trial_period_days, Integer, nil?: true + + # @!attribute unlimited_stock + # Whether the plan has unlimited stock. + # + # @return [Boolean, nil] + optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!attribute visibility + # Whether the plan is visible to customers or hidden from public view. + # + # @return [String, nil] + optional :visibility, String, nil?: true + + # @!method initialize(billing_period: nil, company_id: nil, currency: nil, description: nil, expiration_days: nil, force_create_new_plan: nil, initial_price: nil, metadata: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, product_id: nil, release_method: nil, renewal_price: nil, stock: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CheckoutConfigurationCreateParams::Plan} for more details. + # + # Plan attributes used to create or find a plan for this checkout configuration. + # Mutually exclusive with `plan_id`. + # + # @param billing_period [Integer, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # + # @param company_id [String, nil] Account ID for the inline plan, prefixed `biz_`. Defaults to the account resolve + # + # @param currency [String, nil] Three-letter ISO currency code for the plan's prices. + # + # @param description [String, nil] Customer-visible plan description. + # + # @param expiration_days [Integer, nil] Access duration in days for expiration-based plans. + # + # @param force_create_new_plan [Boolean, nil] Whether to create a new plan instead of reusing a matching one. + # + # @param initial_price [Float, nil] Initial purchase price in the plan currency. + # + # @param metadata [Object, nil] Custom key-value metadata stored on the plan. + # + # @param override_tax_type [String, nil] Tax classification override for this plan. + # + # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration, nil] Payment method overrides for the inline plan. `null` uses platform defaults. + # + # @param plan_type [String, nil] Billing model for the plan: `renewal` (recurring) or `one_time` (single payment) + # + # @param product_id [String, nil] Product ID the inline plan should belong to, prefixed `prod_`. + # + # @param release_method [String, nil] Sales method for the plan, such as `buy_now` or `waitlist`. + # + # @param renewal_price [Float, nil] Recurring price charged each billing period. + # + # @param stock [Integer, nil] Units available for purchase. + # + # @param title [String, nil] Plan display name shown to customers. + # + # @param trial_period_days [Integer, nil] Free trial days before the first renewal charge. + # + # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. + # + # @param visibility [String, nil] Whether the plan is visible to customers or hidden from public view. + + # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Plan#payment_method_configuration + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + # @!attribute disabled + # Payment methods explicitly disabled for this plan. + # + # @return [Array, nil] + optional :disabled, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute enabled + # Payment methods explicitly enabled for this plan. + # + # @return [Array, nil] + optional :enabled, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute include_platform_defaults + # Whether platform default payment methods are included. # # @return [Boolean, nil] - optional :allow_promo_codes, WhopSDK::Internal::Type::Boolean, nil?: true + optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean - # @!attribute checkout_styling - # Checkout styling overrides for this session. Overrides plan and company - # defaults. + # @!method initialize(disabled: nil, enabled: nil, include_platform_defaults: nil) + # Payment method overrides for the inline plan. `null` uses platform defaults. # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling, nil] - optional :checkout_styling, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling - }, - nil?: true - - # @!attribute currency - # The available currencies on the platform - # - # @return [Symbol, WhopSDK::Models::Currency, nil] - optional :currency, enum: -> { WhopSDK::Currency }, nil?: true - - # @!attribute metadata - # Custom key-value metadata to attach to the checkout configuration. - # - # @return [Hash{Symbol=>Object}, nil] - optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true - - # @!attribute payment_method_configuration - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - # - # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration, nil] - optional :payment_method_configuration, - -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration - }, - nil?: true - - # @!attribute redirect_url - # The URL to redirect the user to after checkout is completed. - # - # @return [String, nil] - optional :redirect_url, String, nil?: true - - # @!attribute source_url - # The URL of the page where the checkout is being initiated from. + # @param disabled [Array] Payment methods explicitly disabled for this plan. # - # @return [String, nil] - optional :source_url, String, nil?: true - - # @!attribute three_ds_level - # The 3D Secure behavior for a plan. - # - # @return [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel, nil] - optional :three_ds_level, - enum: -> { - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel - }, - nil?: true - - # @!method initialize(company_id:, allow_promo_codes: nil, checkout_styling: nil, currency: nil, metadata: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil, three_ds_level: nil, mode: :setup) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup} - # for more details. + # @param enabled [Array] Payment methods explicitly enabled for this plan. # - # Autogenerated input type of CreateCheckoutSession - # - # @param company_id [String] The unique identifier of the company to create the checkout configuration for. O - # - # @param allow_promo_codes [Boolean, nil] Whether the checkout should show the promo code input field and accept promo cod - # - # @param checkout_styling [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling, nil] Checkout styling overrides for this session. Overrides plan and company defaults - # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform - # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value metadata to attach to the checkout configuration. - # - # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration, nil] The explicit payment method configuration for the checkout session. Only applies - # - # @param redirect_url [String, nil] The URL to redirect the user to after checkout is completed. - # - # @param source_url [String, nil] The URL of the page where the checkout is being initiated from. - # - # @param three_ds_level [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel, nil] The 3D Secure behavior for a plan. - # - # @param mode [Symbol, :setup] - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup#checkout_styling - 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). - # - # @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::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling} - # for more details. - # - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - # - # @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 - - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup#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, nil] - optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!method initialize(disabled:, enabled:, include_platform_defaults: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration} - # for more details. - # - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will 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 - end - - # The 3D Secure behavior for a plan. - # - # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup#three_ds_level - module ThreeDSLevel - extend WhopSDK::Internal::Type::Enum - - MANDATE_CHALLENGE = :mandate_challenge - FRICTIONLESS = :frictionless - - # @!method self.values - # @return [Array] - end + # @param include_platform_defaults [Boolean] Whether platform default payment methods are included. end - - # @!method self.variants - # @return [Array(WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup)] end end end diff --git a/lib/whop_sdk/models/checkout_configuration_create_response.rb b/lib/whop_sdk/models/checkout_configuration_create_response.rb new file mode 100644 index 00000000..af25fb0b --- /dev/null +++ b/lib/whop_sdk/models/checkout_configuration_create_response.rb @@ -0,0 +1,275 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::CheckoutConfigurations#create + class CheckoutConfigurationCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Checkout configuration ID, prefixed `ch_`. + # + # @return [String] + required :id, String + + # @!attribute company_id + # Account ID, prefixed `biz_`. + # + # @return [String] + required :company_id, String + + # @!attribute created_at + # When the checkout configuration was created, as an ISO 8601 timestamp. + # + # @return [String] + required :created_at, String + + # @!attribute mode + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + # + # @return [Symbol, WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode] + required :mode, enum: -> { WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode } + + # @!attribute updated_at + # When the checkout configuration was last updated, as an ISO 8601 timestamp. + # + # @return [String] + required :updated_at, String + + # @!attribute affiliate_code + # Affiliate code applied at checkout, or `null` when none is set. + # + # @return [String, nil] + optional :affiliate_code, String, nil?: true + + # @!attribute currency + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute metadata + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. + # + # @return [Object, nil] + optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true + + # @!attribute payment_method_configuration + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + # + # @return [WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration, nil] + optional :payment_method_configuration, + -> { WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration }, + nil?: true + + # @!attribute plan + # Plan used for payment checkout. `null` in setup mode. + # + # @return [WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan, nil] + optional :plan, -> { WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan }, nil?: true + + # @!attribute purchase_url + # Checkout URL you can send to customers. + # + # @return [String, nil] + optional :purchase_url, String, nil?: true + + # @!attribute redirect_url + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. + # + # @return [String, nil] + optional :redirect_url, String, nil?: true + + # @!attribute three_ds_level + # 3D Secure behavior for this checkout, or `null` to use the account default. + # + # @return [String, nil] + optional :three_ds_level, String, nil?: true + + # @!method initialize(id:, company_id:, created_at:, mode:, updated_at:, affiliate_code: nil, currency: nil, metadata: nil, payment_method_configuration: nil, plan: nil, purchase_url: nil, redirect_url: nil, three_ds_level: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CheckoutConfigurationCreateResponse} for more details. + # + # @param id [String] Checkout configuration ID, prefixed `ch_`. + # + # @param company_id [String] Account ID, prefixed `biz_`. + # + # @param created_at [String] When the checkout configuration was created, as an ISO 8601 timestamp. + # + # @param mode [Symbol, WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode] Checkout mode: `payment` collects payment now; `setup` saves payment details for + # + # @param updated_at [String] When the checkout configuration was last updated, as an ISO 8601 timestamp. + # + # @param affiliate_code [String, nil] Affiliate code applied at checkout, or `null` when none is set. + # + # @param currency [String, nil] Currency used for setup-mode payment method availability; defaults to `usd` when + # + # @param metadata [Object, nil] Custom key-value metadata copied to payments and memberships. `null` without the + # + # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration, nil] Payment method overrides for this checkout. `null` when it uses the plan or plat + # + # @param plan [WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan, nil] Plan used for payment checkout. `null` in setup mode. + # + # @param purchase_url [String, nil] Checkout URL you can send to customers. + # + # @param redirect_url [String, nil] URL customers are sent to after checkout, or `null` when no redirect is configur + # + # @param three_ds_level [String, nil] 3D Secure behavior for this checkout, or `null` to use the account default. + + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + # + # @see WhopSDK::Models::CheckoutConfigurationCreateResponse#mode + module Mode + extend WhopSDK::Internal::Type::Enum + + PAYMENT = :payment + SETUP = :setup + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::CheckoutConfigurationCreateResponse#payment_method_configuration + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + # @!attribute disabled + # Payment methods explicitly disabled for checkout. + # + # @return [Array, nil] + optional :disabled, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute enabled + # Payment methods explicitly enabled for checkout. + # + # @return [Array, nil] + optional :enabled, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute include_platform_defaults + # Whether platform default payment methods are included. + # + # @return [Boolean, nil] + optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean + + # @!method initialize(disabled: nil, enabled: nil, include_platform_defaults: nil) + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + # + # @param disabled [Array] Payment methods explicitly disabled for checkout. + # + # @param enabled [Array] Payment methods explicitly enabled for checkout. + # + # @param include_platform_defaults [Boolean] Whether platform default payment methods are included. + end + + # @see WhopSDK::Models::CheckoutConfigurationCreateResponse#plan + class Plan < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Plan ID, prefixed `plan_`. + # + # @return [String] + required :id, String + + # @!attribute adaptive_pricing_enabled + # Whether this plan accepts local currency payments via adaptive pricing. + # + # @return [Boolean] + required :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean + + # @!attribute billing_period + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. + # + # @return [Integer, nil] + required :billing_period, Integer, nil?: true + + # @!attribute currency + # Three-letter ISO currency code for the plan's prices. + # + # @return [String] + required :currency, String + + # @!attribute expiration_days + # Access duration in days for expiration-based plans. + # + # @return [Integer, nil] + required :expiration_days, Integer, nil?: true + + # @!attribute initial_price + # Initial purchase price in the plan currency. + # + # @return [Float] + required :initial_price, Float + + # @!attribute plan_type + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + # + # @return [String] + required :plan_type, String + + # @!attribute release_method + # Sales method for the plan, such as `buy_now` or `waitlist`. + # + # @return [String] + required :release_method, String + + # @!attribute renewal_price + # Recurring price charged each billing period. + # + # @return [Float] + required :renewal_price, Float + + # @!attribute three_ds_level + # 3D Secure behavior for this plan, or `null` to use the account default. + # + # @return [String, nil] + required :three_ds_level, String, nil?: true + + # @!attribute trial_period_days + # Free trial days before the first renewal charge. + # + # @return [Integer, nil] + required :trial_period_days, Integer, nil?: true + + # @!attribute visibility + # Whether the plan is visible to customers or hidden from public view. + # + # @return [String] + required :visibility, String + + # @!method initialize(id:, adaptive_pricing_enabled:, billing_period:, currency:, expiration_days:, initial_price:, plan_type:, release_method:, renewal_price:, three_ds_level:, trial_period_days:, visibility:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan} for more details. + # + # Plan used for payment checkout. `null` in setup mode. + # + # @param id [String] Plan ID, prefixed `plan_`. + # + # @param adaptive_pricing_enabled [Boolean] Whether this plan accepts local currency payments via adaptive pricing. + # + # @param billing_period [Integer, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. `n + # + # @param currency [String] Three-letter ISO currency code for the plan's prices. + # + # @param expiration_days [Integer, nil] Access duration in days for expiration-based plans. + # + # @param initial_price [Float] Initial purchase price in the plan currency. + # + # @param plan_type [String] Billing model for the plan: `renewal` (recurring) or `one_time` (single payment) + # + # @param release_method [String] Sales method for the plan, such as `buy_now` or `waitlist`. + # + # @param renewal_price [Float] Recurring price charged each billing period. + # + # @param three_ds_level [String, nil] 3D Secure behavior for this plan, or `null` to use the account default. + # + # @param trial_period_days [Integer, nil] Free trial days before the first renewal charge. + # + # @param visibility [String] Whether the plan is visible to customers or hidden from public view. + end + end + end +end diff --git a/lib/whop_sdk/models/checkout_configuration_delete_params.rb b/lib/whop_sdk/models/checkout_configuration_delete_params.rb new file mode 100644 index 00000000..f21cc77f --- /dev/null +++ b/lib/whop_sdk/models/checkout_configuration_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::CheckoutConfigurations#delete + class CheckoutConfigurationDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/checkout_configuration_list_params.rb b/lib/whop_sdk/models/checkout_configuration_list_params.rb index 883a79c3..bed1ea09 100644 --- a/lib/whop_sdk/models/checkout_configuration_list_params.rb +++ b/lib/whop_sdk/models/checkout_configuration_list_params.rb @@ -8,83 +8,92 @@ class CheckoutConfigurationListParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute company_id - # The unique identifier of the company to list checkout configurations for. + # Account ID, prefixed `biz_`. # # @return [String] required :company_id, String # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # Cursor for the next page of results. # # @return [String, nil] - optional :after, String, nil?: true - - # @!attribute before - # Returns the elements in the list that come before the specified cursor. - # - # @return [String, nil] - optional :before, String, nil?: true + optional :after, String # @!attribute created_after - # Only return checkout configurations created after this timestamp. + # Only return checkout configurations created after this Unix timestamp. # - # @return [Time, nil] - optional :created_after, Time, nil?: true + # @return [Integer, nil] + optional :created_after, Integer # @!attribute created_before - # Only return checkout configurations created before this timestamp. + # Only return checkout configurations created before this Unix timestamp. # - # @return [Time, nil] - optional :created_before, Time, nil?: true + # @return [Integer, nil] + optional :created_before, Integer # @!attribute direction - # The direction of the sort. + # Sort direction. Defaults to `desc`. # - # @return [Symbol, WhopSDK::Models::Direction, nil] - optional :direction, enum: -> { WhopSDK::Direction }, nil?: true + # @return [Symbol, WhopSDK::Models::CheckoutConfigurationListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::CheckoutConfigurationListParams::Direction } # @!attribute first - # Returns the first _n_ elements from the list. + # Number of checkout configurations to return. # # @return [Integer, nil] - optional :first, Integer, nil?: true + optional :first, Integer - # @!attribute last - # Returns the last _n_ elements from the list. + # @!attribute order + # Field used to sort checkout configurations. # - # @return [Integer, nil] - optional :last, Integer, nil?: true + # @return [Symbol, WhopSDK::Models::CheckoutConfigurationListParams::Order, nil] + optional :order, enum: -> { WhopSDK::CheckoutConfigurationListParams::Order } # @!attribute plan_id - # Filter checkout configurations to only those associated with this plan - # identifier. + # Only return checkout configurations for this plan ID, prefixed `plan_`. # # @return [String, nil] - optional :plan_id, String, nil?: true + optional :plan_id, String - # @!method initialize(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, plan_id: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationListParams} for more details. - # - # @param company_id [String] The unique identifier of the company to list checkout configurations for. + # @!method initialize(company_id:, after: nil, created_after: nil, created_before: nil, direction: nil, first: nil, order: nil, plan_id: nil, request_options: {}) + # @param company_id [String] Account ID, prefixed `biz_`. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] Cursor for the next page of results. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param created_after [Integer] Only return checkout configurations created after this Unix timestamp. # - # @param created_after [Time, nil] Only return checkout configurations created after this timestamp. + # @param created_before [Integer] Only return checkout configurations created before this Unix timestamp. # - # @param created_before [Time, nil] Only return checkout configurations created before this timestamp. + # @param direction [Symbol, WhopSDK::Models::CheckoutConfigurationListParams::Direction] Sort direction. Defaults to `desc`. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param first [Integer] Number of checkout configurations to return. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param order [Symbol, WhopSDK::Models::CheckoutConfigurationListParams::Order] Field used to sort checkout configurations. # - # @param last [Integer, nil] Returns the last _n_ elements from the list. - # - # @param plan_id [String, nil] Filter checkout configurations to only those associated with this plan identifie + # @param plan_id [String] Only return checkout configurations for this plan ID, prefixed `plan_`. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Sort direction. Defaults to `desc`. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # Field used to sort checkout configurations. + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT = :created_at + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/checkout_configuration_list_response.rb b/lib/whop_sdk/models/checkout_configuration_list_response.rb index 5cb73663..9fc5dce4 100644 --- a/lib/whop_sdk/models/checkout_configuration_list_response.rb +++ b/lib/whop_sdk/models/checkout_configuration_list_response.rb @@ -5,279 +5,270 @@ module Models # @see WhopSDK::Resources::CheckoutConfigurations#list class CheckoutConfigurationListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for the checkout session. + # Checkout configuration ID, prefixed `ch_`. # # @return [String] required :id, String - # @!attribute affiliate_code - # The affiliate code to use for the checkout configuration + # @!attribute company_id + # Account ID, prefixed `biz_`. # - # @return [String, nil] - required :affiliate_code, String, nil?: true + # @return [String] + required :company_id, String - # @!attribute allow_promo_codes - # Whether the checkout configuration allows promo codes. When false, the promo - # code input is hidden and promo codes are rejected. + # @!attribute created_at + # When the checkout configuration was created, as an ISO 8601 timestamp. # - # @return [Boolean] - required :allow_promo_codes, WhopSDK::Internal::Type::Boolean + # @return [String] + required :created_at, String - # @!attribute company_id - # The ID of the company to use for the checkout configuration + # @!attribute mode + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + # + # @return [Symbol, WhopSDK::Models::CheckoutConfigurationListResponse::Mode] + required :mode, enum: -> { WhopSDK::Models::CheckoutConfigurationListResponse::Mode } + + # @!attribute updated_at + # When the checkout configuration was last updated, as an ISO 8601 timestamp. # # @return [String] - required :company_id, String + required :updated_at, String - # @!attribute currency - # The available currencies on the platform + # @!attribute affiliate_code + # Affiliate code applied at checkout, or `null` when none is set. # - # @return [Symbol, WhopSDK::Models::Currency, nil] - required :currency, enum: -> { WhopSDK::Currency }, nil?: true + # @return [String, nil] + optional :affiliate_code, String, nil?: true - # @!attribute metadata - # The metadata to use for the checkout configuration + # @!attribute currency + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. # - # @return [Hash{Symbol=>Object}, nil] - required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @return [String, nil] + optional :currency, String, nil?: true - # @!attribute mode - # The mode of the checkout session. + # @!attribute metadata + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. # - # @return [Symbol, WhopSDK::Models::CheckoutModes] - required :mode, enum: -> { WhopSDK::CheckoutModes } + # @return [Object, nil] + optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute payment_method_configuration - # The explicit payment method configuration for the session, if any. This - # currently only works in 'setup' mode. Use the plan's - # payment_method_configuration for payment method. + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. # # @return [WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration, nil] - required :payment_method_configuration, + optional :payment_method_configuration, -> { WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration }, nil?: true # @!attribute plan - # The plan to use for the checkout configuration + # Plan used for payment checkout. `null` in setup mode. # # @return [WhopSDK::Models::CheckoutConfigurationListResponse::Plan, nil] - required :plan, -> { WhopSDK::Models::CheckoutConfigurationListResponse::Plan }, nil?: true + optional :plan, -> { WhopSDK::Models::CheckoutConfigurationListResponse::Plan }, nil?: true # @!attribute purchase_url - # A URL you can send to customers to complete a checkout. It looks like - # `/checkout/plan_xxxx?session={id}` + # Checkout URL you can send to customers. # - # @return [String] - required :purchase_url, String + # @return [String, nil] + optional :purchase_url, String, nil?: true # @!attribute redirect_url - # The URL to redirect the user to after the checkout configuration is created + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. # # @return [String, nil] - required :redirect_url, String, nil?: true + optional :redirect_url, String, nil?: true - # @!method initialize(id:, affiliate_code:, allow_promo_codes:, company_id:, currency:, metadata:, mode:, payment_method_configuration:, plan:, purchase_url:, redirect_url:) + # @!attribute three_ds_level + # 3D Secure behavior for this checkout, or `null` to use the account default. + # + # @return [String, nil] + optional :three_ds_level, String, nil?: true + + # @!method initialize(id:, company_id:, created_at:, mode:, updated_at:, affiliate_code: nil, currency: nil, metadata: nil, payment_method_configuration: nil, plan: nil, purchase_url: nil, redirect_url: nil, three_ds_level: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::CheckoutConfigurationListResponse} for more details. # - # A checkout configuration is a reusable configuration for a checkout, including - # the plan, affiliate, and custom metadata. Payments and memberships created from - # a checkout session inherit its metadata. + # @param id [String] Checkout configuration ID, prefixed `ch_`. + # + # @param company_id [String] Account ID, prefixed `biz_`. + # + # @param created_at [String] When the checkout configuration was created, as an ISO 8601 timestamp. # - # @param id [String] The unique identifier for the checkout session. + # @param mode [Symbol, WhopSDK::Models::CheckoutConfigurationListResponse::Mode] Checkout mode: `payment` collects payment now; `setup` saves payment details for # - # @param affiliate_code [String, nil] The affiliate code to use for the checkout configuration + # @param updated_at [String] When the checkout configuration was last updated, as an ISO 8601 timestamp. # - # @param allow_promo_codes [Boolean] Whether the checkout configuration allows promo codes. When false, the promo cod + # @param affiliate_code [String, nil] Affiliate code applied at checkout, or `null` when none is set. # - # @param company_id [String] The ID of the company to use for the checkout configuration + # @param currency [String, nil] Currency used for setup-mode payment method availability; defaults to `usd` when # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param metadata [Object, nil] Custom key-value metadata copied to payments and memberships. `null` without the # - # @param metadata [Hash{Symbol=>Object}, nil] The metadata to use for the checkout configuration + # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration, nil] Payment method overrides for this checkout. `null` when it uses the plan or plat # - # @param mode [Symbol, WhopSDK::Models::CheckoutModes] The mode of the checkout session. + # @param plan [WhopSDK::Models::CheckoutConfigurationListResponse::Plan, nil] Plan used for payment checkout. `null` in setup mode. # - # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration, nil] The explicit payment method configuration for the session, if any. This currentl + # @param purchase_url [String, nil] Checkout URL you can send to customers. # - # @param plan [WhopSDK::Models::CheckoutConfigurationListResponse::Plan, nil] The plan to use for the checkout configuration + # @param redirect_url [String, nil] URL customers are sent to after checkout, or `null` when no redirect is configur # - # @param purchase_url [String] A URL you can send to customers to complete a checkout. It looks like `/checkout + # @param three_ds_level [String, nil] 3D Secure behavior for this checkout, or `null` to use the account default. + + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. # - # @param redirect_url [String, nil] The URL to redirect the user to after the checkout configuration is created + # @see WhopSDK::Models::CheckoutConfigurationListResponse#mode + module Mode + extend WhopSDK::Internal::Type::Enum + + PAYMENT = :payment + SETUP = :setup + + # @!method self.values + # @return [Array] + end # @see WhopSDK::Models::CheckoutConfigurationListResponse#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. + # Payment methods explicitly disabled for checkout. # - # @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. + # Payment methods explicitly enabled for checkout. # - # @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. + # Whether platform default payment methods are included. # - # @return [Boolean] - required :include_platform_defaults, WhopSDK::Internal::Type::Boolean + # @return [Boolean, nil] + optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean - # @!method initialize(disabled:, enabled:, include_platform_defaults:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration} - # for more details. - # - # The explicit payment method configuration for the session, if any. This - # currently only works in 'setup' mode. Use the plan's - # payment_method_configuration for payment method. + # @!method initialize(disabled: nil, enabled: nil, include_platform_defaults: nil) + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. # - # @param disabled [Array] An array of payment method identifiers that are explicitly disabled. Only applie + # @param disabled [Array] Payment methods explicitly disabled for checkout. # - # @param enabled [Array] An array of payment method identifiers that are explicitly enabled. This means t + # @param enabled [Array] Payment methods explicitly enabled for checkout. # - # @param include_platform_defaults [Boolean] Whether Whop's platform default payment method enablement settings are included + # @param include_platform_defaults [Boolean] Whether platform default payment methods are included. end # @see WhopSDK::Models::CheckoutConfigurationListResponse#plan class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for the plan. + # Plan ID, prefixed `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. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. # # @return [Integer, nil] required :billing_period, Integer, nil?: true # @!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. + # Three-letter ISO currency code for the plan's prices. # - # @return [Symbol, WhopSDK::Models::Currency] - required :currency, enum: -> { WhopSDK::Currency } + # @return [String] + required :currency, String # @!attribute expiration_days - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # Access duration in days for expiration-based plans. # # @return [Integer, nil] required :expiration_days, Integer, 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. + # Initial purchase price in the plan currency. # # @return [Float] required :initial_price, Float # @!attribute plan_type - # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). # - # @return [Symbol, WhopSDK::Models::PlanType] - required :plan_type, enum: -> { WhopSDK::PlanType } + # @return [String] + required :plan_type, String # @!attribute release_method - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. + # Sales method for the plan, such as `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. + # Recurring price charged each billing period. # # @return [Float] required :renewal_price, Float # @!attribute three_ds_level - # The 3D Secure behavior for a plan. + # 3D Secure behavior for this plan, or `null` to use the account default. # - # @return [Symbol, WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel, nil] - required :three_ds_level, - enum: -> { WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel }, - nil?: true + # @return [String, nil] + required :three_ds_level, 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. + # Free trial days before the first renewal charge. # # @return [Integer, nil] required :trial_period_days, Integer, nil?: true # @!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:, currency:, expiration_days:, initial_price:, plan_type:, release_method:, renewal_price:, three_ds_level:, trial_period_days:, visibility:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::CheckoutConfigurationListResponse::Plan} for more details. # - # The plan to use for the checkout configuration - # - # @param id [String] The unique identifier for the plan. + # Plan used for payment checkout. `null` in setup mode. # - # @param adaptive_pricing_enabled [Boolean] Whether the creator has turned on adaptive pricing for this plan. Raw setting — + # @param id [String] Plan ID, prefixed `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 currency [Symbol, WhopSDK::Models::Currency] The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary + # @param billing_period [Integer, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. `n # - # @param expiration_days [Integer, nil] The number of days until the membership expires (for expiration-based plans). Fo + # @param currency [String] Three-letter ISO currency code for the plan's prices. # - # @param initial_price [Float] The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). + # @param expiration_days [Integer, nil] Access duration in days for expiration-based plans. # - # @param plan_type [Symbol, WhopSDK::Models::PlanType] The billing model for this plan: 'renewal' for recurring subscriptions or 'one_t + # @param initial_price [Float] Initial purchase price in the plan currency. # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod] The method used to sell this plan: 'buy_now' for immediate purchase or 'waitlist + # @param plan_type [String] Billing model for the plan: `renewal` (recurring) or `one_time` (single payment) # - # @param renewal_price [Float] The recurring price charged every billing_period in the plan's base_currency (e. + # @param release_method [String] Sales method for the plan, such as `buy_now` or `waitlist`. # - # @param three_ds_level [Symbol, WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel, nil] The 3D Secure behavior for a plan. + # @param renewal_price [Float] Recurring price charged each billing period. # - # @param trial_period_days [Integer, nil] The number of free trial days before the first charge on a renewal plan. Null if + # @param three_ds_level [String, nil] 3D Secure behavior for this plan, or `null` to use the account default. # - # @param visibility [Symbol, WhopSDK::Models::Visibility] Controls whether the plan is visible to customers. When set to 'hidden', the pla - - # The 3D Secure behavior for a plan. + # @param trial_period_days [Integer, nil] Free trial days before the first renewal charge. # - # @see WhopSDK::Models::CheckoutConfigurationListResponse::Plan#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/checkout_configuration_retrieve_response.rb b/lib/whop_sdk/models/checkout_configuration_retrieve_response.rb new file mode 100644 index 00000000..bcc86a75 --- /dev/null +++ b/lib/whop_sdk/models/checkout_configuration_retrieve_response.rb @@ -0,0 +1,275 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::CheckoutConfigurations#retrieve + class CheckoutConfigurationRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Checkout configuration ID, prefixed `ch_`. + # + # @return [String] + required :id, String + + # @!attribute company_id + # Account ID, prefixed `biz_`. + # + # @return [String] + required :company_id, String + + # @!attribute created_at + # When the checkout configuration was created, as an ISO 8601 timestamp. + # + # @return [String] + required :created_at, String + + # @!attribute mode + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + # + # @return [Symbol, WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode] + required :mode, enum: -> { WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode } + + # @!attribute updated_at + # When the checkout configuration was last updated, as an ISO 8601 timestamp. + # + # @return [String] + required :updated_at, String + + # @!attribute affiliate_code + # Affiliate code applied at checkout, or `null` when none is set. + # + # @return [String, nil] + optional :affiliate_code, String, nil?: true + + # @!attribute currency + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute metadata + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. + # + # @return [Object, nil] + optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true + + # @!attribute payment_method_configuration + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + # + # @return [WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration, nil] + optional :payment_method_configuration, + -> { WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration }, + nil?: true + + # @!attribute plan + # Plan used for payment checkout. `null` in setup mode. + # + # @return [WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan, nil] + optional :plan, -> { WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan }, nil?: true + + # @!attribute purchase_url + # Checkout URL you can send to customers. + # + # @return [String, nil] + optional :purchase_url, String, nil?: true + + # @!attribute redirect_url + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. + # + # @return [String, nil] + optional :redirect_url, String, nil?: true + + # @!attribute three_ds_level + # 3D Secure behavior for this checkout, or `null` to use the account default. + # + # @return [String, nil] + optional :three_ds_level, String, nil?: true + + # @!method initialize(id:, company_id:, created_at:, mode:, updated_at:, affiliate_code: nil, currency: nil, metadata: nil, payment_method_configuration: nil, plan: nil, purchase_url: nil, redirect_url: nil, three_ds_level: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CheckoutConfigurationRetrieveResponse} for more details. + # + # @param id [String] Checkout configuration ID, prefixed `ch_`. + # + # @param company_id [String] Account ID, prefixed `biz_`. + # + # @param created_at [String] When the checkout configuration was created, as an ISO 8601 timestamp. + # + # @param mode [Symbol, WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode] Checkout mode: `payment` collects payment now; `setup` saves payment details for + # + # @param updated_at [String] When the checkout configuration was last updated, as an ISO 8601 timestamp. + # + # @param affiliate_code [String, nil] Affiliate code applied at checkout, or `null` when none is set. + # + # @param currency [String, nil] Currency used for setup-mode payment method availability; defaults to `usd` when + # + # @param metadata [Object, nil] Custom key-value metadata copied to payments and memberships. `null` without the + # + # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration, nil] Payment method overrides for this checkout. `null` when it uses the plan or plat + # + # @param plan [WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan, nil] Plan used for payment checkout. `null` in setup mode. + # + # @param purchase_url [String, nil] Checkout URL you can send to customers. + # + # @param redirect_url [String, nil] URL customers are sent to after checkout, or `null` when no redirect is configur + # + # @param three_ds_level [String, nil] 3D Secure behavior for this checkout, or `null` to use the account default. + + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + # + # @see WhopSDK::Models::CheckoutConfigurationRetrieveResponse#mode + module Mode + extend WhopSDK::Internal::Type::Enum + + PAYMENT = :payment + SETUP = :setup + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::CheckoutConfigurationRetrieveResponse#payment_method_configuration + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + # @!attribute disabled + # Payment methods explicitly disabled for checkout. + # + # @return [Array, nil] + optional :disabled, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute enabled + # Payment methods explicitly enabled for checkout. + # + # @return [Array, nil] + optional :enabled, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute include_platform_defaults + # Whether platform default payment methods are included. + # + # @return [Boolean, nil] + optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean + + # @!method initialize(disabled: nil, enabled: nil, include_platform_defaults: nil) + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + # + # @param disabled [Array] Payment methods explicitly disabled for checkout. + # + # @param enabled [Array] Payment methods explicitly enabled for checkout. + # + # @param include_platform_defaults [Boolean] Whether platform default payment methods are included. + end + + # @see WhopSDK::Models::CheckoutConfigurationRetrieveResponse#plan + class Plan < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Plan ID, prefixed `plan_`. + # + # @return [String] + required :id, String + + # @!attribute adaptive_pricing_enabled + # Whether this plan accepts local currency payments via adaptive pricing. + # + # @return [Boolean] + required :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean + + # @!attribute billing_period + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. + # + # @return [Integer, nil] + required :billing_period, Integer, nil?: true + + # @!attribute currency + # Three-letter ISO currency code for the plan's prices. + # + # @return [String] + required :currency, String + + # @!attribute expiration_days + # Access duration in days for expiration-based plans. + # + # @return [Integer, nil] + required :expiration_days, Integer, nil?: true + + # @!attribute initial_price + # Initial purchase price in the plan currency. + # + # @return [Float] + required :initial_price, Float + + # @!attribute plan_type + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + # + # @return [String] + required :plan_type, String + + # @!attribute release_method + # Sales method for the plan, such as `buy_now` or `waitlist`. + # + # @return [String] + required :release_method, String + + # @!attribute renewal_price + # Recurring price charged each billing period. + # + # @return [Float] + required :renewal_price, Float + + # @!attribute three_ds_level + # 3D Secure behavior for this plan, or `null` to use the account default. + # + # @return [String, nil] + required :three_ds_level, String, nil?: true + + # @!attribute trial_period_days + # Free trial days before the first renewal charge. + # + # @return [Integer, nil] + required :trial_period_days, Integer, nil?: true + + # @!attribute visibility + # Whether the plan is visible to customers or hidden from public view. + # + # @return [String] + required :visibility, String + + # @!method initialize(id:, adaptive_pricing_enabled:, billing_period:, currency:, expiration_days:, initial_price:, plan_type:, release_method:, renewal_price:, three_ds_level:, trial_period_days:, visibility:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan} for more details. + # + # Plan used for payment checkout. `null` in setup mode. + # + # @param id [String] Plan ID, prefixed `plan_`. + # + # @param adaptive_pricing_enabled [Boolean] Whether this plan accepts local currency payments via adaptive pricing. + # + # @param billing_period [Integer, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. `n + # + # @param currency [String] Three-letter ISO currency code for the plan's prices. + # + # @param expiration_days [Integer, nil] Access duration in days for expiration-based plans. + # + # @param initial_price [Float] Initial purchase price in the plan currency. + # + # @param plan_type [String] Billing model for the plan: `renewal` (recurring) or `one_time` (single payment) + # + # @param release_method [String] Sales method for the plan, such as `buy_now` or `waitlist`. + # + # @param renewal_price [Float] Recurring price charged each billing period. + # + # @param three_ds_level [String, nil] 3D Secure behavior for this plan, or `null` to use the account default. + # + # @param trial_period_days [Integer, nil] Free trial days before the first renewal charge. + # + # @param visibility [String] Whether the plan is visible to customers or hidden from public view. + end + end + end +end diff --git a/lib/whop_sdk/models/company.rb b/lib/whop_sdk/models/company.rb index 8f1d6aee..6f5a6217 100644 --- a/lib/whop_sdk/models/company.rb +++ b/lib/whop_sdk/models/company.rb @@ -70,7 +70,7 @@ class Company < WhopSDK::Internal::Type::BaseModel required :published_reviews_count, Integer # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @return [String] required :route, String @@ -140,7 +140,7 @@ class Company < WhopSDK::Internal::Type::BaseModel # # @param published_reviews_count [Integer] The total number of published customer reviews across all products for this comp # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # @param route [String] URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @param send_customer_emails [Boolean] Whether Whop sends transactional emails (receipts, updates) to customers on beha # diff --git a/lib/whop_sdk/models/company_list_response.rb b/lib/whop_sdk/models/company_list_response.rb index ed2560ee..16e15149 100644 --- a/lib/whop_sdk/models/company_list_response.rb +++ b/lib/whop_sdk/models/company_list_response.rb @@ -57,7 +57,7 @@ class CompanyListResponse < WhopSDK::Internal::Type::BaseModel required :published_reviews_count, Integer # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @return [String] required :route, String @@ -116,7 +116,7 @@ class CompanyListResponse < WhopSDK::Internal::Type::BaseModel # # @param published_reviews_count [Integer] The total number of published customer reviews across all products for this comp # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # @param route [String] URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @param send_customer_emails [Boolean] Whether Whop sends transactional emails (receipts, updates) to customers on beha # diff --git a/lib/whop_sdk/models/conversion_create_response.rb b/lib/whop_sdk/models/conversion_create_response.rb deleted file mode 100644 index 833cb168..00000000 --- a/lib/whop_sdk/models/conversion_create_response.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::Conversions#create - class ConversionCreateResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the conversion - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # A tracked conversion event - # - # @param id [String] The unique identifier for the conversion - end - end -end diff --git a/lib/whop_sdk/models/course.rb b/lib/whop_sdk/models/course.rb index e2452fbb..64a91496 100644 --- a/lib/whop_sdk/models/course.rb +++ b/lib/whop_sdk/models/course.rb @@ -299,7 +299,7 @@ class Thumbnail < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -334,7 +334,7 @@ class Thumbnail < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # diff --git a/lib/whop_sdk/models/course_list_response.rb b/lib/whop_sdk/models/course_list_response.rb index 490081bd..45f9b7c2 100644 --- a/lib/whop_sdk/models/course_list_response.rb +++ b/lib/whop_sdk/models/course_list_response.rb @@ -138,7 +138,7 @@ class Thumbnail < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -173,7 +173,7 @@ class Thumbnail < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # diff --git a/lib/whop_sdk/models/deposit_create_params.rb b/lib/whop_sdk/models/deposit_create_params.rb index b8b09105..af2d6e7a 100644 --- a/lib/whop_sdk/models/deposit_create_params.rb +++ b/lib/whop_sdk/models/deposit_create_params.rb @@ -7,12 +7,6 @@ class DepositCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute amount - # Amount to deposit. - # - # @return [Float] - required :amount, Float - # @!attribute destination # Destination account ID or wallet address. Object form is supported for # compatibility. @@ -20,29 +14,35 @@ class DepositCreateParams < WhopSDK::Internal::Type::BaseModel # @return [String, WhopSDK::Models::DepositCreateParams::Destination::UnionMember1] required :destination, union: -> { WhopSDK::DepositCreateParams::Destination } + # @!attribute amount + # Amount to prefill on hosted deposit page. + # + # @return [Float, nil] + optional :amount, Float + # @!attribute metadata - # Arbitrary metadata echoed in the response. + # Metadata to include with the deposit response. # # @return [Hash{Symbol=>Object}, nil] optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] # @!attribute network - # Optional destination network override. + # Destination network override. # # @return [String, nil] optional :network, String, nil?: true - # @!method initialize(amount:, destination:, metadata: nil, network: nil, request_options: {}) + # @!method initialize(destination:, amount: nil, metadata: nil, network: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::DepositCreateParams} for more details. # - # @param amount [Float] Amount to deposit. - # # @param destination [String, WhopSDK::Models::DepositCreateParams::Destination::UnionMember1] Destination account ID or wallet address. Object form is supported for compatibi # - # @param metadata [Hash{Symbol=>Object}] Arbitrary metadata echoed in the response. + # @param amount [Float] Amount to prefill on hosted deposit page. + # + # @param metadata [Hash{Symbol=>Object}] Metadata to include with the deposit response. # - # @param network [String, nil] Optional destination network override. + # @param network [String, nil] Destination network override. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] @@ -57,24 +57,29 @@ module Destination class UnionMember1 < WhopSDK::Internal::Type::BaseModel # @!attribute account_id + # Destination account ID. # # @return [String, nil] optional :account_id, String # @!attribute address + # Destination wallet address. # # @return [String, nil] optional :address, String # @!attribute network + # Destination wallet network. # # @return [String, nil] optional :network, String # @!method initialize(account_id: nil, address: nil, network: nil) - # @param account_id [String] - # @param address [String] - # @param network [String] + # @param account_id [String] Destination account ID. + # + # @param address [String] Destination wallet address. + # + # @param network [String] Destination wallet network. end # @!method self.variants diff --git a/lib/whop_sdk/models/deposit_create_response.rb b/lib/whop_sdk/models/deposit_create_response.rb index 4f7da382..953c8f39 100644 --- a/lib/whop_sdk/models/deposit_create_response.rb +++ b/lib/whop_sdk/models/deposit_create_response.rb @@ -4,88 +4,214 @@ module WhopSDK module Models # @see WhopSDK::Resources::Deposits#create class DepositCreateResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute amount - # - # @return [String] - required :amount, String - - # @!attribute deposit_address + # @!attribute account_id + # Account ID of the destination owner. Null for raw wallet address destinations. # - # @return [WhopSDK::Models::DepositCreateResponse::DepositAddress] - required :deposit_address, -> { WhopSDK::Models::DepositCreateResponse::DepositAddress } - - # @!attribute destination - # - # @return [WhopSDK::Models::DepositCreateResponse::Destination] - required :destination, -> { WhopSDK::Models::DepositCreateResponse::Destination } + # @return [String, nil] + required :account_id, String, nil?: true # @!attribute hosted_url + # URL of the hosted deposit page. Only present for business destinations. # # @return [String, nil] required :hosted_url, String, nil?: true # @!attribute metadata + # Metadata from the request. # # @return [Hash{Symbol=>Object}] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] + # @!attribute methods_ + # Available deposit methods for destination. + # + # @return [WhopSDK::Models::DepositCreateResponse::Methods] + required :methods_, -> { WhopSDK::Models::DepositCreateResponse::Methods }, api_name: :methods + # @!attribute object # # @return [Symbol, WhopSDK::Models::DepositCreateResponse::Object] required :object, enum: -> { WhopSDK::Models::DepositCreateResponse::Object } - # @!method initialize(amount:, deposit_address:, destination:, hosted_url:, metadata:, object:) - # @param amount [String] - # @param deposit_address [WhopSDK::Models::DepositCreateResponse::DepositAddress] - # @param destination [WhopSDK::Models::DepositCreateResponse::Destination] - # @param hosted_url [String, nil] - # @param metadata [Hash{Symbol=>Object}] - # @param object [Symbol, WhopSDK::Models::DepositCreateResponse::Object] + # @!attribute amount + # Requested deposit amount. + # + # @return [String, nil] + optional :amount, String - # @see WhopSDK::Models::DepositCreateResponse#deposit_address - class DepositAddress < WhopSDK::Internal::Type::BaseModel - # @!attribute evm - # - # @return [String] - required :evm, String + # @!method initialize(account_id:, hosted_url:, metadata:, methods_:, object:, amount: nil) + # @param account_id [String, nil] Account ID of the destination owner. Null for raw wallet address destinations. + # + # @param hosted_url [String, nil] URL of the hosted deposit page. Only present for business destinations. + # + # @param metadata [Hash{Symbol=>Object}] Metadata from the request. + # + # @param methods_ [WhopSDK::Models::DepositCreateResponse::Methods] Available deposit methods for destination. + # + # @param object [Symbol, WhopSDK::Models::DepositCreateResponse::Object] + # + # @param amount [String] Requested deposit amount. - # @!attribute solana + # @see WhopSDK::Models::DepositCreateResponse#methods_ + class Methods < WhopSDK::Internal::Type::BaseModel + # @!attribute bank + # Bank deposit details. Only present when bank deposits are active for the + # destination account. # - # @return [String] - required :solana, String - - # @!method initialize(evm:, solana:) - # @param evm [String] - # @param solana [String] - end + # @return [WhopSDK::Models::DepositCreateResponse::Methods::Bank, nil] + required :bank, -> { WhopSDK::Models::DepositCreateResponse::Methods::Bank }, nil?: true - # @see WhopSDK::Models::DepositCreateResponse#destination - class Destination < WhopSDK::Internal::Type::BaseModel - # @!attribute address + # @!attribute crypto + # Crypto networks available for this deposit, each with its on-chain deposit + # address and the tokens accepted on that network. # - # @return [String] - required :address, String + # @return [Array] + required :crypto, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::DepositCreateResponse::Methods::Crypto] } - # @!attribute currency + # @!method initialize(bank:, crypto:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::DepositCreateResponse::Methods} for more details. # - # @return [String] - required :currency, String - - # @!attribute network + # Available deposit methods for destination. # - # @return [String] - required :network, String - - # @!attribute account_id + # @param bank [WhopSDK::Models::DepositCreateResponse::Methods::Bank, nil] Bank deposit details. Only present when bank deposits are active for the destina # - # @return [String, nil] - optional :account_id, String, nil?: true - - # @!method initialize(address:, currency:, network:, account_id: nil) - # @param address [String] - # @param currency [String] - # @param network [String] - # @param account_id [String, nil] + # @param crypto [Array] Crypto networks available for this deposit, each with its on-chain deposit addre + + # @see WhopSDK::Models::DepositCreateResponse::Methods#bank + class Bank < WhopSDK::Internal::Type::BaseModel + # @!attribute currencies + # Bank transfer currencies available for this deposit. + # + # @return [Array] + required :currencies, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency] } + + # @!method initialize(currencies:) + # Bank deposit details. Only present when bank deposits are active for the + # destination account. + # + # @param currencies [Array] Bank transfer currencies available for this deposit. + + class Currency < WhopSDK::Internal::Type::BaseModel + # @!attribute account_number + # Bank account number for deposits in this currency. + # + # @return [String, nil] + required :account_number, String, nil?: true + + # @!attribute currency + # Currency supported by these bank instructions. + # + # @return [String] + required :currency, String + + # @!attribute deposit_bank_name + # Receiving bank name. + # + # @return [String, nil] + required :deposit_bank_name, String, nil?: true + + # @!attribute deposit_beneficiary_name + # Beneficiary name to use for transfer. + # + # @return [String, nil] + required :deposit_beneficiary_name, String, nil?: true + + # @!attribute deposit_reference + # Reference to include with bank transfer. + # + # @return [String, nil] + required :deposit_reference, String, nil?: true + + # @!attribute rails + # Active deposit rails for this currency, such as `ach`, `wire`, or `sepa`. + # + # @return [Array] + required :rails, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute routing_number + # Bank routing number for deposits in this currency. + # + # @return [String, nil] + required :routing_number, String, nil?: true + + # @!method initialize(account_number:, currency:, deposit_bank_name:, deposit_beneficiary_name:, deposit_reference:, rails:, routing_number:) + # @param account_number [String, nil] Bank account number for deposits in this currency. + # + # @param currency [String] Currency supported by these bank instructions. + # + # @param deposit_bank_name [String, nil] Receiving bank name. + # + # @param deposit_beneficiary_name [String, nil] Beneficiary name to use for transfer. + # + # @param deposit_reference [String, nil] Reference to include with bank transfer. + # + # @param rails [Array] Active deposit rails for this currency, such as `ach`, `wire`, or `sepa`. + # + # @param routing_number [String, nil] Bank routing number for deposits in this currency. + end + end + + class Crypto < WhopSDK::Internal::Type::BaseModel + # @!attribute deposit_address + # Address to send funds to on this network. Null when the provider has not issued + # one yet. + # + # @return [String, nil] + required :deposit_address, String, nil?: true + + # @!attribute icon_url + # Network icon URL. + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute name + # Network display name, such as `Ethereum` or `Solana`. + # + # @return [String] + required :name, String + + # @!attribute supported_currencies + # Tokens accepted for deposit on this network. + # + # @return [Array] + required :supported_currencies, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency] } + + # @!method initialize(deposit_address:, icon_url:, name:, supported_currencies:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::DepositCreateResponse::Methods::Crypto} for more details. + # + # @param deposit_address [String, nil] Address to send funds to on this network. Null when the provider has not issued + # + # @param icon_url [String, nil] Network icon URL. + # + # @param name [String] Network display name, such as `Ethereum` or `Solana`. + # + # @param supported_currencies [Array] Tokens accepted for deposit on this network. + + class SupportedCurrency < WhopSDK::Internal::Type::BaseModel + # @!attribute icon_url + # Token icon URL. Null when no icon is available. + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute name + # Token symbol, such as `USDC`. + # + # @return [String] + required :name, String + + # @!method initialize(icon_url:, name:) + # @param icon_url [String, nil] Token icon URL. Null when no icon is available. + # + # @param name [String] Token symbol, such as `USDC`. + end + end end # @see WhopSDK::Models::DepositCreateResponse#object diff --git a/lib/whop_sdk/models/wallet_balance_params.rb b/lib/whop_sdk/models/deposit_list_params.rb similarity index 59% rename from lib/whop_sdk/models/wallet_balance_params.rb rename to lib/whop_sdk/models/deposit_list_params.rb index 78d19466..8e306514 100644 --- a/lib/whop_sdk/models/wallet_balance_params.rb +++ b/lib/whop_sdk/models/deposit_list_params.rb @@ -2,19 +2,19 @@ module WhopSDK module Models - # @see WhopSDK::Resources::Wallets#balance - class WalletBalanceParams < WhopSDK::Internal::Type::BaseModel + # @see WhopSDK::Resources::Deposits#list + class DepositListParams < 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 balance should be returned. + # Business account ID (biz\_\*). # # @return [String] required :account_id, String # @!method initialize(account_id:, request_options: {}) - # @param account_id [String] The business or user account ID whose wallet balance should be returned. + # @param account_id [String] Business account ID (biz\_\*). # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/whop_sdk/models/deposit_list_response.rb b/lib/whop_sdk/models/deposit_list_response.rb new file mode 100644 index 00000000..30887996 --- /dev/null +++ b/lib/whop_sdk/models/deposit_list_response.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Deposits#list + class DepositListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # Account ID that owns these deposit transactions. + # + # @return [String] + required :account_id, String + + # @!attribute bank + # Bank deposit transactions for this account. + # + # @return [Array] + required :bank, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::DepositListResponse::Bank] } + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::DepositListResponse::Object] + required :object, enum: -> { WhopSDK::Models::DepositListResponse::Object } + + # @!method initialize(account_id:, bank:, object:) + # @param account_id [String] Account ID that owns these deposit transactions. + # + # @param bank [Array] Bank deposit transactions for this account. + # + # @param object [Symbol, WhopSDK::Models::DepositListResponse::Object] + + class Bank < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Bank deposit transaction ID. + # + # @return [String] + required :id, String + + # @!attribute created_at + # When the bank deposit transaction was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute destination_amount + # Amount credited to the account balance. + # + # @return [String, nil] + required :destination_amount, String, nil?: true + + # @!attribute destination_currency + # Currency credited to the account balance. + # + # @return [String, nil] + required :destination_currency, String, nil?: true + + # @!attribute source_amount + # Amount sent by the depositor. + # + # @return [String] + required :source_amount, String + + # @!attribute source_currency + # Currency sent by the depositor. + # + # @return [String] + required :source_currency, String + + # @!attribute status + # Current bank deposit status. + # + # @return [String] + required :status, String + + # @!method initialize(id:, created_at:, destination_amount:, destination_currency:, source_amount:, source_currency:, status:) + # @param id [String] Bank deposit transaction ID. + # + # @param created_at [Time] When the bank deposit transaction was created. + # + # @param destination_amount [String, nil] Amount credited to the account balance. + # + # @param destination_currency [String, nil] Currency credited to the account balance. + # + # @param source_amount [String] Amount sent by the depositor. + # + # @param source_currency [String] Currency sent by the depositor. + # + # @param status [String] Current bank deposit status. + end + + # @see WhopSDK::Models::DepositListResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + DEPOSITS = :deposits + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/dispute.rb b/lib/whop_sdk/models/dispute.rb index a5856cc8..e1c2b790 100644 --- a/lib/whop_sdk/models/dispute.rb +++ b/lib/whop_sdk/models/dispute.rb @@ -262,7 +262,7 @@ class CancellationPolicyAttachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -289,7 +289,7 @@ class CancellationPolicyAttachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # @@ -331,7 +331,7 @@ class CustomerCommunicationAttachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -358,7 +358,7 @@ class CustomerCommunicationAttachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # @@ -637,7 +637,7 @@ class RefundPolicyAttachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -664,7 +664,7 @@ class RefundPolicyAttachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # @@ -684,7 +684,7 @@ class UncategorizedAttachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -711,7 +711,7 @@ class UncategorizedAttachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # diff --git a/lib/whop_sdk/models/conversion_create_params.rb b/lib/whop_sdk/models/event_create_params.rb similarity index 81% rename from lib/whop_sdk/models/conversion_create_params.rb rename to lib/whop_sdk/models/event_create_params.rb index 16458d4e..a599fb3e 100644 --- a/lib/whop_sdk/models/conversion_create_params.rb +++ b/lib/whop_sdk/models/event_create_params.rb @@ -2,40 +2,40 @@ module WhopSDK module Models - # @see WhopSDK::Resources::Conversions#create - class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel + # @see WhopSDK::Resources::Events#create + class EventCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute company_id - # The company to associate with this event. + # @!attribute account_id + # The account to associate with this event. # # @return [String] - required :company_id, String + required :account_id, String # @!attribute event_name - # The type of event. + # The type of conversion or engagement event # - # @return [Symbol, WhopSDK::Models::ConversionCreateParams::EventName] - required :event_name, enum: -> { WhopSDK::ConversionCreateParams::EventName } + # @return [Symbol, WhopSDK::Models::EventCreateParams::EventName] + required :event_name, enum: -> { WhopSDK::EventCreateParams::EventName } # @!attribute action_source # The channel where an event originated # - # @return [Symbol, WhopSDK::Models::ConversionCreateParams::ActionSource, nil] - optional :action_source, enum: -> { WhopSDK::ConversionCreateParams::ActionSource }, nil?: true + # @return [Symbol, WhopSDK::Models::EventCreateParams::ActionSource, nil] + optional :action_source, enum: -> { WhopSDK::EventCreateParams::ActionSource }, nil?: true # @!attribute context # Tracking and attribution context. # - # @return [WhopSDK::Models::ConversionCreateParams::Context, nil] - optional :context, -> { WhopSDK::ConversionCreateParams::Context }, nil?: true + # @return [WhopSDK::Models::EventCreateParams::Context, nil] + optional :context, -> { WhopSDK::EventCreateParams::Context }, nil?: true # @!attribute currency # The available currencies on the platform # - # @return [Symbol, WhopSDK::Models::Currency, nil] - optional :currency, enum: -> { WhopSDK::Currency }, nil?: true + # @return [Symbol, WhopSDK::Models::EventCreateParams::Currency, nil] + optional :currency, enum: -> { WhopSDK::EventCreateParams::Currency }, nil?: true # @!attribute custom_name # Custom event name when event_name is 'custom'. Maximum 35 chars for this value. @@ -107,8 +107,8 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute user # User identity and profile data. # - # @return [WhopSDK::Models::ConversionCreateParams::User, nil] - optional :user, -> { WhopSDK::ConversionCreateParams::User }, nil?: true + # @return [WhopSDK::Models::EventCreateParams::User, nil] + optional :user, -> { WhopSDK::EventCreateParams::User }, nil?: true # @!attribute value # Monetary value associated with the event. @@ -116,19 +116,19 @@ 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, 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: {}) + # @!method initialize(account_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. + # {WhopSDK::Models::EventCreateParams} for more details. # - # @param company_id [String] The company to associate with this event. + # @param account_id [String] The account to associate with this event. # - # @param event_name [Symbol, WhopSDK::Models::ConversionCreateParams::EventName] The type of event. + # @param event_name [Symbol, WhopSDK::Models::EventCreateParams::EventName] The type of conversion or engagement event # - # @param action_source [Symbol, WhopSDK::Models::ConversionCreateParams::ActionSource, nil] The channel where an event originated + # @param action_source [Symbol, WhopSDK::Models::EventCreateParams::ActionSource, nil] The channel where an event originated # - # @param context [WhopSDK::Models::ConversionCreateParams::Context, nil] Tracking and attribution context. + # @param context [WhopSDK::Models::EventCreateParams::Context, nil] Tracking and attribution context. # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param currency [Symbol, WhopSDK::Models::EventCreateParams::Currency, nil] The available currencies on the platform # # @param custom_name [String, nil] Custom event name when event_name is 'custom'. Maximum 35 chars for this value. # @@ -152,13 +152,13 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel # # @param url [String, nil] The URL where the event occurred. # - # @param user [WhopSDK::Models::ConversionCreateParams::User, nil] User identity and profile data. + # @param user [WhopSDK::Models::EventCreateParams::User, nil] User identity and profile data. # # @param value [Float, nil] Monetary value associated with the event. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - # The type of event. + # The type of conversion or engagement event module EventName extend WhopSDK::Internal::Type::Enum @@ -447,6 +447,105 @@ class Context < WhopSDK::Internal::Type::BaseModel # @param wbraid [String, nil] Google Ads wbraid click ID (iOS privacy). end + # The available currencies on the platform + module Currency + extend WhopSDK::Internal::Type::Enum + + 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 self.values + # @return [Array] + end + class User < WhopSDK::Internal::Type::BaseModel # @!attribute anonymous_id # An anonymous identifier for the user. @@ -493,8 +592,8 @@ class User < WhopSDK::Internal::Type::BaseModel # @!attribute gender # Gender # - # @return [Symbol, WhopSDK::Models::ConversionCreateParams::User::Gender, nil] - optional :gender, enum: -> { WhopSDK::ConversionCreateParams::User::Gender }, nil?: true + # @return [Symbol, WhopSDK::Models::EventCreateParams::User::Gender, nil] + optional :gender, enum: -> { WhopSDK::EventCreateParams::User::Gender }, nil?: true # @!attribute last_name # Last name. @@ -565,7 +664,7 @@ class User < WhopSDK::Internal::Type::BaseModel # @!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. + # {WhopSDK::Models::EventCreateParams::User} for more details. # # User identity and profile data. # @@ -583,7 +682,7 @@ class User < WhopSDK::Internal::Type::BaseModel # # @param first_name [String, nil] First name. # - # @param gender [Symbol, WhopSDK::Models::ConversionCreateParams::User::Gender, nil] Gender + # @param gender [Symbol, WhopSDK::Models::EventCreateParams::User::Gender, nil] Gender # # @param last_name [String, nil] Last name. # @@ -609,7 +708,7 @@ class User < WhopSDK::Internal::Type::BaseModel # Gender # - # @see WhopSDK::Models::ConversionCreateParams::User#gender + # @see WhopSDK::Models::EventCreateParams::User#gender module Gender extend WhopSDK::Internal::Type::Enum diff --git a/lib/whop_sdk/models/event_create_response.rb b/lib/whop_sdk/models/event_create_response.rb new file mode 100644 index 00000000..1243434c --- /dev/null +++ b/lib/whop_sdk/models/event_create_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Events#create + class EventCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # @param id [String] + end + end +end diff --git a/lib/whop_sdk/models/event_list_params.rb b/lib/whop_sdk/models/event_list_params.rb new file mode 100644 index 00000000..fbed203b --- /dev/null +++ b/lib/whop_sdk/models/event_list_params.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Events#list + class EventListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute person_id + # The ID of the person. + # + # @return [String] + required :person_id, String + + # @!attribute account_id + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute after + # A cursor for fetching events after a previous page. + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # A cursor for fetching events before a later page. + # + # @return [String, nil] + optional :before, String + + # @!attribute first + # The number of events to return. + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute from + # Start of the time range as a Unix timestamp. + # + # @return [Integer, nil] + optional :from, Integer + + # @!attribute to + # End of the time range as a Unix timestamp. Defaults to now. + # + # @return [Integer, nil] + optional :to, Integer + + # @!method initialize(person_id:, account_id: nil, after: nil, before: nil, first: nil, from: nil, to: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::EventListParams} for more details. + # + # @param person_id [String] The ID of the person. + # + # @param account_id [String] The ID of the account, which will look like biz\_******\*******. Optional for + # acco + # + # @param after [String] A cursor for fetching events after a previous page. + # + # @param before [String] A cursor for fetching events before a later page. + # + # @param first [Integer] The number of events to return. + # + # @param from [Integer] Start of the time range as a Unix timestamp. + # + # @param to [Integer] End of the time range as a Unix timestamp. Defaults to now. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/event_list_response.rb b/lib/whop_sdk/models/event_list_response.rb new file mode 100644 index 00000000..ffb79fb8 --- /dev/null +++ b/lib/whop_sdk/models/event_list_response.rb @@ -0,0 +1,242 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Events#list + class EventListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute event_id + # + # @return [String] + required :event_id, String + + # @!attribute event_name + # + # @return [String] + required :event_name, String + + # @!attribute event_time + # + # @return [Integer] + required :event_time, Integer + + # @!attribute context + # + # @return [WhopSDK::Models::EventListResponse::Context, nil] + optional :context, -> { WhopSDK::Models::EventListResponse::Context }, nil?: true + + # @!attribute currency + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute custom_name + # + # @return [String, nil] + optional :custom_name, String, nil?: true + + # @!attribute path + # + # @return [String, nil] + optional :path, String, nil?: true + + # @!attribute questions + # + # @return [Array, nil] + optional :questions, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::EventListResponse::Question] }, + nil?: true + + # @!attribute referrer_url + # + # @return [String, nil] + optional :referrer_url, String, nil?: true + + # @!attribute total_usd_amount + # + # @return [Float, nil] + optional :total_usd_amount, Float, nil?: true + + # @!attribute url + # + # @return [String, nil] + optional :url, String, nil?: true + + # @!attribute user + # + # @return [WhopSDK::Models::EventListResponse::User, nil] + optional :user, -> { WhopSDK::Models::EventListResponse::User }, nil?: true + + # @!attribute value + # + # @return [Float, nil] + optional :value, Float, nil?: true + + # @!method initialize(id:, event_id:, event_name:, event_time:, context: nil, currency: nil, custom_name: nil, path: nil, questions: nil, referrer_url: nil, total_usd_amount: nil, url: nil, user: nil, value: nil) + # @param id [String] + # @param event_id [String] + # @param event_name [String] + # @param event_time [Integer] + # @param context [WhopSDK::Models::EventListResponse::Context, nil] + # @param currency [String, nil] + # @param custom_name [String, nil] + # @param path [String, nil] + # @param questions [Array, nil] + # @param referrer_url [String, nil] + # @param total_usd_amount [Float, nil] + # @param url [String, nil] + # @param user [WhopSDK::Models::EventListResponse::User, nil] + # @param value [Float, nil] + + # @see WhopSDK::Models::EventListResponse#context + class Context < WhopSDK::Internal::Type::BaseModel + # @!attribute ad_campaign_id + # + # @return [String, nil] + optional :ad_campaign_id, String, nil?: true + + # @!attribute ad_id + # + # @return [String, nil] + optional :ad_id, String, nil?: true + + # @!attribute ad_set_id + # + # @return [String, nil] + optional :ad_set_id, String, nil?: true + + # @!attribute utm_campaign + # + # @return [String, nil] + optional :utm_campaign, String, nil?: true + + # @!attribute utm_content + # + # @return [String, nil] + optional :utm_content, String, nil?: true + + # @!attribute utm_medium + # + # @return [String, nil] + optional :utm_medium, String, nil?: true + + # @!attribute utm_source + # + # @return [String, nil] + optional :utm_source, String, nil?: true + + # @!attribute utm_term + # + # @return [String, nil] + optional :utm_term, String, nil?: true + + # @!method initialize(ad_campaign_id: nil, ad_id: nil, ad_set_id: nil, utm_campaign: nil, utm_content: nil, utm_medium: nil, utm_source: nil, utm_term: nil) + # @param ad_campaign_id [String, nil] + # @param ad_id [String, nil] + # @param ad_set_id [String, nil] + # @param utm_campaign [String, nil] + # @param utm_content [String, nil] + # @param utm_medium [String, nil] + # @param utm_source [String, nil] + # @param utm_term [String, nil] + end + + class Question < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String, nil?: true + + # @!attribute answer + # + # @return [String, nil] + optional :answer, String, nil?: true + + # @!attribute key + # + # @return [String, nil] + optional :key, String, nil?: true + + # @!attribute options + # + # @return [Array, nil] + optional :options, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute question + # + # @return [String, nil] + optional :question, String, nil?: true + + # @!attribute type + # + # @return [String, nil] + optional :type, String, nil?: true + + # @!method initialize(id: nil, answer: nil, key: nil, options: nil, question: nil, type: nil) + # @param id [String, nil] + # @param answer [String, nil] + # @param key [String, nil] + # @param options [Array, nil] + # @param question [String, nil] + # @param type [String, nil] + end + + # @see WhopSDK::Models::EventListResponse#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute email + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute first_name + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute phone + # + # @return [String, nil] + optional :phone, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!method initialize(city: nil, country: nil, email: nil, first_name: nil, last_name: nil, name: nil, phone: nil, state: nil) + # @param city [String, nil] + # @param country [String, nil] + # @param email [String, nil] + # @param first_name [String, nil] + # @param last_name [String, nil] + # @param name [String, nil] + # @param phone [String, nil] + # @param state [String, nil] + end + end + end +end diff --git a/lib/whop_sdk/models/experience.rb b/lib/whop_sdk/models/experience.rb index 876c511d..f0b3077b 100644 --- a/lib/whop_sdk/models/experience.rb +++ b/lib/whop_sdk/models/experience.rb @@ -151,7 +151,7 @@ class Company < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @return [String] required :route, String @@ -163,14 +163,11 @@ class Company < WhopSDK::Internal::Type::BaseModel required :title, String # @!method initialize(id:, route:, title:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Experience::Company} for more details. - # # The company that owns this experience. # # @param id [String] The unique identifier for the company. # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # @param route [String] URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @param title [String] The display name of the company shown to customers. end @@ -202,8 +199,8 @@ class Product < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute route - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. # # @return [String] required :route, String @@ -224,7 +221,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product. # - # @param route [String] The URL slug used in the product's public link (e.g., 'my-product' in whop.com/c + # @param route [String] URL slug in the product's public link, e.g. `pickaxe-analytics` in whop.com/comp # # @param title [String] The display name of the product shown to customers on the product page and in se end diff --git a/lib/whop_sdk/models/experience_list_response.rb b/lib/whop_sdk/models/experience_list_response.rb index 64512bd1..1e498ce6 100644 --- a/lib/whop_sdk/models/experience_list_response.rb +++ b/lib/whop_sdk/models/experience_list_response.rb @@ -142,7 +142,7 @@ class Company < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @return [String] required :route, String @@ -154,14 +154,11 @@ class Company < WhopSDK::Internal::Type::BaseModel required :title, String # @!method initialize(id:, route:, title:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::ExperienceListResponse::Company} for more details. - # # The company that owns this experience. # # @param id [String] The unique identifier for the company. # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # @param route [String] URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @param title [String] The display name of the company shown to customers. end diff --git a/lib/whop_sdk/models/external_ad_status.rb b/lib/whop_sdk/models/external_ad_status.rb deleted file mode 100644 index 4aaef4de..00000000 --- a/lib/whop_sdk/models/external_ad_status.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # The status of an external ad. - module ExternalAdStatus - extend WhopSDK::Internal::Type::Enum - - ACTIVE = :active - PAUSED = :paused - INACTIVE = :inactive - IN_REVIEW = :in_review - REJECTED = :rejected - FLAGGED = :flagged - - # @!method self.values - # @return [Array] - end - end -end diff --git a/lib/whop_sdk/models/financial_activity_list_params.rb b/lib/whop_sdk/models/financial_activity_list_params.rb index 54252781..bbbc3dcb 100644 --- a/lib/whop_sdk/models/financial_activity_list_params.rb +++ b/lib/whop_sdk/models/financial_activity_list_params.rb @@ -13,8 +13,23 @@ class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :account_id, String + # @!attribute available_after + # Only include rows whose funds became withdrawable on or after this `YYYY-MM-DD` + # settlement date (UTC), distinct from posted_at. Requires currency. + # + # @return [Date, nil] + optional :available_after, Date + + # @!attribute available_before + # Only include rows whose funds became withdrawable on or before this `YYYY-MM-DD` + # settlement date (UTC). Set equal to available_after for a single day. Requires + # currency. + # + # @return [Date, nil] + optional :available_before, Date + # @!attribute currency - # Optional currency code filter, for example usd. + # Optional currency code filter, for example `usd`. # # @return [String, nil] optional :currency, String @@ -25,6 +40,15 @@ class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :cursor, String + # @!attribute include_owned_accounts + # When true, aggregates the authenticated user's personal ledger with the + # businesses they own (owner role with balance read) into one feed. Requires + # user_id to be the authenticated user; cannot be combined with account_id or the + # settlement-date filters. Each returned row includes the owning `account`. + # + # @return [Boolean, nil] + optional :include_owned_accounts, WhopSDK::Internal::Type::Boolean + # @!attribute limit # Maximum number of rows to return. # @@ -32,7 +56,9 @@ class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel optional :limit, Integer # @!attribute line_types - # Optional ledger line categories to include. + # Optional ledger line categories to include. Some categories (for example + # `onchain_deposit`, which covers inbound crypto deposits such as MoonPay onramps) + # are only returned when explicitly requested here. # # @return [Array, nil] optional :line_types, WhopSDK::Internal::Type::ArrayOf[String] @@ -55,16 +81,25 @@ class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel # @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: {}) + # @!method initialize(account_id: nil, available_after: nil, available_before: nil, currency: nil, cursor: nil, include_owned_accounts: nil, limit: nil, line_types: nil, posted_after: nil, posted_before: nil, user_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::FinancialActivityListParams} for more details. + # # @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 available_after [Date] Only include rows whose funds became withdrawable on or after this `YYYY-MM-DD` + # + # @param available_before [Date] Only include rows whose funds became withdrawable on or before this `YYYY-MM-DD` + # + # @param currency [String] Optional currency code filter, for example `usd`. # # @param cursor [String] Cursor returned by the previous page. # + # @param include_owned_accounts [Boolean] When true, aggregates the authenticated user's personal ledger with the business + # # @param limit [Integer] Maximum number of rows to return. # - # @param line_types [Array] Optional ledger line categories to include. + # @param line_types [Array] Optional ledger line categories to include. Some categories (for example `onchai # # @param posted_after [Time] Only include rows posted after this ISO 8601 timestamp. # diff --git a/lib/whop_sdk/models/financial_activity_list_response.rb b/lib/whop_sdk/models/financial_activity_list_response.rb index 12b5b2a9..c34553d9 100644 --- a/lib/whop_sdk/models/financial_activity_list_response.rb +++ b/lib/whop_sdk/models/financial_activity_list_response.rb @@ -21,6 +21,7 @@ class FinancialActivityListResponse < WhopSDK::Internal::Type::BaseModel class Data < WhopSDK::Internal::Type::BaseModel # @!attribute id + # Ledger activity ID. # # @return [String] required :id, String @@ -31,17 +32,31 @@ class Data < WhopSDK::Internal::Type::BaseModel # @return [String] required :amount, String + # @!attribute available_at + # ISO 8601 timestamp these funds became (or are scheduled to become) withdrawable: + # the posted time for already-settled funds, or 00:00:00 UTC on the scheduled + # release date for pending funds. Present only on inflows entering the balance + # (payments, top-ups, incoming transfers/affiliate); null on withdrawals, refunds, + # disputes and on-chain rows. The available_after/before filters window on its UTC + # settlement date. + # + # @return [Time, nil] + required :available_at, Time, nil?: true + # @!attribute created_at + # When the activity record was created. # # @return [Time, nil] required :created_at, Time, nil?: true # @!attribute currency + # Currency for this ledger activity. # # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] required :currency, -> { WhopSDK::Models::FinancialActivityListResponse::Data::Currency } # @!attribute line_type + # Type of ledger activity. # # @return [String] required :line_type, String @@ -52,58 +67,90 @@ class Data < WhopSDK::Internal::Type::BaseModel required :object, enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Object } # @!attribute posted_at + # When the activity posted to the ledger. # # @return [Time] required :posted_at, Time # @!attribute resource + # Resource associated with this ledger activity. # - # @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] + # @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, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6, nil] required :resource, union: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource }, nil?: true # @!attribute source + # Source of this ledger activity. # # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Source, nil] required :source, -> { WhopSDK::Models::FinancialActivityListResponse::Data::Source }, nil?: true - # @!method initialize(id:, amount:, created_at:, currency:, line_type:, object:, posted_at:, resource:, source:) - # @param id [String] + # @!attribute account + # The viewer account that owns this row's ledger. Present only when the response + # aggregates owned accounts (include_owned_accounts=true); omitted otherwise. + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1, nil] + optional :account, union: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Account } + + # @!attribute ledger_account_id + # The ledger account (a ldgr\_ identifier) this row belongs to. Present only when + # the response aggregates owned accounts (include_owned_accounts=true); omitted + # otherwise. Pair it with `account` to scope drawers and dashboard links to the + # owning business. + # + # @return [String, nil] + optional :ledger_account_id, String, nil?: true + + # @!method initialize(id:, amount:, available_at:, created_at:, currency:, line_type:, object:, posted_at:, resource:, source:, account: nil, ledger_account_id: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::FinancialActivityListResponse::Data} for more details. + # + # @param id [String] Ledger activity ID. # # @param amount [String] Signed amount in the currency's smallest precision units. # - # @param created_at [Time, nil] + # @param available_at [Time, nil] ISO 8601 timestamp these funds became (or are scheduled to become) withdrawable: # - # @param currency [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] + # @param created_at [Time, nil] When the activity record was created. # - # @param line_type [String] + # @param currency [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] Currency for this ledger activity. + # + # @param line_type [String] Type of ledger activity. # # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Object] # - # @param posted_at [Time] + # @param posted_at [Time] When the activity posted to the ledger. + # + # @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, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6, nil] Resource associated with this ledger activity. # - # @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] Source of this ledger activity. # - # @param source [WhopSDK::Models::FinancialActivityListResponse::Data::Source, nil] + # @param account [WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1] The viewer account that owns this row's ledger. Present only when the response a + # + # @param ledger_account_id [String, nil] The ledger account (a ldgr\_ identifier) this row belongs to. Present only when + # t # @see WhopSDK::Models::FinancialActivityListResponse::Data#currency class Currency < WhopSDK::Internal::Type::BaseModel # @!attribute code + # Currency code. # # @return [String] required :code, String # @!attribute precision - # Precision factor for the currency, for example 100000000 for USD. + # Precision factor for the currency, for example `100000000` for USD. # # @return [String] required :precision, String # @!method initialize(code:, precision:) - # @param code [String] + # Currency for this ledger activity. + # + # @param code [String] Currency code. # - # @param precision [String] Precision factor for the currency, for example 100000000 for USD. + # @param precision [String] Precision factor for the currency, for example `100000000` for USD. end # @see WhopSDK::Models::FinancialActivityListResponse::Data#object @@ -116,6 +163,8 @@ module Object # @return [Array] end + # Resource associated with this ledger activity. + # # @see WhopSDK::Models::FinancialActivityListResponse::Data#resource module Resource extend WhopSDK::Internal::Type::Union @@ -130,13 +179,19 @@ module Resource variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 } + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6 } + class UnionMember0 < WhopSDK::Internal::Type::BaseModel # @!attribute id + # Account ID. # # @return [String] required :id, String # @!attribute logo_url + # Account logo URL. # # @return [String, nil] required :logo_url, String, nil?: true @@ -148,21 +203,27 @@ class UnionMember0 < WhopSDK::Internal::Type::BaseModel enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object } # @!attribute route + # Account route. # # @return [String, nil] required :route, String, nil?: true # @!attribute title + # Account display name. # # @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 id [String] Account ID. + # + # @param logo_url [String, nil] Account logo URL. + # # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object] - # @param route [String, nil] - # @param title [String, nil] + # + # @param route [String, nil] Account route. + # + # @param title [String, nil] Account display name. # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0#object module Object @@ -177,11 +238,13 @@ module Object class UnionMember1 < WhopSDK::Internal::Type::BaseModel # @!attribute id + # User ID. # # @return [String] required :id, String # @!attribute name + # User display name. # # @return [String, nil] required :name, String, nil?: true @@ -193,21 +256,27 @@ class UnionMember1 < WhopSDK::Internal::Type::BaseModel enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object } # @!attribute profile_picture_url + # User profile image URL. # # @return [String, nil] required :profile_picture_url, String, nil?: true # @!attribute username + # User's 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 id [String] User ID. + # + # @param name [String, nil] User display name. + # # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object] - # @param profile_picture_url [String, nil] - # @param username [String, nil] + # + # @param profile_picture_url [String, nil] User profile image URL. + # + # @param username [String, nil] User's username. # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1#object module Object @@ -222,6 +291,7 @@ module Object class UnionMember2 < WhopSDK::Internal::Type::BaseModel # @!attribute id + # Bounty ID. # # @return [String] required :id, String @@ -232,19 +302,66 @@ class UnionMember2 < WhopSDK::Internal::Type::BaseModel required :object, enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object } + # @!attribute status + # Bounty lifecycle status. + # + # @return [String] + required :status, String + + # @!attribute title + # Bounty title. + # + # @return [String] + required :title, String + + # @!method initialize(id:, object:, status:, title:) + # @param id [String] Bounty ID. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object] + # + # @param status [String] Bounty lifecycle status. + # + # @param title [String] Bounty title. + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2#object + module Object + extend WhopSDK::Internal::Type::Enum + + BOUNTY = :bounty + + # @!method self.values + # @return [Array] + end + end + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Ledger account ID. + # + # @return [String] + required :id, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object } + # @!attribute owner # - # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1, nil] + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1, nil] required :owner, - union: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner }, + union: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::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] + # @param id [String] Ledger account ID. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object] + # + # @param owner [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1, nil] - # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2#object + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#object module Object extend WhopSDK::Internal::Type::Enum @@ -254,49 +371,57 @@ module Object # @return [Array] end - # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2#owner + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#owner module Owner extend WhopSDK::Internal::Type::Union - variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0 } + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0 } - variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 } + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1 } class UnionMember0 < WhopSDK::Internal::Type::BaseModel # @!attribute id + # Account ID. # # @return [String] required :id, String # @!attribute logo_url + # Account logo URL. # # @return [String, nil] required :logo_url, String, nil?: true # @!attribute object # - # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object] + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::Object] required :object, - enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object } + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::Object } # @!attribute route + # Account route. # # @return [String, nil] required :route, String, nil?: true # @!attribute title + # Account display name. # # @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] + # @param id [String] Account ID. + # + # @param logo_url [String, nil] Account logo URL. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::Object] + # + # @param route [String, nil] Account route. + # + # @param title [String, nil] Account display name. - # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0#object + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0#object module Object extend WhopSDK::Internal::Type::Enum @@ -309,39 +434,47 @@ module Object class UnionMember1 < WhopSDK::Internal::Type::BaseModel # @!attribute id + # User ID. # # @return [String] required :id, String # @!attribute name + # User display name. # # @return [String, nil] required :name, String, nil?: true # @!attribute object # - # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object] + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object] required :object, - enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object } + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object } # @!attribute profile_picture_url + # User profile image URL. # # @return [String, nil] required :profile_picture_url, String, nil?: true # @!attribute username + # User's 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] + # @param id [String] User ID. + # + # @param name [String, nil] User display name. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object] + # + # @param profile_picture_url [String, nil] User profile image URL. + # + # @param username [String, nil] User's username. - # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1#object + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1#object module Object extend WhopSDK::Internal::Type::Enum @@ -353,119 +486,143 @@ module Object end # @!method self.variants - # @return [Array(WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1)] + # @return [Array(WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1)] end end - class UnionMember3 < WhopSDK::Internal::Type::BaseModel + class UnionMember4 < WhopSDK::Internal::Type::BaseModel # @!attribute id + # Payment method ID. # # @return [String] required :id, String # @!attribute bank # - # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank, nil] + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank, nil] required :bank, - -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank }, + -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank }, nil?: true # @!attribute card # - # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card, nil] + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card, nil] required :card, - -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card }, + -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card }, nil?: true # @!attribute email_identifier + # Email identifier for email-based payment methods. # # @return [String, nil] required :email_identifier, String, nil?: true # @!attribute gateway_type + # Payment gateway type. # # @return [String, nil] required :gateway_type, String, nil?: true # @!attribute object # - # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object] + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object] required :object, - enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object } + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object } # @!attribute payment_method_type + # 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] + # @param id [String] Payment method ID. + # + # @param bank [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank, nil] + # + # @param card [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card, nil] + # + # @param email_identifier [String, nil] Email identifier for email-based payment methods. + # + # @param gateway_type [String, nil] Payment gateway type. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object] + # + # @param payment_method_type [String, nil] Payment method type. - # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#bank + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4#bank class Bank < WhopSDK::Internal::Type::BaseModel # @!attribute account_name + # Bank account holder name. # # @return [String, nil] required :account_name, String, nil?: true # @!attribute account_type + # Bank account type. # # @return [String, nil] required :account_type, String, nil?: true # @!attribute bank_name + # Bank name. # # @return [String, nil] required :bank_name, String, nil?: true # @!attribute last4 + # Last four digits of the bank account. # # @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] + # @param account_name [String, nil] Bank account holder name. + # + # @param account_type [String, nil] Bank account type. + # + # @param bank_name [String, nil] Bank name. + # + # @param last4 [String, nil] Last four digits of the bank account. end - # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#card + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4#card class Card < WhopSDK::Internal::Type::BaseModel # @!attribute brand + # Card brand. # # @return [String, nil] required :brand, String, nil?: true # @!attribute exp_month + # Card expiration month. # # @return [Integer, nil] required :exp_month, Integer, nil?: true # @!attribute exp_year + # Card expiration year. # # @return [Integer, nil] required :exp_year, Integer, nil?: true # @!attribute last4 + # Last four digits of the card. # # @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] + # @param brand [String, nil] Card brand. + # + # @param exp_month [Integer, nil] Card expiration month. + # + # @param exp_year [Integer, nil] Card expiration year. + # + # @param last4 [String, nil] Last four digits of the card. end - # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#object + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4#object module Object extend WhopSDK::Internal::Type::Enum @@ -476,53 +633,65 @@ module Object end end - class UnionMember4 < WhopSDK::Internal::Type::BaseModel + class UnionMember5 < WhopSDK::Internal::Type::BaseModel # @!attribute id + # Payout method ID. # # @return [String] required :id, String # @!attribute account_reference + # Masked account reference. # # @return [String, nil] required :account_reference, String, nil?: true # @!attribute destination_currency_code + # Destination currency code. # # @return [String, nil] required :destination_currency_code, String, nil?: true # @!attribute institution_name + # Payout institution name. # # @return [String, nil] required :institution_name, String, nil?: true # @!attribute nickname + # Payout method nickname. # # @return [String, nil] required :nickname, String, nil?: true # @!attribute object # - # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object] + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object] required :object, - enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object } + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object } # @!attribute provider + # Payout 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] + # @param id [String] Payout method ID. + # + # @param account_reference [String, nil] Masked account reference. + # + # @param destination_currency_code [String, nil] Destination currency code. + # + # @param institution_name [String, nil] Payout institution name. + # + # @param nickname [String, nil] Payout method nickname. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object] + # + # @param provider [String, nil] Payout provider. - # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4#object + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5#object module Object extend WhopSDK::Internal::Type::Enum @@ -533,8 +702,140 @@ module Object end end + class UnionMember6 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Card transaction ID. + # + # @return [String] + required :id, String + + # @!attribute authorized_at + # ISO 8601 timestamp the transaction was authorized. + # + # @return [Time, nil] + required :authorized_at, Time, nil?: true + + # @!attribute card_id + # Identifier of the card that the transaction was charged to. + # + # @return [String, nil] + required :card_id, String, nil?: true + + # @!attribute cashback_usd + # Cashback earned on this transaction as a USD decimal string. Zero for declined + # or ineligible transactions; null when cashback has not been computed yet. + # + # @return [String, nil] + required :cashback_usd, String, nil?: true + + # @!attribute declined_reason + # Reason the transaction was declined (when status is declined). + # + # @return [String, nil] + required :declined_reason, String, nil?: true + + # @!attribute local_amount + # Amount the merchant charged in their local currency, as a decimal string. Pair + # with local_currency. + # + # @return [String, nil] + required :local_amount, String, nil?: true + + # @!attribute local_currency + # ISO 4217 currency code of the merchant-charged amount in local_amount. + # + # @return [String, nil] + required :local_currency, String, nil?: true + + # @!attribute merchant_category + # Merchant category. + # + # @return [String, nil] + required :merchant_category, String, nil?: true + + # @!attribute merchant_icon_url + # Merchant icon URL. + # + # @return [String, nil] + required :merchant_icon_url, String, nil?: true + + # @!attribute merchant_name + # Merchant display name. + # + # @return [String, nil] + required :merchant_name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::Object } + + # @!attribute posted_at + # ISO 8601 timestamp the transaction was settled by the card network. + # + # @return [Time, nil] + required :posted_at, Time, nil?: true + + # @!attribute status + # Current card transaction status. + # + # @return [String, nil] + required :status, String, nil?: true + + # @!attribute usd_amount + # The processor-settled USD amount as a decimal string. The ledger's USDT leg is + # posted 1:1 from this value. + # + # @return [String, nil] + required :usd_amount, String, nil?: true + + # @!method initialize(id:, authorized_at:, card_id:, cashback_usd:, declined_reason:, local_amount:, local_currency:, merchant_category:, merchant_icon_url:, merchant_name:, object:, posted_at:, status:, usd_amount:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6} + # for more details. + # + # @param id [String] Card transaction ID. + # + # @param authorized_at [Time, nil] ISO 8601 timestamp the transaction was authorized. + # + # @param card_id [String, nil] Identifier of the card that the transaction was charged to. + # + # @param cashback_usd [String, nil] Cashback earned on this transaction as a USD decimal string. Zero for declined o + # + # @param declined_reason [String, nil] Reason the transaction was declined (when status is declined). + # + # @param local_amount [String, nil] Amount the merchant charged in their local currency, as a decimal string. Pair w + # + # @param local_currency [String, nil] ISO 4217 currency code of the merchant-charged amount in local_amount. + # + # @param merchant_category [String, nil] Merchant category. + # + # @param merchant_icon_url [String, nil] Merchant icon URL. + # + # @param merchant_name [String, nil] Merchant display name. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::Object] + # + # @param posted_at [Time, nil] ISO 8601 timestamp the transaction was settled by the card network. + # + # @param status [String, nil] Current card transaction status. + # + # @param usd_amount [String, nil] The processor-settled USD amount as a decimal string. The ledger's USDT leg is p + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6#object + module Object + extend WhopSDK::Internal::Type::Enum + + CARD_TRANSACTION = :card_transaction + + # @!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)] + # @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, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6)] end # @see WhopSDK::Models::FinancialActivityListResponse::Data#source @@ -549,6 +850,26 @@ class Source < WhopSDK::Internal::Type::BaseModel # @return [String] required :object, String + # @!attribute amount_float + # Withdrawal amount as a decimal number in the destination currency (withdrawal + # sources only; requires payout:withdrawal:read). + # + # @return [Float, nil] + optional :amount_float, Float, nil?: true + + # @!attribute chain + # Chain the deposit landed on, for example plasma (onchain_transaction sources + # only). + # + # @return [String, nil] + optional :chain, String, nil?: true + + # @!attribute claim_url + # Public claim URL for the airdrop link (airdrop_link sources only). + # + # @return [String, nil] + optional :claim_url, String, nil?: true + # @!attribute created_at # Withdrawal creation time as an ISO 8601 timestamp (withdrawal sources only; # requires payout:withdrawal:read). @@ -563,6 +884,18 @@ class Source < WhopSDK::Internal::Type::BaseModel # @return [Time, nil] optional :estimated_arrival, Time, nil?: true + # @!attribute from_amount + # Amount converted out of from_currency as a decimal string (swap sources only). + # + # @return [String, nil] + optional :from_amount, String, nil?: true + + # @!attribute from_currency + # Lowercase currency code converted from (swap sources only). + # + # @return [String, nil] + optional :from_currency, String, nil?: true + # @!attribute payer_name # Name of the entity processing the payout (withdrawal sources only; requires # payout:withdrawal:read). @@ -584,32 +917,87 @@ class Source < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :payout_token_nickname, String, nil?: true + # @!attribute reason + # Transfer reason on transfer sources, for example pool_top_up or bounty_return. + # + # @return [String, nil] + optional :reason, String, nil?: true + + # @!attribute sender_address + # Sender wallet address or onramp provider identifier (onchain_transaction sources + # only). + # + # @return [String, nil] + optional :sender_address, String, nil?: true + # @!attribute status - # Withdrawal lifecycle status (withdrawal sources only; requires - # payout:withdrawal:read). + # Lifecycle status. On withdrawal sources this is the withdrawal status (requires + # payout:withdrawal:read); on airdrop_link sources it is the claim-link status + # (ungated); on payment and top-up sources it is the friendly payment status such + # as succeeded/pending/failed (ungated). # # @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) + # @!attribute to_amount + # Amount received in to_currency as a decimal string (swap sources only). + # + # @return [String, nil] + optional :to_amount, String, nil?: true + + # @!attribute to_currency + # Lowercase currency code converted to (swap sources only). + # + # @return [String, nil] + optional :to_currency, String, nil?: true + + # @!attribute tx_hash + # On-chain transaction hash (onchain_transaction and swap sources only). + # + # @return [String, nil] + optional :tx_hash, String, nil?: true + + # @!method initialize(id:, object:, amount_float: nil, chain: nil, claim_url: nil, created_at: nil, estimated_arrival: nil, from_amount: nil, from_currency: nil, payer_name: nil, payout_destination: nil, payout_token_nickname: nil, reason: nil, sender_address: nil, status: nil, to_amount: nil, to_currency: nil, tx_hash: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::FinancialActivityListResponse::Data::Source} for more details. # + # Source of this ledger activity. + # # @param id [String] # # @param object [String] # + # @param amount_float [Float, nil] Withdrawal amount as a decimal number in the destination currency (withdrawal so + # + # @param chain [String, nil] Chain the deposit landed on, for example plasma (onchain_transaction sources onl + # + # @param claim_url [String, nil] Public claim URL for the airdrop link (airdrop_link sources only). + # # @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 from_amount [String, nil] Amount converted out of from_currency as a decimal string (swap sources only). + # + # @param from_currency [String, nil] Lowercase currency code converted from (swap sources only). + # # @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 + # @param reason [String, nil] Transfer reason on transfer sources, for example pool_top_up or bounty_return. + # + # @param sender_address [String, nil] Sender wallet address or onramp provider identifier (onchain_transaction sources + # + # @param status [String, nil] Lifecycle status. On withdrawal sources this is the withdrawal status (requires + # + # @param to_amount [String, nil] Amount received in to_currency as a decimal string (swap sources only). + # + # @param to_currency [String, nil] Lowercase currency code converted to (swap sources only). + # + # @param tx_hash [String, nil] On-chain transaction hash (onchain_transaction and swap sources only). # @see WhopSDK::Models::FinancialActivityListResponse::Data::Source#payout_destination class PayoutDestination < WhopSDK::Internal::Type::BaseModel @@ -630,6 +1018,127 @@ class PayoutDestination < WhopSDK::Internal::Type::BaseModel # @param payer_name [String, nil] end end + + # The viewer account that owns this row's ledger. Present only when the response + # aggregates owned accounts (include_owned_accounts=true); omitted otherwise. + # + # @see WhopSDK::Models::FinancialActivityListResponse::Data#account + module Account + extend WhopSDK::Internal::Type::Union + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1 } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Account ID. + # + # @return [String] + required :id, String + + # @!attribute logo_url + # Account logo URL. + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::Object } + + # @!attribute route + # Account route. + # + # @return [String, nil] + required :route, String, nil?: true + + # @!attribute title + # Account display name. + # + # @return [String, nil] + required :title, String, nil?: true + + # @!method initialize(id:, logo_url:, object:, route:, title:) + # @param id [String] Account ID. + # + # @param logo_url [String, nil] Account logo URL. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::Object] + # + # @param route [String, nil] Account route. + # + # @param title [String, nil] Account display name. + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Account::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 + # User ID. + # + # @return [String] + required :id, String + + # @!attribute name + # User display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::Object } + + # @!attribute profile_picture_url + # User profile image URL. + # + # @return [String, nil] + required :profile_picture_url, String, nil?: true + + # @!attribute username + # User's username. + # + # @return [String, nil] + required :username, String, nil?: true + + # @!method initialize(id:, name:, object:, profile_picture_url:, username:) + # @param id [String] User ID. + # + # @param name [String, nil] User display name. + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::Object] + # + # @param profile_picture_url [String, nil] User profile image URL. + # + # @param username [String, nil] User's username. + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Account::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::Account::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1)] + end end # @see WhopSDK::Models::FinancialActivityListResponse#page_info diff --git a/lib/whop_sdk/models/forum_post.rb b/lib/whop_sdk/models/forum_post.rb index 10138640..c586ad4d 100644 --- a/lib/whop_sdk/models/forum_post.rb +++ b/lib/whop_sdk/models/forum_post.rb @@ -139,7 +139,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -165,7 +165,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # diff --git a/lib/whop_sdk/models/forum_post_list_response.rb b/lib/whop_sdk/models/forum_post_list_response.rb index 023ef7c1..47a71047 100644 --- a/lib/whop_sdk/models/forum_post_list_response.rb +++ b/lib/whop_sdk/models/forum_post_list_response.rb @@ -141,7 +141,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -167,7 +167,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # diff --git a/lib/whop_sdk/models/identity_profile_approved_webhook_event.rb b/lib/whop_sdk/models/identity_profile_approved_webhook_event.rb index 9cf866e6..a90cedb1 100644 --- a/lib/whop_sdk/models/identity_profile_approved_webhook_event.rb +++ b/lib/whop_sdk/models/identity_profile_approved_webhook_event.rb @@ -87,9 +87,9 @@ class Data < WhopSDK::Internal::Type::BaseModel required :business_structure, String, nil?: true # @!attribute country - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. # # @return [String, nil] required :country, String, nil?: true @@ -193,7 +193,7 @@ class Data < WhopSDK::Internal::Type::BaseModel # # @param business_structure [String, nil] Reported legal structure of a business profile (e.g. `corp`, `llc`). Provider-sp # - # @param country [String, nil] ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the + # @param country [String, nil] ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` # # @param created_at [Time] When the identity profile was first created. # diff --git a/lib/whop_sdk/models/identity_profile_needs_action_webhook_event.rb b/lib/whop_sdk/models/identity_profile_needs_action_webhook_event.rb index c1d8bce1..2a14658a 100644 --- a/lib/whop_sdk/models/identity_profile_needs_action_webhook_event.rb +++ b/lib/whop_sdk/models/identity_profile_needs_action_webhook_event.rb @@ -87,9 +87,9 @@ class Data < WhopSDK::Internal::Type::BaseModel required :business_structure, String, nil?: true # @!attribute country - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. # # @return [String, nil] required :country, String, nil?: true @@ -194,7 +194,7 @@ class Data < WhopSDK::Internal::Type::BaseModel # # @param business_structure [String, nil] Reported legal structure of a business profile (e.g. `corp`, `llc`). Provider-sp # - # @param country [String, nil] ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the + # @param country [String, nil] ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` # # @param created_at [Time] When the identity profile was first created. # diff --git a/lib/whop_sdk/models/identity_profile_rejected_webhook_event.rb b/lib/whop_sdk/models/identity_profile_rejected_webhook_event.rb index 02549d98..7105d402 100644 --- a/lib/whop_sdk/models/identity_profile_rejected_webhook_event.rb +++ b/lib/whop_sdk/models/identity_profile_rejected_webhook_event.rb @@ -87,9 +87,9 @@ class Data < WhopSDK::Internal::Type::BaseModel required :business_structure, String, nil?: true # @!attribute country - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. # # @return [String, nil] required :country, String, nil?: true @@ -193,7 +193,7 @@ class Data < WhopSDK::Internal::Type::BaseModel # # @param business_structure [String, nil] Reported legal structure of a business profile (e.g. `corp`, `llc`). Provider-sp # - # @param country [String, nil] ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the + # @param country [String, nil] ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` # # @param created_at [Time] When the identity profile was first created. # diff --git a/lib/whop_sdk/models/identity_profile_updated_webhook_event.rb b/lib/whop_sdk/models/identity_profile_updated_webhook_event.rb index 05b21353..6e66a879 100644 --- a/lib/whop_sdk/models/identity_profile_updated_webhook_event.rb +++ b/lib/whop_sdk/models/identity_profile_updated_webhook_event.rb @@ -87,9 +87,9 @@ class Data < WhopSDK::Internal::Type::BaseModel required :business_structure, String, nil?: true # @!attribute country - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. # # @return [String, nil] required :country, String, nil?: true @@ -193,7 +193,7 @@ class Data < WhopSDK::Internal::Type::BaseModel # # @param business_structure [String, nil] Reported legal structure of a business profile (e.g. `corp`, `llc`). Provider-sp # - # @param country [String, nil] ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the + # @param country [String, nil] ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` # # @param created_at [Time] When the identity profile was first created. # diff --git a/lib/whop_sdk/models/invoice_create_params.rb b/lib/whop_sdk/models/invoice_create_params.rb index 9d35eeb5..283a4583 100644 --- a/lib/whop_sdk/models/invoice_create_params.rb +++ b/lib/whop_sdk/models/invoice_create_params.rb @@ -197,6 +197,12 @@ class CreateInvoiceInputWithProduct < WhopSDK::Internal::Type::BaseModel # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct#plan class Plan < WhopSDK::Internal::Type::BaseModel + # @!attribute adaptive_pricing_enabled + # Whether this plan accepts local currency payments via adaptive pricing. + # + # @return [Boolean, nil] + optional :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean, nil?: true + # @!attribute billing_period # The interval in days at which the plan charges (renewal plans). # @@ -307,7 +313,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, 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) + # @!method initialize(adaptive_pricing_enabled: nil, 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. @@ -315,6 +321,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # The plan attributes defining the price, currency, and billing interval for this # invoice. # + # @param adaptive_pricing_enabled [Boolean, nil] Whether this plan accepts local currency payments via adaptive pricing. + # # @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 @@ -754,6 +762,12 @@ class CreateInvoiceInputWithProductID < WhopSDK::Internal::Type::BaseModel # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID#plan class Plan < WhopSDK::Internal::Type::BaseModel + # @!attribute adaptive_pricing_enabled + # Whether this plan accepts local currency payments via adaptive pricing. + # + # @return [Boolean, nil] + optional :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean, nil?: true + # @!attribute billing_period # The interval in days at which the plan charges (renewal plans). # @@ -864,7 +878,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, 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) + # @!method initialize(adaptive_pricing_enabled: nil, 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. @@ -872,6 +886,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # The plan attributes defining the price, currency, and billing interval for this # invoice. # + # @param adaptive_pricing_enabled [Boolean, nil] Whether this plan accepts local currency payments via adaptive pricing. + # # @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 diff --git a/lib/whop_sdk/models/invoice_update_params.rb b/lib/whop_sdk/models/invoice_update_params.rb index 8ddf8acd..3ea7a406 100644 --- a/lib/whop_sdk/models/invoice_update_params.rb +++ b/lib/whop_sdk/models/invoice_update_params.rb @@ -257,6 +257,12 @@ class LineItem < WhopSDK::Internal::Type::BaseModel end class Plan < WhopSDK::Internal::Type::BaseModel + # @!attribute adaptive_pricing_enabled + # Whether this plan accepts local currency payments via adaptive pricing. + # + # @return [Boolean, nil] + optional :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean, nil?: true + # @!attribute billing_period # The interval in days at which the plan charges (renewal plans). # @@ -363,12 +369,14 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Visibility, nil] optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - # @!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) + # @!method initialize(adaptive_pricing_enabled: nil, 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. # # Updated plan attributes. # + # @param adaptive_pricing_enabled [Boolean, nil] Whether this plan accepts local currency payments via adaptive pricing. + # # @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 diff --git a/lib/whop_sdk/models/ledger_account_funds_available_webhook_event.rb b/lib/whop_sdk/models/ledger_account_funds_available_webhook_event.rb new file mode 100644 index 00000000..f31d8480 --- /dev/null +++ b/lib/whop_sdk/models/ledger_account_funds_available_webhook_event.rb @@ -0,0 +1,578 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class LedgerAccountFundsAvailableWebhookEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique ID for every single webhook request + # + # @return [String] + required :id, String + + # @!attribute api_version + # The API version for this webhook + # + # @return [Symbol, :v1] + required :api_version, const: :v1 + + # @!attribute data + # A ledger account represents a financial account on Whop that can hold many + # balances. + # + # @return [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data] + required :data, -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data } + + # @!attribute timestamp + # The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @return [Time] + required :timestamp, Time + + # @!attribute type + # The webhook event type + # + # @return [Symbol, :"ledger_account.funds_available"] + required :type, const: :"ledger_account.funds_available" + + # @!attribute company_id + # The company ID that this webhook event is associated with + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!method initialize(id:, data:, timestamp:, company_id: nil, api_version: :v1, type: :"ledger_account.funds_available") + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent} for more details. + # + # @param id [String] A unique ID for every single webhook request + # + # @param data [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data] A ledger account represents a financial account on Whop that can hold many balan + # + # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @param company_id [String, nil] The company ID that this webhook event is associated with + # + # @param api_version [Symbol, :v1] The API version for this webhook + # + # @param type [Symbol, :"ledger_account.funds_available"] The webhook event type + + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent#data + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the ledger account. + # + # @return [String] + required :id, String + + # @!attribute balances + # The balances associated with the account. + # + # @return [Array] + required :balances, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance] } + + # @!attribute ledger_type + # The type of ledger account. + # + # @return [Symbol, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType] + required :ledger_type, enum: -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType } + + # @!attribute owner + # The owner of the ledger account. + # + # @return [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::User, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Company, nil] + required :owner, union: -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner } + + # @!attribute payments_approval_status + # The different approval statuses an account can have. + # + # @return [Symbol, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus, nil] + required :payments_approval_status, + enum: -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus }, + nil?: true + + # @!attribute payout_account_details + # The payout account associated with the LedgerAccount, if any. + # + # @return [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails, nil] + required :payout_account_details, + -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails }, + nil?: true + + # @!attribute transfer_fee + # The fee for transfers, if applicable. + # + # @return [Float, nil] + required :transfer_fee, Float, nil?: true + + # @!attribute treasury_balance + # The balance cache associated with the account by currency. + # + # @return [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance, nil] + required :treasury_balance, + -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance }, + nil?: true + + # @!method initialize(id:, balances:, ledger_type:, owner:, payments_approval_status:, payout_account_details:, transfer_fee:, treasury_balance:) + # A ledger account represents a financial account on Whop that can hold many + # balances. + # + # @param id [String] The unique identifier for the ledger account. + # + # @param balances [Array] The balances associated with the account. + # + # @param ledger_type [Symbol, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType] The type of ledger account. + # + # @param owner [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::User, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Company, nil] The owner of the ledger account. + # + # @param payments_approval_status [Symbol, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus, nil] The different approval statuses an account can have. + # + # @param payout_account_details [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails, nil] The payout account associated with the LedgerAccount, if any. + # + # @param transfer_fee [Float, nil] The fee for transfers, if applicable. + # + # @param treasury_balance [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance, nil] The balance cache associated with the account by currency. + + class Balance < WhopSDK::Internal::Type::BaseModel + # @!attribute balance + # The amount of the balance. + # + # @return [Float] + required :balance, Float + + # @!attribute currency + # The currency of the balance. + # + # @return [Symbol, WhopSDK::Models::Currency] + required :currency, enum: -> { WhopSDK::Currency } + + # @!attribute pending_balance + # The amount of the balance that is pending. + # + # @return [Float] + required :pending_balance, Float + + # @!attribute reserve_balance + # The amount of the balance that is reserved. + # + # @return [Float] + required :reserve_balance, Float + + # @!method initialize(balance:, currency:, pending_balance:, reserve_balance:) + # A cached balance for a LedgerAccount in respect to a currency. + # + # @param balance [Float] The amount of the balance. + # + # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the balance. + # + # @param pending_balance [Float] The amount of the balance that is pending. + # + # @param reserve_balance [Float] The amount of the balance that is reserved. + end + + # The type of ledger account. + # + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data#ledger_type + module LedgerType + extend WhopSDK::Internal::Type::Enum + + PRIMARY = :primary + POOL = :pool + + # @!method self.values + # @return [Array] + end + + # The owner of the ledger account. + # + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data#owner + module Owner + extend WhopSDK::Internal::Type::Union + + discriminator :typename + + # A user account on Whop. Contains profile information, identity details, and social connections. + variant :User, -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::User } + + # A company is a seller on Whop. Companies own products, manage members, and receive payouts. + variant :Company, -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Company } + + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the user. + # + # @return [String] + required :id, String + + # @!attribute name + # The user's display name shown on their public profile. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute typename + # The typename of this object + # + # @return [Symbol, :User] + required :typename, const: :User + + # @!attribute username + # The user's unique username shown on their public profile. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, username:, typename: :User) + # A user account on Whop. Contains profile information, identity details, and + # social connections. + # + # @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. + # + # @param typename [Symbol, :User] The typename of this object + end + + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the company. + # + # @return [String] + required :id, String + + # @!attribute route + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. + # + # @return [String] + required :route, String + + # @!attribute title + # The display name of the company shown to customers. + # + # @return [String] + required :title, String + + # @!attribute typename + # The typename of this object + # + # @return [Symbol, :Company] + required :typename, const: :Company + + # @!method initialize(id:, route:, title:, typename: :Company) + # A company is a seller on Whop. Companies own products, manage members, and + # receive payouts. + # + # @param id [String] The unique identifier for the company. + # + # @param route [String] URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. + # + # @param title [String] The display name of the company shown to customers. + # + # @param typename [Symbol, :Company] The typename of this object + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::User, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Company)] + end + + # The different approval statuses an account can have. + # + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data#payments_approval_status + module PaymentsApprovalStatus + extend WhopSDK::Internal::Type::Enum + + PENDING = :pending + APPROVED = :approved + MONITORING = :monitoring + REJECTED = :rejected + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data#payout_account_details + class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the payout account. + # + # @return [String] + required :id, String + + # @!attribute address + # The physical address associated with this payout account + # + # @return [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address, nil] + required :address, + -> { + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address + }, + nil?: true + + # @!attribute business_name + # The company's legal name + # + # @return [String, nil] + required :business_name, String, nil?: true + + # @!attribute business_representative + # The business representative for this payout account + # + # @return [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative, nil] + required :business_representative, + -> { + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative + }, + nil?: true + + # @!attribute email + # The email address of the representative + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute latest_verification + # The latest verification for the connected account. + # + # @return [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification, nil] + required :latest_verification, + -> { + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification + }, + nil?: true + + # @!attribute phone + # The business representative's phone + # + # @return [String, nil] + required :phone, String, nil?: true + + # @!attribute status + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + # + # @return [Symbol, WhopSDK::Models::PayoutAccountCalculatedStatuses, nil] + required :status, enum: -> { WhopSDK::PayoutAccountCalculatedStatuses }, nil?: true + + # @!method initialize(id:, address:, business_name:, business_representative:, email:, latest_verification:, phone:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails} + # for more details. + # + # The payout account associated with the LedgerAccount, if any. + # + # @param id [String] The unique identifier for the payout account. + # + # @param address [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address, nil] The physical address associated with this payout account + # + # @param business_name [String, nil] The company's legal name + # + # @param business_representative [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative, nil] The business representative for this payout account + # + # @param email [String, nil] The email address of the representative + # + # @param latest_verification [WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification, nil] The latest verification for the connected account. + # + # @param phone [String, nil] The business representative's phone + # + # @param status [Symbol, WhopSDK::Models::PayoutAccountCalculatedStatuses, nil] The granular calculated statuses reflecting payout account KYC and withdrawal re + + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city of the address. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country of the address. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # The line 1 of the address. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # The line 2 of the address. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # The postal code of the address. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # The state of the address. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!method initialize(city:, country:, line1:, line2:, postal_code:, state:) + # The physical address associated with this payout account + # + # @param city [String, nil] The city of the address. + # + # @param country [String, nil] The country of the address. + # + # @param line1 [String, nil] The line 1 of the address. + # + # @param line2 [String, nil] The line 2 of the address. + # + # @param postal_code [String, nil] The postal code of the address. + # + # @param state [String, nil] The state of the address. + end + + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails#business_representative + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + # @!attribute date_of_birth + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + # + # @return [String, nil] + required :date_of_birth, String, nil?: true + + # @!attribute first_name + # The first name of the business representative. + # + # @return [String, nil] + required :first_name, String, nil?: true + + # @!attribute last_name + # The last name of the business representative. + # + # @return [String, nil] + required :last_name, String, nil?: true + + # @!attribute middle_name + # The middle name of the business representative. + # + # @return [String, nil] + required :middle_name, String, nil?: true + + # @!method initialize(date_of_birth:, first_name:, last_name:, middle_name:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative} + # for more details. + # + # The business representative for this payout account + # + # @param date_of_birth [String, nil] The date of birth of the business representative in ISO 8601 format (YYYY-MM-DD) + # + # @param first_name [String, nil] The first name of the business representative. + # + # @param last_name [String, nil] The last name of the business representative. + # + # @param middle_name [String, nil] The middle name of the business representative. + end + + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails#latest_verification + class LatestVerification < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The numeric id of the verification record. + # + # @return [String] + required :id, String + + # @!attribute last_error_code + # An error code for a verification attempt. + # + # @return [Symbol, WhopSDK::Models::VerificationErrorCode, nil] + required :last_error_code, enum: -> { WhopSDK::VerificationErrorCode }, nil?: true + + # @!attribute last_error_reason + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + # + # @return [String, nil] + required :last_error_reason, String, nil?: true + + # @!attribute status + # The current status of this verification session. + # + # @return [Symbol, WhopSDK::Models::VerificationStatus] + required :status, enum: -> { WhopSDK::VerificationStatus } + + # @!method initialize(id:, last_error_code:, last_error_reason:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification} + # for more details. + # + # The latest verification for the connected account. + # + # @param id [String] The numeric id of the verification record. + # + # @param last_error_code [Symbol, WhopSDK::Models::VerificationErrorCode, nil] An error code for a verification attempt. + # + # @param last_error_reason [String, nil] A human-readable explanation of the most recent verification error. Null if no e + # + # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. + end + end + + # @see WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data#treasury_balance + class TreasuryBalance < WhopSDK::Internal::Type::BaseModel + # @!attribute balance + # The amount of the balance. + # + # @return [Float] + required :balance, Float + + # @!attribute balance_usd + # The balance converted to USD. + # + # @return [Float] + required :balance_usd, Float + + # @!attribute currency + # The currency of the balance. + # + # @return [Symbol, WhopSDK::Models::Currency] + required :currency, enum: -> { WhopSDK::Currency } + + # @!attribute pending_balance + # The amount of the balance that is pending. + # + # @return [Float] + required :pending_balance, Float + + # @!attribute reserve_balance + # The amount of the balance that is reserved. + # + # @return [Float] + required :reserve_balance, Float + + # @!attribute total_withdrawable_balance + # The amount of the balance that is withdrawable. + # + # @return [Float] + required :total_withdrawable_balance, Float + + # @!method initialize(balance:, balance_usd:, currency:, pending_balance:, reserve_balance:, total_withdrawable_balance:) + # The balance cache associated with the account by currency. + # + # @param balance [Float] The amount of the balance. + # + # @param balance_usd [Float] The balance converted to USD. + # + # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the balance. + # + # @param pending_balance [Float] The amount of the balance that is pending. + # + # @param reserve_balance [Float] The amount of the balance that is reserved. + # + # @param total_withdrawable_balance [Float] The amount of the balance that is withdrawable. + end + end + end + end +end diff --git a/lib/whop_sdk/models/ledger_account_retrieve_response.rb b/lib/whop_sdk/models/ledger_account_retrieve_response.rb index 0f29335d..5b132b68 100644 --- a/lib/whop_sdk/models/ledger_account_retrieve_response.rb +++ b/lib/whop_sdk/models/ledger_account_retrieve_response.rb @@ -189,7 +189,7 @@ class Company < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @return [String] required :route, String @@ -207,16 +207,12 @@ class Company < WhopSDK::Internal::Type::BaseModel required :typename, const: :Company # @!method initialize(id:, route:, title:, typename: :Company) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::LedgerAccountRetrieveResponse::Owner::Company} for more - # details. - # # A company is a seller on Whop. Companies own products, manage members, and # receive payouts. # # @param id [String] The unique identifier for the company. # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # @param route [String] URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @param title [String] The display name of the company shown to customers. # diff --git a/lib/whop_sdk/models/lesson.rb b/lib/whop_sdk/models/lesson.rb index 7894096d..7c38165e 100644 --- a/lib/whop_sdk/models/lesson.rb +++ b/lib/whop_sdk/models/lesson.rb @@ -226,7 +226,7 @@ class Image < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -252,7 +252,7 @@ class Image < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # @@ -313,7 +313,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -339,7 +339,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # @@ -359,7 +359,7 @@ class MainPdf < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -386,7 +386,7 @@ class MainPdf < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # diff --git a/lib/whop_sdk/models/media_asset.rb b/lib/whop_sdk/models/media_asset.rb new file mode 100644 index 00000000..f9398946 --- /dev/null +++ b/lib/whop_sdk/models/media_asset.rb @@ -0,0 +1,224 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Media#retrieve + class MediaAsset < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Media asset ID, prefixed `media_`. + # + # @return [String] + required :id, String + + # @!attribute amount_charged + # USD amount charged to the account's balance for this generation. `null` if the + # generation wasn't billed. + # + # @return [Float, nil] + required :amount_charged, Float, nil?: true + + # @!attribute completed_at + # ISO 8601 timestamp when the asset reached a terminal state. `null` while + # `processing`. + # + # @return [String, nil] + required :completed_at, String, nil?: true + + # @!attribute created_at + # ISO 8601 timestamp when the generation was requested. + # + # @return [String] + required :created_at, String + + # @!attribute currency + # Currency of `amount_charged`. Always `usd`. + # + # @return [String] + required :currency, String + + # @!attribute error_message + # Why generation failed. `null` unless status is `failed`. + # + # @return [String, nil] + required :error_message, String, nil?: true + + # @!attribute file + # The produced file, usable anywhere attachments are accepted. `null` until the + # asset is `ready`. + # + # @return [WhopSDK::Models::MediaAsset::File, nil] + required :file, -> { WhopSDK::MediaAsset::File }, nil?: true + + # @!attribute generation + # The inputs the asset was generated from. + # + # @return [WhopSDK::Models::MediaAsset::Generation] + required :generation, -> { WhopSDK::MediaAsset::Generation } + + # @!attribute media_type + # The kind of media this asset holds. + # + # @return [Symbol, WhopSDK::Models::MediaAsset::MediaType] + required :media_type, enum: -> { WhopSDK::MediaAsset::MediaType } + + # @!attribute source + # How the asset was created. Always `generated`. + # + # @return [Symbol, WhopSDK::Models::MediaAsset::Source] + required :source, enum: -> { WhopSDK::MediaAsset::Source } + + # @!attribute status + # Lifecycle state: `processing` while generation runs, `ready` when the file is + # available, `failed` when generation failed and the charge was refunded. + # + # @return [Symbol, WhopSDK::Models::MediaAsset::Status] + required :status, enum: -> { WhopSDK::MediaAsset::Status } + + # @!method initialize(id:, amount_charged:, completed_at:, created_at:, currency:, error_message:, file:, generation:, media_type:, source:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::MediaAsset} for more details. + # + # @param id [String] Media asset ID, prefixed `media_`. + # + # @param amount_charged [Float, nil] USD amount charged to the account's balance for this generation. `null` if the g + # + # @param completed_at [String, nil] ISO 8601 timestamp when the asset reached a terminal state. `null` while `proces + # + # @param created_at [String] ISO 8601 timestamp when the generation was requested. + # + # @param currency [String] Currency of `amount_charged`. Always `usd`. + # + # @param error_message [String, nil] Why generation failed. `null` unless status is `failed`. + # + # @param file [WhopSDK::Models::MediaAsset::File, nil] The produced file, usable anywhere attachments are accepted. `null` until the as + # + # @param generation [WhopSDK::Models::MediaAsset::Generation] The inputs the asset was generated from. + # + # @param media_type [Symbol, WhopSDK::Models::MediaAsset::MediaType] The kind of media this asset holds. + # + # @param source [Symbol, WhopSDK::Models::MediaAsset::Source] How the asset was created. Always `generated`. + # + # @param status [Symbol, WhopSDK::Models::MediaAsset::Status] Lifecycle state: `processing` while generation runs, `ready` when the file is av + + # @see WhopSDK::Models::MediaAsset#file + class File < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # File ID, prefixed `file_`. + # + # @return [String] + required :id, String + + # @!attribute url + # CDN URL for downloading the file. + # + # @return [String] + required :url, String + + # @!method initialize(id:, url:) + # The produced file, usable anywhere attachments are accepted. `null` until the + # asset is `ready`. + # + # @param id [String] File ID, prefixed `file_`. + # + # @param url [String] CDN URL for downloading the file. + end + + # @see WhopSDK::Models::MediaAsset#generation + class Generation < WhopSDK::Internal::Type::BaseModel + # @!attribute duration_seconds + # Requested video length in seconds. `null` for images. + # + # @return [Float, nil] + required :duration_seconds, Float, nil?: true + + # @!attribute prompt + # What the asset was generated from. + # + # @return [String] + required :prompt, String + + # @!attribute reference_media + # + # @return [Array] + required :reference_media, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute resolution + # Requested video resolution. `null` for images. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + # + # @return [Symbol, WhopSDK::Models::MediaAsset::Generation::Resolution, nil] + required :resolution, enum: -> { WhopSDK::MediaAsset::Generation::Resolution }, nil?: true + + # @!method initialize(duration_seconds:, prompt:, reference_media:, resolution:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::MediaAsset::Generation} for more details. + # + # The inputs the asset was generated from. + # + # @param duration_seconds [Float, nil] Requested video length in seconds. `null` for images. + # + # @param prompt [String] What the asset was generated from. + # + # @param reference_media [Array] + # + # @param resolution [Symbol, WhopSDK::Models::MediaAsset::Generation::Resolution, nil] Requested video resolution. `null` for images. `1080p` is not supported by Seeda + + # Requested video resolution. `null` for images. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + # + # @see WhopSDK::Models::MediaAsset::Generation#resolution + module Resolution + extend WhopSDK::Internal::Type::Enum + + RESOLUTION_480P = :"480p" + RESOLUTION_720P = :"720p" + RESOLUTION_1080P = :"1080p" + RESOLUTION_4K = :"4k" + + # @!method self.values + # @return [Array] + end + end + + # The kind of media this asset holds. + # + # @see WhopSDK::Models::MediaAsset#media_type + module MediaType + extend WhopSDK::Internal::Type::Enum + + VIDEO = :video + IMAGE = :image + + # @!method self.values + # @return [Array] + end + + # How the asset was created. Always `generated`. + # + # @see WhopSDK::Models::MediaAsset#source + module Source + extend WhopSDK::Internal::Type::Enum + + GENERATED = :generated + + # @!method self.values + # @return [Array] + end + + # Lifecycle state: `processing` while generation runs, `ready` when the file is + # available, `failed` when generation failed and the charge was refunded. + # + # @see WhopSDK::Models::MediaAsset#status + module Status + extend WhopSDK::Internal::Type::Enum + + PROCESSING = :processing + READY = :ready + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/media_generate_params.rb b/lib/whop_sdk/models/media_generate_params.rb new file mode 100644 index 00000000..a360dfa0 --- /dev/null +++ b/lib/whop_sdk/models/media_generate_params.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Media#generate + class MediaGenerateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute prompt + # What to generate. Up to 2,000 characters. + # + # @return [String] + required :prompt, String + + # @!attribute type + # The kind of media to generate. + # + # @return [Symbol, WhopSDK::Models::MediaGenerateParams::Type] + required :type, enum: -> { WhopSDK::MediaGenerateParams::Type } + + # @!attribute account_id + # Account ID, prefixed `biz_`. Defaults to the account the API key belongs to. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute duration_seconds + # Video length in seconds. Video only; defaults to 5. + # + # @return [Integer, WhopSDK::Models::MediaGenerateParams::DurationSeconds, nil] + optional :duration_seconds, enum: -> { WhopSDK::MediaGenerateParams::DurationSeconds } + + # @!attribute reference_media + # Optional reference image file IDs (`file_` prefixed), up to 4. For video, a + # single reference seeds the opening frame; multiple references guide subject and + # style instead. + # + # @return [Array, nil] + optional :reference_media, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute resolution + # Video resolution. Video only; defaults to `1080p`. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + # + # @return [Symbol, WhopSDK::Models::MediaGenerateParams::Resolution, nil] + optional :resolution, enum: -> { WhopSDK::MediaGenerateParams::Resolution } + + # @!method initialize(prompt:, type:, account_id: nil, duration_seconds: nil, reference_media: nil, resolution: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::MediaGenerateParams} for more details. + # + # @param prompt [String] What to generate. Up to 2,000 characters. + # + # @param type [Symbol, WhopSDK::Models::MediaGenerateParams::Type] The kind of media to generate. + # + # @param account_id [String] Account ID, prefixed `biz_`. Defaults to the account the API key belongs to. + # + # @param duration_seconds [Integer, WhopSDK::Models::MediaGenerateParams::DurationSeconds] Video length in seconds. Video only; defaults to 5. + # + # @param reference_media [Array] Optional reference image file IDs (`file_` prefixed), up to 4. For video, a sing + # + # @param resolution [Symbol, WhopSDK::Models::MediaGenerateParams::Resolution] Video resolution. Video only; defaults to `1080p`. `1080p` is not supported by S + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The kind of media to generate. + module Type + extend WhopSDK::Internal::Type::Enum + + VIDEO = :video + IMAGE = :image + + # @!method self.values + # @return [Array] + end + + # Video length in seconds. Video only; defaults to 5. + module DurationSeconds + extend WhopSDK::Internal::Type::Enum + + DURATION_SECONDS_5 = 5 + DURATION_SECONDS_10 = 10 + DURATION_SECONDS_15 = 15 + + # @!method self.values + # @return [Array] + end + + # Video resolution. Video only; defaults to `1080p`. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + module Resolution + extend WhopSDK::Internal::Type::Enum + + RESOLUTION_480P = :"480p" + RESOLUTION_720P = :"720p" + RESOLUTION_1080P = :"1080p" + RESOLUTION_4K = :"4k" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/media_retrieve_params.rb b/lib/whop_sdk/models/media_retrieve_params.rb new file mode 100644 index 00000000..bbf6c181 --- /dev/null +++ b/lib/whop_sdk/models/media_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Media#retrieve + class MediaRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/membership.rb b/lib/whop_sdk/models/membership.rb index eb40933d..c8649811 100644 --- a/lib/whop_sdk/models/membership.rb +++ b/lib/whop_sdk/models/membership.rb @@ -101,7 +101,7 @@ class Membership < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs for the membership (commonly used for software licensing, - # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. + # e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -296,7 +296,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -321,8 +322,9 @@ class Product < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -342,7 +344,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members # # @param title [String] The display name of the product shown to customers on the product page and in se end diff --git a/lib/whop_sdk/models/membership_list_response.rb b/lib/whop_sdk/models/membership_list_response.rb index 84fa3930..61912ceb 100644 --- a/lib/whop_sdk/models/membership_list_response.rb +++ b/lib/whop_sdk/models/membership_list_response.rb @@ -94,7 +94,7 @@ class MembershipListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs for the membership (commonly used for software licensing, - # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. + # e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -258,7 +258,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -283,8 +284,9 @@ class Product < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -304,7 +306,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members # # @param title [String] The display name of the product shown to customers on the product page and in se end diff --git a/lib/whop_sdk/models/membership_trial_ending_soon_webhook_event.rb b/lib/whop_sdk/models/membership_trial_ending_soon_webhook_event.rb new file mode 100644 index 00000000..692b8491 --- /dev/null +++ b/lib/whop_sdk/models/membership_trial_ending_soon_webhook_event.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class MembershipTrialEndingSoonWebhookEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique ID for every single webhook request + # + # @return [String] + required :id, String + + # @!attribute api_version + # The API version for this webhook + # + # @return [Symbol, :v1] + required :api_version, const: :v1 + + # @!attribute data + # A membership represents an active relationship between a user and a product. It + # tracks the user's access, billing status, and renewal schedule. + # + # @return [WhopSDK::Models::Membership] + required :data, -> { WhopSDK::Membership } + + # @!attribute timestamp + # The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @return [Time] + required :timestamp, Time + + # @!attribute type + # The webhook event type + # + # @return [Symbol, :"membership.trial_ending_soon"] + required :type, const: :"membership.trial_ending_soon" + + # @!attribute company_id + # The company ID that this webhook event is associated with + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!method initialize(id:, data:, timestamp:, company_id: nil, api_version: :v1, type: :"membership.trial_ending_soon") + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::MembershipTrialEndingSoonWebhookEvent} for more details. + # + # @param id [String] A unique ID for every single webhook request + # + # @param data [WhopSDK::Models::Membership] A membership represents an active relationship between a user and a product. It + # + # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @param company_id [String, nil] The company ID that this webhook event is associated with + # + # @param api_version [Symbol, :v1] The API version for this webhook + # + # @param type [Symbol, :"membership.trial_ending_soon"] The webhook event type + end + end +end diff --git a/lib/whop_sdk/models/payment.rb b/lib/whop_sdk/models/payment.rb index c99bbf87..1dad28fb 100644 --- a/lib/whop_sdk/models/payment.rb +++ b/lib/whop_sdk/models/payment.rb @@ -205,6 +205,13 @@ class Payment < WhopSDK::Internal::Type::BaseModel # @return [Time, nil] required :refunded_at, Time, nil?: true + # @!attribute refunds + # The refunds issued against this payment, newest first, including failed and + # canceled refund attempts. Limited to the 100 most recent. + # + # @return [Array] + required :refunds, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Refund] } + # @!attribute resolutions # The resolution center cases opened by the customer on this payment. Null if the # actor in context does not have the payment:resolution_center_case:read @@ -221,6 +228,22 @@ class Payment < WhopSDK::Internal::Type::BaseModel # @return [Boolean] required :retryable, WhopSDK::Internal::Type::Boolean + # @!attribute risk_score + # Whop's in-house fraud risk score for this payment, from 0 (lowest risk) to 100 + # (highest risk). Null when the payment has not been scored or scoring has not yet + # completed. + # + # @return [Integer, nil] + required :risk_score, Integer, nil?: true + + # @!attribute risk_signals + # A curated set of factors behind the risk score, grouped by category (business + # transaction history, buyer, device). Each entry has a key, human-readable label, + # category, and value. Null when there is no risk assessment for this payment. + # + # @return [Hash{Symbol=>Object}, nil] + required :risk_signals, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @!attribute settlement_amount # The total amount charged to the customer for this payment, including taxes and # after any discounts. In the currency specified by the currency field. @@ -240,6 +263,13 @@ class Payment < WhopSDK::Internal::Type::BaseModel # @return [Float, nil] required :settlement_exchange_rate, Float, nil?: true + # @!attribute shipping_address + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + # + # @return [WhopSDK::Models::Payment::ShippingAddress, nil] + required :shipping_address, -> { WhopSDK::Payment::ShippingAddress }, nil?: true + # @!attribute status # The status of a receipt # @@ -277,6 +307,12 @@ class Payment < WhopSDK::Internal::Type::BaseModel # @return [Float, nil] required :tax_refunded_amount, Float, nil?: true + # @!attribute three_ds_verified + # Whether 3D Secure authentication was completed for this payment. + # + # @return [Boolean] + required :three_ds_verified, WhopSDK::Internal::Type::Boolean + # @!attribute total # The total to show to the creator (excluding buyer fees). # @@ -308,7 +344,7 @@ class Payment < WhopSDK::Internal::Type::BaseModel # @return [Boolean] required :voidable, WhopSDK::Internal::Type::Boolean - # @!method initialize(id:, amount_after_fees:, application_fee:, auto_refunded:, billing_address:, billing_reason:, card_brand:, card_last4:, checkout_configuration_id:, company:, created_at:, currency:, dispute_alerted_at:, disputes:, failure_message:, financing_installments_count:, financing_transactions:, last_payment_attempt:, member:, membership:, metadata:, next_payment_attempt:, paid_at:, payment_method:, payment_method_type:, payments_failed:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, resolutions:, retryable:, settlement_amount:, settlement_currency:, settlement_exchange_rate:, status:, substatus:, subtotal:, tax_amount:, tax_behavior:, tax_refunded_amount:, total:, updated_at:, usd_total:, user:, voidable:) + # @!method initialize(id:, amount_after_fees:, application_fee:, auto_refunded:, billing_address:, billing_reason:, card_brand:, card_last4:, checkout_configuration_id:, company:, created_at:, currency:, dispute_alerted_at:, disputes:, failure_message:, financing_installments_count:, financing_transactions:, last_payment_attempt:, member:, membership:, metadata:, next_payment_attempt:, paid_at:, payment_method:, payment_method_type:, payments_failed:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, refunds:, resolutions:, retryable:, risk_score:, risk_signals:, settlement_amount:, settlement_currency:, settlement_exchange_rate:, shipping_address:, status:, substatus:, subtotal:, tax_amount:, tax_behavior:, tax_refunded_amount:, three_ds_verified:, total:, updated_at:, usd_total:, user:, voidable:) # Some parameter documentations has been truncated, see {WhopSDK::Models::Payment} # for more details. # @@ -379,16 +415,24 @@ class Payment < WhopSDK::Internal::Type::BaseModel # # @param refunded_at [Time, nil] When the payment was refunded (if applicable). # + # @param refunds [Array] The refunds issued against this payment, newest first, including failed and canc + # # @param resolutions [Array, nil] The resolution center cases opened by the customer on this payment. Null if the # # @param retryable [Boolean] True when the payment status is `open` and its membership is in one of the retry # + # @param risk_score [Integer, nil] Whop's in-house fraud risk score for this payment, from 0 (lowest risk) to 100 ( + # + # @param risk_signals [Hash{Symbol=>Object}, nil] A curated set of factors behind the risk score, grouped by category (business tr + # # @param settlement_amount [Float] The total amount charged to the customer for this payment, including taxes and a # # @param settlement_currency [Symbol, WhopSDK::Models::Currency] The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). # # @param settlement_exchange_rate [Float, nil] Deprecated. Always returns null. # + # @param shipping_address [WhopSDK::Models::Payment::ShippingAddress, nil] The shipping address provided by the customer for physical goods. Null if no shi + # # @param status [Symbol, WhopSDK::Models::ReceiptStatus, nil] The status of a receipt # # @param substatus [Symbol, WhopSDK::Models::FriendlyReceiptStatus] The friendly status of the payment. @@ -401,6 +445,8 @@ class Payment < WhopSDK::Internal::Type::BaseModel # # @param tax_refunded_amount [Float, nil] The amount of tax that has been refunded (if applicable). # + # @param three_ds_verified [Boolean] Whether 3D Secure authentication was completed for this payment. + # # @param total [Float, nil] The total to show to the creator (excluding buyer fees). # # @param updated_at [Time] The datetime the payment was last updated. @@ -875,7 +921,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -902,15 +949,16 @@ class Product < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true # @!attribute route - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. # # @return [String] required :route, String @@ -930,9 +978,9 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members # - # @param route [String] The URL slug used in the product's public link (e.g., 'my-product' in whop.com/c + # @param route [String] URL slug in the product's public link, e.g. `pickaxe-analytics` in whop.com/comp # # @param title [String] The display name of the product shown to customers on the product page and in se end @@ -996,6 +1044,57 @@ class PromoCode < WhopSDK::Internal::Type::BaseModel # @param promo_type [Symbol, WhopSDK::Models::PromoType] The type (% or flat amount) of the promo. end + class Refund < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the refund. + # + # @return [String] + required :id, String + + # @!attribute amount + # The refunded amount as a decimal in the specified currency, such as 10.43 for + # $10.43 USD. + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # The datetime the refund was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # The three-letter ISO currency code for the refunded amount. + # + # @return [Symbol, WhopSDK::Models::Currency] + required :currency, enum: -> { WhopSDK::Currency } + + # @!attribute status + # The current processing status of the refund, such as pending, succeeded, or + # failed. + # + # @return [Symbol, WhopSDK::Models::RefundStatus] + required :status, enum: -> { WhopSDK::RefundStatus } + + # @!method initialize(id:, amount:, created_at:, currency:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Payment::Refund} for more details. + # + # A refund represents a full or partial reversal of a payment, including the + # amount, status, and payment provider. + # + # @param id [String] The unique identifier for the refund. + # + # @param amount [Float] The refunded amount as a decimal in the specified currency, such as 10.43 for $1 + # + # @param created_at [Time] The datetime the refund was created. + # + # @param currency [Symbol, WhopSDK::Models::Currency] The three-letter ISO currency code for the refunded amount. + # + # @param status [Symbol, WhopSDK::Models::RefundStatus] The current processing status of the refund, such as pending, succeeded, or fail + end + class Resolution < WhopSDK::Internal::Type::BaseModel # @!attribute id # The unique identifier for the resolution. @@ -1083,6 +1182,69 @@ class Resolution < WhopSDK::Internal::Type::BaseModel # @param status [Symbol, WhopSDK::Models::ResolutionCenterCaseStatus] The current status of the resolution case, indicating which party needs to respo end + # @see WhopSDK::Models::Payment#shipping_address + class ShippingAddress < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city of the address. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country of the address. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # The line 1 of the address. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # The line 2 of the address. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute name + # The name of the customer. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute postal_code + # The postal code of the address. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # The state of the address. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!method initialize(city:, country:, line1:, line2:, name:, postal_code:, state:) + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + # + # @param city [String, nil] The city of the address. + # + # @param country [String, nil] The country of the address. + # + # @param line1 [String, nil] The line 1 of the address. + # + # @param line2 [String, nil] The line 2 of the address. + # + # @param name [String, nil] The name of the customer. + # + # @param postal_code [String, nil] The postal code of the address. + # + # @param state [String, nil] The state of the address. + end + # @see WhopSDK::Models::Payment#user class User < WhopSDK::Internal::Type::BaseModel # @!attribute id diff --git a/lib/whop_sdk/models/payment_create_params.rb b/lib/whop_sdk/models/payment_create_params.rb index d26c7af5..8b755755 100644 --- a/lib/whop_sdk/models/payment_create_params.rb +++ b/lib/whop_sdk/models/payment_create_params.rb @@ -60,7 +60,15 @@ class CreatePaymentInputWithPlan < WhopSDK::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true - # @!method initialize(company_id:, member_id:, payment_method_id:, plan:, metadata: nil) + # @!attribute promo_code_id + # The ID of an active promo code to apply to this payment. The promo code must + # belong to the company and be valid for the plan being purchased. The plan must + # be attached to a product — promo codes are not eligible for one-off purchases. + # + # @return [String, nil] + optional :promo_code_id, String, nil?: true + + # @!method initialize(company_id:, member_id:, payment_method_id:, plan:, metadata: nil, promo_code_id: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PaymentCreateParams::Body::CreatePaymentInputWithPlan} for # more details. @@ -76,6 +84,8 @@ class CreatePaymentInputWithPlan < WhopSDK::Internal::Type::BaseModel # @param plan [WhopSDK::Models::PaymentCreateParams::Body::CreatePaymentInputWithPlan::Plan] Pass this object to create a new plan for this payment # # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata to attach to the payment. + # + # @param promo_code_id [String, nil] The ID of an active promo code to apply to this payment. The promo code must bel # @see WhopSDK::Models::PaymentCreateParams::Body::CreatePaymentInputWithPlan#plan class Plan < WhopSDK::Internal::Type::BaseModel @@ -363,7 +373,15 @@ class CreatePaymentInputWithPlanID < WhopSDK::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true - # @!method initialize(company_id:, member_id:, payment_method_id:, plan_id:, metadata: nil) + # @!attribute promo_code_id + # The ID of an active promo code to apply to this payment. The promo code must + # belong to the company and be valid for the plan being purchased. The plan must + # be attached to a product — promo codes are not eligible for one-off purchases. + # + # @return [String, nil] + optional :promo_code_id, String, nil?: true + + # @!method initialize(company_id:, member_id:, payment_method_id:, plan_id:, metadata: nil, promo_code_id: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PaymentCreateParams::Body::CreatePaymentInputWithPlanID} for # more details. @@ -379,6 +397,8 @@ class CreatePaymentInputWithPlanID < WhopSDK::Internal::Type::BaseModel # @param plan_id [String] An ID of an existing plan to use for the payment. # # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata to attach to the payment. + # + # @param promo_code_id [String, nil] The ID of an active promo code to apply to this payment. The promo code must bel end # @!method self.variants diff --git a/lib/whop_sdk/models/payment_list_response.rb b/lib/whop_sdk/models/payment_list_response.rb index 52058bd8..7c345563 100644 --- a/lib/whop_sdk/models/payment_list_response.rb +++ b/lib/whop_sdk/models/payment_list_response.rb @@ -198,6 +198,13 @@ class PaymentListResponse < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Currency] required :settlement_currency, enum: -> { WhopSDK::Currency } + # @!attribute shipping_address + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + # + # @return [WhopSDK::Models::PaymentListResponse::ShippingAddress, nil] + required :shipping_address, -> { WhopSDK::Models::PaymentListResponse::ShippingAddress }, nil?: true + # @!attribute status # The status of a receipt # @@ -260,7 +267,7 @@ class PaymentListResponse < WhopSDK::Internal::Type::BaseModel # @return [Boolean] required :voidable, WhopSDK::Internal::Type::Boolean - # @!method initialize(id:, amount_after_fees:, application_fee:, auto_refunded:, billing_address:, billing_reason:, card_brand:, card_last4:, checkout_configuration_id:, company:, created_at:, currency:, dispute_alerted_at:, failure_message:, last_payment_attempt:, member:, membership:, metadata:, next_payment_attempt:, paid_at:, payment_method:, payment_method_type:, payments_failed:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, retryable:, settlement_currency:, status:, substatus:, subtotal:, tax_amount:, tax_behavior:, total:, updated_at:, usd_total:, user:, voidable:) + # @!method initialize(id:, amount_after_fees:, application_fee:, auto_refunded:, billing_address:, billing_reason:, card_brand:, card_last4:, checkout_configuration_id:, company:, created_at:, currency:, dispute_alerted_at:, failure_message:, last_payment_attempt:, member:, membership:, metadata:, next_payment_attempt:, paid_at:, payment_method:, payment_method_type:, payments_failed:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, retryable:, settlement_currency:, shipping_address:, status:, substatus:, subtotal:, tax_amount:, tax_behavior:, total:, updated_at:, usd_total:, user:, voidable:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PaymentListResponse} for more details. # @@ -329,6 +336,8 @@ class PaymentListResponse < WhopSDK::Internal::Type::BaseModel # # @param settlement_currency [Symbol, WhopSDK::Models::Currency] The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). # + # @param shipping_address [WhopSDK::Models::PaymentListResponse::ShippingAddress, nil] The shipping address provided by the customer for physical goods. Null if no shi + # # @param status [Symbol, WhopSDK::Models::ReceiptStatus, nil] The status of a receipt # # @param substatus [Symbol, WhopSDK::Models::FriendlyReceiptStatus] The friendly status of the payment. @@ -647,7 +656,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -674,15 +684,16 @@ class Product < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true # @!attribute route - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. # # @return [String] required :route, String @@ -702,9 +713,9 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members # - # @param route [String] The URL slug used in the product's public link (e.g., 'my-product' in whop.com/c + # @param route [String] URL slug in the product's public link, e.g. `pickaxe-analytics` in whop.com/comp # # @param title [String] The display name of the product shown to customers on the product page and in se end @@ -768,6 +779,69 @@ class PromoCode < WhopSDK::Internal::Type::BaseModel # @param promo_type [Symbol, WhopSDK::Models::PromoType] The type (% or flat amount) of the promo. end + # @see WhopSDK::Models::PaymentListResponse#shipping_address + class ShippingAddress < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city of the address. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country of the address. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # The line 1 of the address. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # The line 2 of the address. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute name + # The name of the customer. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute postal_code + # The postal code of the address. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # The state of the address. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!method initialize(city:, country:, line1:, line2:, name:, postal_code:, state:) + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + # + # @param city [String, nil] The city of the address. + # + # @param country [String, nil] The country of the address. + # + # @param line1 [String, nil] The line 1 of the address. + # + # @param line2 [String, nil] The line 2 of the address. + # + # @param name [String, nil] The name of the customer. + # + # @param postal_code [String, nil] The postal code of the address. + # + # @param state [String, nil] The state of the address. + end + # @see WhopSDK::Models::PaymentListResponse#user class User < WhopSDK::Internal::Type::BaseModel # @!attribute id diff --git a/lib/whop_sdk/models/payout_create_params.rb b/lib/whop_sdk/models/payout_create_params.rb new file mode 100644 index 00000000..c2cf4f44 --- /dev/null +++ b/lib/whop_sdk/models/payout_create_params.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Payouts#create + class PayoutCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # The account to pay out from (a biz\_ identifier). + # + # @return [String] + required :account_id, String + + # @!attribute amount + # The amount to pay out in the specified currency. + # + # @return [Float] + required :amount, Float + + # @!attribute payout_method_id + # The saved payout method to deliver to (a potk\_ identifier). + # + # @return [String] + required :payout_method_id, String + + # @!attribute currency + # The payout currency. Defaults to usd. + # + # @return [String, nil] + optional :currency, String + + # @!attribute idempotency_key + # A client-generated key that makes retries safe. Retrying with the same key + # returns the original payout instead of creating a second one. + # + # @return [String, nil] + optional :idempotency_key, String + + # @!method initialize(account_id:, amount:, payout_method_id:, currency: nil, idempotency_key: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutCreateParams} for more details. + # + # @param account_id [String] The account to pay out from (a biz\_ identifier). + # + # @param amount [Float] The amount to pay out in the specified currency. + # + # @param payout_method_id [String] The saved payout method to deliver to (a potk\_ identifier). + # + # @param currency [String] The payout currency. Defaults to usd. + # + # @param idempotency_key [String] A client-generated key that makes retries safe. Retrying with the same key retur + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/payout_create_response.rb b/lib/whop_sdk/models/payout_create_response.rb new file mode 100644 index 00000000..e61ea76a --- /dev/null +++ b/lib/whop_sdk/models/payout_create_response.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Payouts#create + class PayoutCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Payout ID. + # + # @return [String] + required :id, String + + # @!attribute amount + # The payout amount in whole currency units. + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # When the payout was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # Payout currency. + # + # @return [String] + required :currency, String + + # @!attribute estimated_arrival + # Estimated time the funds become available in the destination account. Null until + # the payout settles. + # + # @return [Time, nil] + required :estimated_arrival, Time, nil?: true + + # @!attribute fee_amount + # The fee charged for the payout, in the payout currency. + # + # @return [Float] + required :fee_amount, Float + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::PayoutCreateResponse::Object] + required :object, enum: -> { WhopSDK::Models::PayoutCreateResponse::Object } + + # @!attribute payer_name + # Name of the entity processing the payout. Null until the payout settles. + # + # @return [String, nil] + required :payer_name, String, nil?: true + + # @!attribute payout_token + # The saved payout method used. Requires payout:destination:read; null without it. + # + # @return [WhopSDK::Models::PayoutCreateResponse::PayoutToken, nil] + required :payout_token, -> { WhopSDK::Models::PayoutCreateResponse::PayoutToken }, nil?: true + + # @!attribute speed + # Payout delivery speed. + # + # @return [Symbol, WhopSDK::Models::PayoutCreateResponse::Speed] + required :speed, enum: -> { WhopSDK::Models::PayoutCreateResponse::Speed } + + # @!attribute status + # Current payout status, in the same vocabulary as GET /payouts. + # + # @return [Symbol, WhopSDK::Models::PayoutCreateResponse::Status] + required :status, enum: -> { WhopSDK::Models::PayoutCreateResponse::Status } + + # @!method initialize(id:, amount:, created_at:, currency:, estimated_arrival:, fee_amount:, object:, payer_name:, payout_token:, speed:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutCreateResponse} for more details. + # + # @param id [String] Payout ID. + # + # @param amount [Float] The payout amount in whole currency units. + # + # @param created_at [Time] When the payout was created. + # + # @param currency [String] Payout currency. + # + # @param estimated_arrival [Time, nil] Estimated time the funds become available in the destination account. Null until + # + # @param fee_amount [Float] The fee charged for the payout, in the payout currency. + # + # @param object [Symbol, WhopSDK::Models::PayoutCreateResponse::Object] + # + # @param payer_name [String, nil] Name of the entity processing the payout. Null until the payout settles. + # + # @param payout_token [WhopSDK::Models::PayoutCreateResponse::PayoutToken, nil] The saved payout method used. Requires payout:destination:read; null without it. + # + # @param speed [Symbol, WhopSDK::Models::PayoutCreateResponse::Speed] Payout delivery speed. + # + # @param status [Symbol, WhopSDK::Models::PayoutCreateResponse::Status] Current payout status, in the same vocabulary as GET /payouts. + + # @see WhopSDK::Models::PayoutCreateResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT = :payout + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::PayoutCreateResponse#payout_token + class PayoutToken < WhopSDK::Internal::Type::BaseModel + # @!attribute nickname + # Saved payout method nickname. + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!attribute payout_destination + # Payout destination display details. + # + # @return [WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination, nil] + required :payout_destination, + -> { WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination }, + nil?: true + + # @!method initialize(nickname:, payout_destination:) + # The saved payout method used. Requires payout:destination:read; null without it. + # + # @param nickname [String, nil] Saved payout method nickname. + # + # @param payout_destination [WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination, nil] Payout destination display details. + + # @see WhopSDK::Models::PayoutCreateResponse::PayoutToken#payout_destination + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + # @!attribute icon_url + # Payout destination icon URL. + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute payer_name + # Payout destination display name. + # + # @return [String, nil] + required :payer_name, String, nil?: true + + # @!method initialize(icon_url:, payer_name:) + # Payout destination display details. + # + # @param icon_url [String, nil] Payout destination icon URL. + # + # @param payer_name [String, nil] Payout destination display name. + end + end + + # Payout delivery speed. + # + # @see WhopSDK::Models::PayoutCreateResponse#speed + module Speed + extend WhopSDK::Internal::Type::Enum + + STANDARD = :standard + INSTANT = :instant + + # @!method self.values + # @return [Array] + end + + # Current payout status, in the same vocabulary as GET /payouts. + # + # @see WhopSDK::Models::PayoutCreateResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + REQUESTED = :requested + IN_TRANSIT = :in_transit + COMPLETED = :completed + FAILED = :failed + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/payout_destination_category.rb b/lib/whop_sdk/models/payout_destination_category.rb deleted file mode 100644 index 4b04b06e..00000000 --- a/lib/whop_sdk/models/payout_destination_category.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # The category of a payout destination. - module PayoutDestinationCategory - extend WhopSDK::Internal::Type::Enum - - CRYPTO = :crypto - RTP = :rtp - NEXT_DAY_BANK = :next_day_bank - BANK_WIRE = :bank_wire - DIGITAL_WALLET = :digital_wallet - UNKNOWN = :unknown - - # @!method self.values - # @return [Array] - end - end -end diff --git a/lib/whop_sdk/models/payout_list_params.rb b/lib/whop_sdk/models/payout_list_params.rb new file mode 100644 index 00000000..78c71bbf --- /dev/null +++ b/lib/whop_sdk/models/payout_list_params.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Payouts#list + class PayoutListParams < 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 after + # Cursor to fetch the page after (from page_info.end_cursor). + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # Cursor to fetch the page before (from page_info.start_cursor). + # + # @return [String, nil] + optional :before, String + + # @!attribute currency + # Optional currency code filter, for example `usd`. + # + # @return [String, nil] + optional :currency, String + + # @!attribute first + # Number of payouts to return from the start of the window. + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute last + # Number of payouts to return from the end of the window. + # + # @return [Integer, nil] + optional :last, Integer + + # @!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, after: nil, before: nil, currency: nil, first: nil, last: nil, user_id: nil, request_options: {}) + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param currency [String] Optional currency code filter, for example `usd`. + # + # @param first [Integer] Number of payouts to return from the start of the window. + # + # @param last [Integer] Number of payouts to return from the end of the window. + # + # @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/payout_list_response.rb b/lib/whop_sdk/models/payout_list_response.rb new file mode 100644 index 00000000..5ede7c75 --- /dev/null +++ b/lib/whop_sdk/models/payout_list_response.rb @@ -0,0 +1,195 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Payouts#list + class PayoutListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Payout ID. + # + # @return [String] + required :id, String + + # @!attribute amount + # The payout amount in whole currency units. + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # When the payout was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # Payout currency. + # + # @return [String] + required :currency, String + + # @!attribute estimated_arrival + # Estimated time the funds become available in the destination account. + # + # @return [Time, nil] + required :estimated_arrival, Time, nil?: true + + # @!attribute fee_amount + # The fee charged for the payout, in the payout currency. + # + # @return [Float] + required :fee_amount, Float + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::PayoutListResponse::Object] + required :object, enum: -> { WhopSDK::Models::PayoutListResponse::Object } + + # @!attribute payer_name + # Name of the entity processing the payout. + # + # @return [String, nil] + required :payer_name, String, nil?: true + + # @!attribute payout_request_id + # The ID returned by POST /payouts when this payout was requested. Match it to the + # settled payout in GET /payouts. Null for payouts not created by POST /payouts. + # + # @return [String, nil] + required :payout_request_id, String, nil?: true + + # @!attribute payout_token + # The saved payout method used. Requires payout:destination:read; null without it. + # + # @return [WhopSDK::Models::PayoutListResponse::PayoutToken, nil] + required :payout_token, -> { WhopSDK::Models::PayoutListResponse::PayoutToken }, nil?: true + + # @!attribute speed + # Payout delivery speed. + # + # @return [Symbol, WhopSDK::Models::PayoutListResponse::Speed] + required :speed, enum: -> { WhopSDK::Models::PayoutListResponse::Speed } + + # @!attribute status + # Current payout status. + # + # @return [Symbol, WhopSDK::Models::PayoutListResponse::Status] + required :status, enum: -> { WhopSDK::Models::PayoutListResponse::Status } + + # @!method initialize(id:, amount:, created_at:, currency:, estimated_arrival:, fee_amount:, object:, payer_name:, payout_request_id:, payout_token:, speed:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutListResponse} for more details. + # + # @param id [String] Payout ID. + # + # @param amount [Float] The payout amount in whole currency units. + # + # @param created_at [Time] When the payout was created. + # + # @param currency [String] Payout currency. + # + # @param estimated_arrival [Time, nil] Estimated time the funds become available in the destination account. + # + # @param fee_amount [Float] The fee charged for the payout, in the payout currency. + # + # @param object [Symbol, WhopSDK::Models::PayoutListResponse::Object] + # + # @param payer_name [String, nil] Name of the entity processing the payout. + # + # @param payout_request_id [String, nil] The ID returned by POST /payouts when this payout was requested. Match it to the + # + # @param payout_token [WhopSDK::Models::PayoutListResponse::PayoutToken, nil] The saved payout method used. Requires payout:destination:read; null without it. + # + # @param speed [Symbol, WhopSDK::Models::PayoutListResponse::Speed] Payout delivery speed. + # + # @param status [Symbol, WhopSDK::Models::PayoutListResponse::Status] Current payout status. + + # @see WhopSDK::Models::PayoutListResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT = :payout + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::PayoutListResponse#payout_token + class PayoutToken < WhopSDK::Internal::Type::BaseModel + # @!attribute nickname + # Saved payout method nickname. + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!attribute payout_destination + # Payout destination display details. + # + # @return [WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination, nil] + required :payout_destination, + -> { WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination }, + nil?: true + + # @!method initialize(nickname:, payout_destination:) + # The saved payout method used. Requires payout:destination:read; null without it. + # + # @param nickname [String, nil] Saved payout method nickname. + # + # @param payout_destination [WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination, nil] Payout destination display details. + + # @see WhopSDK::Models::PayoutListResponse::PayoutToken#payout_destination + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + # @!attribute icon_url + # Payout destination icon URL. + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute payer_name + # Payout destination display name. + # + # @return [String, nil] + required :payer_name, String, nil?: true + + # @!method initialize(icon_url:, payer_name:) + # Payout destination display details. + # + # @param icon_url [String, nil] Payout destination icon URL. + # + # @param payer_name [String, nil] Payout destination display name. + end + end + + # Payout delivery speed. + # + # @see WhopSDK::Models::PayoutListResponse#speed + module Speed + extend WhopSDK::Internal::Type::Enum + + STANDARD = :standard + INSTANT = :instant + + # @!method self.values + # @return [Array] + end + + # Current payout status. + # + # @see WhopSDK::Models::PayoutListResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + REQUESTED = :requested + AWAITING_PAYMENT = :awaiting_payment + IN_TRANSIT = :in_transit + COMPLETED = :completed + FAILED = :failed + CANCELED = :canceled + DENIED = :denied + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/payout_method_created_webhook_event.rb b/lib/whop_sdk/models/payout_method_created_webhook_event.rb index 490eed46..d4c107f5 100644 --- a/lib/whop_sdk/models/payout_method_created_webhook_event.rb +++ b/lib/whop_sdk/models/payout_method_created_webhook_event.rb @@ -164,8 +164,8 @@ class Destination < WhopSDK::Internal::Type::BaseModel # @!attribute category # The category of the payout destination # - # @return [Symbol, WhopSDK::Models::PayoutDestinationCategory] - required :category, enum: -> { WhopSDK::PayoutDestinationCategory } + # @return [Symbol, WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::Category] + required :category, enum: -> { WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category } # @!attribute country_code # The country code of the payout destination @@ -183,11 +183,28 @@ class Destination < WhopSDK::Internal::Type::BaseModel # The payout destination configuration linked to this token. Null if not yet # configured. # - # @param category [Symbol, WhopSDK::Models::PayoutDestinationCategory] The category of the payout destination + # @param category [Symbol, WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::Category] The category of the payout destination # # @param country_code [String] The country code of the payout destination # # @param name [String] The name of the payer associated with the payout destination + + # The category of the payout destination + # + # @see WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination#category + module Category + extend WhopSDK::Internal::Type::Enum + + CRYPTO = :crypto + RTP = :rtp + NEXT_DAY_BANK = :next_day_bank + BANK_WIRE = :bank_wire + DIGITAL_WALLET = :digital_wallet + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/payout_method_list_params.rb b/lib/whop_sdk/models/payout_method_list_params.rb deleted file mode 100644 index 0a38ab36..00000000 --- a/lib/whop_sdk/models/payout_method_list_params.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::PayoutMethods#list - class PayoutMethodListParams < 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 list payout methods for. - # - # @return [String] - required :company_id, String - - # @!attribute after - # Returns the elements in the list that come after the specified cursor. - # - # @return [String, nil] - optional :after, String, nil?: true - - # @!attribute before - # Returns the elements in the list that come before the specified cursor. - # - # @return [String, nil] - optional :before, String, nil?: true - - # @!attribute first - # Returns the first _n_ elements from the list. - # - # @return [Integer, nil] - optional :first, Integer, nil?: true - - # @!attribute last - # Returns the last _n_ elements from the list. - # - # @return [Integer, nil] - optional :last, Integer, nil?: true - - # @!method initialize(company_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) - # @param company_id [String] The unique identifier of the company to list payout methods for. - # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. - # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. - # - # @param first [Integer, nil] Returns the first _n_ elements from the list. - # - # @param last [Integer, nil] Returns the last _n_ elements from the list. - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/whop_sdk/models/payout_method_list_response.rb b/lib/whop_sdk/models/payout_method_list_response.rb deleted file mode 100644 index 7c0b5ce0..00000000 --- a/lib/whop_sdk/models/payout_method_list_response.rb +++ /dev/null @@ -1,140 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::PayoutMethods#list - class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the payout token. - # - # @return [String] - required :id, String - - # @!attribute account_reference - # A masked identifier for the payout destination, such as the last four digits of - # a bank account or an email address. Null if no reference is available. - # - # @return [String, nil] - required :account_reference, String, nil?: true - - # @!attribute company - # The company associated with this payout destination. Null if not linked to a - # specific company. - # - # @return [WhopSDK::Models::PayoutMethodListResponse::Company, nil] - required :company, -> { WhopSDK::Models::PayoutMethodListResponse::Company }, nil?: true - - # @!attribute created_at - # The datetime the payout token was created. - # - # @return [Time] - required :created_at, Time - - # @!attribute currency - # The three-letter ISO currency code that payouts are delivered in for this - # destination. - # - # @return [String] - required :currency, String - - # @!attribute destination - # The payout destination configuration linked to this token. Null if not yet - # configured. - # - # @return [WhopSDK::Models::PayoutMethodListResponse::Destination, nil] - required :destination, -> { WhopSDK::Models::PayoutMethodListResponse::Destination }, nil?: true - - # @!attribute institution_name - # The name of the bank or financial institution receiving payouts. Null if not - # applicable or not provided. - # - # @return [String, nil] - required :institution_name, String, nil?: true - - # @!attribute is_default - # Whether this is the default payout destination for the associated payout - # account. - # - # @return [Boolean] - required :is_default, WhopSDK::Internal::Type::Boolean - - # @!attribute nickname - # A user-defined label to help identify this payout destination. Not sent to the - # provider. Null if no nickname has been set. - # - # @return [String, nil] - required :nickname, String, nil?: true - - # @!method initialize(id:, account_reference:, company:, created_at:, currency:, destination:, institution_name:, is_default:, nickname:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::PayoutMethodListResponse} for more details. - # - # A configured payout destination where a user receives earned funds, such as a - # bank account or digital wallet. - # - # @param id [String] The unique identifier for the payout token. - # - # @param account_reference [String, nil] A masked identifier for the payout destination, such as the last four digits of - # - # @param company [WhopSDK::Models::PayoutMethodListResponse::Company, nil] The company associated with this payout destination. Null if not linked to a spe - # - # @param created_at [Time] The datetime the payout token was created. - # - # @param currency [String] The three-letter ISO currency code that payouts are delivered in for this destin - # - # @param destination [WhopSDK::Models::PayoutMethodListResponse::Destination, nil] The payout destination configuration linked to this token. Null if not yet confi - # - # @param institution_name [String, nil] The name of the bank or financial institution receiving payouts. Null if not app - # - # @param is_default [Boolean] Whether this is the default payout destination for the associated payout account - # - # @param nickname [String, nil] A user-defined label to help identify this payout destination. Not sent to the p - - # @see WhopSDK::Models::PayoutMethodListResponse#company - class Company < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the company. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The company associated with this payout destination. Null if not linked to a - # specific company. - # - # @param id [String] The unique identifier for the company. - end - - # @see WhopSDK::Models::PayoutMethodListResponse#destination - class Destination < WhopSDK::Internal::Type::BaseModel - # @!attribute category - # The category of the payout destination - # - # @return [Symbol, WhopSDK::Models::PayoutDestinationCategory] - required :category, enum: -> { WhopSDK::PayoutDestinationCategory } - - # @!attribute country_code - # The country code of the payout destination - # - # @return [String] - required :country_code, String - - # @!attribute name - # The name of the payer associated with the payout destination - # - # @return [String] - required :name, String - - # @!method initialize(category:, country_code:, name:) - # The payout destination configuration linked to this token. Null if not yet - # configured. - # - # @param category [Symbol, WhopSDK::Models::PayoutDestinationCategory] The category of the payout destination - # - # @param country_code [String] The country code of the payout destination - # - # @param name [String] The name of the payer associated with the payout destination - end - end - end -end diff --git a/lib/whop_sdk/models/payout_method_retrieve_response.rb b/lib/whop_sdk/models/payout_method_retrieve_response.rb deleted file mode 100644 index 2b6c6e2c..00000000 --- a/lib/whop_sdk/models/payout_method_retrieve_response.rb +++ /dev/null @@ -1,140 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::PayoutMethods#retrieve - class PayoutMethodRetrieveResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the payout token. - # - # @return [String] - required :id, String - - # @!attribute account_reference - # A masked identifier for the payout destination, such as the last four digits of - # a bank account or an email address. Null if no reference is available. - # - # @return [String, nil] - required :account_reference, String, nil?: true - - # @!attribute company - # The company associated with this payout destination. Null if not linked to a - # specific company. - # - # @return [WhopSDK::Models::PayoutMethodRetrieveResponse::Company, nil] - required :company, -> { WhopSDK::Models::PayoutMethodRetrieveResponse::Company }, nil?: true - - # @!attribute created_at - # The datetime the payout token was created. - # - # @return [Time] - required :created_at, Time - - # @!attribute currency - # The three-letter ISO currency code that payouts are delivered in for this - # destination. - # - # @return [String] - required :currency, String - - # @!attribute destination - # The payout destination configuration linked to this token. Null if not yet - # configured. - # - # @return [WhopSDK::Models::PayoutMethodRetrieveResponse::Destination, nil] - required :destination, -> { WhopSDK::Models::PayoutMethodRetrieveResponse::Destination }, nil?: true - - # @!attribute institution_name - # The name of the bank or financial institution receiving payouts. Null if not - # applicable or not provided. - # - # @return [String, nil] - required :institution_name, String, nil?: true - - # @!attribute is_default - # Whether this is the default payout destination for the associated payout - # account. - # - # @return [Boolean] - required :is_default, WhopSDK::Internal::Type::Boolean - - # @!attribute nickname - # A user-defined label to help identify this payout destination. Not sent to the - # provider. Null if no nickname has been set. - # - # @return [String, nil] - required :nickname, String, nil?: true - - # @!method initialize(id:, account_reference:, company:, created_at:, currency:, destination:, institution_name:, is_default:, nickname:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::PayoutMethodRetrieveResponse} for more details. - # - # A configured payout destination where a user receives earned funds, such as a - # bank account or digital wallet. - # - # @param id [String] The unique identifier for the payout token. - # - # @param account_reference [String, nil] A masked identifier for the payout destination, such as the last four digits of - # - # @param company [WhopSDK::Models::PayoutMethodRetrieveResponse::Company, nil] The company associated with this payout destination. Null if not linked to a spe - # - # @param created_at [Time] The datetime the payout token was created. - # - # @param currency [String] The three-letter ISO currency code that payouts are delivered in for this destin - # - # @param destination [WhopSDK::Models::PayoutMethodRetrieveResponse::Destination, nil] The payout destination configuration linked to this token. Null if not yet confi - # - # @param institution_name [String, nil] The name of the bank or financial institution receiving payouts. Null if not app - # - # @param is_default [Boolean] Whether this is the default payout destination for the associated payout account - # - # @param nickname [String, nil] A user-defined label to help identify this payout destination. Not sent to the p - - # @see WhopSDK::Models::PayoutMethodRetrieveResponse#company - class Company < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the company. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The company associated with this payout destination. Null if not linked to a - # specific company. - # - # @param id [String] The unique identifier for the company. - end - - # @see WhopSDK::Models::PayoutMethodRetrieveResponse#destination - class Destination < WhopSDK::Internal::Type::BaseModel - # @!attribute category - # The category of the payout destination - # - # @return [Symbol, WhopSDK::Models::PayoutDestinationCategory] - required :category, enum: -> { WhopSDK::PayoutDestinationCategory } - - # @!attribute country_code - # The country code of the payout destination - # - # @return [String] - required :country_code, String - - # @!attribute name - # The name of the payer associated with the payout destination - # - # @return [String] - required :name, String - - # @!method initialize(category:, country_code:, name:) - # The payout destination configuration linked to this token. Null if not yet - # configured. - # - # @param category [Symbol, WhopSDK::Models::PayoutDestinationCategory] The category of the payout destination - # - # @param country_code [String] The country code of the payout destination - # - # @param name [String] The name of the payer associated with the payout destination - end - end - end -end diff --git a/lib/whop_sdk/models/payouts/method_list_params.rb b/lib/whop_sdk/models/payouts/method_list_params.rb new file mode 100644 index 00000000..e79c3694 --- /dev/null +++ b/lib/whop_sdk/models/payouts/method_list_params.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Payouts + # @see WhopSDK::Resources::Payouts::Methods#list + class MethodListParams < 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 after + # Cursor to fetch the page after (from page_info.end_cursor). + # + # @return [String, nil] + optional :after, String + + # @!attribute amount + # Optional withdrawal amount in whole currency units, for example `250.00`. When + # provided, each method includes a quote with the estimated fee, amount received, + # and delivery date for that amount. + # + # @return [Float, nil] + optional :amount, Float + + # @!attribute before + # Cursor to fetch the page before (from page_info.start_cursor). + # + # @return [String, nil] + optional :before, String + + # @!attribute currency + # Currency code of the amount, for example `usd`. Only meaningful with amount. + # + # @return [String, nil] + optional :currency, String + + # @!attribute first + # Number of payout methods to return from the start of the window. Capped at 25 + # when an amount is provided. + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute include_available + # When true, the response also carries available_destinations — payout rails the + # account could add as a new payout method, with per-currency quotes when an + # amount is provided. + # + # @return [Boolean, nil] + optional :include_available, WhopSDK::Internal::Type::Boolean + + # @!attribute last + # Number of payout methods to return from the end of the window. + # + # @return [Integer, nil] + optional :last, Integer + + # @!attribute status + # Optional status filter. `created` means saved but unused, `active` means a + # payout through it succeeded, `broken` means the last payout failed and the + # method needs fixing. + # + # @return [Symbol, WhopSDK::Models::Payouts::MethodListParams::Status, nil] + optional :status, enum: -> { WhopSDK::Payouts::MethodListParams::Status } + + # @!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, after: nil, amount: nil, before: nil, currency: nil, first: nil, include_available: nil, last: nil, status: nil, user_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Payouts::MethodListParams} for more details. + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param amount [Float] Optional withdrawal amount in whole currency units, for example `250.00`. When p + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param currency [String] Currency code of the amount, for example `usd`. Only meaningful with amount. + # + # @param first [Integer] Number of payout methods to return from the start of the window. Capped at 25 wh + # + # @param include_available [Boolean] When true, the response also carries available_destinations — payout rails the a + # + # @param last [Integer] Number of payout methods to return from the end of the window. + # + # @param status [Symbol, WhopSDK::Models::Payouts::MethodListParams::Status] Optional status filter. `created` means saved but unused, `active` means a payou + # + # @param user_id [String] The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Optional status filter. `created` means saved but unused, `active` means a + # payout through it succeeded, `broken` means the last payout failed and the + # method needs fixing. + module Status + extend WhopSDK::Internal::Type::Enum + + CREATED = :created + ACTIVE = :active + BROKEN = :broken + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/payouts/method_list_response.rb b/lib/whop_sdk/models/payouts/method_list_response.rb new file mode 100644 index 00000000..bb38d79e --- /dev/null +++ b/lib/whop_sdk/models/payouts/method_list_response.rb @@ -0,0 +1,315 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Payouts + # @see WhopSDK::Resources::Payouts::Methods#list + class MethodListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Payout method ID. + # + # @return [String] + required :id, String + + # @!attribute account_reference + # Masked identifier for the destination, such as the last four digits of a bank + # account. + # + # @return [String, nil] + required :account_reference, String, nil?: true + + # @!attribute created_at + # When the payout method was added. + # + # @return [Time] + required :created_at, Time + + # @!attribute destination_currency + # Currency payouts are delivered in for this method. + # + # @return [String] + required :destination_currency, String + + # @!attribute institution_name + # Name of the bank or institution receiving payouts. + # + # @return [String, nil] + required :institution_name, String, nil?: true + + # @!attribute is_default + # Whether this is the default payout method for the account. + # + # @return [Boolean] + required :is_default, WhopSDK::Internal::Type::Boolean + + # @!attribute nickname + # User-defined label for the payout method. + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::Payouts::MethodListResponse::Object] + required :object, enum: -> { WhopSDK::Models::Payouts::MethodListResponse::Object } + + # @!attribute payer_name + # Display name of the payout rail, such as `ACH Bank Deposit`. + # + # @return [String, nil] + required :payer_name, String, nil?: true + + # @!attribute payout_destination + # The payout rail this method delivers through. + # + # @return [WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination, nil] + required :payout_destination, + -> { WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination }, + nil?: true + + # @!attribute quote + # Fee and delivery estimate for withdrawing the requested amount through this + # method. Null unless an amount was provided, or when the estimate is unavailable. + # + # @return [WhopSDK::Models::Payouts::MethodListResponse::Quote, nil] + required :quote, -> { WhopSDK::Models::Payouts::MethodListResponse::Quote }, nil?: true + + # @!attribute status + # Lifecycle status: `created` means saved but unused, `active` means a payout + # succeeded through it, `broken` means the last payout failed. + # + # @return [Symbol, WhopSDK::Models::Payouts::MethodListResponse::Status] + required :status, enum: -> { WhopSDK::Models::Payouts::MethodListResponse::Status } + + # @!method initialize(id:, account_reference:, created_at:, destination_currency:, institution_name:, is_default:, nickname:, object:, payer_name:, payout_destination:, quote:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Payouts::MethodListResponse} for more details. + # + # @param id [String] Payout method ID. + # + # @param account_reference [String, nil] Masked identifier for the destination, such as the last four digits of a bank ac + # + # @param created_at [Time] When the payout method was added. + # + # @param destination_currency [String] Currency payouts are delivered in for this method. + # + # @param institution_name [String, nil] Name of the bank or institution receiving payouts. + # + # @param is_default [Boolean] Whether this is the default payout method for the account. + # + # @param nickname [String, nil] User-defined label for the payout method. + # + # @param object [Symbol, WhopSDK::Models::Payouts::MethodListResponse::Object] + # + # @param payer_name [String, nil] Display name of the payout rail, such as `ACH Bank Deposit`. + # + # @param payout_destination [WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination, nil] The payout rail this method delivers through. + # + # @param quote [WhopSDK::Models::Payouts::MethodListResponse::Quote, nil] Fee and delivery estimate for withdrawing the requested amount through this meth + # + # @param status [Symbol, WhopSDK::Models::Payouts::MethodListResponse::Status] Lifecycle status: `created` means saved but unused, `active` means a payout succ + + # @see WhopSDK::Models::Payouts::MethodListResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT_METHOD = :payout_method + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Payouts::MethodListResponse#payout_destination + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + # @!attribute delivery_type + # How funds are delivered, for example `bank_deposit`. + # + # @return [String] + required :delivery_type, String + + # @!attribute icon_url + # Payout destination icon URL. + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute name + # Payout destination display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute supports_instant_delivery + # + # @return [Boolean] + required :supports_instant_delivery, WhopSDK::Internal::Type::Boolean + + # @!attribute supports_standard_delivery + # + # @return [Boolean] + required :supports_standard_delivery, WhopSDK::Internal::Type::Boolean + + # @!method initialize(delivery_type:, icon_url:, name:, supports_instant_delivery:, supports_standard_delivery:) + # The payout rail this method delivers through. + # + # @param delivery_type [String] How funds are delivered, for example `bank_deposit`. + # + # @param icon_url [String, nil] Payout destination icon URL. + # + # @param name [String, nil] Payout destination display name. + # + # @param supports_instant_delivery [Boolean] + # + # @param supports_standard_delivery [Boolean] + end + + # @see WhopSDK::Models::Payouts::MethodListResponse#quote + class Quote < WhopSDK::Internal::Type::BaseModel + # @!attribute amount + # The withdrawal amount the quote is for. + # + # @return [Float] + required :amount, Float + + # @!attribute currency + # Currency of the quoted amount. + # + # @return [String] + required :currency, String + + # @!attribute exchange_rate + # Exchange rate from the withdrawal currency to the destination currency. + # + # @return [Float] + required :exchange_rate, Float + + # @!attribute instant + # Instant-delivery estimate. Null if the method does not support instant delivery, + # instant delivery is unavailable for the account, or the amount does not cover + # the fee. + # + # @return [WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant, nil] + required :instant, -> { WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant }, nil?: true + + # @!attribute max_limit + # Maximum withdrawal amount for this method, in the withdrawal currency. + # + # @return [Float, nil] + required :max_limit, Float, nil?: true + + # @!attribute min_limit + # Minimum withdrawal amount for this method, in the withdrawal currency. + # + # @return [Float] + required :min_limit, Float + + # @!attribute standard + # Standard-delivery estimate. Null if the method does not support standard + # delivery, or the amount does not cover the fee. + # + # @return [WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard, nil] + required :standard, -> { WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard }, nil?: true + + # @!method initialize(amount:, currency:, exchange_rate:, instant:, max_limit:, min_limit:, standard:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Payouts::MethodListResponse::Quote} for more details. + # + # Fee and delivery estimate for withdrawing the requested amount through this + # method. Null unless an amount was provided, or when the estimate is unavailable. + # + # @param amount [Float] The withdrawal amount the quote is for. + # + # @param currency [String] Currency of the quoted amount. + # + # @param exchange_rate [Float] Exchange rate from the withdrawal currency to the destination currency. + # + # @param instant [WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant, nil] Instant-delivery estimate. Null if the method does not support instant delivery, + # + # @param max_limit [Float, nil] Maximum withdrawal amount for this method, in the withdrawal currency. + # + # @param min_limit [Float] Minimum withdrawal amount for this method, in the withdrawal currency. + # + # @param standard [WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard, nil] Standard-delivery estimate. Null if the method does not support standard deliver + + # @see WhopSDK::Models::Payouts::MethodListResponse::Quote#instant + class Instant < WhopSDK::Internal::Type::BaseModel + # @!attribute estimated_arrival + # Estimated time the funds become available. + # + # @return [Time] + required :estimated_arrival, Time + + # @!attribute fee + # Total fee charged, in the withdrawal currency. + # + # @return [Float] + required :fee, Float + + # @!attribute total_received + # Amount delivered after fees, in the withdrawal currency. + # + # @return [Float] + required :total_received, Float + + # @!method initialize(estimated_arrival:, fee:, total_received:) + # Instant-delivery estimate. Null if the method does not support instant delivery, + # instant delivery is unavailable for the account, or the amount does not cover + # the fee. + # + # @param estimated_arrival [Time] Estimated time the funds become available. + # + # @param fee [Float] Total fee charged, in the withdrawal currency. + # + # @param total_received [Float] Amount delivered after fees, in the withdrawal currency. + end + + # @see WhopSDK::Models::Payouts::MethodListResponse::Quote#standard + class Standard < WhopSDK::Internal::Type::BaseModel + # @!attribute estimated_arrival + # Estimated time the funds become available. + # + # @return [Time] + required :estimated_arrival, Time + + # @!attribute fee + # Total fee charged, in the withdrawal currency. + # + # @return [Float] + required :fee, Float + + # @!attribute total_received + # Amount delivered after fees, in the withdrawal currency. + # + # @return [Float] + required :total_received, Float + + # @!method initialize(estimated_arrival:, fee:, total_received:) + # Standard-delivery estimate. Null if the method does not support standard + # delivery, or the amount does not cover the fee. + # + # @param estimated_arrival [Time] Estimated time the funds become available. + # + # @param fee [Float] Total fee charged, in the withdrawal currency. + # + # @param total_received [Float] Amount delivered after fees, in the withdrawal currency. + end + end + + # Lifecycle status: `created` means saved but unused, `active` means a payout + # succeeded through it, `broken` means the last payout failed. + # + # @see WhopSDK::Models::Payouts::MethodListResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + CREATED = :created + ACTIVE = :active + BROKEN = :broken + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/person_list_params.rb b/lib/whop_sdk/models/person_list_params.rb new file mode 100644 index 00000000..672b2b69 --- /dev/null +++ b/lib/whop_sdk/models/person_list_params.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::People#list + class PersonListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute after + # A cursor for fetching people after a previous page. + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # A cursor for fetching people before a later page. + # + # @return [String, nil] + optional :before, String + + # @!attribute direction + # Sort direction. Defaults to desc. + # + # @return [Symbol, WhopSDK::Models::PersonListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::PersonListParams::Direction } + + # @!attribute filters + # A JSON-encoded array of filters, each with field, operator, and value keys. + # + # @return [String, nil] + optional :filters, String + + # @!attribute first + # The number of people to return (default 100, max 100). + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute from + # Start of the time range as a Unix timestamp. Defaults to 366 days before `to`. + # + # @return [Integer, nil] + optional :from, Integer + + # @!attribute sort + # Column to sort by (e.g. last_seen_at, ltv, purchase_count). Defaults to + # last_seen_at. + # + # @return [String, nil] + optional :sort, String + + # @!attribute to + # End of the time range as a Unix timestamp. Defaults to now. + # + # @return [Integer, nil] + optional :to, Integer + + # @!method initialize(account_id: nil, after: nil, before: nil, direction: nil, filters: nil, first: nil, from: nil, sort: nil, to: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PersonListParams} for more details. + # + # @param account_id [String] The ID of the account, which will look like biz\_******\*******. Optional for + # acco + # + # @param after [String] A cursor for fetching people after a previous page. + # + # @param before [String] A cursor for fetching people before a later page. + # + # @param direction [Symbol, WhopSDK::Models::PersonListParams::Direction] Sort direction. Defaults to desc. + # + # @param filters [String] A JSON-encoded array of filters, each with field, operator, and value keys. + # + # @param first [Integer] The number of people to return (default 100, max 100). + # + # @param from [Integer] Start of the time range as a Unix timestamp. Defaults to 366 days before `to`. + # + # @param sort [String] Column to sort by (e.g. last_seen_at, ltv, purchase_count). Defaults to last_see + # + # @param to [Integer] End of the time range as a Unix timestamp. Defaults to now. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/person_list_response.rb b/lib/whop_sdk/models/person_list_response.rb new file mode 100644 index 00000000..93eb1f96 --- /dev/null +++ b/lib/whop_sdk/models/person_list_response.rb @@ -0,0 +1,167 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::People#list + class PersonListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute first_seen_at + # + # @return [Integer] + required :first_seen_at, Integer + + # @!attribute last_seen_at + # + # @return [Integer] + required :last_seen_at, Integer + + # @!attribute person_id + # + # @return [String] + required :person_id, String + + # @!attribute purchase_count + # + # @return [Integer] + required :purchase_count, Integer + + # @!attribute ad_sets + # + # @return [Array, nil] + optional :ad_sets, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonListResponse::AdSet] } + + # @!attribute ads + # + # @return [Array, nil] + optional :ads, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonListResponse::Ad] } + + # @!attribute aov + # + # @return [Float, nil] + optional :aov, Float + + # @!attribute campaigns + # + # @return [Array, nil] + optional :campaigns, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonListResponse::Campaign] } + + # @!attribute email + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute has_failed_payment + # + # @return [Boolean, nil] + optional :has_failed_payment, WhopSDK::Internal::Type::Boolean + + # @!attribute ltv + # + # @return [Float, nil] + optional :ltv, Float + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute phone + # + # @return [String, nil] + optional :phone, String, nil?: true + + # @!method initialize(id:, account_id:, first_seen_at:, last_seen_at:, person_id:, purchase_count:, ad_sets: nil, ads: nil, aov: nil, campaigns: nil, email: nil, has_failed_payment: nil, ltv: nil, name: nil, phone: nil) + # @param id [String] + # @param account_id [String] + # @param first_seen_at [Integer] + # @param last_seen_at [Integer] + # @param person_id [String] + # @param purchase_count [Integer] + # @param ad_sets [Array] + # @param ads [Array] + # @param aov [Float] + # @param campaigns [Array] + # @param email [String, nil] + # @param has_failed_payment [Boolean] + # @param ltv [Float] + # @param name [String, nil] + # @param phone [String, nil] + + class AdSet < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute thumbnail_url + # + # @return [String, nil] + optional :thumbnail_url, String, nil?: true + + # @!method initialize(id:, name: nil, thumbnail_url: nil) + # @param id [String] + # @param name [String, nil] + # @param thumbnail_url [String, nil] + end + + class Ad < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute thumbnail_url + # + # @return [String, nil] + optional :thumbnail_url, String, nil?: true + + # @!method initialize(id:, name: nil, thumbnail_url: nil) + # @param id [String] + # @param name [String, nil] + # @param thumbnail_url [String, nil] + end + + class Campaign < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute thumbnail_url + # + # @return [String, nil] + optional :thumbnail_url, String, nil?: true + + # @!method initialize(id:, name: nil, thumbnail_url: nil) + # @param id [String] + # @param name [String, nil] + # @param thumbnail_url [String, nil] + end + end + end +end diff --git a/lib/whop_sdk/models/person_retrieve_params.rb b/lib/whop_sdk/models/person_retrieve_params.rb new file mode 100644 index 00000000..59d909e6 --- /dev/null +++ b/lib/whop_sdk/models/person_retrieve_params.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::People#retrieve + class PersonRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute person_id + # + # @return [String] + required :person_id, String + + # @!attribute account_id + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute from + # Start of the time range as a Unix timestamp. + # + # @return [Integer, nil] + optional :from, Integer + + # @!attribute to + # End of the time range as a Unix timestamp. Defaults to now. + # + # @return [Integer, nil] + optional :to, Integer + + # @!method initialize(person_id:, account_id: nil, from: nil, to: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PersonRetrieveParams} for more details. + # + # @param person_id [String] + # + # @param account_id [String] The ID of the account, which will look like biz\_******\*******. Optional for + # acco + # + # @param from [Integer] Start of the time range as a Unix timestamp. + # + # @param to [Integer] End of the time range as a Unix timestamp. Defaults to now. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/person_retrieve_response.rb b/lib/whop_sdk/models/person_retrieve_response.rb new file mode 100644 index 00000000..46b20aac --- /dev/null +++ b/lib/whop_sdk/models/person_retrieve_response.rb @@ -0,0 +1,179 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::People#retrieve + class PersonRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [WhopSDK::Models::PersonRetrieveResponse::Data] + required :data, -> { WhopSDK::Models::PersonRetrieveResponse::Data } + + # @!method initialize(data:) + # @param data [WhopSDK::Models::PersonRetrieveResponse::Data] + + # @see WhopSDK::Models::PersonRetrieveResponse#data + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute first_seen_at + # + # @return [Integer] + required :first_seen_at, Integer + + # @!attribute last_seen_at + # + # @return [Integer] + required :last_seen_at, Integer + + # @!attribute person_id + # + # @return [String] + required :person_id, String + + # @!attribute purchase_count + # + # @return [Integer] + required :purchase_count, Integer + + # @!attribute ad_sets + # + # @return [Array, nil] + optional :ad_sets, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet] } + + # @!attribute ads + # + # @return [Array, nil] + optional :ads, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonRetrieveResponse::Data::Ad] } + + # @!attribute aov + # + # @return [Float, nil] + optional :aov, Float + + # @!attribute campaigns + # + # @return [Array, nil] + optional :campaigns, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonRetrieveResponse::Data::Campaign] } + + # @!attribute email + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute has_failed_payment + # + # @return [Boolean, nil] + optional :has_failed_payment, WhopSDK::Internal::Type::Boolean + + # @!attribute ltv + # + # @return [Float, nil] + optional :ltv, Float + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute phone + # + # @return [String, nil] + optional :phone, String, nil?: true + + # @!method initialize(id:, account_id:, first_seen_at:, last_seen_at:, person_id:, purchase_count:, ad_sets: nil, ads: nil, aov: nil, campaigns: nil, email: nil, has_failed_payment: nil, ltv: nil, name: nil, phone: nil) + # @param id [String] + # @param account_id [String] + # @param first_seen_at [Integer] + # @param last_seen_at [Integer] + # @param person_id [String] + # @param purchase_count [Integer] + # @param ad_sets [Array] + # @param ads [Array] + # @param aov [Float] + # @param campaigns [Array] + # @param email [String, nil] + # @param has_failed_payment [Boolean] + # @param ltv [Float] + # @param name [String, nil] + # @param phone [String, nil] + + class AdSet < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute thumbnail_url + # + # @return [String, nil] + optional :thumbnail_url, String, nil?: true + + # @!method initialize(id:, name: nil, thumbnail_url: nil) + # @param id [String] + # @param name [String, nil] + # @param thumbnail_url [String, nil] + end + + class Ad < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute thumbnail_url + # + # @return [String, nil] + optional :thumbnail_url, String, nil?: true + + # @!method initialize(id:, name: nil, thumbnail_url: nil) + # @param id [String] + # @param name [String, nil] + # @param thumbnail_url [String, nil] + end + + class Campaign < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute thumbnail_url + # + # @return [String, nil] + optional :thumbnail_url, String, nil?: true + + # @!method initialize(id:, name: nil, thumbnail_url: nil) + # @param id [String] + # @param name [String, nil] + # @param thumbnail_url [String, nil] + end + end + end + end +end diff --git a/lib/whop_sdk/models/plan.rb b/lib/whop_sdk/models/plan.rb index 6202da3e..55adb0b5 100644 --- a/lib/whop_sdk/models/plan.rb +++ b/lib/whop_sdk/models/plan.rb @@ -4,259 +4,253 @@ module WhopSDK module Models class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The ID of the plan, which will look like plan\_******\******* + # Plan ID, prefixed `plan_`. # # @return [String] required :id, String + # @!attribute account + # Account that sells this plan; `null` for standalone invoice plans. + # + # @return [Object, nil] + required :account, WhopSDK::Internal::Type::Unknown, nil?: true + # @!attribute adaptive_pricing_enabled - # Whether this plan accepts local currency payments via adaptive pricing + # 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 recurring charges. Null for one-time plans + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. # # @return [Float, nil] required :billing_period, Float, nil?: true # @!attribute collect_tax - # Whether tax is collected on purchases of this plan + # 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, an object with an id and title. Null for - # standalone invoice plans - # - # @return [Object, nil] - required :company, WhopSDK::Internal::Type::Unknown, nil?: true - # @!attribute created_at - # When the plan was created, as an ISO 8601 timestamp + # When the plan was created, as an ISO 8601 timestamp. # # @return [String] required :created_at, String # @!attribute currency - # The three-letter ISO currency code all prices on this plan are denominated in + # Three-letter ISO currency code for this plan's prices. # # @return [Symbol, WhopSDK::Models::Plan::Currency] required :currency, enum: -> { WhopSDK::Plan::Currency } # @!attribute custom_fields - # 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::Internal::Type::Unknown] + # @return [Array] + required :custom_fields, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField] } # @!attribute description - # A text description of the plan visible to customers + # Customer-visible plan description. # # @return [String, nil] required :description, String, nil?: true # @!attribute expiration_days - # The number of days until the membership expires, for expiration-based plans + # Access duration in days for expiration-based plans. # # @return [Float, nil] required :expiration_days, Float, nil?: true # @!attribute initial_price - # The initial purchase price in the plan's currency + # Initial purchase price in plan currency. # # @return [Float] required :initial_price, Float # @!attribute internal_notes - # Private notes visible only to authorized team members + # 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, an object with an id. Null unless the - # plan was created for an invoice + # Invoice this plan was generated for; `null` unless created for an invoice. # # @return [Object, nil] required :invoice, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute member_count - # The number of active memberships on this plan. Only visible to authorized team - # members + # Active memberships through this plan, when visible to the requester. # # @return [Float, nil] required :member_count, Float, nil?: true # @!attribute metadata - # Custom key-value pairs stored on the plan + # Custom key-value pairs stored on the plan. # # @return [Object, nil] required :metadata, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute 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 + # Payment method configuration (`enabled`, `disabled`, + # `include_platform_defaults`); `null` when plan uses default settings. # # @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 + # Billing model for this plan: `renewal` (recurring) or `one_time` (single + # payment). # # @return [Symbol, WhopSDK::Models::Plan::PlanType] required :plan_type, enum: -> { WhopSDK::Plan::PlanType } # @!attribute product - # The product this plan belongs to, an object with an id and title. Null for - # standalone plans + # Product this plan belongs to; `null` for standalone plans. # # @return [Object, nil] required :product, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute purchase_url - # The full URL where customers can purchase this plan directly + # URL where customers can purchase this plan directly. # # @return [String] required :purchase_url, String # @!attribute release_method - # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # Sales method for this plan, such as `buy_now` or `waitlist`. # # @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 currency + # Recurring price charged every billing period. # # @return [Float] required :renewal_price, Float # @!attribute split_pay_required_payments - # The number of installment payments required before the subscription pauses + # Installment payments required before the subscription pauses. # # @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 + # Units available for purchase, when visible to the requester. # # @return [Float, nil] required :stock, Float, nil?: true # @!attribute tax_type - # How tax is handled for this plan: 'inclusive', 'exclusive', or 'unspecified' + # How tax is handled for this plan. # - # @return [String] - required :tax_type, String + # @return [Symbol, WhopSDK::Models::Plan::TaxType] + required :tax_type, enum: -> { WhopSDK::Plan::TaxType } # @!attribute three_ds_level - # The 3D Secure behavior for this plan. Null means the plan inherits the account - # default + # 3D Secure behavior for this plan; `null` inherits 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 + # Plan display name 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 recurring plan + # Free trial days before the first renewal charge. `null` if no trial is + # configured or the user has already used a trial for this plan. # # @return [Float, nil] required :trial_period_days, Float, nil?: true # @!attribute unlimited_stock - # Whether the plan has unlimited stock + # Whether the plan has unlimited stock. # # @return [Boolean] required :unlimited_stock, WhopSDK::Internal::Type::Boolean # @!attribute updated_at - # When the plan was last updated, as an ISO 8601 timestamp + # When the plan was last updated, as an ISO 8601 timestamp. # # @return [String] required :updated_at, String # @!attribute visibility - # Whether the plan is visible to customers or hidden from public view + # Whether the plan is visible to customers or hidden from public view. # # @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:) + # @!method initialize(id:, account:, adaptive_pricing_enabled:, billing_period:, collect_tax:, 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. # - # @param id [String] The ID of the plan, which will look like plan\_******\******* + # @param id [String] Plan ID, prefixed `plan_`. # - # @param adaptive_pricing_enabled [Boolean] Whether this plan accepts local currency payments via adaptive pricing + # @param account [Object, nil] Account that sells this plan; `null` for standalone invoice plans. # - # @param billing_period [Float, nil] The number of days between recurring charges. Null for one-time plans + # @param adaptive_pricing_enabled [Boolean] Whether this plan accepts local currency payments via adaptive pricing. # - # @param collect_tax [Boolean] Whether tax is collected on purchases of this plan + # @param billing_period [Float, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. `n # - # @param company [Object, nil] The company that sells this plan, an object with an id and title. Null for stand + # @param collect_tax [Boolean] Whether tax is collected on purchases of this plan. # - # @param created_at [String] When the plan was created, as an ISO 8601 timestamp + # @param created_at [String] When the plan was created, as an ISO 8601 timestamp. # - # @param currency [Symbol, WhopSDK::Models::Plan::Currency] The three-letter ISO currency code all prices on this plan are denominated in + # @param currency [Symbol, WhopSDK::Models::Plan::Currency] Three-letter ISO currency code for this plan's prices. # - # @param custom_fields [Array] Custom input fields displayed on the checkout form, objects with id, field_type, + # @param custom_fields [Array] # - # @param description [String, nil] A text description of the plan visible to customers + # @param description [String, nil] Customer-visible plan description. # - # @param expiration_days [Float, nil] The number of days until the membership expires, for expiration-based plans + # @param expiration_days [Float, nil] Access duration in days for expiration-based plans. # - # @param initial_price [Float] The initial purchase price in the plan's currency + # @param initial_price [Float] Initial purchase price in plan currency. # - # @param internal_notes [String, nil] Private notes visible only to authorized team members + # @param internal_notes [String, nil] Private notes visible only to authorized team members. # - # @param invoice [Object, nil] The invoice this plan was generated for, an object with an id. Null unless the p + # @param invoice [Object, nil] Invoice this plan was generated for; `null` unless created for an invoice. # - # @param member_count [Float, nil] The number of active memberships on this plan. Only visible to authorized team m + # @param member_count [Float, nil] Active memberships through this plan, when visible to the requester. # - # @param metadata [Object, nil] Custom key-value pairs stored on the plan + # @param metadata [Object, nil] Custom key-value pairs stored on the plan. # - # @param payment_method_configuration [Object, nil] The explicit payment method configuration for the plan, an object with enabled, + # @param payment_method_configuration [Object, nil] Payment method configuration (`enabled`, `disabled`, `include_platform_defaults` # - # @param plan_type [Symbol, WhopSDK::Models::Plan::PlanType] The billing model for this plan: 'renewal' for recurring subscriptions or 'one_t + # @param plan_type [Symbol, WhopSDK::Models::Plan::PlanType] Billing model for this plan: `renewal` (recurring) or `one_time` (single payment # - # @param product [Object, nil] The product this plan belongs to, an object with an id and title. Null for stand + # @param product [Object, nil] Product this plan belongs to; `null` for standalone plans. # - # @param purchase_url [String] The full URL where customers can purchase this plan directly + # @param purchase_url [String] URL where customers can purchase this plan directly. # - # @param release_method [Symbol, WhopSDK::Models::Plan::ReleaseMethod] The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # @param release_method [Symbol, WhopSDK::Models::Plan::ReleaseMethod] Sales method for this plan, such as `buy_now` or `waitlist`. # - # @param renewal_price [Float] The recurring price charged every billing period in the plan's currency + # @param renewal_price [Float] Recurring price charged every billing period. # - # @param split_pay_required_payments [Float, nil] The number of installment payments required before the subscription pauses + # @param split_pay_required_payments [Float, nil] Installment payments required before the subscription pauses. # - # @param stock [Float, nil] The number of units available for purchase. Only visible to authorized team memb + # @param stock [Float, nil] Units available for purchase, when visible to the requester. # - # @param tax_type [String] How tax is handled for this plan: 'inclusive', 'exclusive', or 'unspecified' + # @param tax_type [Symbol, WhopSDK::Models::Plan::TaxType] How tax is handled for this 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 three_ds_level [Symbol, WhopSDK::Models::Plan::ThreeDSLevel, nil] 3D Secure behavior for this plan; `null` inherits account default. # - # @param title [String, nil] The display name of the plan shown to customers + # @param title [String, nil] Plan display name shown to customers. # - # @param trial_period_days [Float, nil] The number of free trial days before the first charge on a recurring plan + # @param trial_period_days [Float, nil] Free trial days before the first renewal charge. `null` if no trial is configure # - # @param unlimited_stock [Boolean] Whether the plan has unlimited stock + # @param unlimited_stock [Boolean] Whether the plan has unlimited stock. # - # @param updated_at [String] When the plan was last updated, as an ISO 8601 timestamp + # @param updated_at [String] When the plan was last updated, as an ISO 8601 timestamp. # - # @param visibility [Symbol, WhopSDK::Models::Plan::Visibility] Whether the plan is visible to customers or hidden from public view + # @param visibility [Symbol, WhopSDK::Models::Plan::Visibility] Whether the plan is visible to customers or hidden from public view. - # The three-letter ISO currency code all prices on this plan are denominated in + # Three-letter ISO currency code for this plan's prices. # # @see WhopSDK::Models::Plan#currency module Currency @@ -357,8 +351,73 @@ module Currency # @return [Array] end - # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments + class CustomField < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Custom field ID. + # + # @return [String] + required :id, String + + # @!attribute field_type + # Custom field input type. + # + # @return [Symbol, WhopSDK::Models::Plan::CustomField::FieldType] + required :field_type, enum: -> { WhopSDK::Plan::CustomField::FieldType } + + # @!attribute name + # Field label shown to customer at checkout. + # + # @return [String] + required :name, String + + # @!attribute order + # Field position on checkout form. + # + # @return [Float] + required :order, Float + + # @!attribute placeholder + # Placeholder text shown in empty field. + # + # @return [String, nil] + required :placeholder, String, nil?: true + + # @!attribute required + # Whether the customer must complete this field to check out. + # + # @return [Boolean] + required :required, WhopSDK::Internal::Type::Boolean + + # @!method initialize(id:, field_type:, name:, order:, placeholder:, required:) + # Custom input fields collected on the checkout form. + # + # @param id [String] Custom field ID. + # + # @param field_type [Symbol, WhopSDK::Models::Plan::CustomField::FieldType] Custom field input type. + # + # @param name [String] Field label shown to customer at checkout. + # + # @param order [Float] Field position on checkout form. + # + # @param placeholder [String, nil] Placeholder text shown in empty field. + # + # @param required [Boolean] Whether the customer must complete this field to check out. + + # Custom field input type. + # + # @see WhopSDK::Models::Plan::CustomField#field_type + module FieldType + extend WhopSDK::Internal::Type::Enum + + TEXT = :text + + # @!method self.values + # @return [Array] + end + end + + # Billing model for this plan: `renewal` (recurring) or `one_time` (single + # payment). # # @see WhopSDK::Models::Plan#plan_type module PlanType @@ -371,7 +430,7 @@ module PlanType # @return [Array] end - # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # Sales method for this plan, such as `buy_now` or `waitlist`. # # @see WhopSDK::Models::Plan#release_method module ReleaseMethod @@ -384,8 +443,21 @@ module ReleaseMethod # @return [Array] end - # The 3D Secure behavior for this plan. Null means the plan inherits the account - # default + # How tax is handled for this plan. + # + # @see WhopSDK::Models::Plan#tax_type + module TaxType + extend WhopSDK::Internal::Type::Enum + + INCLUSIVE = :inclusive + EXCLUSIVE = :exclusive + UNSPECIFIED = :unspecified + + # @!method self.values + # @return [Array] + end + + # 3D Secure behavior for this plan; `null` inherits account default. # # @see WhopSDK::Models::Plan#three_ds_level module ThreeDSLevel @@ -398,7 +470,7 @@ module ThreeDSLevel # @return [Array] end - # Whether the plan is visible to customers or hidden from public view + # Whether the plan is visible to customers or hidden from public view. # # @see WhopSDK::Models::Plan#visibility module Visibility diff --git a/lib/whop_sdk/models/plan_calculate_tax_params.rb b/lib/whop_sdk/models/plan_calculate_tax_params.rb new file mode 100644 index 00000000..0d6b324b --- /dev/null +++ b/lib/whop_sdk/models/plan_calculate_tax_params.rb @@ -0,0 +1,248 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Plans#calculate_tax + class PlanCalculateTaxParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute address + # Buyer billing address used for tax calculation. Provide either `address.country` + # or `ip_address`; include state and postal code when available for more accurate + # results. + # + # @return [WhopSDK::Models::PlanCalculateTaxParams::Address, nil] + optional :address, -> { WhopSDK::PlanCalculateTaxParams::Address }, nil?: true + + # @!attribute ip_address + # Buyer IP address used to infer location when no billing address is provided. + # + # @return [String, nil] + optional :ip_address, String + + # @!attribute tax_ids + # Optional buyer tax ID for B2B exemptions. At most one entry is supported. + # + # @return [Array, nil] + optional :tax_ids, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::PlanCalculateTaxParams::TaxID] }, + nil?: true + + # @!method initialize(id:, address: nil, ip_address: nil, tax_ids: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PlanCalculateTaxParams} for more details. + # + # @param id [String] + # + # @param address [WhopSDK::Models::PlanCalculateTaxParams::Address, nil] Buyer billing address used for tax calculation. Provide either `address.country` + # + # @param ip_address [String] Buyer IP address used to infer location when no billing address is provided. + # + # @param tax_ids [Array, nil] Optional buyer tax ID for B2B exemptions. At most one entry is supported. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute country + # ISO 3166-1 alpha-2 country code, such as `US`, `DE`, or `GB`. + # + # @return [String] + required :country, String + + # @!attribute city + # City name. + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # State, province, or region code, such as `CA`. + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!method initialize(country:, city: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Buyer billing address used for tax calculation. Provide either `address.country` + # or `ip_address`; include state and postal code when available for more accurate + # results. + # + # @param country [String] ISO 3166-1 alpha-2 country code, such as `US`, `DE`, or `GB`. + # + # @param city [String, nil] City name. + # + # @param line1 [String, nil] First line of the street address. + # + # @param line2 [String, nil] Second line of the street address. + # + # @param postal_code [String, nil] Postal or ZIP code. + # + # @param state [String, nil] State, province, or region code, such as `CA`. + end + + class TaxID < WhopSDK::Internal::Type::BaseModel + # @!attribute type + # Tax ID type, such as `eu_vat` for an EU VAT number. + # + # @return [Symbol, WhopSDK::Models::PlanCalculateTaxParams::TaxID::Type, nil] + optional :type, enum: -> { WhopSDK::PlanCalculateTaxParams::TaxID::Type } + + # @!attribute value + # Tax ID value, for example `DE123456789`. + # + # @return [String, nil] + optional :value, String + + # @!method initialize(type: nil, value: nil) + # @param type [Symbol, WhopSDK::Models::PlanCalculateTaxParams::TaxID::Type] Tax ID type, such as `eu_vat` for an EU VAT number. + # + # @param value [String] Tax ID value, for example `DE123456789`. + + # Tax ID type, such as `eu_vat` for an EU VAT number. + # + # @see WhopSDK::Models::PlanCalculateTaxParams::TaxID#type + module Type + extend WhopSDK::Internal::Type::Enum + + AD_NRT = :ad_nrt + AO_TIN = :ao_tin + AR_CUIT = :ar_cuit + AL_TIN = :al_tin + AM_TIN = :am_tin + AW_TIN = :aw_tin + AU_ABN = :au_abn + AU_ARN = :au_arn + EU_VAT = :eu_vat + AZ_TIN = :az_tin + BS_TIN = :bs_tin + BH_VAT = :bh_vat + BD_BIN = :bd_bin + BB_TIN = :bb_tin + BY_TIN = :by_tin + BJ_IFU = :bj_ifu + BO_TIN = :bo_tin + BA_TIN = :ba_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + BG_UIC = :bg_uic + BF_IFU = :bf_ifu + KH_TIN = :kh_tin + CM_NIU = :cm_niu + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CV_NIF = :cv_nif + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CD_NIF = :cd_nif + CR_TIN = :cr_tin + HR_OIB = :hr_oib + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + SV_NIT = :sv_nit + ET_TIN = :et_tin + EU_OSS_VAT = :eu_oss_vat + GE_VAT = :ge_vat + GH_TIN = :gh_tin + DE_STN = :de_stn + GB_VAT = :gb_vat + GN_NIF = :gn_nif + HK_BR = :hk_br + HU_TIN = :hu_tin + IS_VAT = :is_vat + IN_GST = :in_gst + ID_NPWP = :id_npwp + IL_VAT = :il_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KZ_BIN = :kz_bin + KE_PIN = :ke_pin + KG_TIN = :kg_tin + LA_TIN = :la_tin + LI_UID = :li_uid + LI_VAT = :li_vat + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + MR_NIF = :mr_nif + MX_RFC = :mx_rfc + MD_VAT = :md_vat + ME_PIB = :me_pib + MA_VAT = :ma_vat + NP_PAN = :np_pan + NZ_GST = :nz_gst + NG_TIN = :ng_tin + MK_VAT = :mk_vat + NO_VAT = :no_vat + NO_VOEC = :no_voec + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SN_NINEA = :sn_ninea + RS_PIB = :rs_pib + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + ZA_VAT = :za_vat + KR_BRN = :kr_brn + ES_CIF = :es_cif + CH_UID = :ch_uid + CH_VAT = :ch_vat + TW_VAT = :tw_vat + TJ_TIN = :tj_tin + TZ_VAT = :tz_vat + TH_VAT = :th_vat + TR_TIN = :tr_tin + UG_TIN = :ug_tin + UA_VAT = :ua_vat + AE_TRN = :ae_trn + US_EIN = :us_ein + UY_RUC = :uy_ruc + UZ_TIN = :uz_tin + UZ_VAT = :uz_vat + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZM_TIN = :zm_tin + ZW_TIN = :zw_tin + SR_FIN = :sr_fin + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/plan_calculate_tax_response.rb b/lib/whop_sdk/models/plan_calculate_tax_response.rb new file mode 100644 index 00000000..b9038e63 --- /dev/null +++ b/lib/whop_sdk/models/plan_calculate_tax_response.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Plans#calculate_tax + class PlanCalculateTaxResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute currency + # Three-letter ISO 4217 currency code for the returned amounts. + # + # @return [String] + required :currency, String + + # @!attribute status + # Whether Whop calculated tax for this preview. `not_calculated` means no tax + # could be determined, so `tax_amount` is 0 and `total` equals `subtotal`. + # + # @return [Symbol, WhopSDK::Models::PlanCalculateTaxResponse::Status] + required :status, enum: -> { WhopSDK::Models::PlanCalculateTaxResponse::Status } + + # @!attribute subtotal + # Plan price in the currency's smallest unit, for example cents. For exclusive + # tax, this is the pre-tax amount; for inclusive tax, it already includes tax and + # equals the total. + # + # @return [Integer] + required :subtotal, Integer + + # @!attribute tax_amount + # Calculated tax amount in the currency's smallest unit. For exclusive tax, this + # is added on top of the subtotal; for inclusive tax, it is the portion of the + # subtotal that is tax. + # + # @return [Integer] + required :tax_amount, Integer + + # @!attribute tax_behavior + # Whether tax is added on top of the plan price or already included in it for this + # buyer's location. + # + # @return [Symbol, WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior] + required :tax_behavior, enum: -> { WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior } + + # @!attribute total + # Amount the buyer would pay in the currency's smallest unit. + # + # @return [Integer] + required :total, Integer + + # @!method initialize(currency:, status:, subtotal:, tax_amount:, tax_behavior:, total:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PlanCalculateTaxResponse} for more details. + # + # @param currency [String] Three-letter ISO 4217 currency code for the returned amounts. + # + # @param status [Symbol, WhopSDK::Models::PlanCalculateTaxResponse::Status] Whether Whop calculated tax for this preview. `not_calculated` means no tax coul + # + # @param subtotal [Integer] Plan price in the currency's smallest unit, for example cents. For exclusive tax + # + # @param tax_amount [Integer] Calculated tax amount in the currency's smallest unit. For exclusive tax, this i + # + # @param tax_behavior [Symbol, WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior] Whether tax is added on top of the plan price or already included in it for this + # + # @param total [Integer] Amount the buyer would pay in the currency's smallest unit. + + # Whether Whop calculated tax for this preview. `not_calculated` means no tax + # could be determined, so `tax_amount` is 0 and `total` equals `subtotal`. + # + # @see WhopSDK::Models::PlanCalculateTaxResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + CALCULATED = :calculated + NOT_CALCULATED = :not_calculated + + # @!method self.values + # @return [Array] + end + + # Whether tax is added on top of the plan price or already included in it for this + # buyer's location. + # + # @see WhopSDK::Models::PlanCalculateTaxResponse#tax_behavior + module TaxBehavior + extend WhopSDK::Internal::Type::Enum + + EXCLUSIVE = :exclusive + INCLUSIVE = :inclusive + + # @!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 159e58ff..e81cc95a 100644 --- a/lib/whop_sdk/models/plan_create_params.rb +++ b/lib/whop_sdk/models/plan_create_params.rb @@ -7,11 +7,12 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute product_id - # The unique identifier of the product to attach this plan to. + # @!attribute account_id + # The unique identifier of the account to create this plan for. Defaults to the + # caller's account. # - # @return [String] - required :product_id, String + # @return [String, nil] + optional :account_id, String # @!attribute adaptive_pricing_enabled # Whether this plan accepts local currency payments via adaptive pricing. @@ -20,8 +21,7 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean, nil?: true # @!attribute billing_period - # The number of days between recurring charges. For example, 30 for monthly or 365 - # for yearly. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. # # @return [Integer, nil] optional :billing_period, Integer, nil?: true @@ -32,13 +32,6 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # @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 [String, nil] - optional :company_id, String - # @!attribute currency # The three-letter ISO currency code for the plan's pricing. Defaults to USD. # @@ -61,7 +54,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. + # Access duration in days before the membership expires. # # @return [Integer, nil] optional :expiration_days, Integer, nil?: true @@ -73,14 +66,13 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :image, -> { WhopSDK::PlanCreateParams::Image }, nil?: true # @!attribute initial_price - # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 - # for $10.43). + # Initial amount charged in the plan's currency, e.g. 10.43 for $10.43. # # @return [Float, nil] optional :initial_price, Float, nil?: true # @!attribute internal_notes - # Private notes visible only to the business owner. Not shown to customers. + # Private notes visible only to the account owner. Not shown to customers. # # @return [String, nil] optional :internal_notes, String, nil?: true @@ -93,7 +85,8 @@ 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. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Object, nil] optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true @@ -106,7 +99,7 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute payment_method_configuration # Explicit payment method configuration for the plan. When not provided, the - # company's defaults apply. + # account's defaults apply. # # @return [WhopSDK::Models::PlanCreateParams::PaymentMethodConfiguration, nil] optional :payment_method_configuration, @@ -114,13 +107,19 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel nil?: true # @!attribute plan_type - # The billing type of the plan, such as one_time or renewal. + # Plan billing type, such as `one_time` or `renewal`. # # @return [String, nil] optional :plan_type, String + # @!attribute product_id + # The unique identifier of the product to attach this plan to. + # + # @return [String, nil] + optional :product_id, String + # @!attribute release_method - # The method used to sell this plan (e.g., buy_now, waitlist). + # Sales method for this plan, such as `buy_now` or `waitlist`. # # @return [String, nil] optional :release_method, String @@ -133,7 +132,7 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :renewal_price, Float, nil?: true # @!attribute split_pay_required_payments - # The number of installment payments required before the subscription pauses. + # Installment payments required before the subscription pauses. # # @return [Integer, nil] optional :split_pay_required_payments, Integer, nil?: true @@ -146,7 +145,7 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :stock, Integer, nil?: true # @!attribute three_ds_level - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 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 } @@ -158,7 +157,7 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :title, String, nil?: true # @!attribute trial_period_days - # The number of free trial days before the first charge on a recurring plan. + # Free trial duration before the first recurring charge. # # @return [Integer, nil] optional :trial_period_days, Integer, nil?: true @@ -175,33 +174,31 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :visibility, String - # @!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: {}) + # @!method initialize(account_id: nil, 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, product_id: 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 product_id [String] The unique identifier of the product to attach this plan to. + # @param account_id [String] The unique identifier of the account to create this plan for. Defaults to the ca # # @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 billing_period [Integer, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. # # @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 [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. 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. + # @param expiration_days [Integer, nil] Access duration in days before the membership expires. # # @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, in the plan's currency (e.g., 10.43 fo + # @param initial_price [Float, nil] Initial amount charged in the plan's currency, e.g. 10.43 for $10.43. # - # @param internal_notes [String, nil] Private notes visible only to the business owner. Not shown to customers. + # @param internal_notes [String, nil] Private notes visible only to the account owner. Not shown to customers. # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls. # @@ -209,23 +206,25 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # # @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 payment_method_configuration [WhopSDK::Models::PlanCreateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. When not provided, the accou + # + # @param plan_type [String] Plan billing type, such as `one_time` or `renewal`. # - # @param plan_type [String] The billing type of the plan, such as one_time or renewal. + # @param product_id [String] The unique identifier of the product to attach this plan to. # - # @param release_method [String] The method used to sell this plan (e.g., buy_now, waitlist). + # @param release_method [String] Sales method for this plan, such as `buy_now` or `waitlist`. # # @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 split_pay_required_payments [Integer, nil] 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] The 3D Secure behavior for this plan. Send null to inherit the account default. + # @param three_ds_level [Symbol, WhopSDK::Models::PlanCreateParams::ThreeDSLevel] 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 trial_period_days [Integer, nil] Free trial duration before the first recurring charge. # # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. # @@ -332,14 +331,14 @@ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!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. + # account's defaults apply. # # @param disabled [Array] # @param enabled [Array] # @param include_platform_defaults [Boolean] end - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 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 6e900c1c..eb2071ee 100644 --- a/lib/whop_sdk/models/plan_list_params.rb +++ b/lib/whop_sdk/models/plan_list_params.rb @@ -7,11 +7,11 @@ class PlanListParams < 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 list plans for. + # @!attribute account_id + # The unique identifier of the account to list plans for. # # @return [String] - required :company_id, String + required :account_id, String # @!attribute after # A cursor; returns plans after this position. @@ -85,8 +85,8 @@ class PlanListParams < WhopSDK::Internal::Type::BaseModel # @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. + # @!method initialize(account_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 account_id [String] The unique identifier of the account to list plans for. # # @param after [String] A cursor; returns plans after this position. # @@ -133,7 +133,7 @@ module Order ACTIVE_MEMBERS_COUNT = :active_members_count CREATED_AT = :created_at INTERNAL_NOTES = :internal_notes - EXPIRES_AT = :expires_at + EXPIRATION_DAYS = :expiration_days # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/plan_list_response.rb b/lib/whop_sdk/models/plan_list_response.rb index c1428ff3..1c08eb38 100644 --- a/lib/whop_sdk/models/plan_list_response.rb +++ b/lib/whop_sdk/models/plan_list_response.rb @@ -5,232 +5,228 @@ module Models # @see WhopSDK::Resources::Plans#list class PlanListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The ID of the plan, which will look like plan\_******\******* + # Plan ID, prefixed `plan_`. # # @return [String] required :id, String + # @!attribute account + # Account that sells this plan; `null` for standalone invoice plans. + # + # @return [Object, nil] + required :account, WhopSDK::Internal::Type::Unknown, nil?: true + # @!attribute adaptive_pricing_enabled - # Whether this plan accepts local currency payments via adaptive pricing + # 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 recurring charges. Null for one-time plans + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. # # @return [Float, nil] required :billing_period, Float, nil?: true - # @!attribute company - # The company that sells this plan, an object with an id and title. Null for - # standalone invoice plans - # - # @return [Object, nil] - required :company, WhopSDK::Internal::Type::Unknown, nil?: true - # @!attribute created_at - # When the plan was created, as an ISO 8601 timestamp + # When the plan was created, as an ISO 8601 timestamp. # # @return [String] required :created_at, String # @!attribute currency - # The three-letter ISO currency code all prices on this plan are denominated in + # Three-letter ISO currency code for this plan's prices. # # @return [String] required :currency, String # @!attribute description - # A text description of the plan visible to customers + # Customer-visible plan description. # # @return [String, nil] required :description, String, nil?: true # @!attribute expiration_days - # The number of days until the membership expires, for expiration-based plans + # Access duration in days for expiration-based plans. # # @return [Float, nil] required :expiration_days, Float, nil?: true # @!attribute initial_price - # The initial purchase price in the plan's currency + # Initial purchase price in plan currency. # # @return [Float] required :initial_price, Float # @!attribute internal_notes - # Private notes visible only to authorized team members + # 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, an object with an id. Null unless the - # plan was created for an invoice + # Invoice this plan was generated for; `null` unless created for an invoice. # # @return [Object, nil] required :invoice, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute member_count - # The number of active memberships on this plan. Only visible to authorized team - # members + # Active memberships through this plan, when visible to the requester. # # @return [Float, nil] required :member_count, Float, nil?: true # @!attribute metadata - # Custom key-value pairs stored on the plan + # Custom key-value pairs stored on the plan. # # @return [Object, nil] required :metadata, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute 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 + # Payment method configuration (`enabled`, `disabled`, + # `include_platform_defaults`); `null` when plan uses default settings. # # @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 + # Billing model for this plan: `renewal` (recurring) or `one_time` (single + # payment). # # @return [String] required :plan_type, String # @!attribute product - # The product this plan belongs to, an object with an id and title. Null for - # standalone plans + # Product this plan belongs to; `null` for standalone plans. # # @return [Object, nil] required :product, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute purchase_url - # The full URL where customers can purchase this plan directly + # URL where customers can purchase this plan directly. # # @return [String] required :purchase_url, String # @!attribute release_method - # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # Sales method for this plan, such as `buy_now` or `waitlist`. # # @return [String] required :release_method, String # @!attribute renewal_price - # The recurring price charged every billing period in the plan's currency + # Recurring price charged every billing period. # # @return [Float] required :renewal_price, Float # @!attribute split_pay_required_payments - # The number of installment payments required before the subscription pauses + # Installment payments required before the subscription pauses. # # @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 + # Units available for purchase, when visible to the requester. # # @return [Float, nil] required :stock, Float, nil?: true # @!attribute three_ds_level - # The 3D Secure behavior for this plan. Null means the plan inherits the account - # default + # 3D Secure behavior for this plan; `null` inherits account default. # # @return [String, nil] required :three_ds_level, String, nil?: true # @!attribute title - # The display name of the plan shown to customers + # Plan display name 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 recurring plan + # Free trial days before the first renewal charge. `null` if no trial is + # configured or the user has already used a trial for this plan. # # @return [Float, nil] required :trial_period_days, Float, nil?: true # @!attribute unlimited_stock - # Whether the plan has unlimited stock + # Whether the plan has unlimited stock. # # @return [Boolean] required :unlimited_stock, WhopSDK::Internal::Type::Boolean # @!attribute updated_at - # When the plan was last updated, as an ISO 8601 timestamp + # When the plan was last updated, as an ISO 8601 timestamp. # # @return [String] required :updated_at, String # @!attribute visibility - # Whether the plan is visible to customers or hidden from public view + # Whether the plan is visible to customers or hidden from public view. # # @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:) + # @!method initialize(id:, account:, adaptive_pricing_enabled:, billing_period:, 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. # - # @param id [String] The ID of the plan, which will look like plan\_******\******* + # @param id [String] Plan ID, prefixed `plan_`. # - # @param adaptive_pricing_enabled [Boolean] Whether this plan accepts local currency payments via adaptive pricing + # @param account [Object, nil] Account that sells this plan; `null` for standalone invoice plans. # - # @param billing_period [Float, nil] The number of days between recurring charges. Null for one-time plans + # @param adaptive_pricing_enabled [Boolean] Whether this plan accepts local currency payments via adaptive pricing. # - # @param company [Object, nil] The company that sells this plan, an object with an id and title. Null for stand + # @param billing_period [Float, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. `n # - # @param created_at [String] When the plan was created, as an ISO 8601 timestamp + # @param created_at [String] When the plan was created, as an ISO 8601 timestamp. # - # @param currency [String] The three-letter ISO currency code all prices on this plan are denominated in + # @param currency [String] Three-letter ISO currency code for this plan's prices. # - # @param description [String, nil] A text description of the plan visible to customers + # @param description [String, nil] Customer-visible plan description. # - # @param expiration_days [Float, nil] The number of days until the membership expires, for expiration-based plans + # @param expiration_days [Float, nil] Access duration in days for expiration-based plans. # - # @param initial_price [Float] The initial purchase price in the plan's currency + # @param initial_price [Float] Initial purchase price in plan currency. # - # @param internal_notes [String, nil] Private notes visible only to authorized team members + # @param internal_notes [String, nil] Private notes visible only to authorized team members. # - # @param invoice [Object, nil] The invoice this plan was generated for, an object with an id. Null unless the p + # @param invoice [Object, nil] Invoice this plan was generated for; `null` unless created for an invoice. # - # @param member_count [Float, nil] The number of active memberships on this plan. Only visible to authorized team m + # @param member_count [Float, nil] Active memberships through this plan, when visible to the requester. # - # @param metadata [Object, nil] Custom key-value pairs stored on the plan + # @param metadata [Object, nil] Custom key-value pairs stored on the plan. # - # @param payment_method_configuration [Object, nil] The explicit payment method configuration for the plan, an object with enabled, + # @param payment_method_configuration [Object, nil] Payment method configuration (`enabled`, `disabled`, `include_platform_defaults` # - # @param plan_type [String] The billing model for this plan: 'renewal' for recurring subscriptions or 'one_t + # @param plan_type [String] Billing model for this plan: `renewal` (recurring) or `one_time` (single payment # - # @param product [Object, nil] The product this plan belongs to, an object with an id and title. Null for stand + # @param product [Object, nil] Product this plan belongs to; `null` for standalone plans. # - # @param purchase_url [String] The full URL where customers can purchase this plan directly + # @param purchase_url [String] URL where customers can purchase this plan directly. # - # @param release_method [String] The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # @param release_method [String] Sales method for this plan, such as `buy_now` or `waitlist`. # - # @param renewal_price [Float] The recurring price charged every billing period in the plan's currency + # @param renewal_price [Float] Recurring price charged every billing period. # - # @param split_pay_required_payments [Float, nil] The number of installment payments required before the subscription pauses + # @param split_pay_required_payments [Float, nil] Installment payments required before the subscription pauses. # - # @param stock [Float, nil] The number of units available for purchase. Only visible to authorized team memb + # @param stock [Float, nil] Units available for purchase, when visible to the requester. # - # @param three_ds_level [String, nil] The 3D Secure behavior for this plan. Null means the plan inherits the account d + # @param three_ds_level [String, nil] 3D Secure behavior for this plan; `null` inherits account default. # - # @param title [String, nil] The display name of the plan shown to customers + # @param title [String, nil] Plan display name shown to customers. # - # @param trial_period_days [Float, nil] The number of free trial days before the first charge on a recurring plan + # @param trial_period_days [Float, nil] Free trial days before the first renewal charge. `null` if no trial is configure # - # @param unlimited_stock [Boolean] Whether the plan has unlimited stock + # @param unlimited_stock [Boolean] Whether the plan has unlimited stock. # - # @param updated_at [String] When the plan was last updated, as an ISO 8601 timestamp + # @param updated_at [String] When the plan was last updated, as an ISO 8601 timestamp. # - # @param visibility [String] Whether the plan is visible to customers or hidden from public view + # @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 fd2af61c..48be2278 100644 --- a/lib/whop_sdk/models/plan_update_params.rb +++ b/lib/whop_sdk/models/plan_update_params.rb @@ -19,8 +19,7 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean, nil?: true # @!attribute billing_period - # The number of days between recurring charges. For example, 30 for monthly or 365 - # for yearly. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. # # @return [Integer, nil] optional :billing_period, Integer, nil?: true @@ -53,7 +52,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. + # Access duration in days before the membership expires. # # @return [Integer, nil] optional :expiration_days, Integer, nil?: true @@ -65,14 +64,13 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :image, -> { WhopSDK::PlanUpdateParams::Image }, nil?: true # @!attribute initial_price - # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 - # for $10.43). + # Initial amount charged in the plan's currency, e.g. 10.43 for $10.43. # # @return [Float, nil] optional :initial_price, Float, nil?: true # @!attribute internal_notes - # Private notes visible only to the business owner. Not shown to customers. + # Private notes visible only to the account owner. Not shown to customers. # # @return [String, nil] optional :internal_notes, String, nil?: true @@ -85,7 +83,8 @@ 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. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Object, nil] optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true @@ -104,7 +103,7 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # @!attribute payment_method_configuration # Explicit payment method configuration for the plan. When not provided, the - # company's defaults apply. + # account's defaults apply. # # @return [WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration, nil] optional :payment_method_configuration, @@ -138,7 +137,7 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :strike_through_renewal_price, Float, nil?: true # @!attribute three_ds_level - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 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 } @@ -150,7 +149,7 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :title, String, nil?: true # @!attribute trial_period_days - # The number of free trial days before the first charge on a recurring plan. + # Free trial duration before the first recurring charge. # # @return [Integer, nil] optional :trial_period_days, Integer, nil?: true @@ -175,7 +174,7 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # # @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 billing_period [Integer, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. # # @param checkout_styling [Object, nil] Checkout styling overrides for this plan. # @@ -185,13 +184,13 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # # @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. + # @param expiration_days [Integer, nil] Access duration in days before the membership expires. # # @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, in the plan's currency (e.g., 10.43 fo + # @param initial_price [Float, nil] Initial amount charged in the plan's currency, e.g. 10.43 for $10.43. # - # @param internal_notes [String, nil] Private notes visible only to the business owner. Not shown to customers. + # @param internal_notes [String, nil] Private notes visible only to the account owner. Not shown to customers. # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls. # @@ -201,7 +200,7 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # # @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. When not provided, the compa + # @param payment_method_configuration [WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. When not provided, the accou # # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans, in the plan's curren # @@ -211,11 +210,11 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # # @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] The 3D Secure behavior for this plan. Send null to inherit the account default. + # @param three_ds_level [Symbol, WhopSDK::Models::PlanUpdateParams::ThreeDSLevel] 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 trial_period_days [Integer, nil] Free trial duration before the first recurring charge. # # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. # @@ -322,14 +321,14 @@ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!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. + # account's defaults apply. # # @param disabled [Array] # @param enabled [Array] # @param include_platform_defaults [Boolean] end - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 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/product.rb b/lib/whop_sdk/models/product.rb index c0e4212c..a70e992b 100644 --- a/lib/whop_sdk/models/product.rb +++ b/lib/whop_sdk/models/product.rb @@ -22,8 +22,7 @@ class Product < WhopSDK::Internal::Type::BaseModel required :created_at, Time # @!attribute custom_cta - # The call-to-action button label displayed on the product's purchase page (e.g., - # 'join', 'buy', 'subscribe'). + # Call-to-action button label shown on the product purchase page. # # @return [Symbol, WhopSDK::Models::CustomCta] required :custom_cta, enum: -> { WhopSDK::CustomCta } @@ -36,9 +35,8 @@ class Product < WhopSDK::Internal::Type::BaseModel required :custom_cta_url, String, nil?: true # @!attribute custom_statement_descriptor - # A custom text label that appears on the customer's bank or credit card statement - # for purchases of this product. Maximum 22 characters, including the required - # prefix WHOP\*. + # Custom bank statement descriptor for product purchases. Maximum 22 characters, + # including required `WHOP*` prefix. # # @return [String, nil] required :custom_statement_descriptor, String, nil?: true @@ -51,9 +49,8 @@ class Product < WhopSDK::Internal::Type::BaseModel required :description, String, nil?: true # @!attribute external_identifier - # A unique identifier used to create or update products via the API. When provided - # on product creation endpoints, an existing product with this identifier will be - # updated instead of creating a new one. + # External identifier for the product. Providing it on a product creation endpoint + # updates the existing product with this identifier instead of creating a new one. # # @return [String, nil] required :external_identifier, String, nil?: true @@ -65,8 +62,8 @@ class Product < WhopSDK::Internal::Type::BaseModel required :gallery_images, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Product::GalleryImage] } # @!attribute global_affiliate_percentage - # The commission rate (as a percentage) that affiliates earn on sales through the - # Whop marketplace global affiliate program. Null if the program is not active. + # Marketplace affiliate commission percentage for this product, or `null` if + # program is inactive. # # @return [Float, nil] required :global_affiliate_percentage, Float, nil?: true @@ -85,9 +82,8 @@ class Product < WhopSDK::Internal::Type::BaseModel required :headline, String, nil?: true # @!attribute member_affiliate_percentage - # The commission rate (as a percentage) that existing members earn when referring - # new customers through the member affiliate program. Null if the program is not - # active. + # Member referral commission percentage for this product, or `null` if program is + # inactive. # # @return [Float, nil] required :member_affiliate_percentage, Float, nil?: true @@ -99,15 +95,16 @@ class Product < WhopSDK::Internal::Type::BaseModel required :member_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus } # @!attribute member_count - # The number of users who currently hold an active membership to this product. - # Returns 0 if the company has disabled public member counts. + # Active memberships for this product. Returns `0` if the account has disabled + # public member counts. # # @return [Integer] required :member_count, Integer # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -132,8 +129,8 @@ class Product < WhopSDK::Internal::Type::BaseModel required :published_reviews_count, Integer # @!attribute route - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. # # @return [String] required :route, String @@ -177,31 +174,31 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param created_at [Time] The datetime the product was created. # - # @param custom_cta [Symbol, WhopSDK::Models::CustomCta] The call-to-action button label displayed on the product's purchase page (e.g., + # @param custom_cta [Symbol, WhopSDK::Models::CustomCta] Call-to-action button label shown on the product purchase page. # # @param custom_cta_url [String, nil] An optional URL that the call-to-action button links to instead of the default c # - # @param custom_statement_descriptor [String, nil] A custom text label that appears on the customer's bank or credit card statement + # @param custom_statement_descriptor [String, nil] Custom bank statement descriptor for product purchases. Maximum 22 characters, i # # @param description [String, nil] A brief summary of what the product offers, displayed on product pages and searc # - # @param external_identifier [String, nil] A unique identifier used to create or update products via the API. When provided + # @param external_identifier [String, nil] External identifier for the product. Providing it on a product creation endpoint # # @param gallery_images [Array] The gallery images for this product, ordered by position. # - # @param global_affiliate_percentage [Float, nil] The commission rate (as a percentage) that affiliates earn on sales through the + # @param global_affiliate_percentage [Float, nil] Marketplace affiliate commission percentage for this product, or `null` if progr # # @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus] The enrollment status of this product in the Whop marketplace global affiliate p # # @param headline [String, nil] A short marketing headline displayed prominently on the product's product page. # - # @param member_affiliate_percentage [Float, nil] The commission rate (as a percentage) that existing members earn when referring + # @param member_affiliate_percentage [Float, nil] Member referral commission percentage for this product, or `null` if program is # # @param member_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus] The enrollment status of this product in the member affiliate program. # - # @param member_count [Integer] The number of users who currently hold an active membership to this product. Ret + # @param member_count [Integer] Active memberships for this product. Returns `0` if the account has disabled pub # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members # # @param owner_user [WhopSDK::Models::Product::OwnerUser] The user who owns the company that sells this product. # @@ -209,7 +206,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param published_reviews_count [Integer] The total number of published customer reviews for this product's company. # - # @param route [String] The URL slug used in the product's public link (e.g., 'my-product' in whop.com/c + # @param route [String] URL slug in the product's public link, e.g. `pickaxe-analytics` in whop.com/comp # # @param title [String] The display name of the product shown to customers on the product page and in se # @@ -228,7 +225,7 @@ class Company < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @return [String] required :route, String @@ -240,14 +237,11 @@ class Company < WhopSDK::Internal::Type::BaseModel required :title, String # @!method initialize(id:, route:, title:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Product::Company} for more details. - # # The company this product belongs to. # # @param id [String] The unique identifier for the company. # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # @param route [String] URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @param title [String] The display name of the company shown to customers. end @@ -320,14 +314,14 @@ class ProductTaxCode < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute name - # The human-readable name of this tax classification (e.g., 'Digital - SaaS'). + # Human-readable name of this tax classification, such as 'Digital - SaaS'. # # @return [String] required :name, String # @!attribute product_type - # The broad product category this tax code covers (e.g., physical goods, digital - # services). + # Broad product category this tax code covers, such as physical goods or digital + # services. # # @return [Symbol, WhopSDK::Models::Product::ProductTaxCode::ProductType] required :product_type, enum: -> { WhopSDK::Product::ProductTaxCode::ProductType } @@ -341,12 +335,12 @@ class ProductTaxCode < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product tax code. # - # @param name [String] The human-readable name of this tax classification (e.g., 'Digital - SaaS'). + # @param name [String] Human-readable name of this tax classification, such as 'Digital - SaaS'. # - # @param product_type [Symbol, WhopSDK::Models::Product::ProductTaxCode::ProductType] The broad product category this tax code covers (e.g., physical goods, digital s + # @param product_type [Symbol, WhopSDK::Models::Product::ProductTaxCode::ProductType] Broad product category this tax code covers, such as physical goods or digital s - # The broad product category this tax code covers (e.g., physical goods, digital - # services). + # Broad product category this tax code covers, such as physical goods or digital + # services. # # @see WhopSDK::Models::Product::ProductTaxCode#product_type module ProductType diff --git a/lib/whop_sdk/models/product_create_params.rb b/lib/whop_sdk/models/product_create_params.rb index 6c4a22cd..f1d7d5d8 100644 --- a/lib/whop_sdk/models/product_create_params.rb +++ b/lib/whop_sdk/models/product_create_params.rb @@ -7,12 +7,6 @@ class ProductCreateParams < 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 product for. - # - # @return [String] - required :company_id, String - # @!attribute title # The display name of the product. Maximum 80 characters. # @@ -20,98 +14,86 @@ class ProductCreateParams < WhopSDK::Internal::Type::BaseModel required :title, String # @!attribute collect_shipping_address - # Whether the checkout flow collects a shipping address from the customer. + # Whether to collect a shipping address at checkout. # # @return [Boolean, nil] optional :collect_shipping_address, WhopSDK::Internal::Type::Boolean, nil?: true + # @!attribute company_id + # The unique identifier of the company to create this product for. + # + # @return [String, nil] + optional :company_id, String + # @!attribute custom_cta - # The different types of custom CTAs that can be selected. + # The call-to-action button label. # - # @return [Symbol, WhopSDK::Models::CustomCta, nil] - optional :custom_cta, enum: -> { WhopSDK::CustomCta }, nil?: true + # @return [String, nil] + optional :custom_cta, String, nil?: true # @!attribute custom_cta_url - # A URL that the call-to-action button links to instead of the default checkout - # flow. + # A URL the call-to-action button links to. # # @return [String, nil] optional :custom_cta_url, String, nil?: true # @!attribute custom_statement_descriptor - # A custom text label that appears on the customer's bank statement. Must be 5-22 - # characters, contain at least one letter, and not contain <, >, \, ', or " - # characters. + # Custom bank statement descriptor. Must start with WHOP\*. # # @return [String, nil] optional :custom_statement_descriptor, String, nil?: true # @!attribute description - # A written description of the product displayed on its product page. + # A written description displayed on the product page. # # @return [String, nil] optional :description, String, nil?: true - # @!attribute experience_ids - # The unique identifiers of experiences to connect to this product. - # - # @return [Array, nil] - optional :experience_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - # @!attribute global_affiliate_percentage - # The commission rate as a percentage that affiliates earn through the global - # affiliate program. + # The commission rate affiliates earn. # # @return [Float, nil] optional :global_affiliate_percentage, Float, nil?: true # @!attribute global_affiliate_status - # The different statuses of the global affiliate program for a product. + # The enrollment status in the global affiliate program. # - # @return [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] - optional :global_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }, nil?: true + # @return [String, nil] + optional :global_affiliate_status, String # @!attribute headline - # A short marketing headline displayed prominently on the product page. + # A short marketing headline for the product page. # # @return [String, nil] optional :headline, String, nil?: true # @!attribute member_affiliate_percentage - # The commission rate as a percentage that members earn through the member - # affiliate program. + # The commission rate members earn. # # @return [Float, nil] optional :member_affiliate_percentage, Float, nil?: true # @!attribute member_affiliate_status - # The different statuses of the global affiliate program for a product. + # The enrollment status in the member affiliate program. # - # @return [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] - optional :member_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }, nil?: true + # @return [String, nil] + optional :member_affiliate_status, String # @!attribute metadata - # Custom key-value pairs to store on the product. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # Custom key-value pairs to store on the product. # - # @return [Hash{Symbol=>Object}, nil] - optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true - - # @!attribute plan_options - # Configuration for an automatically generated plan to attach to this product. - # - # @return [WhopSDK::Models::ProductCreateParams::PlanOptions, nil] - optional :plan_options, -> { WhopSDK::ProductCreateParams::PlanOptions }, nil?: true + # @return [Object, nil] + optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute product_tax_code_id - # The unique identifier of the tax classification code to apply to this product. + # The unique identifier of the tax classification code. See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). # # @return [String, nil] optional :product_tax_code_id, String, nil?: true # @!attribute redirect_purchase_url - # A URL to redirect the customer to after completing a purchase. + # A URL to redirect the customer to after purchase. # # @return [String, nil] optional :redirect_purchase_url, String, nil?: true @@ -130,185 +112,52 @@ class ProductCreateParams < WhopSDK::Internal::Type::BaseModel optional :send_welcome_message, WhopSDK::Internal::Type::Boolean, nil?: true # @!attribute visibility - # Visibility of a resource + # Whether the product is visible to customers. # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true + # @return [String, nil] + optional :visibility, String - # @!method initialize(company_id:, title:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, experience_ids: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, metadata: nil, plan_options: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, visibility: nil, request_options: {}) + # @!method initialize(title:, collect_shipping_address: nil, company_id: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, metadata: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, visibility: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::ProductCreateParams} for more details. # - # @param company_id [String] The unique identifier of the company to create this product for. - # # @param title [String] The display name of the product. Maximum 80 characters. # - # @param collect_shipping_address [Boolean, nil] Whether the checkout flow collects a shipping address from the customer. - # - # @param custom_cta [Symbol, WhopSDK::Models::CustomCta, nil] The different types of custom CTAs that can be selected. + # @param collect_shipping_address [Boolean, nil] Whether to collect a shipping address at checkout. # - # @param custom_cta_url [String, nil] A URL that the call-to-action button links to instead of the default checkout fl + # @param company_id [String] The unique identifier of the company to create this product for. # - # @param custom_statement_descriptor [String, nil] A custom text label that appears on the customer's bank statement. Must be 5-22 + # @param custom_cta [String, nil] The call-to-action button label. # - # @param description [String, nil] A written description of the product displayed on its product page. + # @param custom_cta_url [String, nil] A URL the call-to-action button links to. # - # @param experience_ids [Array, nil] The unique identifiers of experiences to connect to this product. + # @param custom_statement_descriptor [String, nil] Custom bank statement descriptor. Must start with WHOP\*. # - # @param global_affiliate_percentage [Float, nil] The commission rate as a percentage that affiliates earn through the global affi + # @param description [String, nil] A written description displayed on the product page. # - # @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. + # @param global_affiliate_percentage [Float, nil] The commission rate affiliates earn. # - # @param headline [String, nil] A short marketing headline displayed prominently on the product page. + # @param global_affiliate_status [String] The enrollment status in the global affiliate program. # - # @param member_affiliate_percentage [Float, nil] The commission rate as a percentage that members earn through the member affilia + # @param headline [String, nil] A short marketing headline for the product page. # - # @param member_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. + # @param member_affiliate_percentage [Float, nil] The commission rate members earn. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs to store on the product. Included in webhook payloads for + # @param member_affiliate_status [String] The enrollment status in the member affiliate program. # - # @param plan_options [WhopSDK::Models::ProductCreateParams::PlanOptions, nil] Configuration for an automatically generated plan to attach to this product. + # @param metadata [Object, nil] Custom key-value pairs to store on the product. # - # @param product_tax_code_id [String, nil] The unique identifier of the tax classification code to apply to this product. + # @param product_tax_code_id [String, nil] The unique identifier of the tax classification code. See the available [product # - # @param redirect_purchase_url [String, nil] A URL to redirect the customer to after completing a purchase. + # @param redirect_purchase_url [String, nil] A URL to redirect the customer to after purchase. # # @param route [String, nil] The URL slug for the product's public link. # # @param send_welcome_message [Boolean, nil] Whether to send an automated welcome message via support chat when a user joins # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + # @param visibility [String] Whether the product is visible to customers. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - - class PlanOptions < WhopSDK::Internal::Type::BaseModel - # @!attribute base_currency - # The available currencies on the platform - # - # @return [Symbol, WhopSDK::Models::Currency, nil] - optional :base_currency, enum: -> { WhopSDK::Currency }, nil?: true - - # @!attribute billing_period - # The interval at which the plan charges (renewal plans). - # - # @return [Integer, nil] - optional :billing_period, Integer, nil?: true - - # @!attribute custom_fields - # An array of custom field objects. - # - # @return [Array, nil] - optional :custom_fields, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::ProductCreateParams::PlanOptions::CustomField] - }, - nil?: true - - # @!attribute initial_price - # An additional amount charged upon first purchase. Provided as a number in the - # specified currency. Eg: 10.43 for $10.43 USD. - # - # @return [Float, nil] - optional :initial_price, Float, nil?: true - - # @!attribute plan_type - # The type of plan that can be attached to a product - # - # @return [Symbol, WhopSDK::Models::PlanType, nil] - optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true - - # @!attribute release_method - # The methods of how a plan can be released. - # - # @return [Symbol, WhopSDK::Models::ReleaseMethod, nil] - optional :release_method, enum: -> { WhopSDK::ReleaseMethod }, nil?: true - - # @!attribute renewal_price - # The amount the customer is charged every billing period. Provided as a number in - # the specified currency. Eg: 10.43 for $10.43 USD. - # - # @return [Float, nil] - optional :renewal_price, Float, nil?: true - - # @!attribute visibility - # Visibility of a resource - # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - - # @!method initialize(base_currency: nil, billing_period: nil, custom_fields: nil, initial_price: nil, plan_type: nil, release_method: nil, renewal_price: nil, visibility: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::ProductCreateParams::PlanOptions} for more details. - # - # Configuration for an automatically generated plan to attach to this product. - # - # @param base_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform - # - # @param billing_period [Integer, nil] The interval at which the plan charges (renewal plans). - # - # @param custom_fields [Array, nil] An array of custom field objects. - # - # @param initial_price [Float, nil] An additional amount charged upon first purchase. Provided as a number in the sp - # - # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product - # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod, nil] The methods of how a plan can be released. - # - # @param renewal_price [Float, nil] The amount the customer is charged every billing period. Provided as a number in - # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource - - class CustomField < WhopSDK::Internal::Type::BaseModel - # @!attribute field_type - # The type of the custom field. - # - # @return [Symbol, :text] - required :field_type, const: :text - - # @!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 - - # @!attribute order - # The order of the field. - # - # @return [Integer, nil] - optional :order, Integer, nil?: true - - # @!attribute placeholder - # The placeholder value of the field. - # - # @return [String, nil] - optional :placeholder, String, nil?: true - - # @!attribute required - # Whether or not the field is required. - # - # @return [Boolean, nil] - optional :required, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!method initialize(name:, id: nil, order: nil, placeholder: nil, required: nil, field_type: :text) - # @param name [String] The name of the custom field. - # - # @param id [String, nil] The ID of the custom field (if being updated) - # - # @param order [Integer, nil] The order of the field. - # - # @param placeholder [String, nil] The placeholder value of the field. - # - # @param required [Boolean, nil] Whether or not the field is required. - # - # @param field_type [Symbol, :text] The type of the custom field. - end - end end end end diff --git a/lib/whop_sdk/models/product_list_item.rb b/lib/whop_sdk/models/product_list_item.rb index 1efd69f4..6714645e 100644 --- a/lib/whop_sdk/models/product_list_item.rb +++ b/lib/whop_sdk/models/product_list_item.rb @@ -16,9 +16,8 @@ class ProductListItem < WhopSDK::Internal::Type::BaseModel required :created_at, Time # @!attribute external_identifier - # A unique identifier used to create or update products via the API. When provided - # on product creation endpoints, an existing product with this identifier will be - # updated instead of creating a new one. + # External identifier for the product. Providing it on a product creation endpoint + # updates the existing product with this identifier instead of creating a new one. # # @return [String, nil] required :external_identifier, String, nil?: true @@ -30,15 +29,16 @@ class ProductListItem < WhopSDK::Internal::Type::BaseModel required :headline, String, nil?: true # @!attribute member_count - # The number of users who currently hold an active membership to this product. - # Returns 0 if the company has disabled public member counts. + # Active memberships for this product. Returns `0` if the account has disabled + # public member counts. # # @return [Integer] required :member_count, Integer # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -50,8 +50,8 @@ class ProductListItem < WhopSDK::Internal::Type::BaseModel required :published_reviews_count, Integer # @!attribute route - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. # # @return [String] required :route, String @@ -93,17 +93,17 @@ class ProductListItem < WhopSDK::Internal::Type::BaseModel # # @param created_at [Time] The datetime the product was created. # - # @param external_identifier [String, nil] A unique identifier used to create or update products via the API. When provided + # @param external_identifier [String, nil] External identifier for the product. Providing it on a product creation endpoint # # @param headline [String, nil] A short marketing headline displayed prominently on the product's product page. # - # @param member_count [Integer] The number of users who currently hold an active membership to this product. Ret + # @param member_count [Integer] Active memberships for this product. Returns `0` if the account has disabled pub # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members # # @param published_reviews_count [Integer] The total number of published customer reviews for this product's company. # - # @param route [String] The URL slug used in the product's public link (e.g., 'my-product' in whop.com/c + # @param route [String] URL slug in the product's public link, e.g. `pickaxe-analytics` in whop.com/comp # # @param title [String] The display name of the product shown to customers on the product page and in se # diff --git a/lib/whop_sdk/models/product_list_params.rb b/lib/whop_sdk/models/product_list_params.rb index ceaba9f1..051d91ad 100644 --- a/lib/whop_sdk/models/product_list_params.rb +++ b/lib/whop_sdk/models/product_list_params.rb @@ -13,103 +13,81 @@ class ProductListParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :company_id, String + # @!attribute access_pass_types + # Filter to only products matching these types. + # + # @return [Array, nil] + optional :access_pass_types, WhopSDK::Internal::Type::ArrayOf[String] + # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns products 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 products before this position. # # @return [String, nil] - optional :before, String, nil?: true - - # @!attribute created_after - # Only return products created after this timestamp. - # - # @return [Time, nil] - optional :created_after, Time, nil?: true - - # @!attribute created_before - # Only return products created before this timestamp. - # - # @return [Time, nil] - optional :created_before, Time, nil?: true + optional :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::ProductListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::ProductListParams::Direction } # @!attribute first - # Returns the first _n_ elements from the list. + # The number of products 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 products 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 AccessPasses can be ordered + # The field to sort results by. Defaults to created_at. # - # @return [Symbol, WhopSDK::Models::ProductListParams::Order, nil] - optional :order, enum: -> { WhopSDK::ProductListParams::Order }, nil?: true - - # @!attribute product_types - # Filter to only products matching these type classifications. - # - # @return [Array, nil] - optional :product_types, - -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AccessPassType] }, - nil?: true + # @return [String, nil] + optional :order, String # @!attribute visibilities # Filter to only products 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, product_types: nil, visibilities: nil, request_options: {}) + # @!method initialize(company_id:, access_pass_types: nil, after: nil, before: nil, direction: nil, first: nil, last: nil, order: nil, visibilities: nil, request_options: {}) # @param company_id [String] The unique identifier of the company to list products for. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. - # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. - # - # @param created_after [Time, nil] Only return products created after this timestamp. + # @param access_pass_types [Array] Filter to only products matching these types. # - # @param created_before [Time, nil] Only return products created before this timestamp. + # @param after [String] A cursor; returns products after this position. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param before [String] A cursor; returns products before this position. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param direction [Symbol, WhopSDK::Models::ProductListParams::Direction] The sort direction for results. Defaults to descending. # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param first [Integer] The number of products to return (default and max 100). # - # @param order [Symbol, WhopSDK::Models::ProductListParams::Order, nil] The ways a relation of AccessPasses can be ordered + # @param last [Integer] The number of products to return from the end of the range. # - # @param product_types [Array, nil] Filter to only products matching these type classifications. + # @param order [String] The field to sort results by. Defaults to created_at. # - # @param visibilities [Array, nil] Filter to only products matching these visibility states. + # @param visibilities [Array] Filter to only products matching these visibility states. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - # The ways a relation of AccessPasses can be ordered - module Order + # The sort direction for results. Defaults to descending. + module Direction extend WhopSDK::Internal::Type::Enum - ACTIVE_MEMBERSHIPS_COUNT = :active_memberships_count - CREATED_AT = :created_at - USD_GMV = :usd_gmv - USD_GMV_30_DAYS = :usd_gmv_30_days + ASC = :asc + DESC = :desc # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/product_update_params.rb b/lib/whop_sdk/models/product_update_params.rb index 3bb5554c..7594a308 100644 --- a/lib/whop_sdk/models/product_update_params.rb +++ b/lib/whop_sdk/models/product_update_params.rb @@ -12,105 +12,31 @@ class ProductUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String - # @!attribute collect_shipping_address - # Whether the checkout flow collects a shipping address from the customer. - # - # @return [Boolean, nil] - optional :collect_shipping_address, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute custom_cta - # The different types of custom CTAs that can be selected. - # - # @return [Symbol, WhopSDK::Models::CustomCta, nil] - optional :custom_cta, enum: -> { WhopSDK::CustomCta }, nil?: true - - # @!attribute custom_cta_url - # A URL that the call-to-action button links to instead of the default checkout - # flow. - # - # @return [String, nil] - optional :custom_cta_url, String, nil?: true - - # @!attribute custom_statement_descriptor - # A custom text label that appears on the customer's bank statement. Must be 5-22 - # characters, contain at least one letter, and not contain <, >, \, ', or " - # characters. - # - # @return [String, nil] - optional :custom_statement_descriptor, String, nil?: true - # @!attribute description - # A written description of the product displayed on its product page. + # A written description displayed on the product page. # # @return [String, nil] optional :description, String, nil?: true - # @!attribute gallery_images - # The gallery images for the product. - # - # @return [Array, nil] - optional :gallery_images, - -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::ProductUpdateParams::GalleryImage] }, - nil?: true - - # @!attribute global_affiliate_percentage - # The commission rate as a percentage that affiliates earn through the global - # affiliate program. - # - # @return [Float, nil] - optional :global_affiliate_percentage, Float, nil?: true - - # @!attribute global_affiliate_status - # The different statuses of the global affiliate program for a product. - # - # @return [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] - optional :global_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }, nil?: true - # @!attribute headline - # A short marketing headline displayed prominently on the product page. + # A short marketing headline for the product page. # # @return [String, nil] optional :headline, String, nil?: true - # @!attribute member_affiliate_percentage - # The commission rate as a percentage that members earn through the member - # affiliate program. - # - # @return [Float, nil] - optional :member_affiliate_percentage, Float, nil?: true - - # @!attribute member_affiliate_status - # The different statuses of the global affiliate program for a product. - # - # @return [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] - optional :member_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }, nil?: true - # @!attribute metadata - # Custom key-value pairs to store on the product. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # Custom key-value pairs to store on the product. # - # @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 product_tax_code_id - # The unique identifier of the tax classification code to apply to this product. + # The unique identifier of the tax classification code. See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). # # @return [String, nil] optional :product_tax_code_id, String, nil?: true - # @!attribute redirect_purchase_url - # A URL to redirect the customer to after completing a purchase. - # - # @return [String, nil] - optional :redirect_purchase_url, String, nil?: true - - # @!attribute route - # The URL slug for the product's public link. - # - # @return [String, nil] - optional :route, String, nil?: true - # @!attribute send_welcome_message # Whether to send an automated welcome message via support chat when a user joins # this product. @@ -118,103 +44,39 @@ class ProductUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Boolean, nil] optional :send_welcome_message, WhopSDK::Internal::Type::Boolean, nil?: true - # @!attribute store_page_config - # Layout and display configuration for this product on the company's store page. - # - # @return [WhopSDK::Models::ProductUpdateParams::StorePageConfig, nil] - optional :store_page_config, -> { WhopSDK::ProductUpdateParams::StorePageConfig }, nil?: true - # @!attribute title - # The display name of the product. Maximum 80 characters. + # The display name of the product. # # @return [String, nil] - optional :title, String, nil?: true + optional :title, String # @!attribute visibility - # Visibility of a resource + # Whether the product is visible to customers. # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true + # @return [String, nil] + optional :visibility, String - # @!method initialize(id:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, gallery_images: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, metadata: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, store_page_config: nil, title: nil, visibility: nil, request_options: {}) + # @!method initialize(id:, description: nil, headline: nil, metadata: nil, product_tax_code_id: nil, send_welcome_message: nil, title: nil, visibility: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::ProductUpdateParams} for more details. # # @param id [String] # - # @param collect_shipping_address [Boolean, nil] Whether the checkout flow collects a shipping address from the customer. - # - # @param custom_cta [Symbol, WhopSDK::Models::CustomCta, nil] The different types of custom CTAs that can be selected. - # - # @param custom_cta_url [String, nil] A URL that the call-to-action button links to instead of the default checkout fl - # - # @param custom_statement_descriptor [String, nil] A custom text label that appears on the customer's bank statement. Must be 5-22 - # - # @param description [String, nil] A written description of the product displayed on its product page. - # - # @param gallery_images [Array, nil] The gallery images for the product. - # - # @param global_affiliate_percentage [Float, nil] The commission rate as a percentage that affiliates earn through the global affi + # @param description [String, nil] A written description displayed on the product page. # - # @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. + # @param headline [String, nil] A short marketing headline for the product page. # - # @param headline [String, nil] A short marketing headline displayed prominently on the product page. + # @param metadata [Object, nil] Custom key-value pairs to store on the product. # - # @param member_affiliate_percentage [Float, nil] The commission rate as a percentage that members earn through the member affilia - # - # @param member_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. - # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs to store on the product. Included in webhook payloads for - # - # @param product_tax_code_id [String, nil] The unique identifier of the tax classification code to apply to this product. - # - # @param redirect_purchase_url [String, nil] A URL to redirect the customer to after completing a purchase. - # - # @param route [String, nil] The URL slug for the product's public link. + # @param product_tax_code_id [String, nil] The unique identifier of the tax classification code. See the available [product # # @param send_welcome_message [Boolean, nil] Whether to send an automated welcome message via support chat when a user joins # - # @param store_page_config [WhopSDK::Models::ProductUpdateParams::StorePageConfig, nil] Layout and display configuration for this product on the company's store page. - # - # @param title [String, nil] The display name of the product. Maximum 80 characters. + # @param title [String] The display name of the product. # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + # @param visibility [String] Whether the product is visible to customers. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - - class GalleryImage < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The ID of an existing file object. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # Input for an attachment - # - # @param id [String] The ID of an existing file object. - end - - class StorePageConfig < WhopSDK::Internal::Type::BaseModel - # @!attribute custom_cta - # Custom call-to-action text for the product's store page. - # - # @return [String, nil] - optional :custom_cta, String, nil?: true - - # @!attribute show_price - # Whether or not to show the price on the product's store page. - # - # @return [Boolean, nil] - optional :show_price, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!method initialize(custom_cta: nil, show_price: nil) - # Layout and display configuration for this product on the company's store page. - # - # @param custom_cta [String, nil] Custom call-to-action text for the product's store page. - # - # @param show_price [Boolean, nil] Whether or not to show the price on the product's store page. - end end end end diff --git a/lib/whop_sdk/models/referral_referred_users_params.rb b/lib/whop_sdk/models/referral_referred_users_params.rb new file mode 100644 index 00000000..d6f489bd --- /dev/null +++ b/lib/whop_sdk/models/referral_referred_users_params.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Referrals#referred_users + class ReferralReferredUsersParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute after + # Cursor to fetch the page after (from page_info.end_cursor). + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # Cursor to fetch the page before (from page_info.start_cursor). + # + # @return [String, nil] + optional :before, String + + # @!attribute first + # Number of referred users to return from the start of the window. + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute has_businesses + # When true, only referred users who brought at least one business onto Whop. + # + # @return [Boolean, nil] + optional :has_businesses, WhopSDK::Internal::Type::Boolean + + # @!attribute has_earning_businesses + # When true, only referred users with at least one business that has generated + # earnings. + # + # @return [Boolean, nil] + optional :has_earning_businesses, WhopSDK::Internal::Type::Boolean + + # @!attribute last + # Number of referred users to return from the end of the window. + # + # @return [Integer, nil] + optional :last, Integer + + # @!method initialize(after: nil, before: nil, first: nil, has_businesses: nil, has_earning_businesses: nil, last: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ReferralReferredUsersParams} for more details. + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param first [Integer] Number of referred users to return from the start of the window. + # + # @param has_businesses [Boolean] When true, only referred users who brought at least one business onto Whop. + # + # @param has_earning_businesses [Boolean] When true, only referred users with at least one business that has generated ear + # + # @param last [Integer] Number of referred users to return from the end of the window. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/referral_referred_users_response.rb b/lib/whop_sdk/models/referral_referred_users_response.rb new file mode 100644 index 00000000..b14fa31e --- /dev/null +++ b/lib/whop_sdk/models/referral_referred_users_response.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Referrals#referred_users + class ReferralReferredUsersResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::ReferralReferredUsersResponse::Data] } + + # @!attribute page_info + # + # @return [WhopSDK::Models::ReferralReferredUsersResponse::PageInfo] + required :page_info, -> { WhopSDK::Models::ReferralReferredUsersResponse::PageInfo } + + # @!method initialize(data:, page_info:) + # @param data [Array] + # @param page_info [WhopSDK::Models::ReferralReferredUsersResponse::PageInfo] + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute total_earnings_usd + # + # @return [String] + required :total_earnings_usd, String + + # @!attribute total_volume_usd + # + # @return [String] + required :total_volume_usd, String + + # @!attribute user + # + # @return [WhopSDK::Models::ReferralReferredUsersResponse::Data::User] + required :user, -> { WhopSDK::Models::ReferralReferredUsersResponse::Data::User } + + # @!method initialize(total_earnings_usd:, total_volume_usd:, user:) + # @param total_earnings_usd [String] + # @param total_volume_usd [String] + # @param user [WhopSDK::Models::ReferralReferredUsersResponse::Data::User] + + # @see WhopSDK::Models::ReferralReferredUsersResponse::Data#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute profile_picture + # + # @return [WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture, nil] + optional :profile_picture, + -> { WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture } + + # @!method initialize(id:, username:, city: nil, country: nil, name: nil, profile_picture: nil) + # @param id [String] + # @param username [String] + # @param city [String, nil] + # @param country [String, nil] + # @param name [String, nil] + # @param profile_picture [WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture] + + # @see WhopSDK::Models::ReferralReferredUsersResponse::Data::User#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # + # @return [String, nil] + optional :url, String, nil?: true + + # @!method initialize(url: nil) + # @param url [String, nil] + end + end + end + + # @see WhopSDK::Models::ReferralReferredUsersResponse#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/referrals/business_leaderboard_params.rb b/lib/whop_sdk/models/referrals/business_leaderboard_params.rb new file mode 100644 index 00000000..345d39d6 --- /dev/null +++ b/lib/whop_sdk/models/referrals/business_leaderboard_params.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + # @see WhopSDK::Resources::Referrals::Businesses#leaderboard + class BusinessLeaderboardParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute period + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessLeaderboardParams::Period, nil] + optional :period, enum: -> { WhopSDK::Referrals::BusinessLeaderboardParams::Period } + + # @!method initialize(period: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessLeaderboardParams} for more details. + # + # @param period [Symbol, WhopSDK::Models::Referrals::BusinessLeaderboardParams::Period] Time window for the rankings. `day`, `month`, and `year` count earnings since th + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + module Period + extend WhopSDK::Internal::Type::Enum + + DAY = :day + MONTH = :month + YEAR = :year + LAST_30_DAYS = :last_30_days + ALL_TIME = :all_time + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/business_leaderboard_response.rb b/lib/whop_sdk/models/referrals/business_leaderboard_response.rb new file mode 100644 index 00000000..5188221b --- /dev/null +++ b/lib/whop_sdk/models/referrals/business_leaderboard_response.rb @@ -0,0 +1,284 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + # @see WhopSDK::Resources::Referrals::Businesses#leaderboard + class BusinessLeaderboardResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute leaders + # The top referrers by total earnings, best first. + # + # @return [Array] + required :leaders, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader] } + + # @!attribute me + # The caller's own standing; null when the caller has no referral earnings. + # + # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me, nil] + required :me, -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me }, nil?: true + + # @!method initialize(leaders:, me:) + # @param leaders [Array] The top referrers by total earnings, best first. + # + # @param me [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me, nil] The caller's own standing; null when the caller has no referral earnings. + + class Leader < WhopSDK::Internal::Type::BaseModel + # @!attribute first_referral_started_at + # When the referrer's earliest business referral became active. + # + # @return [Time] + required :first_referral_started_at, Time + + # @!attribute rank + # 1-based leaderboard position. + # + # @return [Integer] + required :rank, Integer + + # @!attribute total_earnings_usd + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + # + # @return [String] + required :total_earnings_usd, String + + # @!attribute total_volume_usd + # Credited GMV across all the referrer's referred businesses, in USD. + # + # @return [String] + required :total_volume_usd, String + + # @!attribute user + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + # + # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, nil] + required :user, -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User }, nil?: true + + # @!method initialize(first_referral_started_at:, rank:, total_earnings_usd:, total_volume_usd:, user:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader} for more + # details. + # + # @param first_referral_started_at [Time] When the referrer's earliest business referral became active. + # + # @param rank [Integer] 1-based leaderboard position. + # + # @param total_earnings_usd [String] The referrer's pending + completed earnings across all referred businesses, in U + # + # @param total_volume_usd [String] Credited GMV across all the referrer's referred businesses, in USD. + # + # @param user [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, nil] The ranked referrer. Identity fields (id, name, username, profile_picture) are r + + # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute id + # User ID, prefixed `user_`. Present only on the caller's own entry. + # + # @return [String, nil] + optional :id, String + + # @!attribute name + # The user's display name. Present only on the caller's own entry. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture. Present only on the caller's own entry. + # + # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, nil] + optional :profile_picture, + -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture } + + # @!attribute username + # The user's unique username. Present only on the caller's own entry. + # + # @return [String, nil] + optional :username, String + + # @!method initialize(city:, country:, id: nil, name: nil, profile_picture: nil, username: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User} for more + # details. + # + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + # + # @param city [String, nil] The city where the referrer is located, derived from their IP address. Null if l + # + # @param country [String, nil] The country where the referrer is located, derived from their IP address. Null i + # + # @param id [String] User ID, prefixed `user_`. Present only on the caller's own entry. + # + # @param name [String, nil] The user's display name. Present only on the caller's own entry. + # + # @param profile_picture [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture] The user's profile picture. Present only on the caller's own entry. + # + # @param username [String] The user's unique username. Present only on the caller's own entry. + + # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # The user's profile picture URL. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The user's profile picture. Present only on the caller's own entry. + # + # @param url [String] The user's profile picture URL. + end + end + end + + # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse#me + class Me < WhopSDK::Internal::Type::BaseModel + # @!attribute first_referral_started_at + # When the referrer's earliest business referral became active. + # + # @return [Time] + required :first_referral_started_at, Time + + # @!attribute rank + # 1-based leaderboard position. + # + # @return [Integer] + required :rank, Integer + + # @!attribute total_earnings_usd + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + # + # @return [String] + required :total_earnings_usd, String + + # @!attribute total_volume_usd + # Credited GMV across all the referrer's referred businesses, in USD. + # + # @return [String] + required :total_volume_usd, String + + # @!attribute user + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + # + # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User, nil] + required :user, -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User }, nil?: true + + # @!method initialize(first_referral_started_at:, rank:, total_earnings_usd:, total_volume_usd:, user:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me} for more details. + # + # The caller's own standing; null when the caller has no referral earnings. + # + # @param first_referral_started_at [Time] When the referrer's earliest business referral became active. + # + # @param rank [Integer] 1-based leaderboard position. + # + # @param total_earnings_usd [String] The referrer's pending + completed earnings across all referred businesses, in U + # + # @param total_volume_usd [String] Credited GMV across all the referrer's referred businesses, in USD. + # + # @param user [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User, nil] The ranked referrer. Identity fields (id, name, username, profile_picture) are r + + # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute id + # User ID, prefixed `user_`. Present only on the caller's own entry. + # + # @return [String, nil] + optional :id, String + + # @!attribute name + # The user's display name. Present only on the caller's own entry. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture. Present only on the caller's own entry. + # + # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, nil] + optional :profile_picture, + -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture } + + # @!attribute username + # The user's unique username. Present only on the caller's own entry. + # + # @return [String, nil] + optional :username, String + + # @!method initialize(city:, country:, id: nil, name: nil, profile_picture: nil, username: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User} for more + # details. + # + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + # + # @param city [String, nil] The city where the referrer is located, derived from their IP address. Null if l + # + # @param country [String, nil] The country where the referrer is located, derived from their IP address. Null i + # + # @param id [String] User ID, prefixed `user_`. Present only on the caller's own entry. + # + # @param name [String, nil] The user's display name. Present only on the caller's own entry. + # + # @param profile_picture [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture] The user's profile picture. Present only on the caller's own entry. + # + # @param username [String] The user's unique username. Present only on the caller's own entry. + + # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # The user's profile picture URL. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The user's profile picture. Present only on the caller's own entry. + # + # @param url [String] The user's profile picture URL. + end + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/business_list_params.rb b/lib/whop_sdk/models/referrals/business_list_params.rb new file mode 100644 index 00000000..ae2bb082 --- /dev/null +++ b/lib/whop_sdk/models/referrals/business_list_params.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + # @see WhopSDK::Resources::Referrals::Businesses#list + class BusinessListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute after + # Cursor to fetch the page after (from page_info.end_cursor). + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # Cursor to fetch the page before (from page_info.start_cursor). + # + # @return [String, nil] + optional :before, String + + # @!attribute created_after + # Only return business referrals created after this timestamp. + # + # @return [String, nil] + optional :created_after, String + + # @!attribute created_before + # Only return business referrals created before this timestamp. + # + # @return [String, nil] + optional :created_before, String + + # @!attribute direction + # Sort direction. + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::Referrals::BusinessListParams::Direction } + + # @!attribute first + # Number of business referrals to return from the start of the window. + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute has_earnings + # When true, only businesses with pending or completed earnings paid to the + # caller. + # + # @return [Boolean, nil] + optional :has_earnings, WhopSDK::Internal::Type::Boolean + + # @!attribute last + # Number of business referrals to return from the end of the window. + # + # @return [Integer, nil] + optional :last, Integer + + # @!attribute order + # The field to sort business referrals by. + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Order, nil] + optional :order, enum: -> { WhopSDK::Referrals::BusinessListParams::Order } + + # @!attribute referred_user_id + # Filter to referrals attributed to this user. For first-tier referrals, this is + # the referred account owner; for second-tier referrals, this is the partner you + # recruited. + # + # @return [String, nil] + optional :referred_user_id, String + + # @!attribute referred_username + # Filter by the referred user's exact username. Ignored when `referred_user_id` is + # present. + # + # @return [String, nil] + optional :referred_username, String + + # @!attribute status + # Filter by referral status. + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Status, nil] + optional :status, enum: -> { WhopSDK::Referrals::BusinessListParams::Status } + + # @!attribute tier + # Filter to only first-tier referrals or only second-tier referrals. + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Tier, nil] + optional :tier, enum: -> { WhopSDK::Referrals::BusinessListParams::Tier } + + # @!method initialize(after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, has_earnings: nil, last: nil, order: nil, referred_user_id: nil, referred_username: nil, status: nil, tier: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessListParams} for more details. + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param created_after [String] Only return business referrals created after this timestamp. + # + # @param created_before [String] Only return business referrals created before this timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Direction] Sort direction. + # + # @param first [Integer] Number of business referrals to return from the start of the window. + # + # @param has_earnings [Boolean] When true, only businesses with pending or completed earnings paid to the caller + # + # @param last [Integer] Number of business referrals to return from the end of the window. + # + # @param order [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Order] The field to sort business referrals by. + # + # @param referred_user_id [String] Filter to referrals attributed to this user. For first-tier referrals, this is t + # + # @param referred_username [String] Filter by the referred user's exact username. Ignored when `referred_user_id` is + # + # @param status [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Status] Filter by referral status. + # + # @param tier [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Tier] Filter to only first-tier referrals or only second-tier referrals. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # The field to sort business referrals by. + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT = :created_at + REFERRAL_STARTED_AT = :referral_started_at + REFERRAL_EXPIRES_AT = :referral_expires_at + PAYOUT_PERCENTAGE = :payout_percentage + VOLUME_USD = :volume_usd + EARNINGS_USD = :earnings_usd + + # @!method self.values + # @return [Array] + end + + # Filter by referral status. + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + REMOVED = :removed + + # @!method self.values + # @return [Array] + end + + # Filter to only first-tier referrals or only second-tier referrals. + module Tier + extend WhopSDK::Internal::Type::Enum + + FIRST = :first + SECOND = :second + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/business_list_response.rb b/lib/whop_sdk/models/referrals/business_list_response.rb new file mode 100644 index 00000000..b4768f9f --- /dev/null +++ b/lib/whop_sdk/models/referrals/business_list_response.rb @@ -0,0 +1,361 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + # @see WhopSDK::Resources::Referrals::Businesses#list + class BusinessListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Business referral ID. + # + # @return [String] + required :id, String + + # @!attribute account + # Referred account. + # + # @return [WhopSDK::Models::Referrals::BusinessListResponse::Account, nil] + required :account, -> { WhopSDK::Models::Referrals::BusinessListResponse::Account }, nil?: true + + # @!attribute created_at + # When the business referral was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute earnings_usd + # + # @return [WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd] + required :earnings_usd, -> { WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd } + + # @!attribute first_tier_partner + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + # + # @return [WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner, nil] + required :first_tier_partner, + -> { WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner }, + nil?: true + + # @!attribute my_partner_tier + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier] + required :my_partner_tier, enum: -> { WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier } + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::Object] + required :object, enum: -> { WhopSDK::Models::Referrals::BusinessListResponse::Object } + + # @!attribute owner + # The owner of the referred business. + # + # @return [WhopSDK::Models::Referrals::BusinessListResponse::Owner, nil] + required :owner, -> { WhopSDK::Models::Referrals::BusinessListResponse::Owner }, nil?: true + + # @!attribute payout_percentage + # Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier + # referrals earn a flat 0.1. + # + # @return [Float] + required :payout_percentage, Float + + # @!attribute referral_expires_at + # When the referral expires. + # + # @return [Time, nil] + required :referral_expires_at, Time, nil?: true + + # @!attribute referral_started_at + # When the referral became active. + # + # @return [Time, nil] + required :referral_started_at, Time, nil?: true + + # @!attribute status + # Current referral status. + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::Status] + required :status, enum: -> { WhopSDK::Models::Referrals::BusinessListResponse::Status } + + # @!attribute volume_usd + # + # @return [WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd] + required :volume_usd, -> { WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd } + + # @!method initialize(id:, account:, created_at:, earnings_usd:, first_tier_partner:, my_partner_tier:, object:, owner:, payout_percentage:, referral_expires_at:, referral_started_at:, status:, volume_usd:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessListResponse} for more details. + # + # @param id [String] Business referral ID. + # + # @param account [WhopSDK::Models::Referrals::BusinessListResponse::Account, nil] Referred account. + # + # @param created_at [Time] When the business referral was created. + # + # @param earnings_usd [WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd] + # + # @param first_tier_partner [WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner, nil] The partner who referred the business owner onto Whop (first tier). Null if ther + # + # @param my_partner_tier [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier] Which tier the caller earns on for this business: `first` (they referred the own + # + # @param object [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::Object] + # + # @param owner [WhopSDK::Models::Referrals::BusinessListResponse::Owner, nil] The owner of the referred business. + # + # @param payout_percentage [Float] Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier re + # + # @param referral_expires_at [Time, nil] When the referral expires. + # + # @param referral_started_at [Time, nil] When the referral became active. + # + # @param status [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::Status] Current referral status. + # + # @param volume_usd [WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd] + + # @see WhopSDK::Models::Referrals::BusinessListResponse#account + class Account < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Referred account ID. + # + # @return [String] + required :id, String + + # @!attribute logo_url + # Referred account logo URL. + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute route + # Referred account route. + # + # @return [String] + required :route, String + + # @!attribute title + # Referred account display name. + # + # @return [String] + required :title, String + + # @!method initialize(id:, logo_url:, route:, title:) + # Referred account. + # + # @param id [String] Referred account ID. + # + # @param logo_url [String, nil] Referred account logo URL. + # + # @param route [String] Referred account route. + # + # @param title [String] Referred account display name. + end + + # @see WhopSDK::Models::Referrals::BusinessListResponse#earnings_usd + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + # @!attribute completed + # Commission already paid out, in USD. + # + # @return [String] + required :completed, String + + # @!attribute pending + # Commission scheduled but not yet paid, in USD. + # + # @return [String] + required :pending, String + + # @!attribute total + # Pending + completed commission, in USD. + # + # @return [String] + required :total, String + + # @!method initialize(completed:, pending:, total:) + # @param completed [String] Commission already paid out, in USD. + # + # @param pending [String] Commission scheduled but not yet paid, in USD. + # + # @param total [String] Pending + completed commission, in USD. + end + + # @see WhopSDK::Models::Referrals::BusinessListResponse#first_tier_partner + class FirstTierPartner < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID, prefixed `user_`. + # + # @return [String] + required :id, String + + # @!attribute name + # The user's display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture. + # + # @return [WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture] + required :profile_picture, + -> { WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture } + + # @!attribute username + # The user's unique username. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, profile_picture:, username:) + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + # + # @param id [String] User ID, prefixed `user_`. + # + # @param name [String, nil] The user's display name. + # + # @param profile_picture [WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture] The user's profile picture. + # + # @param username [String] The user's unique username. + + # @see WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # The user's profile picture URL. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The user's profile picture. + # + # @param url [String] The user's profile picture URL. + end + end + + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + # + # @see WhopSDK::Models::Referrals::BusinessListResponse#my_partner_tier + module MyPartnerTier + extend WhopSDK::Internal::Type::Enum + + FIRST = :first + SECOND = :second + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Referrals::BusinessListResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + BUSINESS_REFERRAL = :business_referral + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Referrals::BusinessListResponse#owner + class Owner < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID, prefixed `user_`. + # + # @return [String] + required :id, String + + # @!attribute name + # The user's display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture. + # + # @return [WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture] + required :profile_picture, -> { WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture } + + # @!attribute username + # The user's unique username. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, profile_picture:, username:) + # The owner of the referred business. + # + # @param id [String] User ID, prefixed `user_`. + # + # @param name [String, nil] The user's display name. + # + # @param profile_picture [WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture] The user's profile picture. + # + # @param username [String] The user's unique username. + + # @see WhopSDK::Models::Referrals::BusinessListResponse::Owner#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # The user's profile picture URL. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The user's profile picture. + # + # @param url [String] The user's profile picture URL. + end + end + + # Current referral status. + # + # @see WhopSDK::Models::Referrals::BusinessListResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + REMOVED = :removed + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Referrals::BusinessListResponse#volume_usd + class VolumeUsd < WhopSDK::Internal::Type::BaseModel + # @!attribute attributed + # Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in + # USD. + # + # @return [String] + required :attributed, String + + # @!attribute awaiting_settlement + # GMV awaiting settlement (commission not yet computed), in USD. + # + # @return [String] + required :awaiting_settlement, String + + # @!attribute settled + # GMV of pending + completed payments, in USD. + # + # @return [String] + required :settled, String + + # @!method initialize(attributed:, awaiting_settlement:, settled:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd} for more details. + # + # @param attributed [String] Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in + # + # @param awaiting_settlement [String] GMV awaiting settlement (commission not yet computed), in USD. + # + # @param settled [String] GMV of pending + completed payments, in USD. + end + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/business_retrieve_params.rb b/lib/whop_sdk/models/referrals/business_retrieve_params.rb new file mode 100644 index 00000000..6f392a37 --- /dev/null +++ b/lib/whop_sdk/models/referrals/business_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + # @see WhopSDK::Resources::Referrals::Businesses#retrieve + class BusinessRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/business_retrieve_response.rb b/lib/whop_sdk/models/referrals/business_retrieve_response.rb new file mode 100644 index 00000000..480925f4 --- /dev/null +++ b/lib/whop_sdk/models/referrals/business_retrieve_response.rb @@ -0,0 +1,881 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + # @see WhopSDK::Resources::Referrals::Businesses#retrieve + class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Business referral ID. + # + # @return [String] + required :id, String + + # @!attribute account + # Referred account. + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account, nil] + required :account, -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account }, nil?: true + + # @!attribute created_at + # When the business referral was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute earnings_usd + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd] + required :earnings_usd, -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd } + + # @!attribute first_tier_partner + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner, nil] + required :first_tier_partner, + -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner }, + nil?: true + + # @!attribute my_partner_tier + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier] + required :my_partner_tier, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier } + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object] + required :object, enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object } + + # @!attribute owner + # The owner of the referred business. + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner, nil] + required :owner, -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner }, nil?: true + + # @!attribute payout_percentage + # Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier + # referrals earn a flat 0.1. + # + # @return [Float] + required :payout_percentage, Float + + # @!attribute referral_expires_at + # When the referral expires. + # + # @return [Time, nil] + required :referral_expires_at, Time, nil?: true + + # @!attribute referral_started_at + # When the referral became active. + # + # @return [Time, nil] + required :referral_started_at, Time, nil?: true + + # @!attribute status + # Current referral status. + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status] + required :status, enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status } + + # @!attribute volume_usd + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd] + required :volume_usd, -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd } + + # @!method initialize(id:, account:, created_at:, earnings_usd:, first_tier_partner:, my_partner_tier:, object:, owner:, payout_percentage:, referral_expires_at:, referral_started_at:, status:, volume_usd:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessRetrieveResponse} for more details. + # + # @param id [String] Business referral ID. + # + # @param account [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account, nil] Referred account. + # + # @param created_at [Time] When the business referral was created. + # + # @param earnings_usd [WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd] + # + # @param first_tier_partner [WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner, nil] The partner who referred the business owner onto Whop (first tier). Null if ther + # + # @param my_partner_tier [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier] Which tier the caller earns on for this business: `first` (they referred the own + # + # @param object [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object] + # + # @param owner [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner, nil] The owner of the referred business. + # + # @param payout_percentage [Float] Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier re + # + # @param referral_expires_at [Time, nil] When the referral expires. + # + # @param referral_started_at [Time, nil] When the referral became active. + # + # @param status [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status] Current referral status. + # + # @param volume_usd [WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd] + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#account + class Account < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Referred account ID. + # + # @return [String] + required :id, String + + # @!attribute capabilities + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities, nil] + required :capabilities, + -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities }, + nil?: true + + # @!attribute logo_url + # Referred account logo URL. + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute recommended_actions + # Optional actions that unlock capabilities or grow the referred account. + # + # @return [Array, nil] + required :recommended_actions, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction] }, + nil?: true + + # @!attribute required_actions + # Actions the referred account owner must take to unblock capabilities. + # + # @return [Array, nil] + required :required_actions, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction] }, + nil?: true + + # @!attribute route + # Referred account route. + # + # @return [String] + required :route, String + + # @!attribute title + # Referred account display name. + # + # @return [String] + required :title, String + + # @!method initialize(id:, capabilities:, logo_url:, recommended_actions:, required_actions:, route:, title:) + # Referred account. + # + # @param id [String] Referred account ID. + # + # @param capabilities [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities, nil] + # + # @param logo_url [String, nil] Referred account logo URL. + # + # @param recommended_actions [Array, nil] Optional actions that unlock capabilities or grow the referred account. + # + # @param required_actions [Array, nil] Actions the referred account owner must take to unblock capabilities. + # + # @param route [String] Referred account route. + # + # @param title [String] Referred account display name. + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account#capabilities + class Capabilities < WhopSDK::Internal::Type::BaseModel + # @!attribute accept_bank_payments + # Bank payins: debits, transfers, and local bank rails + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments] + required :accept_bank_payments, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments } + + # @!attribute accept_bnpl_payments + # Buy-now-pay-later payins; requires approval + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments] + required :accept_bnpl_payments, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments } + + # @!attribute accept_card_payments + # Card payins, including Apple Pay and Google Pay + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments] + required :accept_card_payments, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments } + + # @!attribute bank_deposit + # Deposits by bank wire or ACH to the account's virtual bank account + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit] + required :bank_deposit, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit } + + # @!attribute card_deposit + # Balance top-ups by charging a stored payment method + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit] + required :card_deposit, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit } + + # @!attribute card_issuing + # Issuing Whop cards; requires card application approval + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing] + required :card_issuing, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing } + + # @!attribute crypto_deposit + # On-chain deposits to the account's crypto wallet + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit] + required :crypto_deposit, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit } + + # @!attribute crypto_payout + # On-chain payouts to a crypto wallet + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout] + required :crypto_payout, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout } + + # @!attribute instant_payout + # Instant payouts to an eligible payout destination + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout] + required :instant_payout, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout } + + # @!attribute standard_payout + # Standard payouts to an external payout destination + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout] + required :standard_payout, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout } + + # @!attribute transfer + # Transfers to other accounts + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer] + required :transfer, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer } + + # @!method initialize(accept_bank_payments:, accept_bnpl_payments:, accept_card_payments:, bank_deposit:, card_deposit:, card_issuing:, crypto_deposit:, crypto_payout:, instant_payout:, standard_payout:, transfer:) + # @param accept_bank_payments [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments] Bank payins: debits, transfers, and local bank rails + # + # @param accept_bnpl_payments [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments] Buy-now-pay-later payins; requires approval + # + # @param accept_card_payments [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments] Card payins, including Apple Pay and Google Pay + # + # @param bank_deposit [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit] Deposits by bank wire or ACH to the account's virtual bank account + # + # @param card_deposit [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit] Balance top-ups by charging a stored payment method + # + # @param card_issuing [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing] Issuing Whop cards; requires card application approval + # + # @param crypto_deposit [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit] On-chain deposits to the account's crypto wallet + # + # @param crypto_payout [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout] On-chain payouts to a crypto wallet + # + # @param instant_payout [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout] Instant payouts to an eligible payout destination + # + # @param standard_payout [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout] Standard payouts to an external payout destination + # + # @param transfer [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer] Transfers to other accounts + + # Bank payins: debits, transfers, and local bank rails + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#accept_bank_payments + module AcceptBankPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Buy-now-pay-later payins; requires approval + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#accept_bnpl_payments + module AcceptBnplPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Card payins, including Apple Pay and Google Pay + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#accept_card_payments + module AcceptCardPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Deposits by bank wire or ACH to the account's virtual bank account + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#bank_deposit + module BankDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Balance top-ups by charging a stored payment method + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#card_deposit + module CardDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Issuing Whop cards; requires card application approval + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#card_issuing + module CardIssuing + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # On-chain deposits to the account's crypto wallet + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#crypto_deposit + module CryptoDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # On-chain payouts to a crypto wallet + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#crypto_payout + module CryptoPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Instant payouts to an eligible payout destination + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#instant_payout + module InstantPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Standard payouts to an external payout destination + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#standard_payout + module StandardPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # Transfers to other accounts + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#transfer + module Transfer + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + INACTIVE = :inactive + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + + class RecommendedAction < WhopSDK::Internal::Type::BaseModel + # @!attribute action + # The recommendation; new values may be added, so handle unknown actions + # gracefully + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action] + required :action, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action } + + # @!attribute blocked_capabilities + # + # @return [Array] + required :blocked_capabilities, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute cta + # The URL the call-to-action links to + # + # @return [String] + required :cta, String + + # @!attribute cta_label + # Button label + # + # @return [String] + required :cta_label, String + + # @!attribute description + # Supporting copy, or empty + # + # @return [String] + required :description, String + + # @!attribute icon_url + # Illustration icon URL, or `null` + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute impact_score + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + # + # @return [Integer, nil] + required :impact_score, Integer, nil?: true + + # @!attribute reasoning + # Why this action was recommended for this account, or `null` + # + # @return [String, nil] + required :reasoning, String, nil?: true + + # @!attribute status + # Always optional — never blocking + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status] + required :status, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status } + + # @!attribute title + # Headline for the recommendation + # + # @return [String] + required :title, String + + # @!method initialize(action:, blocked_capabilities:, cta:, cta_label:, description:, icon_url:, impact_score:, reasoning:, status:, title:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction} + # for more details. + # + # @param action [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action] The recommendation; new values may be added, so handle unknown actions gracefull + # + # @param blocked_capabilities [Array] + # + # @param cta [String] The URL the call-to-action links to + # + # @param cta_label [String] Button label + # + # @param description [String] Supporting copy, or empty + # + # @param icon_url [String, nil] Illustration icon URL, or `null` + # + # @param impact_score [Integer, nil] Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # + # @param reasoning [String, nil] Why this action was recommended for this account, or `null` + # + # @param status [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status] Always optional — never blocking + # + # @param title [String] Headline for the recommendation + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction#action + module Action + extend WhopSDK::Internal::Type::Enum + + THEME_BUSINESS = :theme_business + CREATE_PRODUCT = :create_product + CREATE_PLAN = :create_plan + VERIFY_IDENTITY = :verify_identity + CONNECT_AFFILIATE_PROGRAM = :connect_affiliate_program + CREATE_PROMOTION = :create_promotion + SETUP_TRACKING_PIXEL = :setup_tracking_pixel + MIGRATE_FROM_STRIPE = :migrate_from_stripe + ACCEPT_FIRST_PAYMENT = :accept_first_payment + LAUNCH_FIRST_AD = :launch_first_ad + INVITE_TEAM_MEMBER = :invite_team_member + ENABLE_TAX_COLLECTION = :enable_tax_collection + CREATE_CARD = :create_card + JOIN_WHOP_UNIVERSITY = :join_whop_university + APPLY_FOR_FINANCING = :apply_for_financing + + # @!method self.values + # @return [Array] + end + + # Always optional — never blocking + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction#status + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL = :optional + + # @!method self.values + # @return [Array] + end + end + + class RequiredAction < WhopSDK::Internal::Type::BaseModel + # @!attribute action + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action] + required :action, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action } + + # @!attribute blocked_capabilities + # + # @return [Array] + required :blocked_capabilities, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute cta + # The URL the call-to-action links to, or null when there is no button + # + # @return [String, nil] + required :cta, String, nil?: true + + # @!attribute cta_label + # Button label, or empty when there is no button + # + # @return [String] + required :cta_label, String + + # @!attribute description + # Supporting copy, or empty + # + # @return [String] + required :description, String + + # @!attribute icon_url + # The URL of the action's illustration icon, or null if it has none + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute status + # required (act now) or pending (under review) + # + # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status] + required :status, + enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status } + + # @!attribute title + # Headline for the action + # + # @return [String] + required :title, String + + # @!method initialize(action:, blocked_capabilities:, cta:, cta_label:, description:, icon_url:, status:, title:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction} + # for more details. + # + # @param action [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action] What the holder must do; new values may be added, so handle unknown actions grac + # + # @param blocked_capabilities [Array] + # + # @param cta [String, nil] The URL the call-to-action links to, or null when there is no button + # + # @param cta_label [String] Button label, or empty when there is no button + # + # @param description [String] Supporting copy, or empty + # + # @param icon_url [String, nil] The URL of the action's illustration icon, or null if it has none + # + # @param status [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status] required (act now) or pending (under review) + # + # @param title [String] Headline for the action + + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction#action + module Action + extend WhopSDK::Internal::Type::Enum + + DEPOSIT_FUNDS = :deposit_funds + SUBMIT_INFORMATION_REQUEST = :submit_information_request + VERIFY_IDENTITY = :verify_identity + CONNECT_FULFILLMENT_TRACKER = :connect_fulfillment_tracker + + # @!method self.values + # @return [Array] + end + + # required (act now) or pending (under review) + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction#status + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRED = :required + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + end + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#earnings_usd + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + # @!attribute completed + # Commission already paid out, in USD. + # + # @return [String] + required :completed, String + + # @!attribute pending + # Commission scheduled but not yet paid, in USD. + # + # @return [String] + required :pending, String + + # @!attribute total + # Pending + completed commission, in USD. + # + # @return [String] + required :total, String + + # @!method initialize(completed:, pending:, total:) + # @param completed [String] Commission already paid out, in USD. + # + # @param pending [String] Commission scheduled but not yet paid, in USD. + # + # @param total [String] Pending + completed commission, in USD. + end + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#first_tier_partner + class FirstTierPartner < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID, prefixed `user_`. + # + # @return [String] + required :id, String + + # @!attribute name + # The user's display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture. + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture] + required :profile_picture, + -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture } + + # @!attribute username + # The user's unique username. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, profile_picture:, username:) + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + # + # @param id [String] User ID, prefixed `user_`. + # + # @param name [String, nil] The user's display name. + # + # @param profile_picture [WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture] The user's profile picture. + # + # @param username [String] The user's unique username. + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # The user's profile picture URL. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The user's profile picture. + # + # @param url [String] The user's profile picture URL. + end + end + + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#my_partner_tier + module MyPartnerTier + extend WhopSDK::Internal::Type::Enum + + FIRST = :first + SECOND = :second + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + BUSINESS_REFERRAL = :business_referral + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#owner + class Owner < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID, prefixed `user_`. + # + # @return [String] + required :id, String + + # @!attribute name + # The user's display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture. + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture] + required :profile_picture, + -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture } + + # @!attribute username + # The user's unique username. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, profile_picture:, username:) + # The owner of the referred business. + # + # @param id [String] User ID, prefixed `user_`. + # + # @param name [String, nil] The user's display name. + # + # @param profile_picture [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture] The user's profile picture. + # + # @param username [String] The user's unique username. + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # The user's profile picture URL. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The user's profile picture. + # + # @param url [String] The user's profile picture URL. + end + end + + # Current referral status. + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE = :active + REMOVED = :removed + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#volume_usd + class VolumeUsd < WhopSDK::Internal::Type::BaseModel + # @!attribute attributed + # Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in + # USD. + # + # @return [String] + required :attributed, String + + # @!attribute awaiting_settlement + # GMV awaiting settlement (commission not yet computed), in USD. + # + # @return [String] + required :awaiting_settlement, String + + # @!attribute settled + # GMV of pending + completed payments, in USD. + # + # @return [String] + required :settled, String + + # @!method initialize(attributed:, awaiting_settlement:, settled:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd} for more + # details. + # + # @param attributed [String] Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in + # + # @param awaiting_settlement [String] GMV awaiting settlement (commission not yet computed), in USD. + # + # @param settled [String] GMV of pending + completed payments, in USD. + end + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/businesses/earning_list_params.rb b/lib/whop_sdk/models/referrals/businesses/earning_list_params.rb new file mode 100644 index 00000000..12daab8e --- /dev/null +++ b/lib/whop_sdk/models/referrals/businesses/earning_list_params.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + module Businesses + # @see WhopSDK::Resources::Referrals::Businesses::Earnings#list + class EarningListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute after + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # + # @return [String, nil] + optional :before, String + + # @!attribute created_after + # Only return earnings created after this timestamp. + # + # @return [String, nil] + optional :created_after, String + + # @!attribute created_before + # Only return earnings created before this timestamp. + # + # @return [String, nil] + optional :created_before, String + + # @!attribute direction + # Sort direction. + # + # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::Referrals::Businesses::EarningListParams::Direction } + + # @!attribute first + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute last + # + # @return [Integer, nil] + optional :last, Integer + + # @!attribute order + # The field to sort earnings by. + # + # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Order, nil] + optional :order, enum: -> { WhopSDK::Referrals::Businesses::EarningListParams::Order } + + # @!attribute status + # Filter by earning status. + # + # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Status, nil] + optional :status, enum: -> { WhopSDK::Referrals::Businesses::EarningListParams::Status } + + # @!method initialize(id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, status: nil, request_options: {}) + # @param id [String] + # + # @param after [String] + # + # @param before [String] + # + # @param created_after [String] Only return earnings created after this timestamp. + # + # @param created_before [String] Only return earnings created before this timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Direction] Sort direction. + # + # @param first [Integer] + # + # @param last [Integer] + # + # @param order [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Order] The field to sort earnings by. + # + # @param status [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Status] Filter by earning status. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # The field to sort earnings by. + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT = :created_at + COMMISSION_AMOUNT = :commission_amount + TRANSACTION_AMOUNT = :transaction_amount + PAYOUT_AT = :payout_at + + # @!method self.values + # @return [Array] + end + + # Filter by earning status. + module Status + extend WhopSDK::Internal::Type::Enum + + AWAITING_SETTLEMENT = :awaiting_settlement + PENDING = :pending + COMPLETED = :completed + CANCELED = :canceled + REVERSED = :reversed + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/businesses/earning_list_response.rb b/lib/whop_sdk/models/referrals/businesses/earning_list_response.rb new file mode 100644 index 00000000..b0e2815e --- /dev/null +++ b/lib/whop_sdk/models/referrals/businesses/earning_list_response.rb @@ -0,0 +1,371 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + module Businesses + # @see WhopSDK::Resources::Referrals::Businesses::Earnings#list + class EarningListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute account + # Referred account. + # + # @return [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account, nil] + required :account, -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account }, nil?: true + + # @!attribute cancelation_reason + # Why the earning was canceled or reversed, if applicable. + # + # @return [String, nil] + required :cancelation_reason, String, nil?: true + + # @!attribute commission_amount_usd + # What the referrer earns, in USD. Null until the earning settles. + # + # @return [String, nil] + required :commission_amount_usd, String, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute financial_activity + # Income and cost lines behind this earning's commission. Null for earnings + # settled before this data was recorded. + # + # @return [Array, nil] + required :financial_activity, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity] }, + nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object] + required :object, enum: -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object } + + # @!attribute payout_at + # + # @return [Time, nil] + required :payout_at, Time, nil?: true + + # @!attribute payout_percentage + # The referrer's share of Whop's gross profit, as a fraction (0.3 = 30%). Null + # until the earning settles. + # + # @return [Float, nil] + required :payout_percentage, Float, nil?: true + + # @!attribute product + # + # @return [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product, nil] + required :product, -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product }, nil?: true + + # @!attribute resource + # The resource that generated the affiliate earning. + # + # @return [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource, nil] + required :resource, + -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource }, + nil?: true + + # @!attribute second_tier + # Whether this earning is a second-tier (grandparent) commission. + # + # @return [Boolean] + required :second_tier, WhopSDK::Internal::Type::Boolean + + # @!attribute status + # Current status of the earning. + # + # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status] + required :status, enum: -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status } + + # @!attribute transaction_amount_usd + # The sale amount the commission is calculated from, in USD. + # + # @return [String] + required :transaction_amount_usd, String + + # @!method initialize(id:, account:, cancelation_reason:, commission_amount_usd:, created_at:, financial_activity:, object:, payout_at:, payout_percentage:, product:, resource:, second_tier:, status:, transaction_amount_usd:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::Businesses::EarningListResponse} for more details. + # + # @param id [String, nil] + # + # @param account [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account, nil] Referred account. + # + # @param cancelation_reason [String, nil] Why the earning was canceled or reversed, if applicable. + # + # @param commission_amount_usd [String, nil] What the referrer earns, in USD. Null until the earning settles. + # + # @param created_at [Time] + # + # @param financial_activity [Array, nil] Income and cost lines behind this earning's commission. Null for earnings settle + # + # @param object [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object] + # + # @param payout_at [Time, nil] + # + # @param payout_percentage [Float, nil] The referrer's share of Whop's gross profit, as a fraction (0.3 = 30%). Null unt + # + # @param product [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product, nil] + # + # @param resource [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource, nil] The resource that generated the affiliate earning. + # + # @param second_tier [Boolean] Whether this earning is a second-tier (grandparent) commission. + # + # @param status [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status] Current status of the earning. + # + # @param transaction_amount_usd [String] The sale amount the commission is calculated from, in USD. + + # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#account + class Account < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Referred account ID. + # + # @return [String] + required :id, String + + # @!attribute logo_url + # Referred account logo URL. + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute route + # Referred account route. + # + # @return [String] + required :route, String + + # @!attribute title + # Referred account display name. + # + # @return [String] + required :title, String + + # @!method initialize(id:, logo_url:, route:, title:) + # Referred account. + # + # @param id [String] Referred account ID. + # + # @param logo_url [String, nil] Referred account logo URL. + # + # @param route [String] Referred account route. + # + # @param title [String] Referred account display name. + end + + class FinancialActivity < WhopSDK::Internal::Type::BaseModel + # @!attribute amount + # Line amount in its native currency. + # + # @return [String] + required :amount, String + + # @!attribute amount_usd + # Line amount in USD. + # + # @return [String] + required :amount_usd, String + + # @!attribute category + # Fee or cost category of the line. + # + # @return [String, nil] + required :category, String, nil?: true + + # @!attribute created_at + # + # @return [Time, nil] + required :created_at, Time, nil?: true + + # @!attribute currency + # Currency of the native amount. + # + # @return [String] + required :currency, String + + # @!attribute type + # Whether the line is income Whop collected or a cost Whop paid. + # + # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type] + required :type, + enum: -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type } + + # @!method initialize(amount:, amount_usd:, category:, created_at:, currency:, type:) + # @param amount [String] Line amount in its native currency. + # + # @param amount_usd [String] Line amount in USD. + # + # @param category [String, nil] Fee or cost category of the line. + # + # @param created_at [Time, nil] + # + # @param currency [String] Currency of the native amount. + # + # @param type [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type] Whether the line is income Whop collected or a cost Whop paid. + + # Whether the line is income Whop collected or a cost Whop paid. + # + # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity#type + module Type + extend WhopSDK::Internal::Type::Enum + + INCOME = :income + EXPENSE = :expense + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + BUSINESS_REFERRAL_EARNING = :business_referral_earning + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#product + class Product < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute route + # + # @return [String] + required :route, String + + # @!attribute title + # + # @return [String] + required :title, String + + # @!method initialize(id:, route:, title:) + # @param id [String] + # @param route [String] + # @param title [String] + end + + # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#resource + class Resource < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute alternative_payment_method + # + # @return [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, nil] + required :alternative_payment_method, + -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod }, + nil?: true + + # @!attribute brand + # + # @return [String, nil] + required :brand, String, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute last4 + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object] + required :object, + enum: -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object } + + # @!attribute payment_method_type + # + # @return [String, nil] + required :payment_method_type, String, nil?: true + + # @!attribute processor + # + # @return [String, nil] + required :processor, String, nil?: true + + # @!method initialize(id:, alternative_payment_method:, brand:, created_at:, currency:, last4:, object:, payment_method_type:, processor:) + # The resource that generated the affiliate earning. + # + # @param id [String] + # @param alternative_payment_method [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, nil] + # @param brand [String, nil] + # @param created_at [Time] + # @param currency [String] + # @param last4 [String, nil] + # @param object [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object] + # @param payment_method_type [String, nil] + # @param processor [String, nil] + + # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource#alternative_payment_method + class AlternativePaymentMethod < WhopSDK::Internal::Type::BaseModel + # @!attribute image_url + # + # @return [String, nil] + required :image_url, String, nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!method initialize(image_url:, name:) + # @param image_url [String, nil] + # @param name [String] + end + + # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource#object + module Object + extend WhopSDK::Internal::Type::Enum + + RECEIPT = :receipt + + # @!method self.values + # @return [Array] + end + end + + # Current status of the earning. + # + # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + AWAITING_SETTLEMENT = :awaiting_settlement + PENDING = :pending + COMPLETED = :completed + CANCELED = :canceled + REVERSED = :reversed + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/partner_create_params.rb b/lib/whop_sdk/models/referrals/partner_create_params.rb new file mode 100644 index 00000000..aec5e568 --- /dev/null +++ b/lib/whop_sdk/models/referrals/partner_create_params.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + # @see WhopSDK::Resources::Referrals::Partners#create + class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/whop_sdk/models/referrals/partner_create_response.rb b/lib/whop_sdk/models/referrals/partner_create_response.rb new file mode 100644 index 00000000..40b5064c --- /dev/null +++ b/lib/whop_sdk/models/referrals/partner_create_response.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Referrals + # @see WhopSDK::Resources::Referrals::Partners#create + class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute referral_link + # The caller's referral link — businesses that sign up through it are attributed + # to the caller. + # + # @return [String] + required :referral_link, String + + # @!attribute whop_partner_enabled_at + # When the caller became a Whop partner. + # + # @return [Time] + required :whop_partner_enabled_at, Time + + # @!method initialize(referral_link:, whop_partner_enabled_at:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::PartnerCreateResponse} for more details. + # + # @param referral_link [String] The caller's referral link — businesses that sign up through it are attributed t + # + # @param whop_partner_enabled_at [Time] When the caller became a Whop partner. + end + end + end +end diff --git a/lib/whop_sdk/models/refund_created_webhook_event.rb b/lib/whop_sdk/models/refund_created_webhook_event.rb index 0ede905e..37e2a31d 100644 --- a/lib/whop_sdk/models/refund_created_webhook_event.rb +++ b/lib/whop_sdk/models/refund_created_webhook_event.rb @@ -397,7 +397,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -423,8 +424,9 @@ class Product < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -438,7 +440,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members end # @see WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment#user diff --git a/lib/whop_sdk/models/refund_retrieve_response.rb b/lib/whop_sdk/models/refund_retrieve_response.rb index 5ce368dc..5c1f60c1 100644 --- a/lib/whop_sdk/models/refund_retrieve_response.rb +++ b/lib/whop_sdk/models/refund_retrieve_response.rb @@ -339,7 +339,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -364,8 +365,9 @@ class Product < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -378,7 +380,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members end # @see WhopSDK::Models::RefundRetrieveResponse::Payment#user diff --git a/lib/whop_sdk/models/refund_updated_webhook_event.rb b/lib/whop_sdk/models/refund_updated_webhook_event.rb index a94be60e..9c0306a9 100644 --- a/lib/whop_sdk/models/refund_updated_webhook_event.rb +++ b/lib/whop_sdk/models/refund_updated_webhook_event.rb @@ -397,7 +397,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -423,8 +424,9 @@ class Product < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute metadata - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -438,7 +440,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the product. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product. Included in webhook payloads for p + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the product and included in payment and members end # @see WhopSDK::Models::RefundUpdatedWebhookEvent::Data::Payment#user diff --git a/lib/whop_sdk/models/result_label_keys.rb b/lib/whop_sdk/models/result_label_keys.rb index c43f5e02..86991281 100644 --- a/lib/whop_sdk/models/result_label_keys.rb +++ b/lib/whop_sdk/models/result_label_keys.rb @@ -27,8 +27,18 @@ module ResultLabelKeys REGISTRATIONS = :registrations CONTENT_VIEWS = :content_views SEARCHES = :searches + ADDS_TO_CART = :adds_to_cart + ADDS_TO_WISHLIST = :adds_to_wishlist + ADDS_OF_PAYMENT_INFO = :adds_of_payment_info + CHECKOUTS_INITIATED = :checkouts_initiated WEBSITE_SCHEDULES = :website_schedules WEBSITE_SUBMIT_APPLICATIONS = :website_submit_applications + WEBSITE_TRIALS_STARTED = :website_trials_started + WEBSITE_SUBSCRIPTIONS = :website_subscriptions + WEBSITE_CONTACTS = :website_contacts + WEBSITE_DONATIONS = :website_donations + WEBSITE_FIND_LOCATIONS = :website_find_locations + WEBSITE_PRODUCT_CUSTOMIZATIONS = :website_product_customizations CUSTOM = :custom # @!method self.values diff --git a/lib/whop_sdk/models/review_list_response.rb b/lib/whop_sdk/models/review_list_response.rb index 677fac34..70eaf941 100644 --- a/lib/whop_sdk/models/review_list_response.rb +++ b/lib/whop_sdk/models/review_list_response.rb @@ -123,7 +123,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -149,7 +149,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # diff --git a/lib/whop_sdk/models/review_retrieve_response.rb b/lib/whop_sdk/models/review_retrieve_response.rb index 2910e6df..3ba4e374 100644 --- a/lib/whop_sdk/models/review_retrieve_response.rb +++ b/lib/whop_sdk/models/review_retrieve_response.rb @@ -139,7 +139,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute content_type - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @return [String, nil] required :content_type, String, nil?: true @@ -165,7 +165,7 @@ class Attachment < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # - # @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. # # @param filename [String, nil] The original filename of the uploaded attachment, including its file extension. # @@ -181,7 +181,7 @@ class Company < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @return [String] required :route, String @@ -193,14 +193,11 @@ class Company < WhopSDK::Internal::Type::BaseModel required :title, String # @!method initialize(id:, route:, title:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::ReviewRetrieveResponse::Company} for more details. - # # The company that this review was written for. # # @param id [String] The unique identifier for the company. # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # @param route [String] URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. # # @param title [String] The display name of the company shown to customers. end diff --git a/lib/whop_sdk/models/setup_intent.rb b/lib/whop_sdk/models/setup_intent.rb index b84170a9..def26d7d 100644 --- a/lib/whop_sdk/models/setup_intent.rb +++ b/lib/whop_sdk/models/setup_intent.rb @@ -64,7 +64,14 @@ class SetupIntent < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::SetupIntentStatus] required :status, enum: -> { WhopSDK::SetupIntentStatus } - # @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:, payment_method:, status:) + # @!attribute three_ds_verified + # Whether 3D Secure authentication was completed when this payment method was set + # up. + # + # @return [Boolean] + required :three_ds_verified, WhopSDK::Internal::Type::Boolean + + # @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:, payment_method:, status:, three_ds_verified:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::SetupIntent} for more details. # @@ -88,6 +95,8 @@ class SetupIntent < WhopSDK::Internal::Type::BaseModel # @param payment_method [WhopSDK::Models::SetupIntent::PaymentMethod, nil] The saved payment method created by this setup intent. Null if the setup has not # # @param status [Symbol, WhopSDK::Models::SetupIntentStatus] The current status of the setup intent. + # + # @param three_ds_verified [Boolean] Whether 3D Secure authentication was completed when this payment method was set # @see WhopSDK::Models::SetupIntent#checkout_configuration class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel diff --git a/lib/whop_sdk/models/social_account.rb b/lib/whop_sdk/models/social_account.rb new file mode 100644 index 00000000..05235b9c --- /dev/null +++ b/lib/whop_sdk/models/social_account.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::SocialAccounts#create + class SocialAccount < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the social account. + # + # @return [String] + required :id, String + + # @!attribute external_id + # The platform-specific ID for this social account. + # + # @return [String, nil] + required :external_id, String, nil?: true + + # @!attribute name + # The display name of the social account on the platform. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute platform + # The platform the social account exists on. + # + # @return [Symbol, WhopSDK::Models::SocialAccount::Platform] + required :platform, enum: -> { WhopSDK::SocialAccount::Platform } + + # @!attribute profile_picture_url + # The URL where the profile picture of the social account can be accessed. + # + # @return [String, nil] + required :profile_picture_url, String, nil?: true + + # @!attribute scopes + # + # @return [Array] + required :scopes, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute url + # The URL where the social account can be accessed on the platform. Null while a + # Whop-owned page is still being provisioned. + # + # @return [String, nil] + required :url, String, nil?: true + + # @!attribute username + # The username of the social account on the platform. Null while a Whop-owned page + # is still being provisioned. + # + # @return [String, nil] + required :username, String, nil?: true + + # @!attribute verified + # Whether the social account is verified on the platform. + # + # @return [Boolean] + required :verified, WhopSDK::Internal::Type::Boolean + + # @!method initialize(id:, external_id:, name:, platform:, profile_picture_url:, scopes:, url:, username:, verified:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccount} for more details. + # + # @param id [String] Unique identifier for the social account. + # + # @param external_id [String, nil] The platform-specific ID for this social account. + # + # @param name [String, nil] The display name of the social account on the platform. + # + # @param platform [Symbol, WhopSDK::Models::SocialAccount::Platform] The platform the social account exists on. + # + # @param profile_picture_url [String, nil] The URL where the profile picture of the social account can be accessed. + # + # @param scopes [Array] + # + # @param url [String, nil] The URL where the social account can be accessed on the platform. Null while a W + # + # @param username [String, nil] The username of the social account on the platform. Null while a Whop-owned page + # + # @param verified [Boolean] Whether the social account is verified on the platform. + + # The platform the social account exists on. + # + # @see WhopSDK::Models::SocialAccount#platform + module Platform + extend WhopSDK::Internal::Type::Enum + + X = :x + INSTAGRAM = :instagram + YOUTUBE = :youtube + TIKTOK = :tiktok + FACEBOOK = :facebook + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/social_account_connect_params.rb b/lib/whop_sdk/models/social_account_connect_params.rb new file mode 100644 index 00000000..c1b939ca --- /dev/null +++ b/lib/whop_sdk/models/social_account_connect_params.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::SocialAccounts#connect + class SocialAccountConnectParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute platform + # The platform to connect the social account on. Today, the supported option is + # `meta_business`. + # + # @return [Symbol, WhopSDK::Models::SocialAccountConnectParams::Platform] + required :platform, enum: -> { WhopSDK::SocialAccountConnectParams::Platform } + + # @!attribute account_id + # The Account (biz\_ identifier) to connect the social account for. An + # account-scoped API key may omit this to default to its own account. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute redirect_url + # The Whop URL to redirect the user to after they finish connecting. + # + # @return [String, nil] + optional :redirect_url, String + + # @!attribute scopes + # Capabilities to grant for the connected social account. Use `advertise` when + # connecting a Meta Business account for ads. + # + # @return [Array, nil] + optional :scopes, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::SocialAccountConnectParams::Scope] } + + # @!method initialize(platform:, account_id: nil, redirect_url: nil, scopes: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountConnectParams} for more details. + # + # @param platform [Symbol, WhopSDK::Models::SocialAccountConnectParams::Platform] The platform to connect the social account on. Today, the supported option is `m + # + # @param account_id [String] The Account (biz\_ identifier) to connect the social account for. An + # account-scop + # + # @param redirect_url [String] The Whop URL to redirect the user to after they finish connecting. + # + # @param scopes [Array] Capabilities to grant for the connected social account. Use `advertise` when con + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The platform to connect the social account on. Today, the supported option is + # `meta_business`. + module Platform + extend WhopSDK::Internal::Type::Enum + + META_BUSINESS = :meta_business + + # @!method self.values + # @return [Array] + end + + module Scope + extend WhopSDK::Internal::Type::Enum + + ADVERTISE = :advertise + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/social_account_connect_response.rb b/lib/whop_sdk/models/social_account_connect_response.rb new file mode 100644 index 00000000..d5acec6c --- /dev/null +++ b/lib/whop_sdk/models/social_account_connect_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::SocialAccounts#connect + class SocialAccountConnectResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute authorize_url + # The OAuth authorization URL to redirect the user to. + # + # @return [String] + required :authorize_url, String + + # @!method initialize(authorize_url:) + # @param authorize_url [String] The OAuth authorization URL to redirect the user to. + end + end +end diff --git a/lib/whop_sdk/models/social_account_create_params.rb b/lib/whop_sdk/models/social_account_create_params.rb new file mode 100644 index 00000000..36f4a17c --- /dev/null +++ b/lib/whop_sdk/models/social_account_create_params.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::SocialAccounts#create + class SocialAccountCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute platform + # The platform to create the social account on. + # + # @return [Symbol, WhopSDK::Models::SocialAccountCreateParams::Platform] + required :platform, enum: -> { WhopSDK::SocialAccountCreateParams::Platform } + + # @!attribute account_id + # The Account (biz\_ identifier) to create the social account for. An + # account-scoped API key may omit this to default to its own account. + # + # @return [String, nil] + optional :account_id, String + + # @!method initialize(platform:, account_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountCreateParams} for more details. + # + # @param platform [Symbol, WhopSDK::Models::SocialAccountCreateParams::Platform] The platform to create the social account on. + # + # @param account_id [String] The Account (biz\_ identifier) to create the social account for. An + # account-scope + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The platform to create the social account on. + module Platform + extend WhopSDK::Internal::Type::Enum + + FACEBOOK = :facebook + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/social_account_delete_params.rb b/lib/whop_sdk/models/social_account_delete_params.rb new file mode 100644 index 00000000..6afc5578 --- /dev/null +++ b/lib/whop_sdk/models/social_account_delete_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::SocialAccounts#delete + class SocialAccountDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account_id + # The Account that the social account is connected to. Provide either this or + # user_id. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute user_id + # The User that the social account is connected to. Provide either this or + # account_id. + # + # @return [String, nil] + optional :user_id, String + + # @!method initialize(id:, account_id: nil, user_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountDeleteParams} for more details. + # + # @param id [String] + # + # @param account_id [String] The Account that the social account is connected to. Provide either this or user + # + # @param user_id [String] The User that the social account is connected to. Provide either this or account + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/social_account_delete_response.rb b/lib/whop_sdk/models/social_account_delete_response.rb new file mode 100644 index 00000000..9058b1b3 --- /dev/null +++ b/lib/whop_sdk/models/social_account_delete_response.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @type [WhopSDK::Internal::Type::Converter] + SocialAccountDeleteResponse = WhopSDK::Internal::Type::Boolean + end +end diff --git a/lib/whop_sdk/models/social_account_list_params.rb b/lib/whop_sdk/models/social_account_list_params.rb new file mode 100644 index 00000000..83bb5fcf --- /dev/null +++ b/lib/whop_sdk/models/social_account_list_params.rb @@ -0,0 +1,152 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::SocialAccounts#list + class SocialAccountListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # The Account that the social accounts are connected to. Provide either this or + # user_id. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute after + # Cursor to fetch the page after (from page_info.end_cursor). + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # Cursor to fetch the page before (from page_info.start_cursor). + # + # @return [String, nil] + optional :before, String + + # @!attribute direction + # Sort direction. + # + # @return [Symbol, WhopSDK::Models::SocialAccountListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::SocialAccountListParams::Direction } + + # @!attribute first + # The number of social accounts to return. + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute last + # The number of social accounts to return from the end of the range. + # + # @return [Integer, nil] + optional :last, Integer + + # @!attribute order + # The field to sort social accounts by. + # + # @return [Symbol, WhopSDK::Models::SocialAccountListParams::Order, nil] + optional :order, enum: -> { WhopSDK::SocialAccountListParams::Order } + + # @!attribute platform + # Only return social accounts for the platform that is specified. + # + # @return [Symbol, WhopSDK::Models::SocialAccountListParams::Platform, nil] + optional :platform, enum: -> { WhopSDK::SocialAccountListParams::Platform } + + # @!attribute scopes + # Only return social accounts that have these scopes. + # + # @return [Array, nil] + optional :scopes, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::SocialAccountListParams::Scope] } + + # @!attribute user_id + # The User that the social accounts are connected to. Provide either this or + # account_id. + # + # @return [String, nil] + optional :user_id, String + + # @!attribute verified + # Only return social accounts that are verified on the platform. + # + # @return [Boolean, nil] + optional :verified, WhopSDK::Internal::Type::Boolean + + # @!method initialize(account_id: nil, after: nil, before: nil, direction: nil, first: nil, last: nil, order: nil, platform: nil, scopes: nil, user_id: nil, verified: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountListParams} for more details. + # + # @param account_id [String] The Account that the social accounts are connected to. Provide either this or us + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param direction [Symbol, WhopSDK::Models::SocialAccountListParams::Direction] Sort direction. + # + # @param first [Integer] The number of social accounts to return. + # + # @param last [Integer] The number of social accounts to return from the end of the range. + # + # @param order [Symbol, WhopSDK::Models::SocialAccountListParams::Order] The field to sort social accounts by. + # + # @param platform [Symbol, WhopSDK::Models::SocialAccountListParams::Platform] Only return social accounts for the platform that is specified. + # + # @param scopes [Array] Only return social accounts that have these scopes. + # + # @param user_id [String] The User that the social accounts are connected to. Provide either this or accou + # + # @param verified [Boolean] Only return social accounts that are verified on the platform. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # The field to sort social accounts by. + module Order + extend WhopSDK::Internal::Type::Enum + + DISPLAY_ORDER = :display_order + CREATED_AT = :created_at + + # @!method self.values + # @return [Array] + end + + # Only return social accounts for the platform that is specified. + module Platform + extend WhopSDK::Internal::Type::Enum + + X = :x + INSTAGRAM = :instagram + YOUTUBE = :youtube + TIKTOK = :tiktok + FACEBOOK = :facebook + + # @!method self.values + # @return [Array] + end + + module Scope + extend WhopSDK::Internal::Type::Enum + + ADVERTISE = :advertise + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/social_account_post.rb b/lib/whop_sdk/models/social_account_post.rb new file mode 100644 index 00000000..427ac037 --- /dev/null +++ b/lib/whop_sdk/models/social_account_post.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class SocialAccountPost < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The platform's own identifier for the post or media. Use it to reference the + # post on an ad. + # + # @return [String] + required :id, String + + # @!attribute call_to_action + # The post's call-to-action button, for example shop_now (Facebook only; null for + # Instagram). + # + # @return [Symbol, WhopSDK::Models::SocialAccountPost::CallToAction, nil] + required :call_to_action, enum: -> { WhopSDK::SocialAccountPost::CallToAction }, nil?: true + + # @!attribute destination_url + # The URL the post's call-to-action drives to (Facebook only; null for Instagram). + # + # @return [String, nil] + required :destination_url, String, nil?: true + + # @!attribute media_url + # The URL of the post's media — the image for image posts, the playable video file + # for video posts. Meta signs these and they expire after roughly 24 hours, so + # don't store them. + # + # @return [String, nil] + required :media_url, String, nil?: true + + # @!attribute thumbnail_url + # Poster image for video posts; null for image posts, where media_url is already + # the image. Signed and short-lived like media_url. + # + # @return [String, nil] + required :thumbnail_url, String, nil?: true + + # @!method initialize(id:, call_to_action:, destination_url:, media_url:, thumbnail_url:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountPost} for more details. + # + # @param id [String] The platform's own identifier for the post or media. Use it to reference the pos + # + # @param call_to_action [Symbol, WhopSDK::Models::SocialAccountPost::CallToAction, nil] The post's call-to-action button, for example shop_now (Facebook only; null for + # + # @param destination_url [String, nil] The URL the post's call-to-action drives to (Facebook only; null for Instagram). + # + # @param media_url [String, nil] The URL of the post's media — the image for image posts, the playable video file + # + # @param thumbnail_url [String, nil] Poster image for video posts; null for image posts, where media_url is already t + + # The post's call-to-action button, for example shop_now (Facebook only; null for + # Instagram). + # + # @see WhopSDK::Models::SocialAccountPost#call_to_action + module CallToAction + extend WhopSDK::Internal::Type::Enum + + LEARN_MORE = :learn_more + SHOP_NOW = :shop_now + SIGN_UP = :sign_up + SUBSCRIBE = :subscribe + GET_STARTED = :get_started + BOOK_NOW = :book_now + APPLY_NOW = :apply_now + CONTACT_US = :contact_us + DOWNLOAD = :download + ORDER_NOW = :order_now + BUY_NOW = :buy_now + GET_QUOTE = :get_quote + MESSAGE_PAGE = :message_page + WHATSAPP_MESSAGE = :whatsapp_message + INSTAGRAM_MESSAGE = :instagram_message + CALL_NOW = :call_now + GET_DIRECTIONS = :get_directions + SEND_UPDATES = :send_updates + GET_OFFER = :get_offer + WATCH_MORE = :watch_more + LISTEN_NOW = :listen_now + PLAY_GAME = :play_game + OPEN_LINK = :open_link + NO_BUTTON = :no_button + GET_OFFER_VIEW = :get_offer_view + GET_EVENT_TICKETS = :get_event_tickets + SEE_MENU = :see_menu + REQUEST_TIME = :request_time + EVENT_RSVP = :event_rsvp + SEE_DETAILS = :see_details + VIEW_INSTAGRAM_PROFILE = :view_instagram_profile + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/social_account_posts_params.rb b/lib/whop_sdk/models/social_account_posts_params.rb new file mode 100644 index 00000000..4ba29882 --- /dev/null +++ b/lib/whop_sdk/models/social_account_posts_params.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::SocialAccounts#posts + class SocialAccountPostsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account_id + # The Account (a biz\_ identifier) the social account is connected to. + # + # @return [String] + required :account_id, String + + # @!attribute after + # Cursor to fetch the page after (from page_info.end_cursor). + # + # @return [String, nil] + optional :after, String + + # @!attribute first + # The number of posts to return. + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute post_id + # Return only the single post with this platform id, instead of the full list. + # + # @return [String, nil] + optional :post_id, String + + # @!method initialize(id:, account_id:, after: nil, first: nil, post_id: nil, request_options: {}) + # @param id [String] + # + # @param account_id [String] The Account (a biz\_ identifier) the social account is connected to. + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param first [Integer] The number of posts to return. + # + # @param post_id [String] Return only the single post with this platform id, instead of the full list. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/social_account_posts_response.rb b/lib/whop_sdk/models/social_account_posts_response.rb new file mode 100644 index 00000000..421a782a --- /dev/null +++ b/lib/whop_sdk/models/social_account_posts_response.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::SocialAccounts#posts + class SocialAccountPostsResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::SocialAccountPost] } + + # @!attribute page_info + # + # @return [WhopSDK::Models::SocialAccountPostsResponse::PageInfo] + required :page_info, -> { WhopSDK::Models::SocialAccountPostsResponse::PageInfo } + + # @!method initialize(data:, page_info:) + # @param data [Array] + # @param page_info [WhopSDK::Models::SocialAccountPostsResponse::PageInfo] + + # @see WhopSDK::Models::SocialAccountPostsResponse#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 + + # @!method initialize(end_cursor:, has_next_page:) + # @param end_cursor [String, nil] + # @param has_next_page [Boolean] + end + end + end +end diff --git a/lib/whop_sdk/models/wallet_list_params.rb b/lib/whop_sdk/models/stat_list_params.rb similarity index 75% rename from lib/whop_sdk/models/wallet_list_params.rb rename to lib/whop_sdk/models/stat_list_params.rb index b2242f56..1e96d199 100644 --- a/lib/whop_sdk/models/wallet_list_params.rb +++ b/lib/whop_sdk/models/stat_list_params.rb @@ -2,8 +2,8 @@ module WhopSDK module Models - # @see WhopSDK::Resources::Wallets#list - class WalletListParams < WhopSDK::Internal::Type::BaseModel + # @see WhopSDK::Resources::Stats#list + class StatListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters diff --git a/lib/whop_sdk/models/stat_list_response.rb b/lib/whop_sdk/models/stat_list_response.rb new file mode 100644 index 00000000..d1b155c7 --- /dev/null +++ b/lib/whop_sdk/models/stat_list_response.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Stats#list + class StatListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # The available metrics. + # + # @return [Array] + required :data, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::StatListResponse::Data] } + + # @!method initialize(data:) + # @param data [Array] The available metrics. + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute description + # A short description of what the metric measures. + # + # @return [String] + required :description, String + + # @!attribute key + # The metric's key. Pass it to GET /stats/{metric} to query its values. + # + # @return [String] + required :key, String + + # @!attribute name + # Human-readable display name for the metric. + # + # @return [String] + required :name, String + + # @!attribute properties + # The properties you can use with this metric — pass one as a filter + # (property=value) to narrow the series, or as breakdown_by=property to split it. + # + # @return [Array] + required :properties, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute unit + # How to read the metric's values: count is an integer, currency is a decimal + # amount, and percent is a number where 1.6 means 1.6%. + # + # @return [Symbol, WhopSDK::Models::StatListResponse::Data::Unit] + required :unit, enum: -> { WhopSDK::Models::StatListResponse::Data::Unit } + + # @!attribute windows + # Snapshot metrics only: the trailing windows you can pass as snapshot_window, for + # example 30d. Absent on live metrics, which use from/to instead. + # + # @return [Array, nil] + optional :windows, WhopSDK::Internal::Type::ArrayOf[String] + + # @!method initialize(description:, key:, name:, properties:, unit:, windows: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::StatListResponse::Data} for more details. + # + # @param description [String] A short description of what the metric measures. + # + # @param key [String] The metric's key. Pass it to GET /stats/{metric} to query its values. + # + # @param name [String] Human-readable display name for the metric. + # + # @param properties [Array] The properties you can use with this metric — pass one as a filter (property=val + # + # @param unit [Symbol, WhopSDK::Models::StatListResponse::Data::Unit] How to read the metric's values: count is an integer, currency is a decimal amou + # + # @param windows [Array] Snapshot metrics only: the trailing windows you can pass as snapshot_window, for + + # How to read the metric's values: count is an integer, currency is a decimal + # amount, and percent is a number where 1.6 means 1.6%. + # + # @see WhopSDK::Models::StatListResponse::Data#unit + module Unit + extend WhopSDK::Internal::Type::Enum + + COUNT = :count + CURRENCY = :currency + PERCENT = :percent + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/stat_retrieve_params.rb b/lib/whop_sdk/models/stat_retrieve_params.rb new file mode 100644 index 00000000..71865b59 --- /dev/null +++ b/lib/whop_sdk/models/stat_retrieve_params.rb @@ -0,0 +1,265 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Stats#retrieve + class StatRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute metric + # + # @return [String] + required :metric, String + + # @!attribute from + # Start of the date range (YYYY-MM-DD). + # + # @return [Date] + required :from, Date + + # @!attribute to + # End of the date range (YYYY-MM-DD). + # + # @return [Date] + required :to, Date + + # @!attribute access_level + # Filter to a single access level. Pair with breakdown_by=access_level. Available + # on metrics that list access_level. + # + # @return [String, nil] + optional :access_level, String + + # @!attribute account_id + # The account this query concerns, for example biz_AbC123. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute ad_campaign_ids + # Ad campaign ids (adcamp\_...) to scope the report to; stats are summed across + # them. Available on metrics that list ad_campaign_ids. + # + # @return [Array, nil] + optional :ad_campaign_ids, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute ad_group_ids + # Ad group ids (adgrp\_...) to scope the report to; stats are summed across them. + # Available on metrics that list ad_group_ids. + # + # @return [Array, nil] + optional :ad_group_ids, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute ad_ids + # Ad ids (ad\_...) to scope the report to; stats are summed across them. Available + # on metrics that list ad_ids. + # + # @return [Array, nil] + optional :ad_ids, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute breakdown_by + # Split the metric out by one of its properties — each point gets a breakdown + # array. For example breakdown_by=currency returns an entry for usd, an entry for + # eur, and so on. + # + # @return [String, nil] + optional :breakdown_by, String + + # @!attribute card_network + # Filter to a single card brand, for example visa. A refinement of + # payment_method=card. Available on metrics that list card_network. + # + # @return [String, nil] + optional :card_network, String + + # @!attribute category + # Filter to a single balance-activity category, for example payments. Pair with + # breakdown_by=category to split the activity. Available on metrics that list + # category. + # + # @return [String, nil] + optional :category, String + + # @!attribute convert_to + # Display currency for money metrics — every amount is converted into this ISO + # currency using the exchange rate on each period's date. Defaults to usd. For the + # ads metrics (ad_spend, ad_report), pass the account's ads reporting currency to + # match the ad entity endpoints. Ignored when you filter or break down by currency + # (those report the original transaction currency, unconverted). + # + # @return [String, nil] + optional :convert_to, String + + # @!attribute currency + # Filter to transactions made in this original ISO currency, for example eur — + # reported in that currency, not converted. Pair with breakdown_by=currency to + # split a metric by currency. Available on metrics that list currency. + # + # @return [String, nil] + optional :currency, String + + # @!attribute fee_type + # Filter to a single fee type. Pair with breakdown_by=fee_type to split fees by + # type. Available on metrics that list fee_type. + # + # @return [String, nil] + optional :fee_type, String + + # @!attribute interval + # How wide each point is. Defaults to day. Snapshot metrics are day-only. + # + # @return [Symbol, WhopSDK::Models::StatRetrieveParams::Interval, nil] + optional :interval, enum: -> { WhopSDK::StatRetrieveParams::Interval } + + # @!attribute most_recent_action + # Filter to a single most-recent member action. Pair with + # breakdown_by=most_recent_action. Available on metrics that list + # most_recent_action. + # + # @return [String, nil] + optional :most_recent_action, String + + # @!attribute payment_method + # Filter to a single payment method, for example card or crypto. Available on + # metrics that list payment_method. + # + # @return [String, nil] + optional :payment_method, String + + # @!attribute product + # Filter to a single product (access pass id), for example prod_AbC123. Pair with + # breakdown_by=product. Available on metrics that list product. + # + # @return [String, nil] + optional :product, String + + # @!attribute referred_user_id + # Filter a referral metric to the businesses attributed to one person you + # referred, for example user_AbC123. Available on metrics that list + # referred_user_id. + # + # @return [String, nil] + optional :referred_user_id, String + + # @!attribute segment + # Filter to a single wallet-balance segment, for example available. Pair with + # breakdown_by=segment to split the balance. Available on metrics that list + # segment. + # + # @return [String, nil] + optional :segment, String + + # @!attribute snapshot_window + # Trailing window for snapshot metrics. Only accepted by snapshot metrics (each + # lists its allowed windows in the catalog); defaults to the metric's first + # supported window. Only 30d today. + # + # @return [Symbol, WhopSDK::Models::StatRetrieveParams::SnapshotWindow, nil] + optional :snapshot_window, enum: -> { WhopSDK::StatRetrieveParams::SnapshotWindow } + + # @!attribute source + # Filter to a single GMV source, for example payments. Pair with + # breakdown_by=source to split by source. Available on metrics that list source. + # + # @return [String, nil] + optional :source, String + + # @!attribute status + # Filter to a single membership status. Pair with breakdown_by=status. Available + # on metrics that list status. + # + # @return [String, nil] + optional :status, String + + # @!attribute time_zone + # IANA time zone to bucket the series in, for example America/New_York. Defaults + # to UTC. Not accepted by snapshot metrics, which are UTC only. + # + # @return [String, nil] + optional :time_zone, String + + # @!method initialize(metric:, from:, to:, access_level: nil, account_id: nil, ad_campaign_ids: nil, ad_group_ids: nil, ad_ids: nil, breakdown_by: nil, card_network: nil, category: nil, convert_to: nil, currency: nil, fee_type: nil, interval: nil, most_recent_action: nil, payment_method: nil, product: nil, referred_user_id: nil, segment: nil, snapshot_window: nil, source: nil, status: nil, time_zone: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::StatRetrieveParams} for more details. + # + # @param metric [String] + # + # @param from [Date] Start of the date range (YYYY-MM-DD). + # + # @param to [Date] End of the date range (YYYY-MM-DD). + # + # @param access_level [String] Filter to a single access level. Pair with breakdown_by=access_level. Available + # + # @param account_id [String] The account this query concerns, for example biz_AbC123. + # + # @param ad_campaign_ids [Array] Ad campaign ids (adcamp\_...) to scope the report to; stats are summed across + # the + # + # @param ad_group_ids [Array] Ad group ids (adgrp\_...) to scope the report to; stats are summed across them. + # A + # + # @param ad_ids [Array] Ad ids (ad\_...) to scope the report to; stats are summed across them. Available + # + # @param breakdown_by [String] Split the metric out by one of its properties — each point gets a breakdown arra + # + # @param card_network [String] Filter to a single card brand, for example visa. A refinement of payment_method= + # + # @param category [String] Filter to a single balance-activity category, for example payments. Pair with br + # + # @param convert_to [String] Display currency for money metrics — every amount is converted into this ISO cur + # + # @param currency [String] Filter to transactions made in this original ISO currency, for example eur — rep + # + # @param fee_type [String] Filter to a single fee type. Pair with breakdown_by=fee_type to split fees by ty + # + # @param interval [Symbol, WhopSDK::Models::StatRetrieveParams::Interval] How wide each point is. Defaults to day. Snapshot metrics are day-only. + # + # @param most_recent_action [String] Filter to a single most-recent member action. Pair with breakdown_by=most_recent + # + # @param payment_method [String] Filter to a single payment method, for example card or crypto. Available on metr + # + # @param product [String] Filter to a single product (access pass id), for example prod_AbC123. Pair with + # + # @param referred_user_id [String] Filter a referral metric to the businesses attributed to one person you referred + # + # @param segment [String] Filter to a single wallet-balance segment, for example available. Pair with brea + # + # @param snapshot_window [Symbol, WhopSDK::Models::StatRetrieveParams::SnapshotWindow] Trailing window for snapshot metrics. Only accepted by snapshot metrics (each li + # + # @param source [String] Filter to a single GMV source, for example payments. Pair with breakdown_by=sour + # + # @param status [String] Filter to a single membership status. Pair with breakdown_by=status. Available o + # + # @param time_zone [String] IANA time zone to bucket the series in, for example America/New_York. Defaults t + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # How wide each point is. Defaults to day. Snapshot metrics are day-only. + module Interval + extend WhopSDK::Internal::Type::Enum + + HOUR = :hour + DAY = :day + WEEK = :week + MONTH = :month + YEAR = :year + + # @!method self.values + # @return [Array] + end + + # Trailing window for snapshot metrics. Only accepted by snapshot metrics (each + # lists its allowed windows in the catalog); defaults to the metric's first + # supported window. Only 30d today. + module SnapshotWindow + extend WhopSDK::Internal::Type::Enum + + SNAPSHOT_WINDOW_30D = :"30d" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/stat_retrieve_response.rb b/lib/whop_sdk/models/stat_retrieve_response.rb new file mode 100644 index 00000000..1574392f --- /dev/null +++ b/lib/whop_sdk/models/stat_retrieve_response.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Stats#retrieve + class StatRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [WhopSDK::Models::StatRetrieveResponse::Data] + required :data, -> { WhopSDK::Models::StatRetrieveResponse::Data } + + # @!method initialize(data:) + # @param data [WhopSDK::Models::StatRetrieveResponse::Data] + + # @see WhopSDK::Models::StatRetrieveResponse#data + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute points + # One entry per period, oldest first. + # + # @return [Array] + required :points, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::StatRetrieveResponse::Data::Point] } + + # @!attribute currency + # ISO currency the values are denominated in. Present for currency-unit metrics: + # the convert_to currency, or usd. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!method initialize(points:, currency: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::StatRetrieveResponse::Data} for more details. + # + # @param points [Array] One entry per period, oldest first. + # + # @param currency [String, nil] ISO currency the values are denominated in. Present for currency-unit metrics: t + + class Point < WhopSDK::Internal::Type::BaseModel + # @!attribute timestamp + # Unix timestamp (seconds) of the period start. + # + # @return [Integer] + required :timestamp, Integer + + # @!attribute value + # The metric's value for this period, in the metric's unit. + # + # @return [Float, nil] + required :value, Float, nil?: true + + # @!attribute breakdown + # Present only when broken down: one entry per property value in this period. + # + # @return [Array, nil] + optional :breakdown, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown] } + + # @!method initialize(timestamp:, value:, breakdown: nil) + # @param timestamp [Integer] Unix timestamp (seconds) of the period start. + # + # @param value [Float, nil] The metric's value for this period, in the metric's unit. + # + # @param breakdown [Array] Present only when broken down: one entry per property value in this period. + + class Breakdown < WhopSDK::Internal::Type::BaseModel + # @!attribute name + # The property value, for example usd or visa. + # + # @return [String] + required :name, String + + # @!attribute value + # The metric's value for this entry. + # + # @return [Float, nil] + required :value, Float, nil?: true + + # @!method initialize(name:, value:) + # @param name [String] The property value, for example usd or visa. + # + # @param value [Float, nil] The metric's value for this entry. + end + end + 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 df65c8bb..af9096bb 100644 --- a/lib/whop_sdk/models/swap_create_params.rb +++ b/lib/whop_sdk/models/swap_create_params.rb @@ -14,55 +14,65 @@ class SwapCreateParams < WhopSDK::Internal::Type::BaseModel required :account_id, String # @!attribute amount - # Input token amount. + # Source token amount. # # @return [String] required :amount, String # @!attribute from_token - # Source token contract address. + # Source token contract address or ticker symbol, such as "USDT". # # @return [String] required :from_token, String # @!attribute to_token - # Destination token contract address. + # Destination token contract address or ticker symbol, such as "XAUT". # # @return [String] required :to_token, String # @!attribute from_chain + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. # # @return [String, Integer, nil] optional :from_chain, union: -> { WhopSDK::SwapCreateParams::FromChain }, nil?: true # @!attribute slippage_bps + # Maximum slippage tolerance in basis points. # # @return [Integer, nil] optional :slippage_bps, Integer, nil?: true # @!attribute to_chain + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. # # @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: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SwapCreateParams} for more details. + # # @param account_id [String] Business or user account ID (biz*\* / user*\*). # - # @param amount [String] Input token amount. + # @param amount [String] Source token amount. # - # @param from_token [String] Source token contract address. + # @param from_token [String] Source token contract address or ticker symbol, such as "USDT". # - # @param to_token [String] Destination token contract address. + # @param to_token [String] Destination token contract address or ticker symbol, such as "XAUT". # - # @param from_chain [String, Integer, nil] + # @param from_chain [String, Integer, nil] Source chain name or chain ID. Defaults to the source token's chain when omitted # - # @param slippage_bps [Integer, nil] + # @param slippage_bps [Integer, nil] Maximum slippage tolerance in basis points. # - # @param to_chain [String, Integer, nil] + # @param to_chain [String, Integer, nil] Destination chain name or chain ID. Defaults to the destination token's chain wh # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. module FromChain extend WhopSDK::Internal::Type::Union @@ -74,6 +84,8 @@ module FromChain # @return [Array(String, Integer)] end + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. module ToChain extend WhopSDK::Internal::Type::Union diff --git a/lib/whop_sdk/models/swap_create_quote_params.rb b/lib/whop_sdk/models/swap_create_quote_params.rb index 82f002dd..4b916039 100644 --- a/lib/whop_sdk/models/swap_create_quote_params.rb +++ b/lib/whop_sdk/models/swap_create_quote_params.rb @@ -8,74 +8,87 @@ class SwapCreateQuoteParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute amount - # Input token amount. + # Source token amount. # # @return [String] required :amount, String # @!attribute from_token - # Source token contract address. + # Source token contract address or ticker symbol, such as "USDT". # # @return [String] required :from_token, String # @!attribute to_token - # Destination token contract address. + # Destination token contract address or ticker symbol, such as "XAUT". # # @return [String] required :to_token, String # @!attribute from_address + # Source wallet address used for the quote. # # @return [String, nil] optional :from_address, String, nil?: true # @!attribute from_chain + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. # # @return [String, Integer, nil] optional :from_chain, union: -> { WhopSDK::SwapCreateQuoteParams::FromChain }, nil?: true # @!attribute metadata + # Metadata to include with the quote response. # # @return [Hash{Symbol=>Object}, nil] optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] # @!attribute slippage_bps + # Maximum slippage tolerance in basis points. # # @return [Integer, nil] optional :slippage_bps, Integer, nil?: true # @!attribute to_address + # Destination wallet address used for the quote. # # @return [String, nil] optional :to_address, String, nil?: true # @!attribute to_chain + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. # # @return [String, Integer, nil] optional :to_chain, union: -> { WhopSDK::SwapCreateQuoteParams::ToChain }, nil?: true # @!method initialize(amount:, from_token:, to_token:, from_address: nil, from_chain: nil, metadata: nil, slippage_bps: nil, to_address: nil, to_chain: nil, request_options: {}) - # @param amount [String] Input token amount. + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SwapCreateQuoteParams} for more details. # - # @param from_token [String] Source token contract address. + # @param amount [String] Source token amount. # - # @param to_token [String] Destination token contract address. + # @param from_token [String] Source token contract address or ticker symbol, such as "USDT". # - # @param from_address [String, nil] + # @param to_token [String] Destination token contract address or ticker symbol, such as "XAUT". # - # @param from_chain [String, Integer, nil] + # @param from_address [String, nil] Source wallet address used for the quote. # - # @param metadata [Hash{Symbol=>Object}] + # @param from_chain [String, Integer, nil] Source chain name or chain ID. Defaults to the source token's chain when omitted # - # @param slippage_bps [Integer, nil] + # @param metadata [Hash{Symbol=>Object}] Metadata to include with the quote response. # - # @param to_address [String, nil] + # @param slippage_bps [Integer, nil] Maximum slippage tolerance in basis points. # - # @param to_chain [String, Integer, nil] + # @param to_address [String, nil] Destination wallet address used for the quote. + # + # @param to_chain [String, Integer, nil] Destination chain name or chain ID. Defaults to the destination token's chain wh # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. module FromChain extend WhopSDK::Internal::Type::Union @@ -87,6 +100,8 @@ module FromChain # @return [Array(String, Integer)] end + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. module ToChain extend WhopSDK::Internal::Type::Union diff --git a/lib/whop_sdk/models/swap_create_quote_response.rb b/lib/whop_sdk/models/swap_create_quote_response.rb index 8ee17dab..4194eb4e 100644 --- a/lib/whop_sdk/models/swap_create_quote_response.rb +++ b/lib/whop_sdk/models/swap_create_quote_response.rb @@ -5,26 +5,31 @@ module Models # @see WhopSDK::Resources::Swaps#create_quote class SwapCreateQuoteResponse < WhopSDK::Internal::Type::BaseModel # @!attribute amount_in + # Source token amount used for the quote. # # @return [String] required :amount_in, String # @!attribute amount_out + # Estimated destination token amount. # # @return [String] required :amount_out, String # @!attribute fee_bps + # Whop fee in basis points. # # @return [Integer] required :fee_bps, Integer # @!attribute from_token + # Resolved source token details. # # @return [Hash{Symbol=>Object}] required :from_token, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] # @!attribute metadata + # Metadata from the request. # # @return [Hash{Symbol=>Object}] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] @@ -35,60 +40,81 @@ class SwapCreateQuoteResponse < WhopSDK::Internal::Type::BaseModel required :object, enum: -> { WhopSDK::Models::SwapCreateQuoteResponse::Object } # @!attribute rate + # Quoted exchange rate. # # @return [String] required :rate, String # @!attribute to_token + # Resolved destination token details. # # @return [Hash{Symbol=>Object}] required :to_token, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] # @!attribute amount_out_min + # Minimum destination amount after slippage. # # @return [String, nil] optional :amount_out_min, String # @!attribute bridge_fee + # Estimated bridge fee for cross-chain swaps. # # @return [String, nil] optional :bridge_fee, String, nil?: true # @!attribute estimated_duration_seconds + # Estimated time for the swap to complete. # # @return [Integer, nil] optional :estimated_duration_seconds, Integer, nil?: true # @!attribute from_address + # Source wallet address used for the quote. # # @return [String, nil] optional :from_address, String, nil?: true # @!attribute requires_token_approval + # Whether the source token needs approval before swapping. # # @return [Boolean, nil] optional :requires_token_approval, WhopSDK::Internal::Type::Boolean, nil?: true # @!attribute to_address + # Destination wallet address used for the quote. # # @return [String, nil] optional :to_address, String, nil?: true # @!method initialize(amount_in:, amount_out:, fee_bps:, from_token:, metadata:, object:, rate:, to_token:, amount_out_min: nil, bridge_fee: nil, estimated_duration_seconds: nil, from_address: nil, requires_token_approval: nil, to_address: nil) - # @param amount_in [String] - # @param amount_out [String] - # @param fee_bps [Integer] - # @param from_token [Hash{Symbol=>Object}] - # @param metadata [Hash{Symbol=>Object}] + # @param amount_in [String] Source token amount used for the quote. + # + # @param amount_out [String] Estimated destination token amount. + # + # @param fee_bps [Integer] Whop fee in basis points. + # + # @param from_token [Hash{Symbol=>Object}] Resolved source token details. + # + # @param metadata [Hash{Symbol=>Object}] Metadata from the request. + # # @param object [Symbol, WhopSDK::Models::SwapCreateQuoteResponse::Object] - # @param rate [String] - # @param to_token [Hash{Symbol=>Object}] - # @param amount_out_min [String] - # @param bridge_fee [String, nil] - # @param estimated_duration_seconds [Integer, nil] - # @param from_address [String, nil] - # @param requires_token_approval [Boolean, nil] - # @param to_address [String, nil] + # + # @param rate [String] Quoted exchange rate. + # + # @param to_token [Hash{Symbol=>Object}] Resolved destination token details. + # + # @param amount_out_min [String] Minimum destination amount after slippage. + # + # @param bridge_fee [String, nil] Estimated bridge fee for cross-chain swaps. + # + # @param estimated_duration_seconds [Integer, nil] Estimated time for the swap to complete. + # + # @param from_address [String, nil] Source wallet address used for the quote. + # + # @param requires_token_approval [Boolean, nil] Whether the source token needs approval before swapping. + # + # @param to_address [String, nil] Destination wallet address used for the quote. # @see WhopSDK::Models::SwapCreateQuoteResponse#object module Object diff --git a/lib/whop_sdk/models/swap_create_response.rb b/lib/whop_sdk/models/swap_create_response.rb index a5d792d2..5a4deaec 100644 --- a/lib/whop_sdk/models/swap_create_response.rb +++ b/lib/whop_sdk/models/swap_create_response.rb @@ -4,7 +4,14 @@ module WhopSDK module Models # @see WhopSDK::Resources::Swaps#create class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Swap ID. Poll `GET /swaps/:id` for status. + # + # @return [String] + required :id, String + # @!attribute account_id + # Account ID that owns the wallet used for the swap. # # @return [String] required :account_id, String @@ -15,38 +22,51 @@ class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel required :object, enum: -> { WhopSDK::Models::SwapCreateResponse::Object } # @!attribute status + # Initial swap status. # # @return [String] required :status, String # @!attribute amount_out_expected + # Expected destination token amount. # # @return [String, nil] optional :amount_out_expected, String # @!attribute amount_out_min + # Minimum destination amount after slippage. # # @return [String, nil] optional :amount_out_min, String # @!attribute rate + # Quoted exchange rate used to create the swap. # # @return [String, nil] optional :rate, String # @!attribute to_chain + # Destination chain for the swap. # # @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] + # @!method initialize(id:, account_id:, object:, status:, amount_out_expected: nil, amount_out_min: nil, rate: nil, to_chain: nil) + # @param id [String] Swap ID. Poll `GET /swaps/:id` for status. + # + # @param account_id [String] Account ID that owns the wallet used for the swap. + # # @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] + # + # @param status [String] Initial swap status. + # + # @param amount_out_expected [String] Expected destination token amount. + # + # @param amount_out_min [String] Minimum destination amount after slippage. + # + # @param rate [String] Quoted exchange rate used to create the swap. + # + # @param to_chain [String] Destination chain for the swap. # @see WhopSDK::Models::SwapCreateResponse#object module Object diff --git a/lib/whop_sdk/models/swap_list_params.rb b/lib/whop_sdk/models/swap_list_params.rb new file mode 100644 index 00000000..490ea107 --- /dev/null +++ b/lib/whop_sdk/models/swap_list_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#list + class SwapListParams < 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 + + # @!method initialize(account_id:, request_options: {}) + # @param account_id [String] Business or user account ID (biz*\* / user*\*). + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/swap_list_response.rb b/lib/whop_sdk/models/swap_list_response.rb new file mode 100644 index 00000000..5487c4bf --- /dev/null +++ b/lib/whop_sdk/models/swap_list_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#list + class SwapListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # Swaps returned for this account. + # + # @return [Array] + required :data, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::SwapListResponse::Data] } + + # @!method initialize(data:) + # @param data [Array] Swaps returned for this account. + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Swap ID. + # + # @return [String] + required :id, String + + # @!attribute account_id + # Account ID that owns the wallet used for the swap. + # + # @return [String] + required :account_id, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::SwapListResponse::Data::Object] + required :object, enum: -> { WhopSDK::Models::SwapListResponse::Data::Object } + + # @!attribute status + # Current swap status. + # + # @return [String] + required :status, String + + # @!attribute tx_hashes + # On-chain transaction hashes produced by the swap. + # + # @return [Array] + required :tx_hashes, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute error + # Latest error returned for a failed swap. + # + # @return [String, nil] + optional :error, String, nil?: true + + # @!method initialize(id:, account_id:, object:, status:, tx_hashes:, error: nil) + # @param id [String] Swap ID. + # + # @param account_id [String] Account ID that owns the wallet used for the swap. + # + # @param object [Symbol, WhopSDK::Models::SwapListResponse::Data::Object] + # + # @param status [String] Current swap status. + # + # @param tx_hashes [Array] On-chain transaction hashes produced by the swap. + # + # @param error [String, nil] Latest error returned for a failed swap. + + # @see WhopSDK::Models::SwapListResponse::Data#object + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP = :swap + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/swap_retrieve_params.rb b/lib/whop_sdk/models/swap_retrieve_params.rb index 1642d38c..c685acb5 100644 --- a/lib/whop_sdk/models/swap_retrieve_params.rb +++ b/lib/whop_sdk/models/swap_retrieve_params.rb @@ -7,15 +7,13 @@ class SwapRetrieveParams < 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*\*). + # @!attribute id # # @return [String] - required :account_id, String + required :id, String - # @!method initialize(account_id:, request_options: {}) - # @param account_id [String] Business or user account ID (biz*\* / user*\*). - # + # @!method initialize(id:, request_options: {}) + # @param id [String] # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/swap_retrieve_response.rb b/lib/whop_sdk/models/swap_retrieve_response.rb index 7f21eda6..8a0512d9 100644 --- a/lib/whop_sdk/models/swap_retrieve_response.rb +++ b/lib/whop_sdk/models/swap_retrieve_response.rb @@ -4,7 +4,14 @@ module WhopSDK module Models # @see WhopSDK::Resources::Swaps#retrieve class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Swap ID. + # + # @return [String] + required :id, String + # @!attribute account_id + # Account ID that owns the wallet used for the swap. # # @return [String] required :account_id, String @@ -15,26 +22,35 @@ class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel required :object, enum: -> { WhopSDK::Models::SwapRetrieveResponse::Object } # @!attribute status + # Current swap status. # # @return [String] required :status, String # @!attribute tx_hashes + # On-chain transaction hashes produced by the swap. # # @return [Array] required :tx_hashes, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute error + # Latest error returned for a failed swap. # # @return [String, nil] optional :error, String, nil?: true - # @!method initialize(account_id:, object:, status:, tx_hashes:, error: nil) - # @param account_id [String] + # @!method initialize(id:, account_id:, object:, status:, tx_hashes:, error: nil) + # @param id [String] Swap ID. + # + # @param account_id [String] Account ID that owns the wallet used for the swap. + # # @param object [Symbol, WhopSDK::Models::SwapRetrieveResponse::Object] - # @param status [String] - # @param tx_hashes [Array] - # @param error [String, nil] + # + # @param status [String] Current swap status. + # + # @param tx_hashes [Array] On-chain transaction hashes produced by the swap. + # + # @param error [String, nil] Latest error returned for a failed swap. # @see WhopSDK::Models::SwapRetrieveResponse#object module Object diff --git a/lib/whop_sdk/models/tax_identifier_type.rb b/lib/whop_sdk/models/tax_identifier_type.rb index e658fd6d..8374afcb 100644 --- a/lib/whop_sdk/models/tax_identifier_type.rb +++ b/lib/whop_sdk/models/tax_identifier_type.rb @@ -9,6 +9,7 @@ module TaxIdentifierType AD_NRT = :ad_nrt AO_TIN = :ao_tin AR_CUIT = :ar_cuit + AL_TIN = :al_tin AM_TIN = :am_tin AW_TIN = :aw_tin AU_ABN = :au_abn @@ -49,6 +50,7 @@ module TaxIdentifierType ET_TIN = :et_tin EU_OSS_VAT = :eu_oss_vat GE_VAT = :ge_vat + GH_TIN = :gh_tin DE_STN = :de_stn GB_VAT = :gb_vat GN_NIF = :gn_nif diff --git a/lib/whop_sdk/models/transfer.rb b/lib/whop_sdk/models/transfer.rb deleted file mode 100644 index 50d96324..00000000 --- a/lib/whop_sdk/models/transfer.rb +++ /dev/null @@ -1,299 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - class Transfer < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the credit transaction transfer. - # - # @return [String] - required :id, String - - # @!attribute amount - # The transfer amount in the currency specified by the currency field. For - # example, 10.43 represents $10.43 USD. - # - # @return [Float] - required :amount, Float - - # @!attribute created_at - # The datetime the credit transaction transfer was created. - # - # @return [Time] - required :created_at, Time - - # @!attribute currency - # The currency in which this transfer amount is denominated. - # - # @return [Symbol, WhopSDK::Models::Currency] - required :currency, enum: -> { WhopSDK::Currency } - - # @!attribute destination - # The entity receiving the transferred funds. - # - # @return [WhopSDK::Models::Transfer::Destination::User, WhopSDK::Models::Transfer::Destination::Company, nil] - required :destination, union: -> { WhopSDK::Transfer::Destination } - - # @!attribute destination_ledger_account_id - # The unique identifier of the ledger account receiving the funds. - # - # @return [String] - required :destination_ledger_account_id, String - - # @!attribute fee_amount - # The flat fee amount deducted from this transfer, in the transfer's currency. - # Null if no flat fee was applied. - # - # @return [Float, nil] - required :fee_amount, Float, nil?: true - - # @!attribute metadata - # Custom key-value pairs attached to this transfer. Maximum 50 keys, 500 - # characters per key, 5000 characters per value. - # - # @return [Hash{Symbol=>Object}, nil] - required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true - - # @!attribute notes - # A free-text note attached to this transfer by the sender. Null if no note was - # provided. - # - # @return [String, nil] - required :notes, String, nil?: true - - # @!attribute origin - # The entity that sent the transferred funds. - # - # @return [WhopSDK::Models::Transfer::Origin::User, WhopSDK::Models::Transfer::Origin::Company, nil] - required :origin, union: -> { WhopSDK::Transfer::Origin } - - # @!attribute origin_ledger_account_id - # The unique identifier of the ledger account that sent the funds. - # - # @return [String] - required :origin_ledger_account_id, String - - # @!method initialize(id:, amount:, created_at:, currency:, destination:, destination_ledger_account_id:, fee_amount:, metadata:, notes:, origin:, origin_ledger_account_id:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Transfer} for more details. - # - # A transfer of credit between two ledger accounts. - # - # @param id [String] The unique identifier for the credit transaction transfer. - # - # @param amount [Float] The transfer amount in the currency specified by the currency field. For example - # - # @param created_at [Time] The datetime the credit transaction transfer was created. - # - # @param currency [Symbol, WhopSDK::Models::Currency] The currency in which this transfer amount is denominated. - # - # @param destination [WhopSDK::Models::Transfer::Destination::User, WhopSDK::Models::Transfer::Destination::Company, nil] The entity receiving the transferred funds. - # - # @param destination_ledger_account_id [String] The unique identifier of the ledger account receiving the funds. - # - # @param fee_amount [Float, nil] The flat fee amount deducted from this transfer, in the transfer's currency. Nul - # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs attached to this transfer. Maximum 50 keys, 500 character - # - # @param notes [String, nil] A free-text note attached to this transfer by the sender. Null if no note was pr - # - # @param origin [WhopSDK::Models::Transfer::Origin::User, WhopSDK::Models::Transfer::Origin::Company, nil] The entity that sent the transferred funds. - # - # @param origin_ledger_account_id [String] The unique identifier of the ledger account that sent the funds. - - # The entity receiving the transferred funds. - # - # @see WhopSDK::Models::Transfer#destination - module Destination - extend WhopSDK::Internal::Type::Union - - discriminator :typename - - # A user account on Whop. Contains profile information, identity details, and social connections. - variant :User, -> { WhopSDK::Transfer::Destination::User } - - # A company is a seller on Whop. Companies own products, manage members, and receive payouts. - variant :Company, -> { WhopSDK::Transfer::Destination::Company } - - class User < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the user. - # - # @return [String] - required :id, String - - # @!attribute name - # The user's display name shown on their public profile. - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute typename - # The typename of this object - # - # @return [Symbol, :User] - required :typename, const: :User - - # @!attribute username - # The user's unique username shown on their public profile. - # - # @return [String] - required :username, String - - # @!method initialize(id:, name:, username:, typename: :User) - # A user account on Whop. Contains profile information, identity details, and - # social connections. - # - # @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. - # - # @param typename [Symbol, :User] The typename of this object - end - - class Company < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the company. - # - # @return [String] - required :id, String - - # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). - # - # @return [String] - required :route, String - - # @!attribute title - # The display name of the company shown to customers. - # - # @return [String] - required :title, String - - # @!attribute typename - # The typename of this object - # - # @return [Symbol, :Company] - required :typename, const: :Company - - # @!method initialize(id:, route:, title:, typename: :Company) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Transfer::Destination::Company} for more details. - # - # A company is a seller on Whop. Companies own products, manage members, and - # receive payouts. - # - # @param id [String] The unique identifier for the company. - # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). - # - # @param title [String] The display name of the company shown to customers. - # - # @param typename [Symbol, :Company] The typename of this object - end - - # @!method self.variants - # @return [Array(WhopSDK::Models::Transfer::Destination::User, WhopSDK::Models::Transfer::Destination::Company)] - end - - # The entity that sent the transferred funds. - # - # @see WhopSDK::Models::Transfer#origin - module Origin - extend WhopSDK::Internal::Type::Union - - discriminator :typename - - # A user account on Whop. Contains profile information, identity details, and social connections. - variant :User, -> { WhopSDK::Transfer::Origin::User } - - # A company is a seller on Whop. Companies own products, manage members, and receive payouts. - variant :Company, -> { WhopSDK::Transfer::Origin::Company } - - class User < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the user. - # - # @return [String] - required :id, String - - # @!attribute name - # The user's display name shown on their public profile. - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute typename - # The typename of this object - # - # @return [Symbol, :User] - required :typename, const: :User - - # @!attribute username - # The user's unique username shown on their public profile. - # - # @return [String] - required :username, String - - # @!method initialize(id:, name:, username:, typename: :User) - # A user account on Whop. Contains profile information, identity details, and - # social connections. - # - # @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. - # - # @param typename [Symbol, :User] The typename of this object - end - - class Company < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the company. - # - # @return [String] - required :id, String - - # @!attribute route - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). - # - # @return [String] - required :route, String - - # @!attribute title - # The display name of the company shown to customers. - # - # @return [String] - required :title, String - - # @!attribute typename - # The typename of this object - # - # @return [Symbol, :Company] - required :typename, const: :Company - - # @!method initialize(id:, route:, title:, typename: :Company) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Transfer::Origin::Company} for more details. - # - # A company is a seller on Whop. Companies own products, manage members, and - # receive payouts. - # - # @param id [String] The unique identifier for the company. - # - # @param route [String] The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). - # - # @param title [String] The display name of the company shown to customers. - # - # @param typename [Symbol, :Company] The typename of this object - end - - # @!method self.variants - # @return [Array(WhopSDK::Models::Transfer::Origin::User, WhopSDK::Models::Transfer::Origin::Company)] - end - end - end -end diff --git a/lib/whop_sdk/models/transfer_create_params.rb b/lib/whop_sdk/models/transfer_create_params.rb index 5ece585a..e80c5218 100644 --- a/lib/whop_sdk/models/transfer_create_params.rb +++ b/lib/whop_sdk/models/transfer_create_params.rb @@ -8,73 +8,106 @@ class TransferCreateParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute amount - # The amount to transfer in the specified currency. For example, 25.00 for $25.00 - # USD. + # The amount to move, in the transfer currency. For example 25.00. # # @return [Float] required :amount, Float + # @!attribute origin_id + # The account sending the funds. A user ID (user_xxx), account ID (biz_xxx), or + # ledger account ID (ldgr_xxx). + # + # @return [String] + required :origin_id, String + # @!attribute currency - # The currency of the transfer amount, such as 'usd'. + # Currency, such as `usd`. Required for ledger transfers. # - # @return [Symbol, WhopSDK::Models::Currency] - required :currency, enum: -> { WhopSDK::Currency } + # @return [String, nil] + optional :currency, String # @!attribute destination_id - # The identifier of the account receiving the funds. Accepts a user ID - # ('user_xxx'), company ID ('biz_xxx'), ledger account ID ('ldgr_xxx'), or an - # email address — emails without an existing Whop user trigger a placeholder-user - # signup. + # The recipient. Required for ledger and wallet*send (a user*/biz*/ldgr* ID, or — + # for sends — an email). Omit for claim_link. # - # @return [String] - required :destination_id, String + # @return [String, nil] + optional :destination_id, String - # @!attribute origin_id - # The identifier of the account sending the funds. Accepts a user ID ('user_xxx'), - # company ID ('biz_xxx'), or ledger account ID ('ldgr_xxx'). + # @!attribute expires_at + # claim_link only. Link expiry as an ISO 8601 timestamp. Defaults to 24 hours from + # creation. # - # @return [String] - required :origin_id, String + # @return [Time, nil] + optional :expires_at, Time, nil?: true # @!attribute idempotence_key - # A unique key to prevent duplicate transfers. Use a UUID or similar unique - # string. + # Ledger transfers only. A unique key to prevent duplicate transfers. # # @return [String, nil] optional :idempotence_key, String, nil?: true # @!attribute metadata - # A JSON object of custom metadata to attach to the transfer for tracking - # purposes. + # Ledger transfers only. Custom key-value pairs attached to the transfer. Max 50 + # keys, 100 chars per key, 500 chars per string value. # # @return [Hash{Symbol=>Object}, nil] optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true # @!attribute notes - # A short note describing the transfer, up to 50 characters. + # Ledger transfers only. A short note describing the transfer. # # @return [String, nil] optional :notes, String, nil?: true - # @!method initialize(amount:, currency:, destination_id:, origin_id:, idempotence_key: nil, metadata: nil, notes: nil, request_options: {}) + # @!attribute redeemable_count + # claim_link only. How many different users can claim the link. Defaults to 1. + # + # @return [Integer, nil] + optional :redeemable_count, Integer + + # @!attribute type + # The kind of money movement. Defaults to ledger. + # + # @return [Symbol, WhopSDK::Models::TransferCreateParams::Type, nil] + optional :type, enum: -> { WhopSDK::TransferCreateParams::Type } + + # @!method initialize(amount:, origin_id:, currency: nil, destination_id: nil, expires_at: nil, idempotence_key: nil, metadata: nil, notes: nil, redeemable_count: nil, type: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::TransferCreateParams} for more details. # - # @param amount [Float] The amount to transfer in the specified currency. For example, 25.00 for $25.00 + # @param amount [Float] The amount to move, in the transfer currency. For example 25.00. + # + # @param origin_id [String] The account sending the funds. A user ID (user_xxx), account ID (biz_xxx), or le # - # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the transfer amount, such as 'usd'. + # @param currency [String] Currency, such as `usd`. Required for ledger transfers. # - # @param destination_id [String] The identifier of the account receiving the funds. Accepts a user ID ('user_xxx' + # @param destination_id [String] The recipient. Required for ledger and wallet*send (a user*/biz*/ldgr* ID, or — # - # @param origin_id [String] The identifier of the account sending the funds. Accepts a user ID ('user_xxx'), + # @param expires_at [Time, nil] claim_link only. Link expiry as an ISO 8601 timestamp. Defaults to 24 hours from # - # @param idempotence_key [String, nil] A unique key to prevent duplicate transfers. Use a UUID or similar unique string + # @param idempotence_key [String, nil] Ledger transfers only. A unique key to prevent duplicate transfers. # - # @param metadata [Hash{Symbol=>Object}, nil] A JSON object of custom metadata to attach to the transfer for tracking purposes + # @param metadata [Hash{Symbol=>Object}, nil] Ledger transfers only. Custom key-value pairs attached to the transfer. Max 50 k # - # @param notes [String, nil] A short note describing the transfer, up to 50 characters. + # @param notes [String, nil] Ledger transfers only. A short note describing the transfer. + # + # @param redeemable_count [Integer] claim_link only. How many different users can claim the link. Defaults to 1. + # + # @param type [Symbol, WhopSDK::Models::TransferCreateParams::Type] The kind of money movement. Defaults to ledger. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # The kind of money movement. Defaults to ledger. + module Type + extend WhopSDK::Internal::Type::Enum + + LEDGER = :ledger + WALLET_SEND = :wallet_send + CLAIM_LINK = :claim_link + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/transfer_create_response.rb b/lib/whop_sdk/models/transfer_create_response.rb new file mode 100644 index 00000000..7b1a0ce8 --- /dev/null +++ b/lib/whop_sdk/models/transfer_create_response.rb @@ -0,0 +1,452 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # A transfer of credit between two ledger accounts. + # + # @see WhopSDK::Resources::Transfers#create + module TransferCreateResponse + extend WhopSDK::Internal::Type::Union + + # A transfer of credit between two ledger accounts. + variant -> { WhopSDK::Models::TransferCreateResponse::Transfer } + + # Returned for a wallet_send: an onchain USDT send to a recipient. + variant -> { WhopSDK::Models::TransferCreateResponse::Send } + + # Returned for a claim_link: a shareable URL anyone can open to claim the funds. + variant -> { WhopSDK::Models::TransferCreateResponse::ClaimLink } + + class Transfer < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Transfer ID. + # + # @return [String] + required :id, String + + # @!attribute amount + # Transfer amount. + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # When the transfer was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # Transfer currency. + # + # @return [String] + required :currency, String + + # @!attribute destination + # Account or user receiving funds. + # + # @return [WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Company, WhopSDK::Models::TransferCreateResponse::Transfer::Destination::User] + required :destination, union: -> { WhopSDK::Models::TransferCreateResponse::Transfer::Destination } + + # @!attribute destination_ledger_account_id + # Destination ledger account ID. + # + # @return [String] + required :destination_ledger_account_id, String + + # @!attribute origin + # Account or user sending funds. + # + # @return [WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Company, WhopSDK::Models::TransferCreateResponse::Transfer::Origin::User] + required :origin, union: -> { WhopSDK::Models::TransferCreateResponse::Transfer::Origin } + + # @!attribute origin_ledger_account_id + # Source ledger account ID. + # + # @return [String] + required :origin_ledger_account_id, String + + # @!attribute fee_amount + # Fee charged for the transfer. + # + # @return [Float, nil] + optional :fee_amount, Float, nil?: true + + # @!attribute metadata + # Custom metadata attached to the transfer. + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute notes + # Transfer note. + # + # @return [String, nil] + optional :notes, String, nil?: true + + # @!method initialize(id:, amount:, created_at:, currency:, destination:, destination_ledger_account_id:, origin:, origin_ledger_account_id:, fee_amount: nil, metadata: nil, notes: nil) + # A transfer of credit between two ledger accounts. + # + # @param id [String] Transfer ID. + # + # @param amount [Float] Transfer amount. + # + # @param created_at [Time] When the transfer was created. + # + # @param currency [String] Transfer currency. + # + # @param destination [WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Company, WhopSDK::Models::TransferCreateResponse::Transfer::Destination::User] Account or user receiving funds. + # + # @param destination_ledger_account_id [String] Destination ledger account ID. + # + # @param origin [WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Company, WhopSDK::Models::TransferCreateResponse::Transfer::Origin::User] Account or user sending funds. + # + # @param origin_ledger_account_id [String] Source ledger account ID. + # + # @param fee_amount [Float, nil] Fee charged for the transfer. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata attached to the transfer. + # + # @param notes [String, nil] Transfer note. + + # Account or user receiving funds. + # + # @see WhopSDK::Models::TransferCreateResponse::Transfer#destination + module Destination + extend WhopSDK::Internal::Type::Union + + discriminator :typename + + variant :Company, -> { WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Company } + + variant :User, -> { WhopSDK::Models::TransferCreateResponse::Transfer::Destination::User } + + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Account ID. + # + # @return [String] + required :id, String + + # @!attribute typename + # + # @return [Symbol, :Company] + required :typename, const: :Company + + # @!attribute route + # Account route. + # + # @return [String, nil] + optional :route, String, nil?: true + + # @!attribute title + # Account display name. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!method initialize(id:, route: nil, title: nil, typename: :Company) + # @param id [String] Account ID. + # + # @param route [String, nil] Account route. + # + # @param title [String, nil] Account display name. + # + # @param typename [Symbol, :Company] + end + + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID. + # + # @return [String] + required :id, String + + # @!attribute typename + # + # @return [Symbol, :User] + required :typename, const: :User + + # @!attribute name + # User display name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute username + # User's username. + # + # @return [String, nil] + optional :username, String + + # @!method initialize(id:, name: nil, username: nil, typename: :User) + # @param id [String] User ID. + # + # @param name [String, nil] User display name. + # + # @param username [String] User's username. + # + # @param typename [Symbol, :User] + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Company, WhopSDK::Models::TransferCreateResponse::Transfer::Destination::User)] + end + + # Account or user sending funds. + # + # @see WhopSDK::Models::TransferCreateResponse::Transfer#origin + module Origin + extend WhopSDK::Internal::Type::Union + + discriminator :typename + + variant :Company, -> { WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Company } + + variant :User, -> { WhopSDK::Models::TransferCreateResponse::Transfer::Origin::User } + + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Account ID. + # + # @return [String] + required :id, String + + # @!attribute typename + # + # @return [Symbol, :Company] + required :typename, const: :Company + + # @!attribute route + # Account route. + # + # @return [String, nil] + optional :route, String, nil?: true + + # @!attribute title + # Account display name. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!method initialize(id:, route: nil, title: nil, typename: :Company) + # @param id [String] Account ID. + # + # @param route [String, nil] Account route. + # + # @param title [String, nil] Account display name. + # + # @param typename [Symbol, :Company] + end + + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID. + # + # @return [String] + required :id, String + + # @!attribute typename + # + # @return [Symbol, :User] + required :typename, const: :User + + # @!attribute name + # User display name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute username + # User's username. + # + # @return [String, nil] + optional :username, String + + # @!method initialize(id:, name: nil, username: nil, typename: :User) + # @param id [String] User ID. + # + # @param name [String, nil] User display name. + # + # @param username [String] User's username. + # + # @param typename [Symbol, :User] + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Company, WhopSDK::Models::TransferCreateResponse::Transfer::Origin::User)] + end + end + + class Send < WhopSDK::Internal::Type::BaseModel + # @!attribute amount + # + # @return [String] + required :amount, String + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute destination + # + # @return [WhopSDK::Models::TransferCreateResponse::Send::Destination] + required :destination, -> { WhopSDK::Models::TransferCreateResponse::Send::Destination } + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::TransferCreateResponse::Send::Object] + required :object, enum: -> { WhopSDK::Models::TransferCreateResponse::Send::Object } + + # @!attribute source + # + # @return [WhopSDK::Models::TransferCreateResponse::Send::Source] + required :source, -> { WhopSDK::Models::TransferCreateResponse::Send::Source } + + # @!attribute tx_hash + # + # @return [String] + required :tx_hash, String + + # @!method initialize(amount:, currency:, destination:, object:, source:, tx_hash:) + # Returned for a wallet_send: an onchain USDT send to a recipient. + # + # @param amount [String] + # @param currency [String] + # @param destination [WhopSDK::Models::TransferCreateResponse::Send::Destination] + # @param object [Symbol, WhopSDK::Models::TransferCreateResponse::Send::Object] + # @param source [WhopSDK::Models::TransferCreateResponse::Send::Source] + # @param tx_hash [String] + + # @see WhopSDK::Models::TransferCreateResponse::Send#destination + class Destination < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(account_id:, address:) + # @param account_id [String] + # @param address [String] + end + + # @see WhopSDK::Models::TransferCreateResponse::Send#object + module Object + extend WhopSDK::Internal::Type::Enum + + SEND = :send + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::TransferCreateResponse::Send#source + class Source < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(account_id:, address:) + # @param account_id [String] + # @param address [String] + end + end + + class ClaimLink < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [String] + required :amount, String + + # @!attribute claim_url + # + # @return [String] + required :claim_url, String + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute expires_at + # + # @return [Time, nil] + required :expires_at, Time, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::TransferCreateResponse::ClaimLink::Object] + required :object, enum: -> { WhopSDK::Models::TransferCreateResponse::ClaimLink::Object } + + # @!attribute redeemable_count + # + # @return [Integer] + required :redeemable_count, Integer + + # @!attribute source + # + # @return [WhopSDK::Models::TransferCreateResponse::ClaimLink::Source] + required :source, -> { WhopSDK::Models::TransferCreateResponse::ClaimLink::Source } + + # @!attribute status + # + # @return [String] + required :status, String + + # @!method initialize(id:, amount:, claim_url:, currency:, expires_at:, object:, redeemable_count:, source:, status:) + # Returned for a claim_link: a shareable URL anyone can open to claim the funds. + # + # @param id [String] + # @param amount [String] + # @param claim_url [String] + # @param currency [String] + # @param expires_at [Time, nil] + # @param object [Symbol, WhopSDK::Models::TransferCreateResponse::ClaimLink::Object] + # @param redeemable_count [Integer] + # @param source [WhopSDK::Models::TransferCreateResponse::ClaimLink::Source] + # @param status [String] + + # @see WhopSDK::Models::TransferCreateResponse::ClaimLink#object + module Object + extend WhopSDK::Internal::Type::Enum + + CLAIM_LINK = :claim_link + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::TransferCreateResponse::ClaimLink#source + class Source < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!method initialize(account_id:) + # @param account_id [String] + end + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::TransferCreateResponse::Transfer, WhopSDK::Models::TransferCreateResponse::Send, WhopSDK::Models::TransferCreateResponse::ClaimLink)] + end + end +end diff --git a/lib/whop_sdk/models/transfer_list_params.rb b/lib/whop_sdk/models/transfer_list_params.rb index c1103b40..4601a32c 100644 --- a/lib/whop_sdk/models/transfer_list_params.rb +++ b/lib/whop_sdk/models/transfer_list_params.rb @@ -8,99 +8,105 @@ class TransferListParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # Cursor to fetch the page after (from page_info.end_cursor). # # @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. + # Cursor to fetch the page before (from page_info.start_cursor). # # @return [String, nil] - optional :before, String, nil?: true + optional :before, String # @!attribute created_after - # Only return transfers created after this timestamp. + # Only transfers created strictly after this ISO 8601 timestamp. # - # @return [Time, nil] - optional :created_after, Time, nil?: true + # @return [String, nil] + optional :created_after, String # @!attribute created_before - # Only return transfers created before this timestamp. + # Only transfers created strictly before this ISO 8601 timestamp. # - # @return [Time, nil] - optional :created_before, Time, nil?: true + # @return [String, nil] + optional :created_before, String # @!attribute destination_id - # Filter to transfers received by this account. Accepts a user, company, or ledger - # account ID. + # Filter to transfers received by this account. # # @return [String, nil] - optional :destination_id, String, nil?: true + optional :destination_id, String # @!attribute direction - # The direction of the sort. + # Sort direction. Defaults to desc. # - # @return [Symbol, WhopSDK::Models::Direction, nil] - optional :direction, enum: -> { WhopSDK::Direction }, nil?: true + # @return [Symbol, WhopSDK::Models::TransferListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::TransferListParams::Direction } # @!attribute first - # Returns the first _n_ elements from the list. + # Number of transfers to return from the start of the window. # # @return [Integer, nil] - optional :first, Integer, nil?: true + optional :first, Integer # @!attribute last - # Returns the last _n_ elements from the list. + # Number of transfers to return from the end of the window. # # @return [Integer, nil] - optional :last, Integer, nil?: true + optional :last, Integer # @!attribute order - # Which columns can be used to sort. + # Sort column. Defaults to created_at. # # @return [Symbol, WhopSDK::Models::TransferListParams::Order, nil] - optional :order, enum: -> { WhopSDK::TransferListParams::Order }, nil?: true + optional :order, enum: -> { WhopSDK::TransferListParams::Order } # @!attribute origin_id - # Filter to transfers sent from this account. Accepts a user, company, or ledger - # account ID. + # Filter to transfers sent from this account. # # @return [String, nil] - optional :origin_id, String, nil?: true + optional :origin_id, String # @!method initialize(after: nil, before: nil, created_after: nil, created_before: nil, destination_id: nil, direction: nil, first: nil, last: nil, order: nil, origin_id: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::TransferListParams} for more details. - # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). # - # @param created_after [Time, nil] Only return transfers created after this timestamp. + # @param created_after [String] Only transfers created strictly after this ISO 8601 timestamp. # - # @param created_before [Time, nil] Only return transfers created before this timestamp. + # @param created_before [String] Only transfers created strictly before this ISO 8601 timestamp. # - # @param destination_id [String, nil] Filter to transfers received by this account. Accepts a user, company, or ledger + # @param destination_id [String] Filter to transfers received by this account. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param direction [Symbol, WhopSDK::Models::TransferListParams::Direction] Sort direction. Defaults to desc. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param first [Integer] Number of transfers to return from the start of the window. # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param last [Integer] Number of transfers to return from the end of the window. # - # @param order [Symbol, WhopSDK::Models::TransferListParams::Order, nil] Which columns can be used to sort. + # @param order [Symbol, WhopSDK::Models::TransferListParams::Order] Sort column. Defaults to created_at. # - # @param origin_id [String, nil] Filter to transfers sent from this account. Accepts a user, company, or ledger a + # @param origin_id [String] Filter to transfers sent from this account. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - # Which columns can be used to sort. + # Sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # Sort column. Defaults to created_at. module Order extend WhopSDK::Internal::Type::Enum - AMOUNT = :amount CREATED_AT = :created_at + AMOUNT = :amount # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/transfer_list_response.rb b/lib/whop_sdk/models/transfer_list_response.rb index de4b39c3..034fa3ba 100644 --- a/lib/whop_sdk/models/transfer_list_response.rb +++ b/lib/whop_sdk/models/transfer_list_response.rb @@ -5,86 +5,79 @@ module Models # @see WhopSDK::Resources::Transfers#list class TransferListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for the credit transaction transfer. + # Transfer ID. # # @return [String] required :id, String # @!attribute amount - # The transfer amount in the currency specified by the currency field. For - # example, 10.43 represents $10.43 USD. + # Transfer amount. # # @return [Float] required :amount, Float # @!attribute created_at - # The datetime the credit transaction transfer was created. + # When the transfer was created. # # @return [Time] required :created_at, Time # @!attribute currency - # The currency in which this transfer amount is denominated. + # Transfer currency. # - # @return [Symbol, WhopSDK::Models::Currency] - required :currency, enum: -> { WhopSDK::Currency } + # @return [String] + required :currency, String # @!attribute destination_ledger_account_id - # The unique identifier of the ledger account receiving the funds. + # Destination ledger account ID. # # @return [String] required :destination_ledger_account_id, String + # @!attribute origin_ledger_account_id + # Source ledger account ID. + # + # @return [String] + required :origin_ledger_account_id, String + # @!attribute fee_amount - # The flat fee amount deducted from this transfer, in the transfer's currency. - # Null if no flat fee was applied. + # Fee charged for the transfer. # # @return [Float, nil] - required :fee_amount, Float, nil?: true + optional :fee_amount, Float, nil?: true # @!attribute metadata - # Custom key-value pairs attached to this transfer. Maximum 50 keys, 500 - # characters per key, 5000 characters per value. + # Custom metadata attached to the transfer. # # @return [Hash{Symbol=>Object}, nil] - required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true # @!attribute notes - # A free-text note attached to this transfer by the sender. Null if no note was - # provided. + # Transfer note. # # @return [String, nil] - required :notes, String, nil?: true + optional :notes, String, nil?: true - # @!attribute origin_ledger_account_id - # The unique identifier of the ledger account that sent the funds. - # - # @return [String] - required :origin_ledger_account_id, String - - # @!method initialize(id:, amount:, created_at:, currency:, destination_ledger_account_id:, fee_amount:, metadata:, notes:, origin_ledger_account_id:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::TransferListResponse} for more details. - # + # @!method initialize(id:, amount:, created_at:, currency:, destination_ledger_account_id:, origin_ledger_account_id:, fee_amount: nil, metadata: nil, notes: nil) # A transfer of credit between two ledger accounts. # - # @param id [String] The unique identifier for the credit transaction transfer. + # @param id [String] Transfer ID. # - # @param amount [Float] The transfer amount in the currency specified by the currency field. For example + # @param amount [Float] Transfer amount. # - # @param created_at [Time] The datetime the credit transaction transfer was created. + # @param created_at [Time] When the transfer was created. # - # @param currency [Symbol, WhopSDK::Models::Currency] The currency in which this transfer amount is denominated. + # @param currency [String] Transfer currency. # - # @param destination_ledger_account_id [String] The unique identifier of the ledger account receiving the funds. + # @param destination_ledger_account_id [String] Destination ledger account ID. # - # @param fee_amount [Float, nil] The flat fee amount deducted from this transfer, in the transfer's currency. Nul + # @param origin_ledger_account_id [String] Source ledger account ID. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs attached to this transfer. Maximum 50 keys, 500 character + # @param fee_amount [Float, nil] Fee charged for the transfer. # - # @param notes [String, nil] A free-text note attached to this transfer by the sender. Null if no note was pr + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata attached to the transfer. # - # @param origin_ledger_account_id [String] The unique identifier of the ledger account that sent the funds. + # @param notes [String, nil] Transfer note. end end end diff --git a/lib/whop_sdk/models/transfer_retrieve_response.rb b/lib/whop_sdk/models/transfer_retrieve_response.rb new file mode 100644 index 00000000..d4ccc831 --- /dev/null +++ b/lib/whop_sdk/models/transfer_retrieve_response.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Transfers#retrieve + class TransferRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Transfer ID. + # + # @return [String] + required :id, String + + # @!attribute amount + # Transfer amount. + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # When the transfer was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # Transfer currency. + # + # @return [String] + required :currency, String + + # @!attribute destination + # Account or user receiving funds. + # + # @return [WhopSDK::Models::TransferRetrieveResponse::Destination::Company, WhopSDK::Models::TransferRetrieveResponse::Destination::User] + required :destination, union: -> { WhopSDK::Models::TransferRetrieveResponse::Destination } + + # @!attribute destination_ledger_account_id + # Destination ledger account ID. + # + # @return [String] + required :destination_ledger_account_id, String + + # @!attribute origin + # Account or user sending funds. + # + # @return [WhopSDK::Models::TransferRetrieveResponse::Origin::Company, WhopSDK::Models::TransferRetrieveResponse::Origin::User] + required :origin, union: -> { WhopSDK::Models::TransferRetrieveResponse::Origin } + + # @!attribute origin_ledger_account_id + # Source ledger account ID. + # + # @return [String] + required :origin_ledger_account_id, String + + # @!attribute fee_amount + # Fee charged for the transfer. + # + # @return [Float, nil] + optional :fee_amount, Float, nil?: true + + # @!attribute metadata + # Custom metadata attached to the transfer. + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute notes + # Transfer note. + # + # @return [String, nil] + optional :notes, String, nil?: true + + # @!method initialize(id:, amount:, created_at:, currency:, destination:, destination_ledger_account_id:, origin:, origin_ledger_account_id:, fee_amount: nil, metadata: nil, notes: nil) + # A transfer of credit between two ledger accounts. + # + # @param id [String] Transfer ID. + # + # @param amount [Float] Transfer amount. + # + # @param created_at [Time] When the transfer was created. + # + # @param currency [String] Transfer currency. + # + # @param destination [WhopSDK::Models::TransferRetrieveResponse::Destination::Company, WhopSDK::Models::TransferRetrieveResponse::Destination::User] Account or user receiving funds. + # + # @param destination_ledger_account_id [String] Destination ledger account ID. + # + # @param origin [WhopSDK::Models::TransferRetrieveResponse::Origin::Company, WhopSDK::Models::TransferRetrieveResponse::Origin::User] Account or user sending funds. + # + # @param origin_ledger_account_id [String] Source ledger account ID. + # + # @param fee_amount [Float, nil] Fee charged for the transfer. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata attached to the transfer. + # + # @param notes [String, nil] Transfer note. + + # Account or user receiving funds. + # + # @see WhopSDK::Models::TransferRetrieveResponse#destination + module Destination + extend WhopSDK::Internal::Type::Union + + discriminator :typename + + variant :Company, -> { WhopSDK::Models::TransferRetrieveResponse::Destination::Company } + + variant :User, -> { WhopSDK::Models::TransferRetrieveResponse::Destination::User } + + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Account ID. + # + # @return [String] + required :id, String + + # @!attribute typename + # + # @return [Symbol, :Company] + required :typename, const: :Company + + # @!attribute route + # Account route. + # + # @return [String, nil] + optional :route, String, nil?: true + + # @!attribute title + # Account display name. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!method initialize(id:, route: nil, title: nil, typename: :Company) + # @param id [String] Account ID. + # + # @param route [String, nil] Account route. + # + # @param title [String, nil] Account display name. + # + # @param typename [Symbol, :Company] + end + + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID. + # + # @return [String] + required :id, String + + # @!attribute typename + # + # @return [Symbol, :User] + required :typename, const: :User + + # @!attribute name + # User display name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute username + # User's username. + # + # @return [String, nil] + optional :username, String + + # @!method initialize(id:, name: nil, username: nil, typename: :User) + # @param id [String] User ID. + # + # @param name [String, nil] User display name. + # + # @param username [String] User's username. + # + # @param typename [Symbol, :User] + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::TransferRetrieveResponse::Destination::Company, WhopSDK::Models::TransferRetrieveResponse::Destination::User)] + end + + # Account or user sending funds. + # + # @see WhopSDK::Models::TransferRetrieveResponse#origin + module Origin + extend WhopSDK::Internal::Type::Union + + discriminator :typename + + variant :Company, -> { WhopSDK::Models::TransferRetrieveResponse::Origin::Company } + + variant :User, -> { WhopSDK::Models::TransferRetrieveResponse::Origin::User } + + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Account ID. + # + # @return [String] + required :id, String + + # @!attribute typename + # + # @return [Symbol, :Company] + required :typename, const: :Company + + # @!attribute route + # Account route. + # + # @return [String, nil] + optional :route, String, nil?: true + + # @!attribute title + # Account display name. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!method initialize(id:, route: nil, title: nil, typename: :Company) + # @param id [String] Account ID. + # + # @param route [String, nil] Account route. + # + # @param title [String, nil] Account display name. + # + # @param typename [Symbol, :Company] + end + + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID. + # + # @return [String] + required :id, String + + # @!attribute typename + # + # @return [Symbol, :User] + required :typename, const: :User + + # @!attribute name + # User display name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute username + # User's username. + # + # @return [String, nil] + optional :username, String + + # @!method initialize(id:, name: nil, username: nil, typename: :User) + # @param id [String] User ID. + # + # @param name [String, nil] User display name. + # + # @param username [String] User's username. + # + # @param typename [Symbol, :User] + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::TransferRetrieveResponse::Origin::Company, WhopSDK::Models::TransferRetrieveResponse::Origin::User)] + end + end + end +end diff --git a/lib/whop_sdk/models/unwrap_webhook_event.rb b/lib/whop_sdk/models/unwrap_webhook_event.rb index d5152791..ccec9579 100644 --- a/lib/whop_sdk/models/unwrap_webhook_event.rb +++ b/lib/whop_sdk/models/unwrap_webhook_event.rb @@ -7,6 +7,10 @@ module UnwrapWebhookEvent discriminator :type + variant :"chat.message.created", -> { WhopSDK::ChatMessageCreatedWebhookEvent } + + variant :"chat.reaction.created", -> { WhopSDK::ChatReactionCreatedWebhookEvent } + variant :"course_lesson_interaction.completed", -> { WhopSDK::CourseLessonInteractionCompletedWebhookEvent } @@ -42,6 +46,8 @@ module UnwrapWebhookEvent variant :"invoice.voided", -> { WhopSDK::InvoiceVoidedWebhookEvent } + variant :"ledger_account.funds_available", -> { WhopSDK::LedgerAccountFundsAvailableWebhookEvent } + variant :"membership.activated", -> { WhopSDK::MembershipActivatedWebhookEvent } variant :"membership.cancel_at_period_end_changed", @@ -49,6 +55,8 @@ module UnwrapWebhookEvent variant :"membership.deactivated", -> { WhopSDK::MembershipDeactivatedWebhookEvent } + variant :"membership.trial_ending_soon", -> { WhopSDK::MembershipTrialEndingSoonWebhookEvent } + variant :"payment.created", -> { WhopSDK::PaymentCreatedWebhookEvent } variant :"payment.failed", -> { WhopSDK::PaymentFailedWebhookEvent } @@ -84,7 +92,7 @@ module UnwrapWebhookEvent variant :"withdrawal.updated", -> { WhopSDK::WithdrawalUpdatedWebhookEvent } # @!method self.variants - # @return [Array(WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::IdentityProfileApprovedWebhookEvent, WhopSDK::Models::IdentityProfileNeedsActionWebhookEvent, WhopSDK::Models::IdentityProfileRejectedWebhookEvent, WhopSDK::Models::IdentityProfileUpdatedWebhookEvent, WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoiceMarkedUncollectibleWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseCreatedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseDecidedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseUpdatedWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent)] + # @return [Array(WhopSDK::Models::ChatMessageCreatedWebhookEvent, WhopSDK::Models::ChatReactionCreatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::IdentityProfileApprovedWebhookEvent, WhopSDK::Models::IdentityProfileNeedsActionWebhookEvent, WhopSDK::Models::IdentityProfileRejectedWebhookEvent, WhopSDK::Models::IdentityProfileUpdatedWebhookEvent, WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoiceMarkedUncollectibleWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::MembershipTrialEndingSoonWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseCreatedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseDecidedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseUpdatedWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent)] end end end diff --git a/lib/whop_sdk/models/user.rb b/lib/whop_sdk/models/user.rb index 76bb8412..3717237f 100644 --- a/lib/whop_sdk/models/user.rb +++ b/lib/whop_sdk/models/user.rb @@ -5,11 +5,28 @@ module Models # @see WhopSDK::Resources::Users#retrieve class User < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The ID of the user, which will look like user\_******\******* + # User ID, prefixed `user_`. # # @return [String] required :id, String + # @!attribute balance + # The user's balance: personal cash + crypto + in-flight treasury deposits, plus + # account balances for accounts they own. Computed only on `GET /users/me` + # self-view for callers with balance-read scope; `null` otherwise. + # + # @return [WhopSDK::Models::UserBalance, nil] + required :balance, -> { WhopSDK::UserBalance }, nil?: true + + # @!attribute balance_history + # The user's cumulative wallet balance over time (USD `{ t, v }` points plus + # last/min/max), for the balance chart. Opt in with `include_balance_history=true` + # on `GET /users/me`; populated only for callers with balance-read scope and + # `null` otherwise. A user with no wallet activity returns an empty series. + # + # @return [WhopSDK::Models::User::BalanceHistory, nil] + required :balance_history, -> { WhopSDK::User::BalanceHistory }, nil?: true + # @!attribute bio # The user's biography # @@ -22,6 +39,13 @@ class User < WhopSDK::Internal::Type::BaseModel # @return [String] required :created_at, String + # @!attribute earnings_usd + # The user's gross USD income over time. Populated only on single-user self reads + # for callers with balance-read scope; `null` otherwise. + # + # @return [WhopSDK::Models::User::EarningsUsd, nil] + required :earnings_usd, -> { WhopSDK::User::EarningsUsd }, nil?: true + # @!attribute name # The user's display name # @@ -40,18 +64,265 @@ class User < WhopSDK::Internal::Type::BaseModel # @return [String] required :username, String - # @!method initialize(id:, bio:, created_at:, name:, profile_picture:, username:) - # @param id [String] The ID of the user, which will look like user\_******\******* + # @!attribute verification + # Identity verification status for the user's `individual` (KYC) and `business` + # (KYB) profiles. Each is `null` until created, otherwise a `status` of + # `not_started`, `pending`, `approved`, or `rejected`. + # + # @return [Object] + required :verification, WhopSDK::Internal::Type::Unknown + + # @!attribute whop_partner_enabled_at + # When the user became an enrolled Whop Partner, as an ISO 8601 timestamp. `null` + # if never enrolled. + # + # @return [String, nil] + required :whop_partner_enabled_at, String, nil?: true + + # @!method initialize(id:, balance:, balance_history:, bio:, created_at:, earnings_usd:, name:, profile_picture:, username:, verification:, whop_partner_enabled_at:) + # Some parameter documentations has been truncated, see {WhopSDK::Models::User} + # for more details. + # + # @param id [String] User ID, prefixed `user_`. + # + # @param balance [WhopSDK::Models::UserBalance, nil] The user's balance: personal cash + crypto + in-flight treasury deposits, plus a + # + # @param balance_history [WhopSDK::Models::User::BalanceHistory, nil] The user's cumulative wallet balance over time (USD `{ t, v }` points plus last/ # # @param bio [String, nil] The user's biography # # @param created_at [String] When the user was created, as an ISO 8601 timestamp # + # @param earnings_usd [WhopSDK::Models::User::EarningsUsd, nil] The user's gross USD income over time. Populated only on single-user self reads + # # @param name [String, nil] The user's display name # # @param profile_picture [Object, nil] The user's profile picture, an object with a url # # @param username [String] The user's unique username + # + # @param verification [Object] Identity verification status for the user's `individual` (KYC) and `business` (K + # + # @param whop_partner_enabled_at [String, nil] When the user became an enrolled Whop Partner, as an ISO 8601 timestamp. `null` + + # @see WhopSDK::Models::User#balance_history + class BalanceHistory < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::User::BalanceHistory::Data] } + + # @!attribute last + # Value of the most recent point, in USD. + # + # @return [Float] + required :last, Float + + # @!attribute max + # Maximum value across the window, in USD. + # + # @return [Float] + required :max, Float + + # @!attribute min + # Minimum value across the window, in USD. + # + # @return [Float] + required :min, Float + + # @!method initialize(data:, last:, max:, min:) + # The user's cumulative wallet balance over time (USD `{ t, v }` points plus + # last/min/max), for the balance chart. Opt in with `include_balance_history=true` + # on `GET /users/me`; populated only for callers with balance-read scope and + # `null` otherwise. A user with no wallet activity returns an empty series. + # + # @param data [Array] + # + # @param last [Float] Value of the most recent point, in USD. + # + # @param max [Float] Maximum value across the window, in USD. + # + # @param min [Float] Minimum value across the window, in USD. + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute t + # Point timestamp, in Unix seconds. + # + # @return [Integer] + required :t, Integer + + # @!attribute v + # Cumulative wallet balance at this point, in USD. + # + # @return [Float] + required :v, Float + + # @!method initialize(t:, v:) + # Cumulative balance points over the requested window, oldest first. + # + # @param t [Integer] Point timestamp, in Unix seconds. + # + # @param v [Float] Cumulative wallet balance at this point, in USD. + end + end + + # @see WhopSDK::Models::User#earnings_usd + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + # @!attribute first_earned_at + # The first time the user earned gross income, as an ISO 8601 timestamp. + # + # @return [String, nil] + required :first_earned_at, String, nil?: true + + # @!attribute owned_accounts + # Gross income from accounts the user owns or is owner-authorized on. + # + # @return [WhopSDK::Models::User::EarningsUsd::OwnedAccounts] + required :owned_accounts, -> { WhopSDK::User::EarningsUsd::OwnedAccounts } + + # @!attribute personal + # Gross income from the user's personal wallet. + # + # @return [WhopSDK::Models::User::EarningsUsd::Personal] + required :personal, -> { WhopSDK::User::EarningsUsd::Personal } + + # @!attribute total + # Gross income from the user's personal wallet plus accounts they own or are + # owner-authorized on. + # + # @return [WhopSDK::Models::User::EarningsUsd::Total] + required :total, -> { WhopSDK::User::EarningsUsd::Total } + + # @!method initialize(first_earned_at:, owned_accounts:, personal:, total:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::User::EarningsUsd} for more details. + # + # The user's gross USD income over time. Populated only on single-user self reads + # for callers with balance-read scope; `null` otherwise. + # + # @param first_earned_at [String, nil] The first time the user earned gross income, as an ISO 8601 timestamp. + # + # @param owned_accounts [WhopSDK::Models::User::EarningsUsd::OwnedAccounts] Gross income from accounts the user owns or is owner-authorized on. + # + # @param personal [WhopSDK::Models::User::EarningsUsd::Personal] Gross income from the user's personal wallet. + # + # @param total [WhopSDK::Models::User::EarningsUsd::Total] Gross income from the user's personal wallet plus accounts they own or are owner + + # @see WhopSDK::Models::User::EarningsUsd#owned_accounts + class OwnedAccounts < WhopSDK::Internal::Type::BaseModel + # @!attribute last_24_hours + # Gross income in USD over the last 24 hours. + # + # @return [String] + required :last_24_hours, String + + # @!attribute last_30_days + # Gross income in USD over the last 30 days. + # + # @return [String] + required :last_30_days, String + + # @!attribute last_7_days + # Gross income in USD over the last 7 days. + # + # @return [String] + required :last_7_days, String + + # @!attribute lifetime + # All-time gross income in USD. + # + # @return [String] + required :lifetime, String + + # @!method initialize(last_24_hours:, last_30_days:, last_7_days:, lifetime:) + # Gross income from accounts the user owns or is owner-authorized on. + # + # @param last_24_hours [String] Gross income in USD over the last 24 hours. + # + # @param last_30_days [String] Gross income in USD over the last 30 days. + # + # @param last_7_days [String] Gross income in USD over the last 7 days. + # + # @param lifetime [String] All-time gross income in USD. + end + + # @see WhopSDK::Models::User::EarningsUsd#personal + class Personal < WhopSDK::Internal::Type::BaseModel + # @!attribute last_24_hours + # Gross income in USD over the last 24 hours. + # + # @return [String] + required :last_24_hours, String + + # @!attribute last_30_days + # Gross income in USD over the last 30 days. + # + # @return [String] + required :last_30_days, String + + # @!attribute last_7_days + # Gross income in USD over the last 7 days. + # + # @return [String] + required :last_7_days, String + + # @!attribute lifetime + # All-time gross income in USD. + # + # @return [String] + required :lifetime, String + + # @!method initialize(last_24_hours:, last_30_days:, last_7_days:, lifetime:) + # Gross income from the user's personal wallet. + # + # @param last_24_hours [String] Gross income in USD over the last 24 hours. + # + # @param last_30_days [String] Gross income in USD over the last 30 days. + # + # @param last_7_days [String] Gross income in USD over the last 7 days. + # + # @param lifetime [String] All-time gross income in USD. + end + + # @see WhopSDK::Models::User::EarningsUsd#total + class Total < WhopSDK::Internal::Type::BaseModel + # @!attribute last_24_hours + # Gross income in USD over the last 24 hours. + # + # @return [String] + required :last_24_hours, String + + # @!attribute last_30_days + # Gross income in USD over the last 30 days. + # + # @return [String] + required :last_30_days, String + + # @!attribute last_7_days + # Gross income in USD over the last 7 days. + # + # @return [String] + required :last_7_days, String + + # @!attribute lifetime + # All-time gross income in USD. + # + # @return [String] + required :lifetime, String + + # @!method initialize(last_24_hours:, last_30_days:, last_7_days:, lifetime:) + # Gross income from the user's personal wallet plus accounts they own or are + # owner-authorized on. + # + # @param last_24_hours [String] Gross income in USD over the last 24 hours. + # + # @param last_30_days [String] Gross income in USD over the last 30 days. + # + # @param last_7_days [String] Gross income in USD over the last 7 days. + # + # @param lifetime [String] All-time gross income in USD. + end + end end end end diff --git a/lib/whop_sdk/models/user_balance.rb b/lib/whop_sdk/models/user_balance.rb new file mode 100644 index 00000000..76f4be64 --- /dev/null +++ b/lib/whop_sdk/models/user_balance.rb @@ -0,0 +1,226 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class UserBalance < WhopSDK::Internal::Type::BaseModel + # @!attribute businesses + # + # @return [Array] + required :businesses, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::UserBalance::Business] } + + # @!attribute businesses_total_usd + # Combined USD balance across every account the user owns. + # + # @return [String] + required :businesses_total_usd, String + + # @!attribute cash + # + # @return [Array] + required :cash, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::UserBalance::Cash] } + + # @!attribute cash_usd + # Fiat cash in USD, including pending and reserve. + # + # @return [String] + required :cash_usd, String + + # @!attribute crypto + # + # @return [Array] + required :crypto, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::UserBalance::Crypto] } + + # @!attribute crypto_usd + # Crypto holdings in USD. + # + # @return [String] + required :crypto_usd, String + + # @!attribute pending_usd + # Pending funds in USD: fiat pending + in-flight treasury deposits. + # + # @return [String] + required :pending_usd, String + + # @!attribute total_usd + # The user's personal balance in USD: cash (available + pending + reserve) + + # crypto + in-flight treasury deposits. Excludes account balances (see + # businesses_total_usd). + # + # @return [String] + required :total_usd, String + + # @!attribute treasury_pending_usd + # Balance-to-wallet USDT0 withdrawals still in flight, in USD. + # + # @return [String] + required :treasury_pending_usd, String + + # @!method initialize(businesses:, businesses_total_usd:, cash:, cash_usd:, crypto:, crypto_usd:, pending_usd:, total_usd:, treasury_pending_usd:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::UserBalance} for more details. + # + # @param businesses [Array] + # + # @param businesses_total_usd [String] Combined USD balance across every account the user owns. + # + # @param cash [Array] + # + # @param cash_usd [String] Fiat cash in USD, including pending and reserve. + # + # @param crypto [Array] + # + # @param crypto_usd [String] Crypto holdings in USD. + # + # @param pending_usd [String] Pending funds in USD: fiat pending + in-flight treasury deposits. + # + # @param total_usd [String] The user's personal balance in USD: cash (available + pending + reserve) + crypt + # + # @param treasury_pending_usd [String] Balance-to-wallet USDT0 withdrawals still in flight, in USD. + + class Business < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The account ID, which looks like biz\_******\*******. + # + # @return [String] + required :id, String + + # @!attribute balance_usd + # The account's total balance in USD. + # + # @return [String] + required :balance_usd, String + + # @!attribute logo_url + # The account's logo URL. + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute name + # The account's display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!method initialize(id:, balance_usd:, logo_url:, name:) + # Account balances for accounts the user owns, highest balance first. Excludes + # accounts with no balance. + # + # @param id [String] The account ID, which looks like biz\_******\*******. + # + # @param balance_usd [String] The account's total balance in USD. + # + # @param logo_url [String, nil] The account's logo URL. + # + # @param name [String, nil] The account's display name. + end + + class Cash < WhopSDK::Internal::Type::BaseModel + # @!attribute balance + # Available balance in the native currency. + # + # @return [Float] + required :balance, Float + + # @!attribute balance_usd + # Available balance converted to USD. + # + # @return [Float] + required :balance_usd, Float + + # @!attribute currency + # Lowercase ISO currency code, such as `usd` or `eur`. + # + # @return [String] + required :currency, String + + # @!attribute pending_balance_usd + # Pending balance converted to USD. + # + # @return [Float] + required :pending_balance_usd, Float + + # @!attribute reserve_balance_usd + # Reserved balance converted to USD. + # + # @return [Float] + required :reserve_balance_usd, Float + + # @!attribute total_withdrawable_balance + # Withdrawable amount in the native currency. + # + # @return [Float] + required :total_withdrawable_balance, Float + + # @!method initialize(balance:, balance_usd:, currency:, pending_balance_usd:, reserve_balance_usd:, total_withdrawable_balance:) + # Per-currency fiat cash balances. + # + # @param balance [Float] Available balance in the native currency. + # + # @param balance_usd [Float] Available balance converted to USD. + # + # @param currency [String] Lowercase ISO currency code, such as `usd` or `eur`. + # + # @param pending_balance_usd [Float] Pending balance converted to USD. + # + # @param reserve_balance_usd [Float] Reserved balance converted to USD. + # + # @param total_withdrawable_balance [Float] Withdrawable amount in the native currency. + end + + class Crypto < WhopSDK::Internal::Type::BaseModel + # @!attribute balance + # Amount held in native token units, as a decimal string. + # + # @return [String] + required :balance, String + + # @!attribute icon_url + # Token icon URL. + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute name + # The token's display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute price_usd + # USD price per token, or `null` when unknown. + # + # @return [Float, nil] + required :price_usd, Float, nil?: true + + # @!attribute symbol + # Token display symbol, such as `USDT`, `XAUT`, or `cbBTC`. + # + # @return [String] + required :symbol, String + + # @!attribute value_usd + # Holding USD value. + # + # @return [Float] + required :value_usd, Float + + # @!method initialize(balance:, icon_url:, name:, price_usd:, symbol:, value_usd:) + # Per-token crypto holdings in the ledger's own wallet. + # + # @param balance [String] Amount held in native token units, as a decimal string. + # + # @param icon_url [String, nil] Token icon URL. + # + # @param name [String, nil] The token's display name. + # + # @param price_usd [Float, nil] USD price per token, or `null` when unknown. + # + # @param symbol [String] Token display symbol, such as `USDT`, `XAUT`, or `cbBTC`. + # + # @param value_usd [Float] Holding USD value. + 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 7e07865a..6751c713 100644 --- a/lib/whop_sdk/models/user_retrieve_params.rb +++ b/lib/whop_sdk/models/user_retrieve_params.rb @@ -19,7 +19,43 @@ class UserRetrieveParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :account_id, String - # @!method initialize(id:, account_id: nil, request_options: {}) + # @!attribute from + # Balance-history window start, ISO 8601 date or datetime. Defaults to 30 days + # ago. Only used with `include_balance_history`. + # + # @return [String, nil] + optional :from, String + + # @!attribute include_balance_history + # On `GET /users/me`, also compute the caller's balance history (opt-in; runs a + # heavier query). Ignored for other users and for callers without balance-read + # scope. + # + # @return [Boolean, nil] + optional :include_balance_history, WhopSDK::Internal::Type::Boolean + + # @!attribute interval + # Balance-history point granularity. Defaults to `day`. Only used with + # `include_balance_history`. + # + # @return [Symbol, WhopSDK::Models::UserRetrieveParams::Interval, nil] + optional :interval, enum: -> { WhopSDK::UserRetrieveParams::Interval } + + # @!attribute time_zone + # IANA time zone the balance-history points are bucketed in. Defaults to `UTC`. + # Only used with `include_balance_history`. + # + # @return [String, nil] + optional :time_zone, String + + # @!attribute to + # Balance-history window end, ISO 8601 date or datetime. Defaults to now. Only + # used with `include_balance_history`. + # + # @return [String, nil] + optional :to, String + + # @!method initialize(id:, account_id: nil, from: nil, include_balance_history: nil, interval: nil, time_zone: nil, to: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::UserRetrieveParams} for more details. # @@ -27,7 +63,31 @@ class UserRetrieveParams < WhopSDK::Internal::Type::BaseModel # # @param account_id [String] When set, returns the user's account-specific profile overrides for this account # + # @param from [String] Balance-history window start, ISO 8601 date or datetime. Defaults to 30 days ago + # + # @param include_balance_history [Boolean] On `GET /users/me`, also compute the caller's balance history (opt-in; runs a he + # + # @param interval [Symbol, WhopSDK::Models::UserRetrieveParams::Interval] Balance-history point granularity. Defaults to `day`. Only used with `include_ba + # + # @param time_zone [String] IANA time zone the balance-history points are bucketed in. Defaults to `UTC`. On + # + # @param to [String] Balance-history window end, ISO 8601 date or datetime. Defaults to now. Only use + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Balance-history point granularity. Defaults to `day`. Only used with + # `include_balance_history`. + module Interval + extend WhopSDK::Internal::Type::Enum + + HOUR = :hour + DAY = :day + WEEK = :week + MONTH = :month + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/verification_create_params.rb b/lib/whop_sdk/models/verification_create_params.rb new file mode 100644 index 00000000..c33b5985 --- /dev/null +++ b/lib/whop_sdk/models/verification_create_params.rb @@ -0,0 +1,414 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Verifications#create + class VerificationCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # Account or user ID whose identity you want to verify. Use a `biz_` account ID + # for account verifications, or the caller's `user_` ID for personal verification. + # + # @return [String] + required :account_id, String + + # @!attribute body + # Request body for an individual (KYC) verification. Omit `kind` or set it to + # `individual`. KYC is required to pay out funds and is a prerequisite for Whop + # Card access. Accepting payments does not require verification until a business + # reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the + # individual operates under a business entity. This enables payouts to be received + # by a business bank account. + # + # @return [WhopSDK::Models::VerificationCreateParams::Body::Individual, WhopSDK::Models::VerificationCreateParams::Body::Business] + required :body, union: -> { WhopSDK::VerificationCreateParams::Body } + + # @!method initialize(account_id:, body:, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationCreateParams} for more details. + # + # @param account_id [String] Account or user ID whose identity you want to verify. Use a `biz_` account ID fo + # + # @param body [WhopSDK::Models::VerificationCreateParams::Body::Individual, WhopSDK::Models::VerificationCreateParams::Body::Business] Request body for an individual (KYC) verification. Omit `kind` or set it to `ind + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Request body for an individual (KYC) verification. Omit `kind` or set it to + # `individual`. KYC is required to pay out funds and is a prerequisite for Whop + # Card access. Accepting payments does not require verification until a business + # reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the + # individual operates under a business entity. This enables payouts to be received + # by a business bank account. + module Body + extend WhopSDK::Internal::Type::Union + + discriminator :kind + + # Request body for an individual (KYC) verification. Omit `kind` or set it to `individual`. KYC is required to pay out funds and is a prerequisite for Whop Card access. Accepting payments does not require verification until a business reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the individual operates under a business entity. This enables payouts to be received by a business bank account. + variant :individual, -> { WhopSDK::VerificationCreateParams::Body::Individual } + + # Request body for a business entity (KYB) verification. Set `kind` to `business`. KYB includes everything KYC provides and additionally unlocks financing options for payments and business Whop Cards. + variant :business, -> { WhopSDK::VerificationCreateParams::Body::Business } + + class Individual < WhopSDK::Internal::Type::BaseModel + # @!attribute address + # + # @return [WhopSDK::Models::VerificationCreateParams::Body::Individual::Address, nil] + optional :address, -> { WhopSDK::VerificationCreateParams::Body::Individual::Address } + + # @!attribute business_name + # Legal business name for a sole proprietor or single-member LLC. + # + # @return [String, nil] + optional :business_name, String + + # @!attribute business_structure + # Entity type for sole proprietors, such as `single_member_llc`. Supported values + # vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + # + # @return [String, nil] + optional :business_structure, String + + # @!attribute business_website + # Business website URL. Whop store pages are not accepted. + # + # @return [String, nil] + optional :business_website, String + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute date_of_birth + # Formatted as `YYYY-MM-DD`. + # + # @return [String, nil] + optional :date_of_birth, String + + # @!attribute document_type + # Identity document being sent. Providing it (with `documents`) verifies from + # uploaded documents instead of a hosted session, and determines the expected + # `documents` keys: cards and licenses need front and back, passports only the + # photo page. + # + # @return [Symbol, WhopSDK::Models::VerificationCreateParams::Body::Individual::DocumentType, nil] + optional :document_type, enum: -> { WhopSDK::VerificationCreateParams::Body::Individual::DocumentType } + + # @!attribute documents + # Identity document files, keyed by slot (`id_card_front`, `id_card_back`, + # `selfie`, …) with each value the file's raw bytes base64-encoded. Providing them + # verifies the person from these documents instead of a hosted session — + # individual verifications only, and the request must also carry `document_type`, + # `first_name`, `last_name`, `date_of_birth`, `country`, `phone`, + # `tax_identification_number`, and an `address` with `line1`, `city`, `state`, and + # `postal_code`. JPEG, PNG, and PDF are accepted (selfies must be images), up to + # 5MB per file before encoding. Send the complete set — a missing or rejected file + # fails the whole request and nothing is submitted; review starts automatically + # once every document is accepted. + # + # @return [Hash{Symbol=>String}, nil] + optional :documents, WhopSDK::Internal::Type::HashOf[String] + + # @!attribute first_name + # + # @return [String, nil] + optional :first_name, String + + # @!attribute kind + # Verification type. Defaults to `individual`. + # + # @return [Symbol, WhopSDK::Models::VerificationCreateParams::Body::Individual::Kind, nil] + optional :kind, enum: -> { WhopSDK::VerificationCreateParams::Body::Individual::Kind } + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone + # + # @return [String, nil] + optional :phone, String + + # @!attribute tax_identification_number + # SSN or ITIN. Tokenized in transit and never stored raw. + # + # @return [String, nil] + optional :tax_identification_number, String + + # @!method initialize(address: nil, business_name: nil, business_structure: nil, business_website: nil, country: nil, date_of_birth: nil, document_type: nil, documents: nil, first_name: nil, kind: nil, last_name: nil, phone: nil, tax_identification_number: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationCreateParams::Body::Individual} for more details. + # + # Request body for an individual (KYC) verification. Omit `kind` or set it to + # `individual`. KYC is required to pay out funds and is a prerequisite for Whop + # Card access. Accepting payments does not require verification until a business + # reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the + # individual operates under a business entity. This enables payouts to be received + # by a business bank account. + # + # @param address [WhopSDK::Models::VerificationCreateParams::Body::Individual::Address] + # + # @param business_name [String] Legal business name for a sole proprietor or single-member LLC. + # + # @param business_structure [String] Entity type for sole proprietors, such as `single_member_llc`. Supported values + # + # @param business_website [String] Business website URL. Whop store pages are not accepted. + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param date_of_birth [String] Formatted as `YYYY-MM-DD`. + # + # @param document_type [Symbol, WhopSDK::Models::VerificationCreateParams::Body::Individual::DocumentType] Identity document being sent. Providing it (with `documents`) verifies from uplo + # + # @param documents [Hash{Symbol=>String}] Identity document files, keyed by slot (`id_card_front`, `id_card_back`, `selfie + # + # @param first_name [String] + # + # @param kind [Symbol, WhopSDK::Models::VerificationCreateParams::Body::Individual::Kind] Verification type. Defaults to `individual`. + # + # @param last_name [String] + # + # @param phone [String] + # + # @param tax_identification_number [String] SSN or ITIN. Tokenized in transit and never stored raw. + + # @see WhopSDK::Models::VerificationCreateParams::Body::Individual#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # @param city [String] + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String] Second line of the street address. + # + # @param postal_code [String] Postal or ZIP code. + # + # @param state [String] State, province, or region code, for example `CA`. + end + + # Identity document being sent. Providing it (with `documents`) verifies from + # uploaded documents instead of a hosted session, and determines the expected + # `documents` keys: cards and licenses need front and back, passports only the + # photo page. + # + # @see WhopSDK::Models::VerificationCreateParams::Body::Individual#document_type + module DocumentType + extend WhopSDK::Internal::Type::Enum + + ID_CARD = :ID_CARD + PASSPORT = :PASSPORT + DRIVERS = :DRIVERS + RESIDENCE_PERMIT = :RESIDENCE_PERMIT + + # @!method self.values + # @return [Array] + end + + # Verification type. Defaults to `individual`. + # + # @see WhopSDK::Models::VerificationCreateParams::Body::Individual#kind + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL = :individual + + # @!method self.values + # @return [Array] + end + end + + class Business < WhopSDK::Internal::Type::BaseModel + # @!attribute address + # + # @return [WhopSDK::Models::VerificationCreateParams::Body::Business::Address, nil] + optional :address, -> { WhopSDK::VerificationCreateParams::Body::Business::Address } + + # @!attribute business_name + # Legal business name. + # + # @return [String, nil] + optional :business_name, String + + # @!attribute business_structure + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + # + # @return [String, nil] + optional :business_structure, String + + # @!attribute business_website + # Business website URL. Whop store pages are not accepted. + # + # @return [String, nil] + optional :business_website, String + + # @!attribute country + # Country of incorporation as a two-letter ISO 3166-1 country code. + # + # @return [String, nil] + optional :country, String + + # @!attribute kind + # Must be `business` to start a KYB verification. + # + # @return [Symbol, WhopSDK::Models::VerificationCreateParams::Body::Business::Kind, nil] + optional :kind, enum: -> { WhopSDK::VerificationCreateParams::Body::Business::Kind } + + # @!attribute place_of_incorporation + # State or region where the business is incorporated. + # + # @return [String, nil] + optional :place_of_incorporation, String + + # @!attribute tax_identification_number + # EIN. Tokenized in transit and never stored raw. + # + # @return [String, nil] + optional :tax_identification_number, String + + # @!method initialize(address: nil, business_name: nil, business_structure: nil, business_website: nil, country: nil, kind: nil, place_of_incorporation: nil, tax_identification_number: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationCreateParams::Body::Business} for more details. + # + # Request body for a business entity (KYB) verification. Set `kind` to `business`. + # KYB includes everything KYC provides and additionally unlocks financing options + # for payments and business Whop Cards. + # + # @param address [WhopSDK::Models::VerificationCreateParams::Body::Business::Address] + # + # @param business_name [String] Legal business name. + # + # @param business_structure [String] Legal entity structure of the business, such as `private_corporation` or `sole_p + # + # @param business_website [String] Business website URL. Whop store pages are not accepted. + # + # @param country [String] Country of incorporation as a two-letter ISO 3166-1 country code. + # + # @param kind [Symbol, WhopSDK::Models::VerificationCreateParams::Body::Business::Kind] Must be `business` to start a KYB verification. + # + # @param place_of_incorporation [String] State or region where the business is incorporated. + # + # @param tax_identification_number [String] EIN. Tokenized in transit and never stored raw. + + # @see WhopSDK::Models::VerificationCreateParams::Body::Business#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # @param city [String] + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String] Second line of the street address. + # + # @param postal_code [String] Postal or ZIP code. + # + # @param state [String] State, province, or region code, for example `CA`. + end + + # Must be `business` to start a KYB verification. + # + # @see WhopSDK::Models::VerificationCreateParams::Body::Business#kind + module Kind + extend WhopSDK::Internal::Type::Enum + + BUSINESS = :business + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::VerificationCreateParams::Body::Individual, WhopSDK::Models::VerificationCreateParams::Body::Business)] + end + end + end +end diff --git a/lib/whop_sdk/models/verification_create_response.rb b/lib/whop_sdk/models/verification_create_response.rb new file mode 100644 index 00000000..abbd0a03 --- /dev/null +++ b/lib/whop_sdk/models/verification_create_response.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Verifications#create + class VerificationCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Verification profile ID, prefixed `idpf_`. + # + # @return [String, nil] + optional :id, String + + # @!attribute address + # Address on the verification profile. `null` when no address is set. + # + # @return [WhopSDK::Models::VerificationCreateResponse::Address, nil] + optional :address, -> { WhopSDK::Models::VerificationCreateResponse::Address }, nil?: true + + # @!attribute business_name + # Legal business name. + # + # @return [String, nil] + optional :business_name, String, nil?: true + + # @!attribute business_structure + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + # + # @return [String, nil] + optional :business_structure, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute created_at + # When the verification profile was created, as an ISO 8601 timestamp. + # + # @return [String, nil] + optional :created_at, String + + # @!attribute date_of_birth + # Formatted as `YYYY-MM-DD`. + # + # @return [String, nil] + optional :date_of_birth, String, nil?: true + + # @!attribute first_name + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute kind + # + # @return [Symbol, WhopSDK::Models::VerificationCreateResponse::Kind, nil] + optional :kind, enum: -> { WhopSDK::Models::VerificationCreateResponse::Kind } + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute requested_information + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + # + # @return [Array, nil] + optional :requested_information, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationCreateResponse::RequestedInformation] } + + # @!attribute required_documents + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + # + # @return [Array, nil] + optional :required_documents, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationCreateResponse::RequiredDocument] } + + # @!attribute session_url + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + # + # @return [String, nil] + optional :session_url, String, nil?: true + + # @!attribute status + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + # + # @return [Symbol, WhopSDK::Models::VerificationCreateResponse::Status, nil] + optional :status, enum: -> { WhopSDK::Models::VerificationCreateResponse::Status } + + # @!attribute updated_at + # When the verification profile was last updated, as an ISO 8601 timestamp. + # + # @return [String, nil] + optional :updated_at, String + + # @!method initialize(id: nil, address: nil, business_name: nil, business_structure: nil, country: nil, created_at: nil, date_of_birth: nil, first_name: nil, kind: nil, last_name: nil, requested_information: nil, required_documents: nil, session_url: nil, status: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationCreateResponse} for more details. + # + # @param id [String] Verification profile ID, prefixed `idpf_`. + # + # @param address [WhopSDK::Models::VerificationCreateResponse::Address, nil] Address on the verification profile. `null` when no address is set. + # + # @param business_name [String, nil] Legal business name. + # + # @param business_structure [String, nil] Legal entity structure of the business, such as `private_corporation` or `sole_p + # + # @param country [String, nil] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param created_at [String] When the verification profile was created, as an ISO 8601 timestamp. + # + # @param date_of_birth [String, nil] Formatted as `YYYY-MM-DD`. + # + # @param first_name [String, nil] + # + # @param kind [Symbol, WhopSDK::Models::VerificationCreateResponse::Kind] + # + # @param last_name [String, nil] + # + # @param requested_information [Array] Fields or documents Whop still needs before review can continue. Submit answers + # + # @param required_documents [Array] Documents for a document-upload verification and their progress. Present only on + # + # @param session_url [String, nil] Hosted verification session URL for the user to complete identity checks. Expire + # + # @param status [Symbol, WhopSDK::Models::VerificationCreateResponse::Status] Current verification state. `not_started` before any session has been created; ` + # + # @param updated_at [String] When the verification profile was last updated, as an ISO 8601 timestamp. + + # @see WhopSDK::Models::VerificationCreateResponse#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Address on the verification profile. `null` when no address is set. + # + # @param city [String, nil] + # + # @param country [String, nil] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String, nil] Second line of the street address. + # + # @param postal_code [String, nil] Postal or ZIP code. + # + # @param state [String, nil] State, province, or region code, for example `CA`. + end + + # @see WhopSDK::Models::VerificationCreateResponse#kind + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL = :individual + BUSINESS = :business + + # @!method self.values + # @return [Array] + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + # + # @return [String, nil] + optional :id, String + + # @!attribute description + # Additional instructions for this requested item, or `null`. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute error_message + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + # + # @return [String, nil] + optional :error_message, String, nil?: true + + # @!attribute field + # Stable field key, such as `ssn` or `business_description`. + # + # @return [String, nil] + optional :field, String + + # @!attribute label + # Human-readable label for the field, such as `Social Security Number`. + # + # @return [String, nil] + optional :label, String + + # @!attribute options + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + # + # @return [Array, nil] + optional :options, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute requested_files + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + # + # @return [Array, nil] + optional :requested_files, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile] } + + # @!attribute type + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + # + # @return [String, nil] + optional :type, String, nil?: true + + # @!method initialize(id: nil, description: nil, error_message: nil, field: nil, label: nil, options: nil, requested_files: nil, type: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationCreateResponse::RequestedInformation} for more + # details. + # + # @param id [String] Requested information item ID, prefixed `inrqi_`. Include this ID when submittin + # + # @param description [String, nil] Additional instructions for this requested item, or `null`. + # + # @param error_message [String, nil] Reason a previously submitted value was rejected. `null` if no submitted value h + # + # @param field [String] Stable field key, such as `ssn` or `business_description`. + # + # @param label [String] Human-readable label for the field, such as `Social Security Number`. + # + # @param options [Array] Allowed values for a `select` field (e.g. account_type, business_structure) — th + # + # @param requested_files [Array] Document upload slots for this item. Present when `type` is `files`; upload one + # + # @param type [String, nil] Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + # + # @return [String, nil] + optional :category, String, nil?: true + + # @!attribute is_optional + # Whether this slot can be left empty. + # + # @return [Boolean, nil] + optional :is_optional, WhopSDK::Internal::Type::Boolean + + # @!attribute kind + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + # + # @return [String, nil] + optional :kind, String, nil?: true + + # @!attribute label + # Label for this upload slot, such as `Front of ID Document`. + # + # @return [String, nil] + optional :label, String + + # @!attribute multiple + # Whether this slot accepts more than one file. + # + # @return [Boolean, nil] + optional :multiple, WhopSDK::Internal::Type::Boolean + + # @!method initialize(category: nil, is_optional: nil, kind: nil, label: nil, multiple: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile} + # for more details. + # + # @param category [String, nil] File category to include with the uploaded file so Whop can route the document c + # + # @param is_optional [Boolean] Whether this slot can be left empty. + # + # @param kind [String, nil] Specific document type requested, such as `Bank Statement`. `null` for standard + # + # @param label [String] Label for this upload slot, such as `Front of ID Document`. + # + # @param multiple [Boolean] Whether this slot accepts more than one file. + end + end + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + # @!attribute document + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + # + # @return [String, nil] + optional :document, String + + # @!attribute rejection_reason + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + # + # @return [String, nil] + optional :rejection_reason, String, nil?: true + + # @!attribute status + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + # + # @return [Symbol, WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status, nil] + optional :status, enum: -> { WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status } + + # @!method initialize(document: nil, rejection_reason: nil, status: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationCreateResponse::RequiredDocument} for more + # details. + # + # @param document [String] Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + # + # @param rejection_reason [String, nil] Why the previous submission was rejected, when the provider requested new docume + # + # @param status [Symbol, WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status] `pending_upload` until the document has been relayed for review; `submitted` aft + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + # + # @see WhopSDK::Models::VerificationCreateResponse::RequiredDocument#status + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING_UPLOAD = :pending_upload + SUBMITTED = :submitted + + # @!method self.values + # @return [Array] + end + end + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + # + # @see WhopSDK::Models::VerificationCreateResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + NOT_STARTED = :not_started + PENDING = :pending + APPROVED = :approved + REJECTED = :rejected + ACTION_REQUIRED = :action_required + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/verification_list_params.rb b/lib/whop_sdk/models/verification_list_params.rb index 8f302d0d..0e942126 100644 --- a/lib/whop_sdk/models/verification_list_params.rb +++ b/lib/whop_sdk/models/verification_list_params.rb @@ -7,48 +7,58 @@ class VerificationListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute payout_account_id - # The unique identifier of the payout account to list verifications for. + # @!attribute account_id + # Account or user ID whose verifications you want to list. Use a `biz_` account + # ID, or the caller's `user_` ID for personal verifications. # # @return [String] - required :payout_account_id, String + required :account_id, String - # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # @!attribute direction + # Sort direction for returned verifications. # - # @return [String, nil] - optional :after, String, nil?: true + # @return [Symbol, WhopSDK::Models::VerificationListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::VerificationListParams::Direction } - # @!attribute before - # Returns the elements in the list that come before the specified cursor. + # @!attribute order + # Field used to sort returned verifications. # - # @return [String, nil] - optional :before, String, nil?: true + # @return [Symbol, WhopSDK::Models::VerificationListParams::Order, nil] + optional :order, enum: -> { WhopSDK::VerificationListParams::Order } - # @!attribute first - # Returns the first _n_ elements from the list. + # @!method initialize(account_id:, direction: nil, order: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationListParams} for more details. # - # @return [Integer, nil] - optional :first, Integer, nil?: true - - # @!attribute last - # Returns the last _n_ elements from the list. - # - # @return [Integer, nil] - optional :last, Integer, nil?: true - - # @!method initialize(payout_account_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) - # @param payout_account_id [String] The unique identifier of the payout account to list verifications for. + # @param account_id [String] Account or user ID whose verifications you want to list. Use a `biz_` account ID # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param direction [Symbol, WhopSDK::Models::VerificationListParams::Direction] Sort direction for returned verifications. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. - # - # @param first [Integer, nil] Returns the first _n_ elements from the list. - # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param order [Symbol, WhopSDK::Models::VerificationListParams::Order] Field used to sort returned verifications. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Sort direction for returned verifications. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # Field used to sort returned verifications. + module Order + extend WhopSDK::Internal::Type::Enum + + UPDATED_AT = :updated_at + CREATED_AT = :created_at + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/verification_list_response.rb b/lib/whop_sdk/models/verification_list_response.rb index 1a8dee06..8e51a4cf 100644 --- a/lib/whop_sdk/models/verification_list_response.rb +++ b/lib/whop_sdk/models/verification_list_response.rb @@ -4,45 +4,407 @@ module WhopSDK module Models # @see WhopSDK::Resources::Verifications#list class VerificationListResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The numeric id of the verification record. + # @!attribute data # - # @return [String] - required :id, String + # @return [Array, nil] + optional :data, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationListResponse::Data] } - # @!attribute last_error_code - # An error code for a verification attempt. - # - # @return [Symbol, WhopSDK::Models::VerificationErrorCode, nil] - required :last_error_code, enum: -> { WhopSDK::VerificationErrorCode }, nil?: true + # @!method initialize(data: nil) + # @param data [Array] - # @!attribute last_error_reason - # A human-readable explanation of the most recent verification error. Null if no - # error has occurred. - # - # @return [String, nil] - required :last_error_reason, String, nil?: true + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Verification profile ID, prefixed `idpf_`. + # + # @return [String, nil] + optional :id, String - # @!attribute status - # The current status of this verification session. - # - # @return [Symbol, WhopSDK::Models::VerificationStatus] - required :status, enum: -> { WhopSDK::VerificationStatus } + # @!attribute address + # Address on the verification profile. `null` when no address is set. + # + # @return [WhopSDK::Models::VerificationListResponse::Data::Address, nil] + optional :address, -> { WhopSDK::Models::VerificationListResponse::Data::Address }, nil?: true - # @!method initialize(id:, last_error_code:, last_error_reason:, status:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::VerificationListResponse} for more details. - # - # An identity verification session used to confirm a person or entity's identity - # for payout account eligibility. - # - # @param id [String] The numeric id of the verification record. - # - # @param last_error_code [Symbol, WhopSDK::Models::VerificationErrorCode, nil] An error code for a verification attempt. - # - # @param last_error_reason [String, nil] A human-readable explanation of the most recent verification error. Null if no e - # - # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. + # @!attribute business_name + # Legal business name. + # + # @return [String, nil] + optional :business_name, String, nil?: true + + # @!attribute business_structure + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + # + # @return [String, nil] + optional :business_structure, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute created_at + # When the verification profile was created, as an ISO 8601 timestamp. + # + # @return [String, nil] + optional :created_at, String + + # @!attribute date_of_birth + # Formatted as `YYYY-MM-DD`. + # + # @return [String, nil] + optional :date_of_birth, String, nil?: true + + # @!attribute first_name + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute kind + # + # @return [Symbol, WhopSDK::Models::VerificationListResponse::Data::Kind, nil] + optional :kind, enum: -> { WhopSDK::Models::VerificationListResponse::Data::Kind } + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute requested_information + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + # + # @return [Array, nil] + optional :requested_information, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation] } + + # @!attribute required_documents + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + # + # @return [Array, nil] + optional :required_documents, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationListResponse::Data::RequiredDocument] } + + # @!attribute session_url + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + # + # @return [String, nil] + optional :session_url, String, nil?: true + + # @!attribute status + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + # + # @return [Symbol, WhopSDK::Models::VerificationListResponse::Data::Status, nil] + optional :status, enum: -> { WhopSDK::Models::VerificationListResponse::Data::Status } + + # @!attribute updated_at + # When the verification profile was last updated, as an ISO 8601 timestamp. + # + # @return [String, nil] + optional :updated_at, String + + # @!method initialize(id: nil, address: nil, business_name: nil, business_structure: nil, country: nil, created_at: nil, date_of_birth: nil, first_name: nil, kind: nil, last_name: nil, requested_information: nil, required_documents: nil, session_url: nil, status: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationListResponse::Data} for more details. + # + # @param id [String] Verification profile ID, prefixed `idpf_`. + # + # @param address [WhopSDK::Models::VerificationListResponse::Data::Address, nil] Address on the verification profile. `null` when no address is set. + # + # @param business_name [String, nil] Legal business name. + # + # @param business_structure [String, nil] Legal entity structure of the business, such as `private_corporation` or `sole_p + # + # @param country [String, nil] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param created_at [String] When the verification profile was created, as an ISO 8601 timestamp. + # + # @param date_of_birth [String, nil] Formatted as `YYYY-MM-DD`. + # + # @param first_name [String, nil] + # + # @param kind [Symbol, WhopSDK::Models::VerificationListResponse::Data::Kind] + # + # @param last_name [String, nil] + # + # @param requested_information [Array] Fields or documents Whop still needs before review can continue. Submit answers + # + # @param required_documents [Array] Documents for a document-upload verification and their progress. Present only on + # + # @param session_url [String, nil] Hosted verification session URL for the user to complete identity checks. Expire + # + # @param status [Symbol, WhopSDK::Models::VerificationListResponse::Data::Status] Current verification state. `not_started` before any session has been created; ` + # + # @param updated_at [String] When the verification profile was last updated, as an ISO 8601 timestamp. + + # @see WhopSDK::Models::VerificationListResponse::Data#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Address on the verification profile. `null` when no address is set. + # + # @param city [String, nil] + # + # @param country [String, nil] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String, nil] Second line of the street address. + # + # @param postal_code [String, nil] Postal or ZIP code. + # + # @param state [String, nil] State, province, or region code, for example `CA`. + end + + # @see WhopSDK::Models::VerificationListResponse::Data#kind + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL = :individual + BUSINESS = :business + + # @!method self.values + # @return [Array] + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + # + # @return [String, nil] + optional :id, String + + # @!attribute description + # Additional instructions for this requested item, or `null`. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute error_message + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + # + # @return [String, nil] + optional :error_message, String, nil?: true + + # @!attribute field + # Stable field key, such as `ssn` or `business_description`. + # + # @return [String, nil] + optional :field, String + + # @!attribute label + # Human-readable label for the field, such as `Social Security Number`. + # + # @return [String, nil] + optional :label, String + + # @!attribute options + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + # + # @return [Array, nil] + optional :options, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute requested_files + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + # + # @return [Array, nil] + optional :requested_files, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile] } + + # @!attribute type + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + # + # @return [String, nil] + optional :type, String, nil?: true + + # @!method initialize(id: nil, description: nil, error_message: nil, field: nil, label: nil, options: nil, requested_files: nil, type: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationListResponse::Data::RequestedInformation} for more + # details. + # + # @param id [String] Requested information item ID, prefixed `inrqi_`. Include this ID when submittin + # + # @param description [String, nil] Additional instructions for this requested item, or `null`. + # + # @param error_message [String, nil] Reason a previously submitted value was rejected. `null` if no submitted value h + # + # @param field [String] Stable field key, such as `ssn` or `business_description`. + # + # @param label [String] Human-readable label for the field, such as `Social Security Number`. + # + # @param options [Array] Allowed values for a `select` field (e.g. account_type, business_structure) — th + # + # @param requested_files [Array] Document upload slots for this item. Present when `type` is `files`; upload one + # + # @param type [String, nil] Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + # + # @return [String, nil] + optional :category, String, nil?: true + + # @!attribute is_optional + # Whether this slot can be left empty. + # + # @return [Boolean, nil] + optional :is_optional, WhopSDK::Internal::Type::Boolean + + # @!attribute kind + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + # + # @return [String, nil] + optional :kind, String, nil?: true + + # @!attribute label + # Label for this upload slot, such as `Front of ID Document`. + # + # @return [String, nil] + optional :label, String + + # @!attribute multiple + # Whether this slot accepts more than one file. + # + # @return [Boolean, nil] + optional :multiple, WhopSDK::Internal::Type::Boolean + + # @!method initialize(category: nil, is_optional: nil, kind: nil, label: nil, multiple: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile} + # for more details. + # + # @param category [String, nil] File category to include with the uploaded file so Whop can route the document c + # + # @param is_optional [Boolean] Whether this slot can be left empty. + # + # @param kind [String, nil] Specific document type requested, such as `Bank Statement`. `null` for standard + # + # @param label [String] Label for this upload slot, such as `Front of ID Document`. + # + # @param multiple [Boolean] Whether this slot accepts more than one file. + end + end + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + # @!attribute document + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + # + # @return [String, nil] + optional :document, String + + # @!attribute rejection_reason + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + # + # @return [String, nil] + optional :rejection_reason, String, nil?: true + + # @!attribute status + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + # + # @return [Symbol, WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status, nil] + optional :status, enum: -> { WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status } + + # @!method initialize(document: nil, rejection_reason: nil, status: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationListResponse::Data::RequiredDocument} for more + # details. + # + # @param document [String] Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + # + # @param rejection_reason [String, nil] Why the previous submission was rejected, when the provider requested new docume + # + # @param status [Symbol, WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status] `pending_upload` until the document has been relayed for review; `submitted` aft + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + # + # @see WhopSDK::Models::VerificationListResponse::Data::RequiredDocument#status + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING_UPLOAD = :pending_upload + SUBMITTED = :submitted + + # @!method self.values + # @return [Array] + end + end + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + # + # @see WhopSDK::Models::VerificationListResponse::Data#status + module Status + extend WhopSDK::Internal::Type::Enum + + NOT_STARTED = :not_started + PENDING = :pending + APPROVED = :approved + REJECTED = :rejected + ACTION_REQUIRED = :action_required + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/whop_sdk/models/verification_retrieve_params.rb b/lib/whop_sdk/models/verification_retrieve_params.rb index 54e0c409..78320de4 100644 --- a/lib/whop_sdk/models/verification_retrieve_params.rb +++ b/lib/whop_sdk/models/verification_retrieve_params.rb @@ -7,13 +7,13 @@ class VerificationRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute id + # @!attribute verification_id # # @return [String] - required :id, String + required :verification_id, String - # @!method initialize(id:, request_options: {}) - # @param id [String] + # @!method initialize(verification_id:, request_options: {}) + # @param verification_id [String] # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/verification_retrieve_response.rb b/lib/whop_sdk/models/verification_retrieve_response.rb index f15b284e..e627df4b 100644 --- a/lib/whop_sdk/models/verification_retrieve_response.rb +++ b/lib/whop_sdk/models/verification_retrieve_response.rb @@ -5,44 +5,396 @@ module Models # @see WhopSDK::Resources::Verifications#retrieve class VerificationRetrieveResponse < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The numeric id of the verification record. + # Verification profile ID, prefixed `idpf_`. # - # @return [String] - required :id, String + # @return [String, nil] + optional :id, String + + # @!attribute address + # Address on the verification profile. `null` when no address is set. + # + # @return [WhopSDK::Models::VerificationRetrieveResponse::Address, nil] + optional :address, -> { WhopSDK::Models::VerificationRetrieveResponse::Address }, nil?: true + + # @!attribute business_name + # Legal business name. + # + # @return [String, nil] + optional :business_name, String, nil?: true + + # @!attribute business_structure + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + # + # @return [String, nil] + optional :business_structure, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute created_at + # When the verification profile was created, as an ISO 8601 timestamp. + # + # @return [String, nil] + optional :created_at, String - # @!attribute last_error_code - # An error code for a verification attempt. + # @!attribute date_of_birth + # Formatted as `YYYY-MM-DD`. # - # @return [Symbol, WhopSDK::Models::VerificationErrorCode, nil] - required :last_error_code, enum: -> { WhopSDK::VerificationErrorCode }, nil?: true + # @return [String, nil] + optional :date_of_birth, String, nil?: true - # @!attribute last_error_reason - # A human-readable explanation of the most recent verification error. Null if no - # error has occurred. + # @!attribute first_name # # @return [String, nil] - required :last_error_reason, String, nil?: true + optional :first_name, String, nil?: true + + # @!attribute kind + # + # @return [Symbol, WhopSDK::Models::VerificationRetrieveResponse::Kind, nil] + optional :kind, enum: -> { WhopSDK::Models::VerificationRetrieveResponse::Kind } + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute requested_information + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + # + # @return [Array, nil] + optional :requested_information, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation] } + + # @!attribute required_documents + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + # + # @return [Array, nil] + optional :required_documents, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument] } + + # @!attribute session_url + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + # + # @return [String, nil] + optional :session_url, String, nil?: true # @!attribute status - # The current status of this verification session. + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. # - # @return [Symbol, WhopSDK::Models::VerificationStatus] - required :status, enum: -> { WhopSDK::VerificationStatus } + # @return [Symbol, WhopSDK::Models::VerificationRetrieveResponse::Status, nil] + optional :status, enum: -> { WhopSDK::Models::VerificationRetrieveResponse::Status } - # @!method initialize(id:, last_error_code:, last_error_reason:, status:) + # @!attribute updated_at + # When the verification profile was last updated, as an ISO 8601 timestamp. + # + # @return [String, nil] + optional :updated_at, String + + # @!method initialize(id: nil, address: nil, business_name: nil, business_structure: nil, country: nil, created_at: nil, date_of_birth: nil, first_name: nil, kind: nil, last_name: nil, requested_information: nil, required_documents: nil, session_url: nil, status: nil, updated_at: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::VerificationRetrieveResponse} for more details. # - # An identity verification session used to confirm a person or entity's identity - # for payout account eligibility. + # @param id [String] Verification profile ID, prefixed `idpf_`. + # + # @param address [WhopSDK::Models::VerificationRetrieveResponse::Address, nil] Address on the verification profile. `null` when no address is set. + # + # @param business_name [String, nil] Legal business name. + # + # @param business_structure [String, nil] Legal entity structure of the business, such as `private_corporation` or `sole_p + # + # @param country [String, nil] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param created_at [String] When the verification profile was created, as an ISO 8601 timestamp. + # + # @param date_of_birth [String, nil] Formatted as `YYYY-MM-DD`. + # + # @param first_name [String, nil] + # + # @param kind [Symbol, WhopSDK::Models::VerificationRetrieveResponse::Kind] # - # @param id [String] The numeric id of the verification record. + # @param last_name [String, nil] # - # @param last_error_code [Symbol, WhopSDK::Models::VerificationErrorCode, nil] An error code for a verification attempt. + # @param requested_information [Array] Fields or documents Whop still needs before review can continue. Submit answers # - # @param last_error_reason [String, nil] A human-readable explanation of the most recent verification error. Null if no e + # @param required_documents [Array] Documents for a document-upload verification and their progress. Present only on # - # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. + # @param session_url [String, nil] Hosted verification session URL for the user to complete identity checks. Expire + # + # @param status [Symbol, WhopSDK::Models::VerificationRetrieveResponse::Status] Current verification state. `not_started` before any session has been created; ` + # + # @param updated_at [String] When the verification profile was last updated, as an ISO 8601 timestamp. + + # @see WhopSDK::Models::VerificationRetrieveResponse#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Address on the verification profile. `null` when no address is set. + # + # @param city [String, nil] + # + # @param country [String, nil] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String, nil] Second line of the street address. + # + # @param postal_code [String, nil] Postal or ZIP code. + # + # @param state [String, nil] State, province, or region code, for example `CA`. + end + + # @see WhopSDK::Models::VerificationRetrieveResponse#kind + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL = :individual + BUSINESS = :business + + # @!method self.values + # @return [Array] + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + # + # @return [String, nil] + optional :id, String + + # @!attribute description + # Additional instructions for this requested item, or `null`. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute error_message + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + # + # @return [String, nil] + optional :error_message, String, nil?: true + + # @!attribute field + # Stable field key, such as `ssn` or `business_description`. + # + # @return [String, nil] + optional :field, String + + # @!attribute label + # Human-readable label for the field, such as `Social Security Number`. + # + # @return [String, nil] + optional :label, String + + # @!attribute options + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + # + # @return [Array, nil] + optional :options, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute requested_files + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + # + # @return [Array, nil] + optional :requested_files, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile] } + + # @!attribute type + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + # + # @return [String, nil] + optional :type, String, nil?: true + + # @!method initialize(id: nil, description: nil, error_message: nil, field: nil, label: nil, options: nil, requested_files: nil, type: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation} for more + # details. + # + # @param id [String] Requested information item ID, prefixed `inrqi_`. Include this ID when submittin + # + # @param description [String, nil] Additional instructions for this requested item, or `null`. + # + # @param error_message [String, nil] Reason a previously submitted value was rejected. `null` if no submitted value h + # + # @param field [String] Stable field key, such as `ssn` or `business_description`. + # + # @param label [String] Human-readable label for the field, such as `Social Security Number`. + # + # @param options [Array] Allowed values for a `select` field (e.g. account_type, business_structure) — th + # + # @param requested_files [Array] Document upload slots for this item. Present when `type` is `files`; upload one + # + # @param type [String, nil] Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + # + # @return [String, nil] + optional :category, String, nil?: true + + # @!attribute is_optional + # Whether this slot can be left empty. + # + # @return [Boolean, nil] + optional :is_optional, WhopSDK::Internal::Type::Boolean + + # @!attribute kind + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + # + # @return [String, nil] + optional :kind, String, nil?: true + + # @!attribute label + # Label for this upload slot, such as `Front of ID Document`. + # + # @return [String, nil] + optional :label, String + + # @!attribute multiple + # Whether this slot accepts more than one file. + # + # @return [Boolean, nil] + optional :multiple, WhopSDK::Internal::Type::Boolean + + # @!method initialize(category: nil, is_optional: nil, kind: nil, label: nil, multiple: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile} + # for more details. + # + # @param category [String, nil] File category to include with the uploaded file so Whop can route the document c + # + # @param is_optional [Boolean] Whether this slot can be left empty. + # + # @param kind [String, nil] Specific document type requested, such as `Bank Statement`. `null` for standard + # + # @param label [String] Label for this upload slot, such as `Front of ID Document`. + # + # @param multiple [Boolean] Whether this slot accepts more than one file. + end + end + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + # @!attribute document + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + # + # @return [String, nil] + optional :document, String + + # @!attribute rejection_reason + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + # + # @return [String, nil] + optional :rejection_reason, String, nil?: true + + # @!attribute status + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + # + # @return [Symbol, WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status, nil] + optional :status, enum: -> { WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status } + + # @!method initialize(document: nil, rejection_reason: nil, status: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument} for more + # details. + # + # @param document [String] Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + # + # @param rejection_reason [String, nil] Why the previous submission was rejected, when the provider requested new docume + # + # @param status [Symbol, WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status] `pending_upload` until the document has been relayed for review; `submitted` aft + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + # + # @see WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument#status + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING_UPLOAD = :pending_upload + SUBMITTED = :submitted + + # @!method self.values + # @return [Array] + end + end + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + # + # @see WhopSDK::Models::VerificationRetrieveResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + NOT_STARTED = :not_started + PENDING = :pending + APPROVED = :approved + REJECTED = :rejected + ACTION_REQUIRED = :action_required + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/verification_update_params.rb b/lib/whop_sdk/models/verification_update_params.rb new file mode 100644 index 00000000..ed165859 --- /dev/null +++ b/lib/whop_sdk/models/verification_update_params.rb @@ -0,0 +1,578 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Verifications#update + class VerificationUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute verification_id + # + # @return [String] + required :verification_id, String + + # @!attribute body + # Fields that can be updated on an individual (KYC) verification. At least one + # field is required. + # + # @return [WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification, WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification] + required :body, union: -> { WhopSDK::VerificationUpdateParams::Body } + + # @!method initialize(verification_id:, body:, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateParams} for more details. + # + # @param verification_id [String] + # + # @param body [WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification, WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification] Fields that can be updated on an individual (KYC) verification. At least one fie + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Fields that can be updated on an individual (KYC) verification. At least one + # field is required. + module Body + extend WhopSDK::Internal::Type::Union + + # Fields that can be updated on an individual (KYC) verification. At least one field is required. + variant -> { WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification } + + # Fields that can be updated on a business entity (KYB) verification. At least one field is required. + variant -> { WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification } + + class UpdateIndividualVerification < WhopSDK::Internal::Type::BaseModel + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute date_of_birth + # Formatted as `YYYY-MM-DD`. + # + # @return [String, nil] + optional :date_of_birth, String + + # @!attribute first_name + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String + + # @!attribute personal_address + # Personal address for the individual. + # + # @return [WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, nil] + optional :personal_address, + -> { WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress } + + # @!attribute requested_information + # Answers to items returned in `requested_information`. Each entry must include + # the requested item `id` and exactly one answer payload matching the item's + # `type`: `value` for `text`, `date`, or `phone`; `address` for `address`; `files` + # for `files`. + # + # @return [Array, nil] + optional :requested_information, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] } + + # @!method initialize(country: nil, date_of_birth: nil, first_name: nil, last_name: nil, personal_address: nil, requested_information: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification} + # for more details. + # + # Fields that can be updated on an individual (KYC) verification. At least one + # field is required. + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param date_of_birth [String] Formatted as `YYYY-MM-DD`. + # + # @param first_name [String] + # + # @param last_name [String] + # + # @param personal_address [WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress] Personal address for the individual. + # + # @param requested_information [Array] Answers to items returned in `requested_information`. Each entry must include th + + # @see WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification#personal_address + class PersonalAddress < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Personal address for the individual. + # + # @param city [String] + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String] Second line of the street address. + # + # @param postal_code [String] Postal or ZIP code. + # + # @param state [String] State, province, or region code, for example `CA`. + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Requested information item ID, prefixed `inrqi_`. + # + # @return [String] + required :id, String + + # @!attribute address + # Address payload for `address` items. + # + # @return [WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address, nil] + optional :address, + -> { WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address } + + # @!attribute files + # Uploaded file payloads for `files` items. Each file should include a + # `direct_upload_id` from the upload flow, plus the requested file `category` and + # `kind` when provided. + # + # @return [Array, nil] + optional :files, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File] } + + # @!attribute value + # Answer value for `text`, `date`, or `phone` items. + # + # @return [String, nil] + optional :value, String + + # @!attribute value_type + # Whether `value` is raw input or a vault token. + # + # @return [Symbol, WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType, nil] + optional :value_type, + enum: -> { WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType } + + # @!method initialize(id:, address: nil, files: nil, value: nil, value_type: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation} + # for more details. + # + # @param id [String] Requested information item ID, prefixed `inrqi_`. + # + # @param address [WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address] Address payload for `address` items. + # + # @param files [Array] Uploaded file payloads for `files` items. Each file should include a `direct_upl + # + # @param value [String] Answer value for `text`, `date`, or `phone` items. + # + # @param value_type [Symbol, WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType] Whether `value` is raw input or a vault token. + + # @see WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Address payload for `address` items. + # + # @param city [String] + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String] Second line of the street address. + # + # @param postal_code [String] Postal or ZIP code. + # + # @param state [String] State, province, or region code, for example `CA`. + end + + class File < WhopSDK::Internal::Type::BaseModel + # @!attribute attachment_id + # Existing attachment ID, when reusing an already attached document. + # + # @return [String, nil] + optional :attachment_id, String + + # @!attribute category + # Requested file category copied from `requested_files.category`. + # + # @return [String, nil] + optional :category, String + + # @!attribute direct_upload_id + # Direct upload ID for the uploaded document. + # + # @return [String, nil] + optional :direct_upload_id, String + + # @!attribute kind + # Requested document kind copied from `requested_files.kind`. + # + # @return [String, nil] + optional :kind, String + + # @!method initialize(attachment_id: nil, category: nil, direct_upload_id: nil, kind: nil) + # @param attachment_id [String] Existing attachment ID, when reusing an already attached document. + # + # @param category [String] Requested file category copied from `requested_files.category`. + # + # @param direct_upload_id [String] Direct upload ID for the uploaded document. + # + # @param kind [String] Requested document kind copied from `requested_files.kind`. + end + + # Whether `value` is raw input or a vault token. + # + # @see WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation#value_type + module ValueType + extend WhopSDK::Internal::Type::Enum + + RAW = :raw + VAULT_TOKEN = :vault_token + + # @!method self.values + # @return [Array] + end + end + end + + class UpdateBusinessVerification < WhopSDK::Internal::Type::BaseModel + # @!attribute business_address + # Business address. + # + # @return [WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, nil] + optional :business_address, + -> { WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress } + + # @!attribute business_name + # Legal business name. + # + # @return [String, nil] + optional :business_name, String + + # @!attribute business_structure + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + # + # @return [String, nil] + optional :business_structure, String + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute requested_information + # Answers to items returned in `requested_information`. Each entry must include + # the requested item `id` and exactly one answer payload matching the item's + # `type`: `value` for `text`, `date`, or `phone`; `address` for `address`; `files` + # for `files`. + # + # @return [Array, nil] + optional :requested_information, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] } + + # @!method initialize(business_address: nil, business_name: nil, business_structure: nil, country: nil, requested_information: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification} + # for more details. + # + # Fields that can be updated on a business entity (KYB) verification. At least one + # field is required. + # + # @param business_address [WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress] Business address. + # + # @param business_name [String] Legal business name. + # + # @param business_structure [String] Legal entity structure of the business, such as `private_corporation` or `sole_p + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param requested_information [Array] Answers to items returned in `requested_information`. Each entry must include th + + # @see WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification#business_address + class BusinessAddress < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Business address. + # + # @param city [String] + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String] Second line of the street address. + # + # @param postal_code [String] Postal or ZIP code. + # + # @param state [String] State, province, or region code, for example `CA`. + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Requested information item ID, prefixed `inrqi_`. + # + # @return [String] + required :id, String + + # @!attribute address + # Address payload for `address` items. + # + # @return [WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address, nil] + optional :address, + -> { WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address } + + # @!attribute files + # Uploaded file payloads for `files` items. Each file should include a + # `direct_upload_id` from the upload flow, plus the requested file `category` and + # `kind` when provided. + # + # @return [Array, nil] + optional :files, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File] } + + # @!attribute value + # Answer value for `text`, `date`, or `phone` items. + # + # @return [String, nil] + optional :value, String + + # @!attribute value_type + # Whether `value` is raw input or a vault token. + # + # @return [Symbol, WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType, nil] + optional :value_type, + enum: -> { WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType } + + # @!method initialize(id:, address: nil, files: nil, value: nil, value_type: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation} + # for more details. + # + # @param id [String] Requested information item ID, prefixed `inrqi_`. + # + # @param address [WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address] Address payload for `address` items. + # + # @param files [Array] Uploaded file payloads for `files` items. Each file should include a `direct_upl + # + # @param value [String] Answer value for `text`, `date`, or `phone` items. + # + # @param value_type [Symbol, WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType] Whether `value` is raw input or a vault token. + + # @see WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Address payload for `address` items. + # + # @param city [String] + # + # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String] Second line of the street address. + # + # @param postal_code [String] Postal or ZIP code. + # + # @param state [String] State, province, or region code, for example `CA`. + end + + class File < WhopSDK::Internal::Type::BaseModel + # @!attribute attachment_id + # Existing attachment ID, when reusing an already attached document. + # + # @return [String, nil] + optional :attachment_id, String + + # @!attribute category + # Requested file category copied from `requested_files.category`. + # + # @return [String, nil] + optional :category, String + + # @!attribute direct_upload_id + # Direct upload ID for the uploaded document. + # + # @return [String, nil] + optional :direct_upload_id, String + + # @!attribute kind + # Requested document kind copied from `requested_files.kind`. + # + # @return [String, nil] + optional :kind, String + + # @!method initialize(attachment_id: nil, category: nil, direct_upload_id: nil, kind: nil) + # @param attachment_id [String] Existing attachment ID, when reusing an already attached document. + # + # @param category [String] Requested file category copied from `requested_files.category`. + # + # @param direct_upload_id [String] Direct upload ID for the uploaded document. + # + # @param kind [String] Requested document kind copied from `requested_files.kind`. + end + + # Whether `value` is raw input or a vault token. + # + # @see WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation#value_type + module ValueType + extend WhopSDK::Internal::Type::Enum + + RAW = :raw + VAULT_TOKEN = :vault_token + + # @!method self.values + # @return [Array] + end + end + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification, WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification)] + end + end + end +end diff --git a/lib/whop_sdk/models/verification_update_response.rb b/lib/whop_sdk/models/verification_update_response.rb new file mode 100644 index 00000000..e9a65c1d --- /dev/null +++ b/lib/whop_sdk/models/verification_update_response.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Verifications#update + class VerificationUpdateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Verification profile ID, prefixed `idpf_`. + # + # @return [String, nil] + optional :id, String + + # @!attribute address + # Address on the verification profile. `null` when no address is set. + # + # @return [WhopSDK::Models::VerificationUpdateResponse::Address, nil] + optional :address, -> { WhopSDK::Models::VerificationUpdateResponse::Address }, nil?: true + + # @!attribute business_name + # Legal business name. + # + # @return [String, nil] + optional :business_name, String, nil?: true + + # @!attribute business_structure + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + # + # @return [String, nil] + optional :business_structure, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute created_at + # When the verification profile was created, as an ISO 8601 timestamp. + # + # @return [String, nil] + optional :created_at, String + + # @!attribute date_of_birth + # Formatted as `YYYY-MM-DD`. + # + # @return [String, nil] + optional :date_of_birth, String, nil?: true + + # @!attribute first_name + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute kind + # + # @return [Symbol, WhopSDK::Models::VerificationUpdateResponse::Kind, nil] + optional :kind, enum: -> { WhopSDK::Models::VerificationUpdateResponse::Kind } + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute requested_information + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + # + # @return [Array, nil] + optional :requested_information, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation] } + + # @!attribute required_documents + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + # + # @return [Array, nil] + optional :required_documents, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument] } + + # @!attribute session_url + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + # + # @return [String, nil] + optional :session_url, String, nil?: true + + # @!attribute status + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + # + # @return [Symbol, WhopSDK::Models::VerificationUpdateResponse::Status, nil] + optional :status, enum: -> { WhopSDK::Models::VerificationUpdateResponse::Status } + + # @!attribute updated_at + # When the verification profile was last updated, as an ISO 8601 timestamp. + # + # @return [String, nil] + optional :updated_at, String + + # @!method initialize(id: nil, address: nil, business_name: nil, business_structure: nil, country: nil, created_at: nil, date_of_birth: nil, first_name: nil, kind: nil, last_name: nil, requested_information: nil, required_documents: nil, session_url: nil, status: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateResponse} for more details. + # + # @param id [String] Verification profile ID, prefixed `idpf_`. + # + # @param address [WhopSDK::Models::VerificationUpdateResponse::Address, nil] Address on the verification profile. `null` when no address is set. + # + # @param business_name [String, nil] Legal business name. + # + # @param business_structure [String, nil] Legal entity structure of the business, such as `private_corporation` or `sole_p + # + # @param country [String, nil] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param created_at [String] When the verification profile was created, as an ISO 8601 timestamp. + # + # @param date_of_birth [String, nil] Formatted as `YYYY-MM-DD`. + # + # @param first_name [String, nil] + # + # @param kind [Symbol, WhopSDK::Models::VerificationUpdateResponse::Kind] + # + # @param last_name [String, nil] + # + # @param requested_information [Array] Fields or documents Whop still needs before review can continue. Submit answers + # + # @param required_documents [Array] Documents for a document-upload verification and their progress. Present only on + # + # @param session_url [String, nil] Hosted verification session URL for the user to complete identity checks. Expire + # + # @param status [Symbol, WhopSDK::Models::VerificationUpdateResponse::Status] Current verification state. `not_started` before any session has been created; ` + # + # @param updated_at [String] When the verification profile was last updated, as an ISO 8601 timestamp. + + # @see WhopSDK::Models::VerificationUpdateResponse#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # First line of the street address. + # + # @return [String, nil] + optional :line1, String + + # @!attribute line2 + # Second line of the street address. + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # Postal or ZIP code. + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # State, province, or region code, for example `CA`. + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + # Address on the verification profile. `null` when no address is set. + # + # @param city [String, nil] + # + # @param country [String, nil] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + # + # @param line1 [String] First line of the street address. + # + # @param line2 [String, nil] Second line of the street address. + # + # @param postal_code [String, nil] Postal or ZIP code. + # + # @param state [String, nil] State, province, or region code, for example `CA`. + end + + # @see WhopSDK::Models::VerificationUpdateResponse#kind + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL = :individual + BUSINESS = :business + + # @!method self.values + # @return [Array] + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + # + # @return [String, nil] + optional :id, String + + # @!attribute description + # Additional instructions for this requested item, or `null`. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute error_message + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + # + # @return [String, nil] + optional :error_message, String, nil?: true + + # @!attribute field + # Stable field key, such as `ssn` or `business_description`. + # + # @return [String, nil] + optional :field, String + + # @!attribute label + # Human-readable label for the field, such as `Social Security Number`. + # + # @return [String, nil] + optional :label, String + + # @!attribute options + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + # + # @return [Array, nil] + optional :options, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute requested_files + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + # + # @return [Array, nil] + optional :requested_files, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile] } + + # @!attribute type + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + # + # @return [String, nil] + optional :type, String, nil?: true + + # @!method initialize(id: nil, description: nil, error_message: nil, field: nil, label: nil, options: nil, requested_files: nil, type: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateResponse::RequestedInformation} for more + # details. + # + # @param id [String] Requested information item ID, prefixed `inrqi_`. Include this ID when submittin + # + # @param description [String, nil] Additional instructions for this requested item, or `null`. + # + # @param error_message [String, nil] Reason a previously submitted value was rejected. `null` if no submitted value h + # + # @param field [String] Stable field key, such as `ssn` or `business_description`. + # + # @param label [String] Human-readable label for the field, such as `Social Security Number`. + # + # @param options [Array] Allowed values for a `select` field (e.g. account_type, business_structure) — th + # + # @param requested_files [Array] Document upload slots for this item. Present when `type` is `files`; upload one + # + # @param type [String, nil] Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + # + # @return [String, nil] + optional :category, String, nil?: true + + # @!attribute is_optional + # Whether this slot can be left empty. + # + # @return [Boolean, nil] + optional :is_optional, WhopSDK::Internal::Type::Boolean + + # @!attribute kind + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + # + # @return [String, nil] + optional :kind, String, nil?: true + + # @!attribute label + # Label for this upload slot, such as `Front of ID Document`. + # + # @return [String, nil] + optional :label, String + + # @!attribute multiple + # Whether this slot accepts more than one file. + # + # @return [Boolean, nil] + optional :multiple, WhopSDK::Internal::Type::Boolean + + # @!method initialize(category: nil, is_optional: nil, kind: nil, label: nil, multiple: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile} + # for more details. + # + # @param category [String, nil] File category to include with the uploaded file so Whop can route the document c + # + # @param is_optional [Boolean] Whether this slot can be left empty. + # + # @param kind [String, nil] Specific document type requested, such as `Bank Statement`. `null` for standard + # + # @param label [String] Label for this upload slot, such as `Front of ID Document`. + # + # @param multiple [Boolean] Whether this slot accepts more than one file. + end + end + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + # @!attribute document + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + # + # @return [String, nil] + optional :document, String + + # @!attribute rejection_reason + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + # + # @return [String, nil] + optional :rejection_reason, String, nil?: true + + # @!attribute status + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + # + # @return [Symbol, WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status, nil] + optional :status, enum: -> { WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status } + + # @!method initialize(document: nil, rejection_reason: nil, status: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateResponse::RequiredDocument} for more + # details. + # + # @param document [String] Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + # + # @param rejection_reason [String, nil] Why the previous submission was rejected, when the provider requested new docume + # + # @param status [Symbol, WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status] `pending_upload` until the document has been relayed for review; `submitted` aft + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + # + # @see WhopSDK::Models::VerificationUpdateResponse::RequiredDocument#status + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING_UPLOAD = :pending_upload + SUBMITTED = :submitted + + # @!method self.values + # @return [Array] + end + end + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + # + # @see WhopSDK::Models::VerificationUpdateResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + NOT_STARTED = :not_started + PENDING = :pending + APPROVED = :approved + REJECTED = :rejected + ACTION_REQUIRED = :action_required + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/wallet_balance_response.rb b/lib/whop_sdk/models/wallet_balance_response.rb deleted file mode 100644 index 4963961e..00000000 --- a/lib/whop_sdk/models/wallet_balance_response.rb +++ /dev/null @@ -1,84 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::Wallets#balance - class WalletBalanceResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute object - # - # @return [Symbol, WhopSDK::Models::WalletBalanceResponse::Object] - required :object, enum: -> { WhopSDK::Models::WalletBalanceResponse::Object } - - # @!attribute tokens - # - # @return [Array] - required :tokens, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::WalletBalanceResponse::Token] } - - # @!attribute total_usd - # - # @return [String] - required :total_usd, String - - # @!method initialize(object:, tokens:, total_usd:) - # @param object [Symbol, WhopSDK::Models::WalletBalanceResponse::Object] - # @param tokens [Array] - # @param total_usd [String] - - # @see WhopSDK::Models::WalletBalanceResponse#object - module Object - extend WhopSDK::Internal::Type::Enum - - BALANCE = :balance - - # @!method self.values - # @return [Array] - end - - class Token < WhopSDK::Internal::Type::BaseModel - # @!attribute balance - # - # @return [String] - required :balance, String - - # @!attribute icon_url - # - # @return [String, nil] - required :icon_url, String, nil?: true - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute price_usd - # - # @return [Float] - required :price_usd, Float - - # @!attribute symbol - # - # @return [String] - required :symbol, String - - # @!attribute token_address - # - # @return [String, nil] - required :token_address, String, nil?: true - - # @!attribute value_usd - # - # @return [String] - required :value_usd, String - - # @!method initialize(balance:, icon_url:, name:, price_usd:, symbol:, token_address:, value_usd:) - # @param balance [String] - # @param icon_url [String, nil] - # @param name [String] - # @param price_usd [Float] - # @param symbol [String] - # @param token_address [String, nil] - # @param value_usd [String] - end - end - end -end diff --git a/lib/whop_sdk/models/wallet_list_response.rb b/lib/whop_sdk/models/wallet_list_response.rb deleted file mode 100644 index 25224bda..00000000 --- a/lib/whop_sdk/models/wallet_list_response.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::Wallets#list - class WalletListResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute wallets - # - # @return [Array] - required :wallets, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::WalletListResponse::Wallet] } - - # @!method initialize(wallets:) - # @param wallets [Array] - - class Wallet < WhopSDK::Internal::Type::BaseModel - # @!attribute address - # - # @return [String] - required :address, String - - # @!attribute balance_usd - # - # @return [String] - required :balance_usd, String - - # @!attribute network - # - # @return [String] - required :network, String - - # @!method initialize(address:, balance_usd:, network:) - # @param address [String] - # @param balance_usd [String] - # @param network [String] - end - end - end -end diff --git a/lib/whop_sdk/models/wallet_send_params.rb b/lib/whop_sdk/models/wallet_send_params.rb deleted file mode 100644 index 1a50c385..00000000 --- a/lib/whop_sdk/models/wallet_send_params.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::Wallets#send_ - class WalletSendParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - # @!attribute account_id - # The sending account ID. - # - # @return [String] - required :account_id, String - - # @!attribute amount - # USDT amount to send. - # - # @return [String] - required :amount, String - - # @!attribute to - # Recipient user ID, business account ID, ledger account ID, or email. - # - # @return [String] - required :to, String - - # @!method initialize(account_id:, amount:, to:, request_options: {}) - # @param account_id [String] The sending account ID. - # - # @param amount [String] USDT amount to send. - # - # @param to [String] Recipient user ID, business account ID, ledger account ID, or email. - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/whop_sdk/models/wallet_send_response.rb b/lib/whop_sdk/models/wallet_send_response.rb deleted file mode 100644 index 233d3e75..00000000 --- a/lib/whop_sdk/models/wallet_send_response.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::Wallets#send_ - class WalletSendResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute amount - # - # @return [String] - required :amount, String - - # @!attribute currency - # - # @return [String] - required :currency, String - - # @!attribute destination - # - # @return [WhopSDK::Models::WalletSendResponse::Destination] - required :destination, -> { WhopSDK::Models::WalletSendResponse::Destination } - - # @!attribute object - # - # @return [Symbol, WhopSDK::Models::WalletSendResponse::Object] - required :object, enum: -> { WhopSDK::Models::WalletSendResponse::Object } - - # @!attribute source - # - # @return [WhopSDK::Models::WalletSendResponse::Source] - required :source, -> { WhopSDK::Models::WalletSendResponse::Source } - - # @!attribute tx_hash - # - # @return [String] - required :tx_hash, String - - # @!method initialize(amount:, currency:, destination:, object:, source:, tx_hash:) - # @param amount [String] - # @param currency [String] - # @param destination [WhopSDK::Models::WalletSendResponse::Destination] - # @param object [Symbol, WhopSDK::Models::WalletSendResponse::Object] - # @param source [WhopSDK::Models::WalletSendResponse::Source] - # @param tx_hash [String] - - # @see WhopSDK::Models::WalletSendResponse#destination - class Destination < WhopSDK::Internal::Type::BaseModel - # @!attribute account_id - # - # @return [String] - required :account_id, String - - # @!attribute address - # - # @return [String] - required :address, String - - # @!method initialize(account_id:, address:) - # @param account_id [String] - # @param address [String] - end - - # @see WhopSDK::Models::WalletSendResponse#object - module Object - extend WhopSDK::Internal::Type::Enum - - SEND = :send - - # @!method self.values - # @return [Array] - end - - # @see WhopSDK::Models::WalletSendResponse#source - class Source < WhopSDK::Internal::Type::BaseModel - # @!attribute account_id - # - # @return [String] - required :account_id, String - - # @!attribute address - # - # @return [String] - required :address, String - - # @!method initialize(account_id:, address:) - # @param account_id [String] - # @param address [String] - end - end - end -end diff --git a/lib/whop_sdk/models/webhook_event.rb b/lib/whop_sdk/models/webhook_event.rb index ce6d526f..c369b6d1 100644 --- a/lib/whop_sdk/models/webhook_event.rb +++ b/lib/whop_sdk/models/webhook_event.rb @@ -13,6 +13,7 @@ module WebhookEvent INVOICE_VOIDED = :"invoice.voided" MEMBERSHIP_ACTIVATED = :"membership.activated" MEMBERSHIP_DEACTIVATED = :"membership.deactivated" + MEMBERSHIP_TRIAL_ENDING_SOON = :"membership.trial_ending_soon" ENTRY_CREATED = :"entry.created" ENTRY_APPROVED = :"entry.approved" ENTRY_DENIED = :"entry.denied" @@ -20,6 +21,7 @@ module WebhookEvent SETUP_INTENT_REQUIRES_ACTION = :"setup_intent.requires_action" SETUP_INTENT_SUCCEEDED = :"setup_intent.succeeded" SETUP_INTENT_CANCELED = :"setup_intent.canceled" + LEDGER_ACCOUNT_FUNDS_AVAILABLE = :"ledger_account.funds_available" WITHDRAWAL_CREATED = :"withdrawal.created" WITHDRAWAL_UPDATED = :"withdrawal.updated" COURSE_LESSON_INTERACTION_COMPLETED = :"course_lesson_interaction.completed" @@ -33,6 +35,8 @@ module WebhookEvent RESOLUTION_CENTER_CASE_CREATED = :"resolution_center_case.created" RESOLUTION_CENTER_CASE_UPDATED = :"resolution_center_case.updated" RESOLUTION_CENTER_CASE_DECIDED = :"resolution_center_case.decided" + CHAT_MESSAGE_CREATED = :"chat.message.created" + CHAT_REACTION_CREATED = :"chat.reaction.created" PAYMENT_CREATED = :"payment.created" PAYMENT_SUCCEEDED = :"payment.succeeded" PAYMENT_FAILED = :"payment.failed" diff --git a/lib/whop_sdk/models/withdrawal.rb b/lib/whop_sdk/models/withdrawal.rb index 381b5d8f..4529091b 100644 --- a/lib/whop_sdk/models/withdrawal.rb +++ b/lib/whop_sdk/models/withdrawal.rb @@ -183,6 +183,7 @@ module ErrorCode MISSING_PHONE_NUMBER = :missing_phone_number MISSING_REMITTANCE_INFO = :missing_remittance_info PAYEE_NAME_INVALID = :payee_name_invalid + BENEFICIARY_NAME_MISMATCH = :beneficiary_name_mismatch RECEIVING_ACCOUNT_LOCKED = :receiving_account_locked REJECTED_BY_COMPLIANCE = :rejected_by_compliance RTP_NOT_SUPPORTED = :rtp_not_supported diff --git a/lib/whop_sdk/models/withdrawal_create_params.rb b/lib/whop_sdk/models/withdrawal_create_params.rb index c351e079..61ffb59c 100644 --- a/lib/whop_sdk/models/withdrawal_create_params.rb +++ b/lib/whop_sdk/models/withdrawal_create_params.rb @@ -32,7 +32,7 @@ class WithdrawalCreateParams < WhopSDK::Internal::Type::BaseModel optional :payout_method_id, String, nil?: true # @!attribute platform_covers_fees - # Whether the platform covers the payout fees instead of the connected account. + # Whether the platform covers the payout fees. # # @return [Boolean, nil] optional :platform_covers_fees, WhopSDK::Internal::Type::Boolean, nil?: true @@ -56,7 +56,7 @@ class WithdrawalCreateParams < WhopSDK::Internal::Type::BaseModel # # @param payout_method_id [String, nil] The ID of the payout method to use for the withdrawal. # - # @param platform_covers_fees [Boolean, nil] Whether the platform covers the payout fees instead of the connected account. + # @param platform_covers_fees [Boolean, nil] Whether the platform covers the payout fees. # # @param statement_descriptor [String, nil] Custom statement descriptor for the withdrawal. Must be between 5 and 22 charact # diff --git a/lib/whop_sdk/models/workforce/bounty_list_params.rb b/lib/whop_sdk/models/workforce/bounty_list_params.rb new file mode 100644 index 00000000..20e88a2e --- /dev/null +++ b/lib/whop_sdk/models/workforce/bounty_list_params.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Workforce + # @see WhopSDK::Resources::Workforce::Bounties#list + class BountyListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # Scope the list to this account (`biz_` tag). Requires read access to the + # account; account API keys may pass their own account or a connected account. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute after + # Cursor to paginate forwards from. + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # Cursor to paginate backwards from. + # + # @return [String, nil] + optional :before, String + + # @!attribute created_after + # Only bounties created after this ISO 8601 timestamp. + # + # @return [String, nil] + optional :created_after, String + + # @!attribute created_before + # Only bounties created before this ISO 8601 timestamp. + # + # @return [String, nil] + optional :created_before, String + + # @!attribute direction + # Sort direction. + # + # @return [Symbol, WhopSDK::Models::Workforce::BountyListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::Workforce::BountyListParams::Direction } + + # @!attribute first + # Number of bounties to return from the start of the window. + # + # @return [Integer, nil] + optional :first, Integer + + # @!attribute last + # Number of bounties to return from the end of the window. + # + # @return [Integer, nil] + optional :last, Integer + + # @!attribute order + # Sort field. + # + # @return [Symbol, WhopSDK::Models::Workforce::BountyListParams::Order, nil] + optional :order, enum: -> { WhopSDK::Workforce::BountyListParams::Order } + + # @!attribute query + # Substring match on the bounty title or ID. + # + # @return [String, nil] + optional :query, String + + # @!attribute status + # Filter by lifecycle state. + # + # @return [Symbol, WhopSDK::Models::Workforce::BountyListParams::Status, nil] + optional :status, enum: -> { WhopSDK::Workforce::BountyListParams::Status } + + # @!attribute user_id + # List the bounties this user participated in (`user_` tag). Must be the + # authenticated user. + # + # @return [String, nil] + optional :user_id, String + + # @!method initialize(account_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, status: nil, user_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Workforce::BountyListParams} for more details. + # + # @param account_id [String] Scope the list to this account (`biz_` tag). Requires read access to the account + # + # @param after [String] Cursor to paginate forwards from. + # + # @param before [String] Cursor to paginate backwards from. + # + # @param created_after [String] Only bounties created after this ISO 8601 timestamp. + # + # @param created_before [String] Only bounties created before this ISO 8601 timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Workforce::BountyListParams::Direction] Sort direction. + # + # @param first [Integer] Number of bounties to return from the start of the window. + # + # @param last [Integer] Number of bounties to return from the end of the window. + # + # @param order [Symbol, WhopSDK::Models::Workforce::BountyListParams::Order] Sort field. + # + # @param query [String] Substring match on the bounty title or ID. + # + # @param status [Symbol, WhopSDK::Models::Workforce::BountyListParams::Status] Filter by lifecycle state. + # + # @param user_id [String] List the bounties this user participated in (`user_` tag). Must be the authentic + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # Sort field. + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT = :created_at + GROSS_PAID_OUT_AMOUNT = :gross_paid_out_amount + + # @!method self.values + # @return [Array] + end + + # Filter by lifecycle state. + module Status + extend WhopSDK::Internal::Type::Enum + + SCHEDULED = :scheduled + OPEN = :open + CLOSED = :closed + COMPLETED = :completed + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/workforce/bounty_retrieve_params.rb b/lib/whop_sdk/models/workforce/bounty_retrieve_params.rb new file mode 100644 index 00000000..bda14ed6 --- /dev/null +++ b/lib/whop_sdk/models/workforce/bounty_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Workforce + # @see WhopSDK::Resources::Workforce::Bounties#retrieve + class BountyRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/whop_sdk/models/workforce/workforce_bounty.rb b/lib/whop_sdk/models/workforce/workforce_bounty.rb new file mode 100644 index 00000000..7648bdef --- /dev/null +++ b/lib/whop_sdk/models/workforce/workforce_bounty.rb @@ -0,0 +1,351 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Workforce + # @see WhopSDK::Resources::Workforce::Bounties#retrieve + class WorkforceBounty < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Bounty ID, prefixed `bnty_`. + # + # @return [String] + required :id, String + + # @!attribute accepted_submissions_count + # Submissions accepted so far. + # + # @return [Integer] + required :accepted_submissions_count, Integer + + # @!attribute accepted_submissions_limit + # Number of submissions that can be accepted (winner slots). + # + # @return [Integer] + required :accepted_submissions_limit, Integer + + # @!attribute allowed_country_codes + # + # @return [Array] + required :allowed_country_codes, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute budget_amount + # Total gross budget committed to the bounty: `gross_reward_amount` times + # `accepted_submissions_limit`. + # + # @return [Float] + required :budget_amount, Float + + # @!attribute business_goal_type + # What the poster wants the work to achieve. + # + # @return [Symbol, WhopSDK::Models::Workforce::WorkforceBounty::BusinessGoalType, nil] + required :business_goal_type, + enum: -> { WhopSDK::Workforce::WorkforceBounty::BusinessGoalType }, + nil?: true + + # @!attribute created_at + # When the bounty was created, as an ISO 8601 timestamp. + # + # @return [String] + required :created_at, String + + # @!attribute currency + # Currency for all amounts on the bounty, as a lowercase ISO 4217 code. + # + # @return [String] + required :currency, String + + # @!attribute description + # Full task instructions shown to workers. + # + # @return [String] + required :description, String + + # @!attribute experience_id + # Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide + # bounties; may belong to a different account than the funder. + # + # @return [String, nil] + required :experience_id, String, nil?: true + + # @!attribute funding_account + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + # + # @return [WhopSDK::Models::Workforce::WorkforceBounty::FundingAccount, nil] + required :funding_account, -> { WhopSDK::Workforce::WorkforceBounty::FundingAccount }, nil?: true + + # @!attribute gross_paid_out_amount + # Gross amount paid out from the bounty pool across accepted submissions — worker + # payouts, platform fees, and affiliate shares together. Tips and reviewer rewards + # are excluded. + # + # @return [Float] + required :gross_paid_out_amount, Float + + # @!attribute gross_reward_amount + # Gross bounty-pool amount allocated per accepted submission, in whole currency + # units. + # + # @return [Float] + required :gross_reward_amount, Float + + # @!attribute poster + # The user who posted the bounty. + # + # @return [WhopSDK::Models::Workforce::WorkforceBounty::Poster] + required :poster, -> { WhopSDK::Workforce::WorkforceBounty::Poster } + + # @!attribute scheduled_frequency + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + # + # @return [Symbol, WhopSDK::Models::Workforce::WorkforceBounty::ScheduledFrequency, nil] + required :scheduled_frequency, + enum: -> { WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency }, + nil?: true + + # @!attribute scheduled_publish_at + # When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once + # published, for bounties that were never scheduled, and for terminally failed + # drafts parked for manual rescheduling. + # + # @return [String, nil] + required :scheduled_publish_at, String, nil?: true + + # @!attribute spots_remaining + # Unfilled winner capacity: `accepted_submissions_limit` minus + # `accepted_submissions_count`, clamped to zero. Not a signal that the bounty + # currently accepts new claims. + # + # @return [Integer] + required :spots_remaining, Integer + + # @!attribute status + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + # + # @return [Symbol, WhopSDK::Models::Workforce::WorkforceBounty::Status] + required :status, enum: -> { WhopSDK::Workforce::WorkforceBounty::Status } + + # @!attribute submissions_closed_at + # When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null + # when submissions were never explicitly stopped — including closed or completed + # bounties that simply filled every winner slot. + # + # @return [String, nil] + required :submissions_closed_at, String, nil?: true + + # @!attribute title + # Short name of the task shown to workers. + # + # @return [String] + required :title, String + + # @!attribute unresolved_submissions_count + # Submissions still awaiting an outcome: in progress or pending review. + # + # @return [Integer] + required :unresolved_submissions_count, Integer + + # @!attribute updated_at + # When the bounty was last updated, as an ISO 8601 timestamp. + # + # @return [String] + required :updated_at, String + + # @!method initialize(id:, accepted_submissions_count:, accepted_submissions_limit:, allowed_country_codes:, budget_amount:, business_goal_type:, created_at:, currency:, description:, experience_id:, funding_account:, gross_paid_out_amount:, gross_reward_amount:, poster:, scheduled_frequency:, scheduled_publish_at:, spots_remaining:, status:, submissions_closed_at:, title:, unresolved_submissions_count:, updated_at:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Workforce::WorkforceBounty} for more details. + # + # @param id [String] Bounty ID, prefixed `bnty_`. + # + # @param accepted_submissions_count [Integer] Submissions accepted so far. + # + # @param accepted_submissions_limit [Integer] Number of submissions that can be accepted (winner slots). + # + # @param allowed_country_codes [Array] + # + # @param budget_amount [Float] Total gross budget committed to the bounty: `gross_reward_amount` times `accepte + # + # @param business_goal_type [Symbol, WhopSDK::Models::Workforce::WorkforceBounty::BusinessGoalType, nil] What the poster wants the work to achieve. + # + # @param created_at [String] When the bounty was created, as an ISO 8601 timestamp. + # + # @param currency [String] Currency for all amounts on the bounty, as a lowercase ISO 4217 code. + # + # @param description [String] Full task instructions shown to workers. + # + # @param experience_id [String, nil] Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide boun + # + # @param funding_account [WhopSDK::Models::Workforce::WorkforceBounty::FundingAccount, nil] The account whose balance funds the bounty pool, or `null` when a user funds it + # + # @param gross_paid_out_amount [Float] Gross amount paid out from the bounty pool across accepted submissions — worker + # + # @param gross_reward_amount [Float] Gross bounty-pool amount allocated per accepted submission, in whole currency un + # + # @param poster [WhopSDK::Models::Workforce::WorkforceBounty::Poster] The user who posted the bounty. + # + # @param scheduled_frequency [Symbol, WhopSDK::Models::Workforce::WorkforceBounty::ScheduledFrequency, nil] How often the schedule creates a new bounty. Each occurrence is a separate bount + # + # @param scheduled_publish_at [String, nil] When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once publis + # + # @param spots_remaining [Integer] Unfilled winner capacity: `accepted_submissions_limit` minus `accepted_submissio + # + # @param status [Symbol, WhopSDK::Models::Workforce::WorkforceBounty::Status] Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their p + # + # @param submissions_closed_at [String, nil] When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null whe + # + # @param title [String] Short name of the task shown to workers. + # + # @param unresolved_submissions_count [Integer] Submissions still awaiting an outcome: in progress or pending review. + # + # @param updated_at [String] When the bounty was last updated, as an ISO 8601 timestamp. + + # What the poster wants the work to achieve. + # + # @see WhopSDK::Models::Workforce::WorkforceBounty#business_goal_type + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + CLIPPING = :clipping + POST_ENGAGEMENT = :post_engagement + OWNED_ACCOUNT_GROWTH = :owned_account_growth + UGC_CONTENT = :ugc_content + LOCAL_ACTIVATION = :local_activation + OTHER = :other + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Workforce::WorkforceBounty#funding_account + class FundingAccount < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Account ID, prefixed `biz_`. + # + # @return [String] + required :id, String + + # @!attribute title + # Account display name. + # + # @return [String] + required :title, String + + # @!method initialize(id:, title:) + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + # + # @param id [String] Account ID, prefixed `biz_`. + # + # @param title [String] Account display name. + end + + # @see WhopSDK::Models::Workforce::WorkforceBounty#poster + class Poster < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID, prefixed `user_`. + # + # @return [String] + required :id, String + + # @!attribute name + # Display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + # + # @return [WhopSDK::Models::Workforce::WorkforceBounty::Poster::ProfilePicture] + required :profile_picture, -> { WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture } + + # @!attribute username + # Public username. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, profile_picture:, username:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Workforce::WorkforceBounty::Poster} for more details. + # + # The user who posted the bounty. + # + # @param id [String] User ID, prefixed `user_`. + # + # @param name [String, nil] Display name. + # + # @param profile_picture [WhopSDK::Models::Workforce::WorkforceBounty::Poster::ProfilePicture] Avatar wrapper; its `url` is always present, using a generated placeholder when + # + # @param username [String] Public username. + + # @see WhopSDK::Models::Workforce::WorkforceBounty::Poster#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # Avatar image URL. Always present — a generated placeholder when the user set no + # picture. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Workforce::WorkforceBounty::Poster::ProfilePicture} for more + # details. + # + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + # + # @param url [String] Avatar image URL. Always present — a generated placeholder when the user set no + end + end + + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + # + # @see WhopSDK::Models::Workforce::WorkforceBounty#scheduled_frequency + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + ONCE = :once + HOURLY = :hourly + DAILY = :daily + WEEKLY = :weekly + MONTHLY = :monthly + + # @!method self.values + # @return [Array] + end + + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + # + # @see WhopSDK::Models::Workforce::WorkforceBounty#status + module Status + extend WhopSDK::Internal::Type::Enum + + SCHEDULED = :scheduled + OPEN = :open + CLOSED = :closed + COMPLETED = :completed + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + end + end + + WorkforceBounty = Workforce::WorkforceBounty + end +end diff --git a/lib/whop_sdk/models/workforce/workforce_bounty_list_item.rb b/lib/whop_sdk/models/workforce/workforce_bounty_list_item.rb new file mode 100644 index 00000000..c995e5b9 --- /dev/null +++ b/lib/whop_sdk/models/workforce/workforce_bounty_list_item.rb @@ -0,0 +1,347 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + module Workforce + # @see WhopSDK::Resources::Workforce::Bounties#list + class WorkforceBountyListItem < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Bounty ID, prefixed `bnty_`. + # + # @return [String] + required :id, String + + # @!attribute accepted_submissions_count + # Submissions accepted so far. + # + # @return [Integer] + required :accepted_submissions_count, Integer + + # @!attribute accepted_submissions_limit + # Number of submissions that can be accepted (winner slots). + # + # @return [Integer] + required :accepted_submissions_limit, Integer + + # @!attribute allowed_country_codes + # + # @return [Array] + required :allowed_country_codes, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute budget_amount + # Total gross budget committed to the bounty: `gross_reward_amount` times + # `accepted_submissions_limit`. + # + # @return [Float] + required :budget_amount, Float + + # @!attribute business_goal_type + # What the poster wants the work to achieve. + # + # @return [Symbol, WhopSDK::Models::Workforce::WorkforceBountyListItem::BusinessGoalType, nil] + required :business_goal_type, + enum: -> { WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType }, + nil?: true + + # @!attribute created_at + # When the bounty was created, as an ISO 8601 timestamp. + # + # @return [String] + required :created_at, String + + # @!attribute currency + # Currency for all amounts on the bounty, as a lowercase ISO 4217 code. + # + # @return [String] + required :currency, String + + # @!attribute experience_id + # Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide + # bounties; may belong to a different account than the funder. + # + # @return [String, nil] + required :experience_id, String, nil?: true + + # @!attribute funding_account + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + # + # @return [WhopSDK::Models::Workforce::WorkforceBountyListItem::FundingAccount, nil] + required :funding_account, + -> { + WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount + }, + nil?: true + + # @!attribute gross_paid_out_amount + # Gross amount paid out from the bounty pool across accepted submissions — worker + # payouts, platform fees, and affiliate shares together. Tips and reviewer rewards + # are excluded. + # + # @return [Float] + required :gross_paid_out_amount, Float + + # @!attribute gross_reward_amount + # Gross bounty-pool amount allocated per accepted submission, in whole currency + # units. + # + # @return [Float] + required :gross_reward_amount, Float + + # @!attribute poster + # The user who posted the bounty. + # + # @return [WhopSDK::Models::Workforce::WorkforceBountyListItem::Poster] + required :poster, -> { WhopSDK::Workforce::WorkforceBountyListItem::Poster } + + # @!attribute scheduled_frequency + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + # + # @return [Symbol, WhopSDK::Models::Workforce::WorkforceBountyListItem::ScheduledFrequency, nil] + required :scheduled_frequency, + enum: -> { WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency }, + nil?: true + + # @!attribute scheduled_publish_at + # When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once + # published, for bounties that were never scheduled, and for terminally failed + # drafts parked for manual rescheduling. + # + # @return [String, nil] + required :scheduled_publish_at, String, nil?: true + + # @!attribute spots_remaining + # Unfilled winner capacity: `accepted_submissions_limit` minus + # `accepted_submissions_count`, clamped to zero. Not a signal that the bounty + # currently accepts new claims. + # + # @return [Integer] + required :spots_remaining, Integer + + # @!attribute status + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + # + # @return [Symbol, WhopSDK::Models::Workforce::WorkforceBountyListItem::Status] + required :status, enum: -> { WhopSDK::Workforce::WorkforceBountyListItem::Status } + + # @!attribute submissions_closed_at + # When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null + # when submissions were never explicitly stopped — including closed or completed + # bounties that simply filled every winner slot. + # + # @return [String, nil] + required :submissions_closed_at, String, nil?: true + + # @!attribute title + # Short name of the task shown to workers. + # + # @return [String] + required :title, String + + # @!attribute unresolved_submissions_count + # Submissions still awaiting an outcome: in progress or pending review. + # + # @return [Integer] + required :unresolved_submissions_count, Integer + + # @!attribute updated_at + # When the bounty was last updated, as an ISO 8601 timestamp. + # + # @return [String] + required :updated_at, String + + # @!method initialize(id:, accepted_submissions_count:, accepted_submissions_limit:, allowed_country_codes:, budget_amount:, business_goal_type:, created_at:, currency:, experience_id:, funding_account:, gross_paid_out_amount:, gross_reward_amount:, poster:, scheduled_frequency:, scheduled_publish_at:, spots_remaining:, status:, submissions_closed_at:, title:, unresolved_submissions_count:, updated_at:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Workforce::WorkforceBountyListItem} for more details. + # + # @param id [String] Bounty ID, prefixed `bnty_`. + # + # @param accepted_submissions_count [Integer] Submissions accepted so far. + # + # @param accepted_submissions_limit [Integer] Number of submissions that can be accepted (winner slots). + # + # @param allowed_country_codes [Array] + # + # @param budget_amount [Float] Total gross budget committed to the bounty: `gross_reward_amount` times `accepte + # + # @param business_goal_type [Symbol, WhopSDK::Models::Workforce::WorkforceBountyListItem::BusinessGoalType, nil] What the poster wants the work to achieve. + # + # @param created_at [String] When the bounty was created, as an ISO 8601 timestamp. + # + # @param currency [String] Currency for all amounts on the bounty, as a lowercase ISO 4217 code. + # + # @param experience_id [String, nil] Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide boun + # + # @param funding_account [WhopSDK::Models::Workforce::WorkforceBountyListItem::FundingAccount, nil] The account whose balance funds the bounty pool, or `null` when a user funds it + # + # @param gross_paid_out_amount [Float] Gross amount paid out from the bounty pool across accepted submissions — worker + # + # @param gross_reward_amount [Float] Gross bounty-pool amount allocated per accepted submission, in whole currency un + # + # @param poster [WhopSDK::Models::Workforce::WorkforceBountyListItem::Poster] The user who posted the bounty. + # + # @param scheduled_frequency [Symbol, WhopSDK::Models::Workforce::WorkforceBountyListItem::ScheduledFrequency, nil] How often the schedule creates a new bounty. Each occurrence is a separate bount + # + # @param scheduled_publish_at [String, nil] When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once publis + # + # @param spots_remaining [Integer] Unfilled winner capacity: `accepted_submissions_limit` minus `accepted_submissio + # + # @param status [Symbol, WhopSDK::Models::Workforce::WorkforceBountyListItem::Status] Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their p + # + # @param submissions_closed_at [String, nil] When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null whe + # + # @param title [String] Short name of the task shown to workers. + # + # @param unresolved_submissions_count [Integer] Submissions still awaiting an outcome: in progress or pending review. + # + # @param updated_at [String] When the bounty was last updated, as an ISO 8601 timestamp. + + # What the poster wants the work to achieve. + # + # @see WhopSDK::Models::Workforce::WorkforceBountyListItem#business_goal_type + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + CLIPPING = :clipping + POST_ENGAGEMENT = :post_engagement + OWNED_ACCOUNT_GROWTH = :owned_account_growth + UGC_CONTENT = :ugc_content + LOCAL_ACTIVATION = :local_activation + OTHER = :other + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::Workforce::WorkforceBountyListItem#funding_account + class FundingAccount < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Account ID, prefixed `biz_`. + # + # @return [String] + required :id, String + + # @!attribute title + # Account display name. + # + # @return [String] + required :title, String + + # @!method initialize(id:, title:) + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + # + # @param id [String] Account ID, prefixed `biz_`. + # + # @param title [String] Account display name. + end + + # @see WhopSDK::Models::Workforce::WorkforceBountyListItem#poster + class Poster < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # User ID, prefixed `user_`. + # + # @return [String] + required :id, String + + # @!attribute name + # Display name. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + # + # @return [WhopSDK::Models::Workforce::WorkforceBountyListItem::Poster::ProfilePicture] + required :profile_picture, -> { WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture } + + # @!attribute username + # Public username. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, profile_picture:, username:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Workforce::WorkforceBountyListItem::Poster} for more details. + # + # The user who posted the bounty. + # + # @param id [String] User ID, prefixed `user_`. + # + # @param name [String, nil] Display name. + # + # @param profile_picture [WhopSDK::Models::Workforce::WorkforceBountyListItem::Poster::ProfilePicture] Avatar wrapper; its `url` is always present, using a generated placeholder when + # + # @param username [String] Public username. + + # @see WhopSDK::Models::Workforce::WorkforceBountyListItem::Poster#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # Avatar image URL. Always present — a generated placeholder when the user set no + # picture. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Workforce::WorkforceBountyListItem::Poster::ProfilePicture} + # for more details. + # + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + # + # @param url [String] Avatar image URL. Always present — a generated placeholder when the user set no + end + end + + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + # + # @see WhopSDK::Models::Workforce::WorkforceBountyListItem#scheduled_frequency + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + ONCE = :once + HOURLY = :hourly + DAILY = :daily + WEEKLY = :weekly + MONTHLY = :monthly + + # @!method self.values + # @return [Array] + end + + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + # + # @see WhopSDK::Models::Workforce::WorkforceBountyListItem#status + module Status + extend WhopSDK::Internal::Type::Enum + + SCHEDULED = :scheduled + OPEN = :open + CLOSED = :closed + COMPLETED = :completed + CANCELED = :canceled + + # @!method self.values + # @return [Array] + end + end + end + + WorkforceBountyListItem = Workforce::WorkforceBountyListItem + end +end diff --git a/lib/whop_sdk/resources/access_tokens.rb b/lib/whop_sdk/resources/access_tokens.rb index 704d8f81..46dddadb 100644 --- a/lib/whop_sdk/resources/access_tokens.rb +++ b/lib/whop_sdk/resources/access_tokens.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Access tokens class AccessTokens # Some parameter documentations has been truncated, see # {WhopSDK::Models::AccessTokenCreateParams} for more details. diff --git a/lib/whop_sdk/resources/account_links.rb b/lib/whop_sdk/resources/account_links.rb index cc119052..e5f60350 100644 --- a/lib/whop_sdk/resources/account_links.rb +++ b/lib/whop_sdk/resources/account_links.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Account links class AccountLinks # Some parameter documentations has been truncated, see # {WhopSDK::Models::AccountLinkCreateParams} for more details. diff --git a/lib/whop_sdk/resources/accounts.rb b/lib/whop_sdk/resources/accounts.rb index 5694a85a..6fe9b291 100644 --- a/lib/whop_sdk/resources/accounts.rb +++ b/lib/whop_sdk/resources/accounts.rb @@ -2,19 +2,40 @@ module WhopSDK module Resources + # An Account represents a person or business on Whop that can have its own + # profile, wallet, and account-scoped settings. Use accounts for customers, + # creators, merchants, sellers, or connected businesses your integration supports. + # + # Use the Accounts API to create accounts, list accounts visible to your + # credentials, retrieve or update an account, and retrieve the account associated + # with the current API key. class Accounts + # An Account represents a person or business on Whop that can have its own + # profile, wallet, and account-scoped settings. Use accounts for customers, + # creators, merchants, sellers, or connected businesses your integration supports. + # + # Use the Accounts API to create accounts, list accounts visible to your + # credentials, retrieve or update an account, and retrieve the account associated + # with the current API key. + # @return [WhopSDK::Resources::Accounts::Preferences] + attr_reader :preferences + # Some parameter documentations has been truncated, see # {WhopSDK::Models::AccountCreateParams} for more details. # # Creates an account. User tokens create business accounts; business account API - # keys create connected accounts. + # keys create connected accounts. Tax fields (`tax_remitted_by`, + # `product_tax_code_id`, `business_address`, `tax_identifiers`) are configured + # with Update Account, not at creation. # - # @overload create(email: nil, metadata: nil, request_options: {}) + # @overload create(email: nil, metadata: nil, title: nil, request_options: {}) # # @param email [String] The email address of the account owner. Required for business account API key re # # @param metadata [Hash{Symbol=>Object}] Arbitrary key/value metadata to store on the account. # + # @param title [String] The display name of the account. Defaults to `metadata.external_id` or the owner + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::Account] @@ -36,7 +57,7 @@ def create(params = {}) # # @overload retrieve(account_id, request_options: {}) # - # @param account_id [String] The ID of the account, which will look like biz\_******\******* + # @param account_id [String] Account ID, prefixed `biz_`. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -58,9 +79,9 @@ 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, 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: {}) + # @overload update(account_id, affiliate_application_required: nil, affiliate_instructions: nil, banner_image: nil, business_address: 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, product_tax_code_id: 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, tax_identifiers: nil, tax_remitted_by: 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\_******\******* + # @param account_id [String] Account ID, prefixed `biz_`. # # @param affiliate_application_required [Boolean] Whether prospective affiliates must submit an application before promoting this # @@ -68,21 +89,23 @@ def retrieve(account_id, params = {}) # # @param banner_image [Hash{Symbol=>Object}, nil] Attachment input for the account banner image. # - # @param business_type [String, nil] The high-level business category for the account. + # @param business_address [WhopSDK::Models::AccountUpdateParams::BusinessAddress] Account business address used to calculate tax. A complete address in a supporte # - # @param country [String, nil] The country the account is located in. + # @param business_type [String, nil] High-level business category for the account. # - # @param description [String, nil] A promotional description for the account. + # @param country [String, nil] Country where the account is located. # - # @param featured_affiliate_product_id [String, nil] The ID of the product to feature for affiliates. Pass null to clear. + # @param description [String, nil] Account promotional description. # - # @param home_preferences [Array] Preferences for the public business home page. + # @param featured_affiliate_product_id [String, nil] The ID of the product to feature for affiliates. Pass `null` to clear. # - # @param industry_group [String, nil] The industry group the account belongs to. + # @param home_preferences [Array] Public account home page preferences. # - # @param industry_type [String, nil] The specific industry vertical the account operates in. + # @param industry_group [String, nil] Account industry group. # - # @param invoice_prefix [String, nil] The prefix to use for account invoices. + # @param industry_type [String, nil] Specific industry vertical for the account. + # + # @param invoice_prefix [String, nil] Prefix used for account invoices. # # @param logo [Hash{Symbol=>Object}, nil] Attachment input for the account logo. # @@ -98,6 +121,8 @@ def retrieve(account_id, params = {}) # # @param other_industry_description [String, nil] The description of the industry type when industry_type is other. # + # @param product_tax_code_id [String, nil] ID of the tax classification code applied by default to the account's products. + # # @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. @@ -112,10 +137,14 @@ def retrieve(account_id, params = {}) # # @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 store_page_config [Hash{Symbol=>Object}, nil] Account store page display configuration. # # @param target_audience [String, nil] The target audience for this account. # + # @param tax_identifiers [Array] Account tax/VAT registrations to add or update. When `tax_remitted_by` is `self` + # + # @param tax_remitted_by [Symbol, WhopSDK::Models::AccountUpdateParams::TaxRemittedBy] Who calculates and remits tax for the account: `whop` (Whop calculates and remit + # # @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. @@ -136,22 +165,27 @@ def update(account_id, params = {}) ) end - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AccountListParams} for more details. - # # Lists accounts visible to the credential. User tokens return the user's business # accounts; business account API keys return the requesting business account and # its connected accounts. # - # @overload list(page: nil, per: nil, request_options: {}) + # @overload list(after: nil, before: nil, direction: nil, first: nil, last: nil, order: nil, request_options: {}) + # + # @param after [String] A cursor; returns accounts after this position. + # + # @param before [String] A cursor; returns accounts before this position. # - # @param page [Integer] The page number to retrieve + # @param direction [Symbol, WhopSDK::Models::AccountListParams::Direction] Sort direction. # - # @param per [Integer] The number of resources to return per page. There is a limit of 50 results per p + # @param first [Integer] The number of accounts to return (default 10, max 50). + # + # @param last [Integer] The number of accounts to return from the end of the range. + # + # @param order [Symbol, WhopSDK::Models::AccountListParams::Order] The field to sort accounts by. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Models::AccountListResponse] + # @return [WhopSDK::Internal::CursorPage] # # @see WhopSDK::Models::AccountListParams def list(params = {}) @@ -161,7 +195,8 @@ def list(params = {}) method: :get, path: "accounts", query: query, - model: WhopSDK::Models::AccountListResponse, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Account, options: options ) end @@ -185,11 +220,34 @@ def me(params = {}) ) end + # Lists the recommended actions computed for the account — the same set embedded + # on the account resource, served on their own so a caller can fetch just the + # recommendations. + # + # @overload recommend_actions(account_id, request_options: {}) + # + # @param account_id [String] Account ID, prefixed `biz_`. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::AccountRecommendActionsResponse] + # + # @see WhopSDK::Models::AccountRecommendActionsParams + def recommend_actions(account_id, params = {}) + @client.request( + method: :get, + path: ["accounts/%1$s/recommend_actions", account_id], + model: WhopSDK::Models::AccountRecommendActionsResponse, + options: params[:request_options] + ) + end + # @api private # # @param client [WhopSDK::Client] def initialize(client:) @client = client + @preferences = WhopSDK::Resources::Accounts::Preferences.new(client: client) end end end diff --git a/lib/whop_sdk/resources/accounts/preferences.rb b/lib/whop_sdk/resources/accounts/preferences.rb new file mode 100644 index 00000000..e037cbc6 --- /dev/null +++ b/lib/whop_sdk/resources/accounts/preferences.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Accounts + # An Account represents a person or business on Whop that can have its own + # profile, wallet, and account-scoped settings. Use accounts for customers, + # creators, merchants, sellers, or connected businesses your integration supports. + # + # Use the Accounts API to create accounts, list accounts visible to your + # credentials, retrieve or update an account, and retrieve the account associated + # with the current API key. + class Preferences + # Retrieves the account's preferences: a singleton settings document keyed by + # preference name. + # + # @overload retrieve(account_id, request_options: {}) + # + # @param account_id [String] Account ID, prefixed `biz_`. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Accounts::PreferenceRetrieveResponse] + # + # @see WhopSDK::Models::Accounts::PreferenceRetrieveParams + def retrieve(account_id, params = {}) + @client.request( + method: :get, + path: ["accounts/%1$s/preferences", account_id], + model: WhopSDK::Models::Accounts::PreferenceRetrieveResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Accounts::PreferenceUpdateParams} for more details. + # + # Updates the account's preferences. Each top-level key present in the body is + # replaced as a whole; omitted keys are left untouched. `ads_payment_methods` + # always requires a `primary` entry. `backup` is optional when the primary is + # `platform_balance` — omitting it removes any configured card — while a `card` + # primary requires a `platform_balance` backup. A `platform_balance` entry may + # omit `id` to use the account's default Whop balance. Changing which funding + # sources are configured requires a user token, while account API keys may only + # swap `primary` and `backup`. + # + # @overload update(account_id, ads_payment_methods: nil, request_options: {}) + # + # @param account_id [String] Account ID, prefixed `biz_`. + # + # @param ads_payment_methods [WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods] How the account pays for Whop Ads spend. `primary` is charged first; `backup` co + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Accounts::PreferenceUpdateResponse] + # + # @see WhopSDK::Models::Accounts::PreferenceUpdateParams + def update(account_id, params = {}) + parsed, options = WhopSDK::Accounts::PreferenceUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["accounts/%1$s/preferences", account_id], + body: parsed, + model: WhopSDK::Models::Accounts::PreferenceUpdateResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/whop_sdk/resources/ad_campaigns.rb b/lib/whop_sdk/resources/ad_campaigns.rb index 62194fbe..38befccb 100644 --- a/lib/whop_sdk/resources/ad_campaigns.rb +++ b/lib/whop_sdk/resources/ad_campaigns.rb @@ -2,24 +2,71 @@ module WhopSDK module Resources - # Ad campaigns + # An Ad Campaign is the top-level container for paid ads on an ad network. It sets + # the platform, objective, and budget strategy shared by its + # [ad groups](/api-reference/beta/ad-groups/ad-group) and ads. + # + # Use the Ad Campaigns API to create campaigns, list campaigns for an account, + # retrieve or update campaign settings, and pause or resume campaign delivery. class AdCampaigns # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdCampaignRetrieveParams} for more details. + # {WhopSDK::Models::AdCampaignCreateParams} for more details. # - # Retrieves a single ad campaign by its unique identifier. + # Creates an ad campaign for an account. # - # Required permissions: + # @overload create(objective:, platform:, title:, account_id: nil, bid_type: nil, budget_amount: nil, budget_optimization: nil, budget_type: nil, desired_cost_per_result: nil, ends_at: nil, special_ad_categories: nil, starts_at: nil, request_options: {}) # - # - `ad_campaign:basic:read` + # @param objective [Symbol, WhopSDK::Models::AdCampaignCreateParams::Objective] The goal the campaign optimizes toward. # - # @overload retrieve(id, stats_from: nil, stats_to: nil, request_options: {}) + # @param platform [Symbol, WhopSDK::Models::AdCampaignCreateParams::Platform] The ad network the campaign runs on. # - # @param id [String] The unique identifier of the ad campaign. + # @param title [String] The title of the campaign. # - # @param stats_from [Time, nil] Inclusive start of the window for the campaign's metric fields (spend, impressio + # @param account_id [String] The account to create the campaign under. Defaults to the account-scoped key's o # - # @param stats_to [Time, nil] Inclusive end of the window for the campaign's metric fields. Omit both statsFro + # @param bid_type [Symbol, WhopSDK::Models::AdCampaignCreateParams::BidType] CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or maxi + # + # @param budget_amount [Float] The campaign budget, in USD. Required for CBO (budget_optimization: ad_campaign) + # + # @param budget_optimization [Symbol, WhopSDK::Models::AdCampaignCreateParams::BudgetOptimization] Which level owns the budget — the campaign (CBO) or each ad group (ABO). Default + # + # @param budget_type [Symbol, WhopSDK::Models::AdCampaignCreateParams::BudgetType] Whether the budget is spent per day or over the campaign's lifetime. Defaults to + # + # @param desired_cost_per_result [Float] Target/cap cost per result in USD for average_target / maximum_target bidding. C + # + # @param ends_at [String] Campaign schedule end (ISO 8601). CBO only. + # + # @param special_ad_categories [Array] Regulated categories the campaign falls under. Ads in these categories are subje + # + # @param starts_at [String] Campaign schedule start (ISO 8601). CBO only. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::AdCampaign] + # + # @see WhopSDK::Models::AdCampaignCreateParams + def create(params) + parsed, options = WhopSDK::AdCampaignCreateParams.dump_request(params) + @client.request( + method: :post, + path: "ad_campaigns", + body: parsed, + model: WhopSDK::AdCampaign, + options: options + ) + end + + # Retrieves a single ad campaign with stats over the requested window. + # + # @overload retrieve(id, stats_from: nil, stats_to: nil, time_zone: nil, request_options: {}) + # + # @param id [String] The ad campaign ID. + # + # @param stats_from [String] Start of the stats window. + # + # @param stats_to [String] End of the stats window. + # + # @param time_zone [String] IANA timezone the stats window is interpreted in. Defaults to UTC. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -41,17 +88,28 @@ def retrieve(id, params = {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdCampaignUpdateParams} for more details. # - # Updates an ad campaign synchronously. + # Updates an ad campaign's editable fields (title, budget, schedule, bid strategy, + # and — before launch — budget optimization), and launches a draft campaign by + # setting status to active. Objective, budget type, special ad categories and + # desired cost per result are fixed at creation and cannot be changed. + # + # @overload update(id, bid_type: nil, budget_amount: nil, budget_optimization: nil, ends_at: nil, starts_at: nil, status: nil, title: nil, request_options: {}) + # + # @param id [String] The ad campaign ID. # - # Required permissions: + # @param bid_type [Symbol, WhopSDK::Models::AdCampaignUpdateParams::BidType] CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or maxi # - # - `ad_campaign:update` + # @param budget_amount [Float] The campaign budget, in the account's currency. Interpreted as daily or lifetime # - # @overload update(id, budget: nil, request_options: {}) + # @param budget_optimization [Symbol, WhopSDK::Models::AdCampaignUpdateParams::BudgetOptimization] Which level owns the budget — the campaign (CBO) or each ad group (ABO). Only ch # - # @param id [String] The unique identifier of the ad campaign to update. + # @param ends_at [String] Campaign schedule end (ISO 8601). CBO only. # - # @param budget [Float, nil] The campaign budget in dollars. The interpretation (daily or lifetime) follows t + # @param starts_at [String] Campaign schedule start (ISO 8601). CBO only. + # + # @param status [Symbol, WhopSDK::Models::AdCampaignUpdateParams::Status] Set to active to launch a draft campaign (moderates and pushes it live). Live-ca + # + # @param title [String] The name of the campaign. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -72,40 +130,41 @@ def update(id, params = {}) # 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. + # Lists the ad campaigns for an account, with stats over the requested window. + # + # @overload list(account_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, time_zone: nil, request_options: {}) # - # Required permissions: + # @param account_id [String] The account the campaigns belong to. Defaults to the account-scoped key's own ac # - # - `ad_campaign:basic:read` + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # - # @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 before [String] Cursor to fetch the page before (from page_info.start_cursor). # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param created_after [String] Only return campaigns created after this timestamp. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param created_before [String] Only return campaigns created before this timestamp. # - # @param company_id [String, nil] The unique identifier of the company to list ad campaigns for. + # @param direction [Symbol, WhopSDK::Models::AdCampaignListParams::Direction] The sort direction. Defaults to desc. # - # @param created_after [Time, nil] Only return ad campaigns created after this timestamp. + # @param first [Integer] The number of campaigns to return. # - # @param created_before [Time, nil] Only return ad campaigns created before this timestamp. + # @param last [Integer] The number of campaigns to return from the end of the range. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param order [Symbol, WhopSDK::Models::AdCampaignListParams::Order] The field to sort by. Defaults to created_at. Stat columns (spend, impressions, # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param query [String] Filter campaigns by a title or ID substring. # - # @param query [String, nil] Case-insensitive substring match against the campaign title or ID. + # @param stats_from [String] Start of the stats window. Defaults to all-time. # - # @param stats_from [Time, nil] Inclusive start of the window for each campaign's metric fields (spend, impressi + # @param stats_to [String] End of the stats window. Defaults to now. # - # @param stats_to [Time, nil] Inclusive end of the window for each campaign's metric fields. Omit both statsFr + # @param status [Symbol, WhopSDK::Models::AdCampaignListParams::Status] Only return campaigns with this status. # - # @param status [Symbol, WhopSDK::Models::AdCampaignStatus, nil] The status of an ad campaign. + # @param time_zone [String] IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare s # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Internal::CursorPage] + # @return [WhopSDK::Internal::CursorPage] # # @see WhopSDK::Models::AdCampaignListParams def list(params = {}) @@ -116,20 +175,37 @@ def list(params = {}) path: "ad_campaigns", query: query, page: WhopSDK::Internal::CursorPage, - model: WhopSDK::Models::AdCampaignListResponse, + model: WhopSDK::AdCampaign, options: options ) end - # Pauses an ad campaign, optionally until a specific date. + # Deletes an ad campaign and archives it on the ad platform (cascades to ad groups + # and ads). Returns true on success. + # + # @overload delete(id, request_options: {}) # - # Required permissions: + # @param id [String] The ad campaign ID. # - # - `ad_campaign:update` + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Boolean] + # + # @see WhopSDK::Models::AdCampaignDeleteParams + def delete(id, params = {}) + @client.request( + method: :delete, + path: ["ad_campaigns/%1$s", id], + model: WhopSDK::Internal::Type::Boolean, + options: params[:request_options] + ) + end + + # Pauses an active ad campaign. # # @overload pause(id, request_options: {}) # - # @param id [String] The unique identifier of the ad campaign to pause. + # @param id [String] The ad campaign ID. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -147,13 +223,9 @@ def pause(id, params = {}) # Resumes a paused ad campaign. # - # Required permissions: - # - # - `ad_campaign:update` - # # @overload unpause(id, request_options: {}) # - # @param id [String] The unique identifier of the ad campaign to unpause. + # @param id [String] The ad campaign ID. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/whop_sdk/resources/ad_groups.rb b/lib/whop_sdk/resources/ad_groups.rb index 510b1ab5..3b969a9a 100644 --- a/lib/whop_sdk/resources/ad_groups.rb +++ b/lib/whop_sdk/resources/ad_groups.rb @@ -2,24 +2,93 @@ module WhopSDK module Resources - # Ad groups + # An Ad Group sits inside an + # [ad campaign](/api-reference/beta/ad-campaigns/ad-campaign) and controls + # delivery for [ads](/api-reference/beta/ads/ad). It sets the audience, + # placements, schedule, budget, and optimization goal for its ads. + # + # Use the Ad Groups API to create ad groups in campaigns, list or retrieve + # targeting and delivery settings, update budgets or targeting, delete groups that + # should stop running, and pause or resume delivery. class AdGroups # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdGroupRetrieveParams} for more details. + # {WhopSDK::Models::AdGroupCreateParams} for more details. # - # Retrieves a single ad group by its unique identifier. + # Creates an ad group (ad set) in a campaign. # - # Required permissions: + # @overload create(ad_campaign_id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, devices: nil, dynamic_creative: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) # - # - `ad_campaign:basic:read` + # @param ad_campaign_id [String] The ad campaign to create the ad group in. # - # @overload retrieve(id, stats_from: nil, stats_to: nil, request_options: {}) + # @param audiences [Object] Saved-audience targeting: { include, exclude } arrays of audience IDs. Incompati # - # @param id [String] The unique identifier of the ad group. + # @param bid_type [Symbol, WhopSDK::Models::AdGroupCreateParams::BidType] Bid strategy. # - # @param stats_from [Time, nil] Inclusive start of the window for the ad group's metric fields (spend, impressio + # @param budget_amount [Float] Ad-set budget in dollars (ABO only; omit under CBO). # - # @param stats_to [Time, nil] Inclusive end of the window for the ad group's metric fields. Omit both statsFro + # @param budget_type [Symbol, WhopSDK::Models::AdGroupCreateParams::BudgetType] Whether the budget is daily or lifetime. + # + # @param conversion_event [Symbol, String, WhopSDK::Models::AdGroupCreateParams::ConversionEvent, nil] The pixel event optimized for. A standard event, or any custom pixel event name. + # + # @param conversion_location [Symbol, WhopSDK::Models::AdGroupCreateParams::ConversionLocation] Where results happen: website (conversions), profile (IG/FB engagement), messagi + # + # @param demographics [Object] Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + # + # @param desired_cost_per_result [Float] Target/cap cost for average_target / maximum_target. + # + # @param devices [Object] Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + # + # @param dynamic_creative [Boolean] Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; immutab + # + # @param ends_at [String] Schedule end, ISO 8601. + # + # @param frequency_cap [Object] { maximum_impressions, per_days } — only valid for reach optimization. + # + # @param languages [Array] Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all language + # + # @param message_apps [Array] Required when conversion_location is messaging: which apps to message on. Combin + # + # @param minimum_daily_spend [Float] Daily spend floor within the budget. + # + # @param optimization_goal [String] What the ad group optimizes for (e.g. conversions, link_clicks, reach). + # + # @param placements [Object] 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # + # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), regions (states/pr + # + # @param starts_at [String] Schedule start, ISO 8601. + # + # @param status [Symbol, WhopSDK::Models::AdGroupCreateParams::Status] Initial status (default: active). + # + # @param title [String] The display name of the ad group. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::AdGroup] + # + # @see WhopSDK::Models::AdGroupCreateParams + def create(params) + parsed, options = WhopSDK::AdGroupCreateParams.dump_request(params) + @client.request( + method: :post, + path: "ad_groups", + body: parsed, + model: WhopSDK::AdGroup, + options: options + ) + end + + # Retrieves a single ad group. + # + # @overload retrieve(id, stats_from: nil, stats_to: nil, time_zone: nil, request_options: {}) + # + # @param id [String] The ad group ID. + # + # @param stats_from [String] Start of the stats window. + # + # @param stats_to [String] End of the stats window. + # + # @param time_zone [String] IANA timezone the stats window is interpreted in. Defaults to UTC. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -38,32 +107,54 @@ def retrieve(id, params = {}) ) end - # Updates an existing ad group. + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdGroupUpdateParams} for more details. + # + # Updates an ad group's editable fields. Only the keys you send are changed. + # + # @overload update(id, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, devices: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) + # + # @param id [String] The ad group ID. + # + # @param audiences [Object] Saved-audience targeting: { include, exclude } arrays of audience IDs. Incompati + # + # @param bid_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::BidType] Bid strategy. # - # Required permissions: + # @param budget_amount [Float] Ad-set budget in dollars (ABO only; omit under CBO). # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` + # @param budget_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::BudgetType] Whether the budget is daily or lifetime. # - # @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 conversion_event [Symbol, String, WhopSDK::Models::AdGroupUpdateParams::ConversionEvent, nil] The pixel event optimized for. A standard event, or any custom pixel event name. # - # @param id [String] The unique identifier of the ad group to update. + # @param conversion_location [Symbol, WhopSDK::Models::AdGroupUpdateParams::ConversionLocation] Where results happen: website (conversions), profile (IG/FB engagement), messagi # - # @param budget [Float, nil] Budget amount in dollars. + # @param demographics [Object] Demographic targeting: { automatic, minimum_age, maximum_age, gender }. # - # @param budget_type [Symbol, WhopSDK::Models::AdBudgetType, nil] The budget type for an ad campaign or ad group. + # @param desired_cost_per_result [Float] Target/cap cost for average_target / maximum_target. # - # @param config [WhopSDK::Models::AdGroupUpdateParams::Config, nil] Unified ad group configuration (bidding, optimization, targeting). + # @param devices [Object] Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. # - # @param daily_budget [Float, nil] Daily budget in dollars. + # @param ends_at [String] Schedule end, ISO 8601. # - # @param name [String, nil] Human-readable ad group name. + # @param frequency_cap [Object] { maximum_impressions, per_days } — only valid for reach optimization. # - # @param platform_config [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig, nil] Platform-specific ad group configuration. + # @param languages [Array] Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all language # - # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. + # @param message_apps [Array] Required when conversion_location is messaging: which apps to message on. Combin # - # @param title [String, nil] Human-readable ad group title. + # @param minimum_daily_spend [Float] Daily spend floor within the budget. + # + # @param optimization_goal [String] What the ad group optimizes for (e.g. conversions, link_clicks, reach). + # + # @param placements [Object] 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # + # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), regions (states/pr + # + # @param starts_at [String] Schedule start, ISO 8601. + # + # @param status [Symbol, WhopSDK::Models::AdGroupUpdateParams::Status] Initial status (default: active). + # + # @param title [String] The display name of the ad group. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -84,46 +175,43 @@ def update(id, params = {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdGroupListParams} for more details. # - # Returns a paginated list of ad groups scoped by campaign or company, with - # optional filtering by status and creation date. - # - # Required permissions: + # Lists ad groups for the account, newest first. # - # - `ad_campaign:basic:read` + # @overload list(account_id: nil, ad_campaign_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, time_zone: 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 account_id [String] Account whose ad groups to list. Defaults to the authenticated account. # - # @param ad_campaign_id [String, nil] Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + # @param ad_campaign_id [String] Filter to ad groups in this campaign. # - # @param ad_campaign_ids [Array, nil] Only return ad groups belonging to these ad campaigns (max 100). Can be combined + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param created_after [String] Only return ad groups created after this timestamp. # - # @param campaign_id [String, nil] Filter by campaign. + # @param created_before [String] Only return ad groups created before this timestamp. # - # @param company_id [String, nil] Filter by company. Provide companyId or adCampaignIds. + # @param direction [Symbol, WhopSDK::Models::AdGroupListParams::Direction] The sort direction. Defaults to desc. # - # @param created_after [Time, nil] Only return ad groups created after this timestamp. + # @param first [Integer] The number of ad groups to return. # - # @param created_before [Time, nil] Only return ad groups created before this timestamp. + # @param last [Integer] The number of ad groups to return from the end of the range. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param order [Symbol, WhopSDK::Models::AdGroupListParams::Order] The field to sort by. Defaults to created_at. Stat columns (spend, impressions, # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param query [String] Filter ad groups by a title or ID substring. # - # @param query [String, nil] Case-insensitive substring match against the ad group name or ID. + # @param stats_from [String] Start of the stats window. Defaults to all-time. # - # @param stats_from [Time, nil] Inclusive start of the window for each ad group's metric fields (spend, impressi + # @param stats_to [String] End of the stats window. Defaults to now. # - # @param stats_to [Time, nil] Inclusive end of the window for each ad group's metric fields. Omit both statsFr + # @param status [String] Filter to a status (active, paused, in_review, rejected). # - # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. + # @param time_zone [String] IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare s # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Internal::CursorPage] + # @return [WhopSDK::Internal::CursorPage] # # @see WhopSDK::Models::AdGroupListParams def list(params = {}) @@ -134,20 +222,16 @@ def list(params = {}) path: "ad_groups", query: query, page: WhopSDK::Internal::CursorPage, - model: WhopSDK::Models::AdGroupListResponse, + model: WhopSDK::AdGroup, options: options ) end - # Soft-deletes an ad group. - # - # Required permissions: - # - # - `ad_campaign:update` + # Deletes an ad group. Returns true on success. # # @overload delete(id, request_options: {}) # - # @param id [String] The unique identifier of the ad group to delete. + # @param id [String] The ad group ID. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -163,16 +247,11 @@ def delete(id, params = {}) ) end - # Pauses an ad group. - # - # Required permissions: - # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` + # Pauses delivery of an ad group. # # @overload pause(id, request_options: {}) # - # @param id [String] The unique identifier of the ad group to pause. + # @param id [String] The ad group ID. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -188,16 +267,11 @@ def pause(id, params = {}) ) end - # Resumes a paused ad group. - # - # Required permissions: - # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` + # Resumes delivery of a paused ad group. # # @overload unpause(id, request_options: {}) # - # @param id [String] The unique identifier of the ad group to unpause. + # @param id [String] The ad group ID. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/whop_sdk/resources/ad_reports.rb b/lib/whop_sdk/resources/ad_reports.rb index 97b8d117..88b33577 100644 --- a/lib/whop_sdk/resources/ad_reports.rb +++ b/lib/whop_sdk/resources/ad_reports.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Ad reports class AdReports # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdReportRetrieveParams} for more details. diff --git a/lib/whop_sdk/resources/ads.rb b/lib/whop_sdk/resources/ads.rb index 4640ddb3..6a81d6b5 100644 --- a/lib/whop_sdk/resources/ads.rb +++ b/lib/whop_sdk/resources/ads.rb @@ -2,24 +2,76 @@ module WhopSDK module Resources - # Ads + # An Ad is the individual creative unit delivered by an + # [ad group](/api-reference/beta/ad-groups/ad-group). It holds the copy, creative + # assets, and destination URL for one ad. + # + # Use the Ads API to list ads for an account, create ads inside ad groups, + # retrieve or update creative details, delete ads that should stop running, and + # pause or resume delivery. class Ads # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdRetrieveParams} for more details. + # {WhopSDK::Models::AdCreateParams} for more details. # - # Retrieve an ad by its unique identifier. + # Creates an ad in an ad group. # - # Required permissions: + # @overload create(ad_group: nil, ad_group_id: nil, call_to_action: nil, creatives: nil, descriptions: nil, headlines: nil, lead_form: nil, lead_form_id: nil, messaging_config: nil, multi_advertiser_ads: nil, post_id: nil, post_source: nil, primary_texts: nil, social_accounts: nil, title: nil, url: nil, url_parameters: nil, request_options: {}) # - # - `ad_campaign:basic:read` + # @param ad_group [Object] An inline ad group to create (same shape as POST /ad_groups, including ad_campai # - # @overload retrieve(id, stats_from: nil, stats_to: nil, request_options: {}) + # @param ad_group_id [String] The existing ad group to create the ad in. Provide this OR ad_group, not both. # - # @param id [String] The unique identifier of the ad. + # @param call_to_action [Symbol, WhopSDK::Models::AdCreateParams::CallToAction] The call-to-action button shown on the ad. # - # @param stats_from [Time, nil] Inclusive start of the window for the ad's metric fields (spend, impressions, …) + # @param creatives [Array] The ad's creative assets. Each entry is an uploaded file id with an optional for # - # @param stats_to [Time, nil] Inclusive end of the window for the ad's metric fields. Omit both statsFrom and + # @param descriptions [Array] The description variants shown on the ad. + # + # @param headlines [Array] The headline variants shown on the ad. + # + # @param lead_form [WhopSDK::Models::AdCreateParams::LeadForm] Instant lead form for the ad. Only allowed when the ad group's conversion_locati + # + # @param lead_form_id [String] Use an existing Meta instant form instead of creating one — the form's Meta id, + # + # @param messaging_config [WhopSDK::Models::AdCreateParams::MessagingConfig] Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # + # @param multi_advertiser_ads [Boolean] Whether the ad can appear alongside other advertisers' ads in the same unit. Def + # + # @param post_id [String] Promote an existing post instead of uploading creatives — a Facebook post or Ins + # + # @param post_source [Symbol, WhopSDK::Models::AdCreateParams::PostSource] Which network post_id refers to — facebook (a page post) or instagram (a media i + # + # @param primary_texts [Array] The primary text variants shown in the ad body. + # + # @param social_accounts [Array] The social accounts (Facebook page, Instagram profile) the ad runs under. + # + # @param title [String] The display name of the ad. + # + # @param url [String] The URL the ad links to. + # + # @param url_parameters [Object] Query parameters appended to the destination URL, as a string-to-string map. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Ad] + # + # @see WhopSDK::Models::AdCreateParams + def create(params = {}) + parsed, options = WhopSDK::AdCreateParams.dump_request(params) + @client.request(method: :post, path: "ads", body: parsed, model: WhopSDK::Ad, options: options) + end + + # Retrieves a single ad with stats over the requested window. + # + # @overload retrieve(id, stats_from: nil, stats_to: nil, time_zone: nil, request_options: {}) + # + # @param id [String] The ad ID. + # + # @param stats_from [String] Start of the stats window. + # + # @param stats_to [String] End of the stats window. + # + # @param time_zone [String] IANA timezone the stats window is interpreted in. Defaults to UTC. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -39,59 +91,102 @@ def retrieve(id, params = {}) end # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdListParams} for more details. + # {WhopSDK::Models::AdUpdateParams} for more details. + # + # Updates an ad's editable fields. + # + # @overload update(id, call_to_action: nil, creatives: nil, descriptions: nil, headlines: nil, lead_form: nil, lead_form_id: nil, messaging_config: nil, multi_advertiser_ads: nil, post_id: nil, post_source: nil, primary_texts: nil, social_accounts: nil, title: nil, url: nil, url_parameters: nil, request_options: {}) + # + # @param id [String] The ad ID. + # + # @param call_to_action [Symbol, WhopSDK::Models::AdUpdateParams::CallToAction] The call-to-action button shown on the ad. + # + # @param creatives [Array] The ad's creative assets. Each entry is an uploaded file id with an optional for + # + # @param descriptions [Array] The description variants shown on the ad. + # + # @param headlines [Array] The headline variants shown on the ad. # - # List ads scoped by ad group, campaign, or company. + # @param lead_form [WhopSDK::Models::AdUpdateParams::LeadForm] Instant lead form for the ad. Only allowed when the ad group's conversion_locati # - # Required permissions: + # @param lead_form_id [String] Use an existing Meta instant form instead of creating one — the form's Meta id, # - # - `ad_campaign:basic:read` + # @param messaging_config [WhopSDK::Models::AdUpdateParams::MessagingConfig] Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt # - # @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 multi_advertiser_ads [Boolean] Whether the ad can appear alongside other advertisers' ads in the same unit. Def # - # @param ad_campaign_id [String, nil] Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or co + # @param post_id [String] Promote an existing post instead of uploading creatives — a Facebook post or Ins # - # @param ad_campaign_ids [Array, nil] Only return ads belonging to these ad campaigns (max 100). Can be combined with + # @param post_source [Symbol, WhopSDK::Models::AdUpdateParams::PostSource] Which network post_id refers to — facebook (a page post) or instagram (a media i # - # @param ad_group_id [String, nil] Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or compa + # @param primary_texts [Array] The primary text variants shown in the ad body. # - # @param ad_group_ids [Array, nil] Only return ads belonging to these ad groups (max 100). Can be combined with com + # @param social_accounts [Array] The social accounts the ad runs under. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param title [String] The display name of the ad. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param url [String] The URL the ad links to. # - # @param campaign_id [String, nil] Filter by campaign. + # @param url_parameters [Object] Query parameters appended to the destination URL, as a string-to-string map. # - # @param company_id [String, nil] Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or compan + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Ad] + # + # @see WhopSDK::Models::AdUpdateParams + def update(id, params = {}) + parsed, options = WhopSDK::AdUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["ads/%1$s", id], + body: parsed, + model: WhopSDK::Ad, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdListParams} for more details. + # + # Lists the ads for an account, with stats over the requested window. + # + # @overload list(account_id: nil, ad_campaign_id: nil, ad_group_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, time_zone: nil, request_options: {}) + # + # @param account_id [String] The account the ads belong to. Defaults to the account-scoped key's own account. # - # @param created_after [Time, nil] Only return ads created after this timestamp. + # @param ad_campaign_id [String] Only return ads in this ad campaign. # - # @param created_before [Time, nil] Only return ads created before this timestamp. + # @param ad_group_id [String] Only return ads in this ad group. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param created_after [String] Only return ads created after this timestamp. # - # @param order [Symbol, WhopSDK::Models::AdListParams::Order, nil] The fields ad resources can be ordered by. + # @param created_before [String] Only return ads created before this timestamp. # - # @param order_by [Symbol, WhopSDK::Models::AdListParams::OrderBy, nil] Columns that the listAds query can sort by. Deprecated — use AdOrder. + # @param direction [Symbol, WhopSDK::Models::AdListParams::Direction] The sort direction. Defaults to desc. # - # @param order_direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param first [Integer] The number of ads to return. # - # @param query [String, nil] Case-insensitive substring match against the ad title or ID. + # @param last [Integer] The number of ads to return from the end of the range. # - # @param stats_from [Time, nil] Inclusive start of the window for each ad's metric fields (spend, impressions, … + # @param order [Symbol, WhopSDK::Models::AdListParams::Order] The field to sort by. Defaults to created_at. Stat columns (spend, impressions, # - # @param stats_to [Time, nil] Inclusive end of the window for each ad's metric fields and for stats-column sor + # @param query [String] Filter ads by a title or ID substring. # - # @param status [Symbol, WhopSDK::Models::ExternalAdStatus, nil] The status of an external ad. + # @param stats_from [String] Start of the stats window. Defaults to all-time. + # + # @param stats_to [String] End of the stats window. Defaults to now. + # + # @param status [Symbol, WhopSDK::Models::AdListParams::Status] Only return ads with this status. + # + # @param time_zone [String] IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare s # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Internal::CursorPage] + # @return [WhopSDK::Internal::CursorPage] # # @see WhopSDK::Models::AdListParams def list(params = {}) @@ -102,21 +197,36 @@ def list(params = {}) path: "ads", query: query, page: WhopSDK::Internal::CursorPage, - model: WhopSDK::Models::AdListResponse, + model: WhopSDK::Ad, options: options ) end - # Pauses an ad. + # Deletes an ad. Returns true on success. + # + # @overload delete(id, request_options: {}) + # + # @param id [String] The ad ID. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # Required permissions: + # @return [Boolean] # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` + # @see WhopSDK::Models::AdDeleteParams + def delete(id, params = {}) + @client.request( + method: :delete, + path: ["ads/%1$s", id], + model: WhopSDK::Internal::Type::Boolean, + options: params[:request_options] + ) + end + + # Pauses an active ad. # # @overload pause(id, request_options: {}) # - # @param id [String] The unique identifier of the ad to pause. + # @param id [String] The ad ID. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -134,14 +244,9 @@ def pause(id, params = {}) # Resumes a paused ad. # - # Required permissions: - # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` - # # @overload unpause(id, request_options: {}) # - # @param id [String] The unique identifier of the ad to unpause. + # @param id [String] The ad ID. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/whop_sdk/resources/affiliates.rb b/lib/whop_sdk/resources/affiliates.rb index db71ae78..574723d6 100644 --- a/lib/whop_sdk/resources/affiliates.rb +++ b/lib/whop_sdk/resources/affiliates.rb @@ -2,9 +2,7 @@ module WhopSDK module Resources - # Affiliates class Affiliates - # Affiliates # @return [WhopSDK::Resources::Affiliates::Overrides] attr_reader :overrides diff --git a/lib/whop_sdk/resources/affiliates/overrides.rb b/lib/whop_sdk/resources/affiliates/overrides.rb index a7ebac52..b755e50d 100644 --- a/lib/whop_sdk/resources/affiliates/overrides.rb +++ b/lib/whop_sdk/resources/affiliates/overrides.rb @@ -3,7 +3,6 @@ module WhopSDK module Resources class Affiliates - # Affiliates class Overrides # Creates a commission override for an affiliate. # diff --git a/lib/whop_sdk/resources/ai_chats.rb b/lib/whop_sdk/resources/ai_chats.rb index 847d48fd..40515192 100644 --- a/lib/whop_sdk/resources/ai_chats.rb +++ b/lib/whop_sdk/resources/ai_chats.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Ai chats class AIChats # Some parameter documentations has been truncated, see # {WhopSDK::Models::AIChatCreateParams} for more details. diff --git a/lib/whop_sdk/resources/app_builds.rb b/lib/whop_sdk/resources/app_builds.rb index 3a65720a..61427e32 100644 --- a/lib/whop_sdk/resources/app_builds.rb +++ b/lib/whop_sdk/resources/app_builds.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # App builds class AppBuilds # Some parameter documentations has been truncated, see # {WhopSDK::Models::AppBuildCreateParams} for more details. diff --git a/lib/whop_sdk/resources/apps.rb b/lib/whop_sdk/resources/apps.rb index 181a33a1..76197457 100644 --- a/lib/whop_sdk/resources/apps.rb +++ b/lib/whop_sdk/resources/apps.rb @@ -2,7 +2,15 @@ module WhopSDK module Resources - # Apps + # An App is software you build on Whop. It can be a hosted web app served at + # `.whop.app` or an API integration installed as an experience, and it + # belongs to the account that owns its credentials, settings, builds, and runtime + # logs. + # + # Use the Apps API to manage app configuration and, for hosted apps, read server + # runtime logs for console output, uncaught exceptions, and failed requests. Logs + # are retained for 7 days and can be filtered by build, level, time window, and + # message text. class Apps # Some parameter documentations has been truncated, see # {WhopSDK::Models::AppCreateParams} for more details. @@ -14,8 +22,9 @@ class Apps # # - `developer:create_app` # - `developer:manage_api_key` + # - `developer:update_app` # - # @overload create(company_id:, name:, base_url: nil, icon: nil, redirect_uris: nil, request_options: {}) + # @overload create(company_id:, name:, base_url: nil, icon: nil, redirect_uris: nil, route: nil, request_options: {}) # # @param company_id [String] The unique identifier of the company to create the app for, starting with # 'biz\_' @@ -28,6 +37,8 @@ class Apps # # @param redirect_uris [Array, nil] The whitelisted OAuth callback URLs that users are redirected to after authorizi # + # @param route [String, nil] The unique subdomain route where the app's hosted web builds are served, such as + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::App] @@ -43,6 +54,7 @@ def create(params) # Required permissions: # # - `developer:manage_api_key` + # - `developer:update_app` # # @overload retrieve(id, request_options: {}) # @@ -73,7 +85,7 @@ def retrieve(id, params = {}) # - `developer:update_app` # - `developer:manage_api_key` # - # @overload update(id, app_store_description: nil, app_type: nil, base_url: nil, dashboard_path: nil, description: nil, discover_path: nil, experience_path: nil, icon: nil, name: nil, oauth_client_type: nil, openapi_path: nil, redirect_uris: nil, required_scopes: nil, skills_path: nil, status: nil, request_options: {}) + # @overload update(id, app_store_description: nil, app_type: nil, base_url: nil, dashboard_path: nil, description: nil, discover_path: nil, experience_path: nil, icon: nil, name: nil, oauth_client_type: nil, openapi_path: nil, redirect_uris: nil, required_scopes: nil, route: nil, secrets: nil, skills_path: nil, status: nil, request_options: {}) # # @param id [String] The unique identifier of the app to update, starting with 'app\_'. # @@ -103,6 +115,10 @@ def retrieve(id, params = {}) # # @param required_scopes [Array, nil] The permission scopes the app will request from users when they install it. # + # @param route [String, nil] The unique subdomain route where the app's hosted web builds are served, such as + # + # @param secrets [Hash{Symbol=>Object}, nil] Secrets to add or overwrite on the app, as an object of string values (e.g. {"MA + # # @param skills_path [String, nil] The URL path to the skills directory of the app, such as '/assets/skills/'. # # @param status [Symbol, WhopSDK::Models::AppStatuses, nil] The status of an experience interface @@ -171,6 +187,50 @@ def list(params = {}) ) end + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AppLogsParams} for more details. + # + # Lists a hosted app's server runtime logs, most recent first: console output, + # uncaught exceptions, and failed-request summaries captured on whop.app hosting. + # Logs are retained for 7 days. + # + # @overload logs(id, after: nil, app_build_id: nil, before: nil, created_after: nil, created_before: nil, first: nil, level: nil, query: nil, request_options: {}) + # + # @param id [String] The ID of the app, which will look like app\_******\*******. + # + # @param after [String] A cursor for fetching logs after a previous page. + # + # @param app_build_id [String] Only return logs from this build. + # + # @param before [String] A cursor for fetching logs before a later page. + # + # @param created_after [Time] Start of the time window as an ISO 8601 timestamp. Defaults to 7 days before cre + # + # @param created_before [Time] End of the time window as an ISO 8601 timestamp. Defaults to now. + # + # @param first [Integer] The number of log lines to return (max 500). + # + # @param level [Symbol, WhopSDK::Models::AppLogsParams::Level] Only return console lines of this level. + # + # @param query [String] Only return logs whose message contains this text (case-insensitive). + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::AppLogsResponse] + # + # @see WhopSDK::Models::AppLogsParams + def logs(id, params = {}) + parsed, options = WhopSDK::AppLogsParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["apps/%1$s/logs", id], + query: query, + model: WhopSDK::Models::AppLogsResponse, + options: options + ) + end + # @api private # # @param client [WhopSDK::Client] diff --git a/lib/whop_sdk/resources/audiences.rb b/lib/whop_sdk/resources/audiences.rb new file mode 100644 index 00000000..cf168160 --- /dev/null +++ b/lib/whop_sdk/resources/audiences.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # An Audience represents a customer list uploaded to Whop for ad targeting. + # Audiences belong to an account and sync to supported ad platforms as custom + # audiences. + # + # Use the Audiences API to create audiences from CSV uploads, monitor processing + # status, and list or delete audiences for an account. Created audiences are + # usable for targeting after processing reaches `ready` or `partial`. + class Audiences + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AudienceCreateParams} for more details. + # + # Creates an audience from an uploaded customer identity CSV file and starts + # processing it. + # + # @overload create(account_id:, column_mapping:, file_id:, name:, request_options: {}) + # + # @param account_id [String] Account ID, prefixed `biz_`. + # + # @param column_mapping [WhopSDK::Models::AudienceCreateParams::ColumnMapping] Maps supported identity fields to CSV column headers. Map at least one of `email + # + # @param file_id [String] Direct upload ID from the standard media upload endpoint. + # + # @param name [String] Audience display name. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Audience] + # + # @see WhopSDK::Models::AudienceCreateParams + def create(params) + parsed, options = WhopSDK::AudienceCreateParams.dump_request(params) + @client.request( + method: :post, + path: "audiences", + body: parsed, + model: WhopSDK::Audience, + options: options + ) + end + + # Lists uploaded customer-list audiences for an account. Pass `audience_id` to + # return a specific audience. + # + # @overload list(account_id:, after: nil, audience_id: nil, first: nil, request_options: {}) + # + # @param account_id [String] Account ID, prefixed `biz_`. + # + # @param after [String] Cursor for the next page of audiences. + # + # @param audience_id [String] Audience ID, prefixed `adaud_`, used to filter the response to one audience. + # + # @param first [Integer] Number of audiences to return. Defaults to 20; maximum 100. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::AudienceListParams + def list(params) + parsed, options = WhopSDK::AudienceListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "audiences", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Audience, + options: options + ) + end + + # Deletes an audience so it is no longer available for targeting. + # + # @overload delete(audience_id, request_options: {}) + # + # @param audience_id [String] Audience ID, prefixed `adaud_`. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::AudienceDeleteResponse] + # + # @see WhopSDK::Models::AudienceDeleteParams + def delete(audience_id, params = {}) + @client.request( + method: :delete, + path: ["audiences/%1$s", audience_id], + model: WhopSDK::Models::AudienceDeleteResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/whop_sdk/resources/authorized_users.rb b/lib/whop_sdk/resources/authorized_users.rb index 838e6ca6..4492c072 100644 --- a/lib/whop_sdk/resources/authorized_users.rb +++ b/lib/whop_sdk/resources/authorized_users.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Authorized users class AuthorizedUsers # Some parameter documentations has been truncated, see # {WhopSDK::Models::AuthorizedUserCreateParams} for more details. @@ -14,7 +13,7 @@ class AuthorizedUsers # - `authorized_user:create` # - `member:email:read` # - # @overload create(company_id:, role:, user_id:, send_emails: nil, request_options: {}) + # @overload create(company_id:, role:, user_id:, elevation: nil, send_emails: nil, request_options: {}) # # @param company_id [String] The ID of the company to add the authorized user to. # @@ -22,6 +21,8 @@ class AuthorizedUsers # # @param user_id [String] The ID of the user to add as an authorized user. # + # @param elevation [WhopSDK::Models::AuthorizedUserCreateParams::Elevation, nil] Re-authentication proof required to perform this sensitive action. + # # @param send_emails [Boolean, nil] Whether to send notification emails to the user on creation. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/whop_sdk/resources/bounties.rb b/lib/whop_sdk/resources/bounties.rb index 7c040f5a..35aed2ab 100644 --- a/lib/whop_sdk/resources/bounties.rb +++ b/lib/whop_sdk/resources/bounties.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Bounties class Bounties # Some parameter documentations has been truncated, see # {WhopSDK::Models::BountyCreateParams} for more details. @@ -13,7 +12,7 @@ class Bounties # # - `bounty:create` # - # @overload create(base_unit_amount:, currency:, description:, title:, accepted_submissions_limit: nil, allowed_country_codes: nil, experience_id: nil, origin_account_id: nil, post_markdown_content: nil, post_title: nil, request_options: {}) + # @overload create(base_unit_amount:, currency:, description:, title:, accepted_submissions_limit: nil, allowed_country_codes: nil, business_goal_type: nil, experience_id: nil, origin_account_id: nil, post_markdown_content: nil, post_title: nil, scheduled_frequency: nil, scheduled_publish_at: nil, scheduled_timezone: nil, request_options: {}) # # @param base_unit_amount [Float] The amount paid to each approved submission. The total bounty pool funded is thi # @@ -27,6 +26,8 @@ class Bounties # # @param allowed_country_codes [Array, nil] The ISO3166 country codes where this bounty should be visible. Empty means globa # + # @param business_goal_type [Symbol, WhopSDK::Models::BountyCreateParams::BusinessGoalType, nil] What the poster is trying to accomplish with a workforce bounty. Used for produc + # # @param experience_id [String, nil] An optional experience to scope the bounty to. # # @param origin_account_id [String, nil] The user (user*\*) or company (biz*\*) tag whose balance funds this bounty pool. @@ -36,6 +37,12 @@ class Bounties # # @param post_title [String, nil] Optional title for the anchor forum post. Falls back to the bounty title when om # + # @param scheduled_frequency [Symbol, WhopSDK::Models::BountyCreateParams::ScheduledFrequency, nil] How often a scheduled bounty republishes a new bounty. + # + # @param scheduled_publish_at [Time, nil] When to publish the bounty. When provided, the bounty is created as a hidden dra + # + # @param scheduled_timezone [String, nil] The IANA timezone used for recurring occurrences. Required when scheduled_publis + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::BountyCreateResponse] diff --git a/lib/whop_sdk/resources/cards.rb b/lib/whop_sdk/resources/cards.rb new file mode 100644 index 00000000..d704f3ec --- /dev/null +++ b/lib/whop_sdk/resources/cards.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # Cards represent Whop-issued virtual payment cards that spend from an account or + # user balance. Cards can be assigned to cardholders and configured with spending + # limits for controlled spending. + # + # Use the Cards API to issue cards, list cards for an account or user, and + # retrieve active card details such as the card number and CVC. + class Cards + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CardCreateParams} for more details. + # + # Issues a virtual card. For an individual (consumer) card issuing account, the + # card is issued to the account's own cardholder. For a company (business) card + # issuing account, pass assigned*user_id to issue the card to a company member; if + # that member is not yet an approved card-issuing user, the card is provisioned + # asynchronously or an onboarding invitation is sent (HTTP 202). Pass exactly one + # of account_id (a biz* identifier) or user*id (a user* identifier). Returns the + # newly created card resource. + # + # @overload create(account_id: nil, assigned_user_id: nil, name: nil, spend_limit: nil, spend_limit_frequency: nil, transaction_limit: nil, user_id: nil, request_options: {}) + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param assigned_user_id [String] The company member (a user\_ identifier) to assign the card to. Required for + # comp + # + # @param name [String] A display name for the card. + # + # @param spend_limit [Float] Spending limit amount, in dollars. + # + # @param spend_limit_frequency [Symbol, WhopSDK::Models::CardCreateParams::SpendLimitFrequency] The spending limit window. + # + # @param transaction_limit [Float] Per-transaction limit amount, in dollars. + # + # @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::CardCreateResponse] + # + # @see WhopSDK::Models::CardCreateParams + def create(params = {}) + parsed, options = WhopSDK::CardCreateParams.dump_request(params) + @client.request( + method: :post, + path: "cards", + body: parsed, + model: WhopSDK::Models::CardCreateResponse, + options: options + ) + end + + # Retrieves a single card by its icrd\_ identifier, including its secrets (full + # card number, CVC, and cardholder name) for active cards. + # + # @overload retrieve(card_id, account_id: nil, user_id: nil, request_options: {}) + # + # @param card_id [String] Card ID to retrieve, prefixed `icrd_`. + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @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::CardRetrieveResponse] + # + # @see WhopSDK::Models::CardRetrieveParams + def retrieve(card_id, params = {}) + parsed, options = WhopSDK::CardRetrieveParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["cards/%1$s", card_id], + query: query, + model: WhopSDK::Models::CardRetrieveResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CardUpdateParams} for more details. + # + # Updates an issued card. All fields are optional; only the fields you pass are + # changed. Updates the card name, billing address, and spending limits in one + # call, sets a new PIN, freezes or unfreezes the card, or cancels it. Pass + # canceled: true alone to cancel the card — cancellation is permanent and a + # canceled card cannot be uncanceled. Pass exactly one of account*id (a biz* + # identifier) or user*id (a user* identifier). Assigned cardholders without the + # payout:account:update scope can update the PIN and freeze state of their own + # card. The PIN can only be changed on a card assigned to the acting user. Returns + # the updated card resource. + # + # @overload update(card_id, account_id: nil, billing: nil, canceled: nil, frozen: nil, name: nil, pin: nil, remove_limit: nil, spend_limit: nil, spend_limit_frequency: nil, transaction_limit: nil, user_id: nil, request_options: {}) + # + # @param card_id [String] Card ID to retrieve, prefixed `icrd_`. + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param billing [WhopSDK::Models::CardUpdateParams::Billing] New billing address. Requires line1, city, region, postal_code, and country_code + # + # @param canceled [Boolean] Pass `true` to permanently cancel the card. A canceled card cannot be uncanceled + # + # @param frozen [Boolean] Pass `true` to freeze the card, `false` to unfreeze it. + # + # @param name [String] A display name for the card. + # + # @param pin [String] New 4-digit PIN. Can only be set on a card assigned to the acting user. + # + # @param remove_limit [Boolean] Pass `true` to remove the spending limit (make the card unlimited). + # + # @param spend_limit [Float] Spending limit amount, in dollars. + # + # @param spend_limit_frequency [Symbol, WhopSDK::Models::CardUpdateParams::SpendLimitFrequency] The spending limit window. + # + # @param transaction_limit [Float] Per-transaction limit amount, in dollars. + # + # @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::CardUpdateResponse] + # + # @see WhopSDK::Models::CardUpdateParams + def update(card_id, params = {}) + parsed, options = WhopSDK::CardUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["cards/%1$s", card_id], + body: parsed, + model: WhopSDK::Models::CardUpdateResponse, + options: options + ) + end + + # Lists issued Whop virtual cards for an account or user, including pending + # invitation cards that have not been issued by the card provider yet. Pass + # exactly one of account*id (a biz* identifier) or user*id (a user* identifier). + # Non-owner team members only see cards assigned to them. Users without the + # payout:account:read scope can still list cards assigned to them (for example + # moderators or external cardholders). Use GET /cards/:card_id to retrieve a + # single card with its secrets. + # + # @overload list(account_id: nil, user_id: nil, request_options: {}) + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @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::CardListResponse] + # + # @see WhopSDK::Models::CardListParams + def list(params = {}) + parsed, options = WhopSDK::CardListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "cards", + query: query, + model: WhopSDK::Models::CardListResponse, + 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/chat_channels.rb b/lib/whop_sdk/resources/chat_channels.rb index 653fb84d..961188cf 100644 --- a/lib/whop_sdk/resources/chat_channels.rb +++ b/lib/whop_sdk/resources/chat_channels.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Chat channels class ChatChannels # Retrieves the details of an existing chat channel. # diff --git a/lib/whop_sdk/resources/checkout_configurations.rb b/lib/whop_sdk/resources/checkout_configurations.rb index 75fbaabf..09608140 100644 --- a/lib/whop_sdk/resources/checkout_configurations.rb +++ b/lib/whop_sdk/resources/checkout_configurations.rb @@ -2,91 +2,98 @@ module WhopSDK module Resources - # Checkout configurations + # A Checkout Configuration is a reusable checkout link owned by an account. In + # `payment` mode it sells a specific plan; in `setup` mode it collects and saves + # payment details without charging. Each configuration can also override which + # payment methods are accepted and how 3D Secure is enforced for that checkout. + # + # Use the Checkout Configurations API to create checkout links for an existing or + # inline plan, list configurations for an account, retrieve the configuration + # behind a checkout URL, and delete links that should no longer be used. class CheckoutConfigurations - # Creates a new checkout configuration + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::CheckoutConfigurationCreateParams} for more details. + # + # Creates a reusable checkout configuration for an existing or inline plan. + # + # @overload create(affiliate_code: nil, company_id: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, plan: nil, plan_id: nil, redirect_url: nil, three_ds_level: nil, request_options: {}) + # + # @param affiliate_code [String, nil] Affiliate code to apply to the checkout. + # + # @param company_id [String] Account ID, prefixed `biz_`. + # + # @param currency [String, nil] Currency used for setup-mode payment method availability. + # + # @param metadata [Object, nil] Custom key-value metadata copied to payments and memberships. # - # Required permissions: + # @param mode [Symbol, WhopSDK::Models::CheckoutConfigurationCreateParams::Mode] Checkout mode: `payment` collects payment for a plan now; `setup` saves payment # - # - `checkout_configuration:create` - # - `plan:create` - # - `access_pass:create` - # - `access_pass:update` - # - `checkout_configuration:basic:read` + # @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateParams::PaymentMethodConfiguration, nil] Payment method overrides for this checkout. `null` uses the plan or platform def # - # @overload create(body:, request_options: {}) + # @param plan [WhopSDK::Models::CheckoutConfigurationCreateParams::Plan, nil] Plan attributes used to create or find a plan for this checkout configuration. M # - # @param body [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID, WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup] Parameters for CreateCheckoutSession + # @param plan_id [String, nil] Existing plan ID, prefixed `plan_`. Mutually exclusive with `plan`. + # + # @param redirect_url [String, nil] URL customers are sent to after checkout. + # + # @param three_ds_level [String, nil] 3D Secure behavior for this checkout. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Models::CheckoutConfiguration] + # @return [WhopSDK::Models::CheckoutConfigurationCreateResponse] # # @see WhopSDK::Models::CheckoutConfigurationCreateParams - def create(params) + def create(params = {}) parsed, options = WhopSDK::CheckoutConfigurationCreateParams.dump_request(params) @client.request( method: :post, path: "checkout_configurations", - body: parsed[:body], - model: WhopSDK::CheckoutConfiguration, + body: parsed, + model: WhopSDK::Models::CheckoutConfigurationCreateResponse, options: options ) end - # Retrieves the details of an existing checkout configuration. - # - # Required permissions: - # - # - `checkout_configuration:basic:read` + # Retrieves a checkout configuration by ID. This endpoint is public so a checkout + # page can load from the configuration URL. # # @overload retrieve(id, request_options: {}) # - # @param id [String] The unique identifier of the checkout configuration. + # @param id [String] The ID of the checkout configuration. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Models::CheckoutConfiguration] + # @return [WhopSDK::Models::CheckoutConfigurationRetrieveResponse] # # @see WhopSDK::Models::CheckoutConfigurationRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["checkout_configurations/%1$s", id], - model: WhopSDK::CheckoutConfiguration, + model: WhopSDK::Models::CheckoutConfigurationRetrieveResponse, options: params[:request_options] ) end - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::CheckoutConfigurationListParams} for more details. - # - # Returns a paginated list of checkout configurations for a company, with optional - # filtering by plan and creation date. - # - # Required permissions: + # Lists checkout configurations for an account. # - # - `checkout_configuration:basic:read` + # @overload list(company_id:, after: nil, created_after: nil, created_before: nil, direction: nil, first: nil, order: nil, plan_id: nil, request_options: {}) # - # @overload list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, plan_id: nil, request_options: {}) + # @param company_id [String] Account ID, prefixed `biz_`. # - # @param company_id [String] The unique identifier of the company to list checkout configurations for. + # @param after [String] Cursor for the next page of results. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param created_after [Integer] Only return checkout configurations created after this Unix timestamp. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param created_before [Integer] Only return checkout configurations created before this Unix timestamp. # - # @param created_after [Time, nil] Only return checkout configurations created after this timestamp. + # @param direction [Symbol, WhopSDK::Models::CheckoutConfigurationListParams::Direction] Sort direction. Defaults to `desc`. # - # @param created_before [Time, nil] Only return checkout configurations created before this timestamp. + # @param first [Integer] Number of checkout configurations to return. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param order [Symbol, WhopSDK::Models::CheckoutConfigurationListParams::Order] Field used to sort checkout configurations. # - # @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 plan_id [String, nil] Filter checkout configurations to only those associated with this plan identifie + # @param plan_id [String] Only return checkout configurations for this plan ID, prefixed `plan_`. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -106,6 +113,26 @@ def list(params) ) end + # Deletes a checkout configuration so its checkout URL can no longer be used. + # + # @overload delete(id, request_options: {}) + # + # @param id [String] The ID of the checkout configuration. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see WhopSDK::Models::CheckoutConfigurationDeleteParams + def delete(id, params = {}) + @client.request( + method: :delete, + path: ["checkout_configurations/%1$s", id], + model: NilClass, + options: params[:request_options] + ) + end + # @api private # # @param client [WhopSDK::Client] diff --git a/lib/whop_sdk/resources/companies.rb b/lib/whop_sdk/resources/companies.rb index 7ff72aa3..2f5a39c9 100644 --- a/lib/whop_sdk/resources/companies.rb +++ b/lib/whop_sdk/resources/companies.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Companies class Companies # Some parameter documentations has been truncated, see # {WhopSDK::Models::CompanyCreateParams} for more details. diff --git a/lib/whop_sdk/resources/company_token_transactions.rb b/lib/whop_sdk/resources/company_token_transactions.rb index f70f64e0..f78b7ae0 100644 --- a/lib/whop_sdk/resources/company_token_transactions.rb +++ b/lib/whop_sdk/resources/company_token_transactions.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Company token transactions class CompanyTokenTransactions # Create a token transaction to add, subtract, or transfer tokens for a member # within a company. diff --git a/lib/whop_sdk/resources/conversions.rb b/lib/whop_sdk/resources/conversions.rb deleted file mode 100644 index 27d80a3e..00000000 --- a/lib/whop_sdk/resources/conversions.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -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, 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. - # - # @param event_name [Symbol, WhopSDK::Models::ConversionCreateParams::EventName] The type of event. - # - # @param action_source [Symbol, WhopSDK::Models::ConversionCreateParams::ActionSource, nil] The channel where an event originated - # - # @param context [WhopSDK::Models::ConversionCreateParams::Context, nil] Tracking and attribution context. - # - # @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'. Maximum 35 chars for this value. - # - # @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. - # - # @param plan_id [String, nil] The plan associated with the event. - # - # @param product_id [String, nil] The product associated with the event. - # - # @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. - # - # @param value [Float, nil] Monetary value associated with the event. - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Models::ConversionCreateResponse] - # - # @see WhopSDK::Models::ConversionCreateParams - def create(params) - parsed, options = WhopSDK::ConversionCreateParams.dump_request(params) - @client.request( - method: :post, - path: "conversions", - body: parsed, - model: WhopSDK::Models::ConversionCreateResponse, - 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/course_chapters.rb b/lib/whop_sdk/resources/course_chapters.rb index acdcb53d..57d12f8f 100644 --- a/lib/whop_sdk/resources/course_chapters.rb +++ b/lib/whop_sdk/resources/course_chapters.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Course chapters class CourseChapters # Some parameter documentations has been truncated, see # {WhopSDK::Models::CourseChapterCreateParams} for more details. diff --git a/lib/whop_sdk/resources/course_lesson_interactions.rb b/lib/whop_sdk/resources/course_lesson_interactions.rb index a2c10a3e..d089df92 100644 --- a/lib/whop_sdk/resources/course_lesson_interactions.rb +++ b/lib/whop_sdk/resources/course_lesson_interactions.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Course lesson interactions class CourseLessonInteractions # Retrieves the details of an existing course lesson interaction. # diff --git a/lib/whop_sdk/resources/course_lessons.rb b/lib/whop_sdk/resources/course_lessons.rb index db8b0074..efc28e8a 100644 --- a/lib/whop_sdk/resources/course_lessons.rb +++ b/lib/whop_sdk/resources/course_lessons.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Course lessons class CourseLessons # Some parameter documentations has been truncated, see # {WhopSDK::Models::CourseLessonCreateParams} for more details. diff --git a/lib/whop_sdk/resources/course_students.rb b/lib/whop_sdk/resources/course_students.rb index 918e6c6b..d7077f4a 100644 --- a/lib/whop_sdk/resources/course_students.rb +++ b/lib/whop_sdk/resources/course_students.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Course students class CourseStudents # Retrieves the details of an existing course student. # diff --git a/lib/whop_sdk/resources/courses.rb b/lib/whop_sdk/resources/courses.rb index b75cac5b..82e428f2 100644 --- a/lib/whop_sdk/resources/courses.rb +++ b/lib/whop_sdk/resources/courses.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Courses class Courses # Some parameter documentations has been truncated, see # {WhopSDK::Models::CourseCreateParams} for more details. diff --git a/lib/whop_sdk/resources/deposits.rb b/lib/whop_sdk/resources/deposits.rb index e11222ae..cd876e9b 100644 --- a/lib/whop_sdk/resources/deposits.rb +++ b/lib/whop_sdk/resources/deposits.rb @@ -2,22 +2,29 @@ module WhopSDK module Resources + # Deposits describe ways to add funds to an account balance, including hosted + # deposit pages, bank deposit instructions, and supported crypto wallet addresses. + # + # Use the Deposits API to create deposit instructions for an account and retrieve + # existing bank deposit activity. class Deposits # Some parameter documentations has been truncated, see # {WhopSDK::Models::DepositCreateParams} for more details. # # Resolves a deposit destination and returns the on-chain addresses that can fund - # it. + # it. No authentication is required; any business can be resolved by its account + # ID. A caller authenticated as a user can additionally resolve their own user + # account. # - # @overload create(amount:, destination:, metadata: nil, network: nil, request_options: {}) - # - # @param amount [Float] Amount to deposit. + # @overload create(destination:, amount: nil, metadata: nil, network: nil, request_options: {}) # # @param destination [String, WhopSDK::Models::DepositCreateParams::Destination::UnionMember1] Destination account ID or wallet address. Object form is supported for compatibi # - # @param metadata [Hash{Symbol=>Object}] Arbitrary metadata echoed in the response. + # @param amount [Float] Amount to prefill on hosted deposit page. + # + # @param metadata [Hash{Symbol=>Object}] Metadata to include with the deposit response. # - # @param network [String, nil] Optional destination network override. + # @param network [String, nil] Destination network override. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -35,6 +42,30 @@ def create(params) ) end + # Returns deposit transactions for a business account. Bank deposit transactions + # are nested under the bank field. + # + # @overload list(account_id:, request_options: {}) + # + # @param account_id [String] Business account ID (biz\_\*). + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::DepositListResponse] + # + # @see WhopSDK::Models::DepositListParams + def list(params) + parsed, options = WhopSDK::DepositListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "deposits", + query: query, + model: WhopSDK::Models::DepositListResponse, + options: options + ) + end + # @api private # # @param client [WhopSDK::Client] diff --git a/lib/whop_sdk/resources/dispute_alerts.rb b/lib/whop_sdk/resources/dispute_alerts.rb index 68403d98..cb5d0e8b 100644 --- a/lib/whop_sdk/resources/dispute_alerts.rb +++ b/lib/whop_sdk/resources/dispute_alerts.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Dispute alerts class DisputeAlerts # Retrieves the details of an existing dispute alert. # diff --git a/lib/whop_sdk/resources/disputes.rb b/lib/whop_sdk/resources/disputes.rb index aaff5825..f4e1ec98 100644 --- a/lib/whop_sdk/resources/disputes.rb +++ b/lib/whop_sdk/resources/disputes.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Disputes class Disputes # Retrieves the details of an existing dispute. # diff --git a/lib/whop_sdk/resources/dm_channels.rb b/lib/whop_sdk/resources/dm_channels.rb index a8248079..61241eef 100644 --- a/lib/whop_sdk/resources/dm_channels.rb +++ b/lib/whop_sdk/resources/dm_channels.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Dm channels class DmChannels # Some parameter documentations has been truncated, see # {WhopSDK::Models::DmChannelCreateParams} for more details. diff --git a/lib/whop_sdk/resources/dm_members.rb b/lib/whop_sdk/resources/dm_members.rb index 4387c08f..21b0d54b 100644 --- a/lib/whop_sdk/resources/dm_members.rb +++ b/lib/whop_sdk/resources/dm_members.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Dm members class DmMembers # Some parameter documentations has been truncated, see # {WhopSDK::Models::DmMemberCreateParams} for more details. diff --git a/lib/whop_sdk/resources/entries.rb b/lib/whop_sdk/resources/entries.rb index 7d6b4a44..41805a63 100644 --- a/lib/whop_sdk/resources/entries.rb +++ b/lib/whop_sdk/resources/entries.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Entries class Entries # Retrieves the details of an existing waitlist entry. # diff --git a/lib/whop_sdk/resources/events.rb b/lib/whop_sdk/resources/events.rb new file mode 100644 index 00000000..160171a7 --- /dev/null +++ b/lib/whop_sdk/resources/events.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # An Event records conversion or engagement activity for an account, such as page + # views, purchases, or leads. Each event ties the action to the + # [person](/api-reference/beta/people/person) who took it, so activity can be + # attributed to the ads and links that drove it. + # + # Use the Events API to send new tracking events and list the events recorded for + # a person. + class Events + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::EventCreateParams} for more details. + # + # Tracks a conversion or engagement event for an account. + # + # @overload create(account_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 account_id [String] The account to associate with this event. + # + # @param event_name [Symbol, WhopSDK::Models::EventCreateParams::EventName] The type of conversion or engagement event + # + # @param action_source [Symbol, WhopSDK::Models::EventCreateParams::ActionSource, nil] The channel where an event originated + # + # @param context [WhopSDK::Models::EventCreateParams::Context, nil] Tracking and attribution context. + # + # @param currency [Symbol, WhopSDK::Models::EventCreateParams::Currency, nil] The available currencies on the platform + # + # @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. + # + # @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. + # + # @param plan_id [String, nil] The plan associated with the event. + # + # @param product_id [String, nil] The product associated with the event. + # + # @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::EventCreateParams::User, nil] User identity and profile data. + # + # @param value [Float, nil] Monetary value associated with the event. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::EventCreateResponse] + # + # @see WhopSDK::Models::EventCreateParams + def create(params) + parsed, options = WhopSDK::EventCreateParams.dump_request(params) + @client.request( + method: :post, + path: "events", + body: parsed, + model: WhopSDK::Models::EventCreateResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::EventListParams} for more details. + # + # Lists pixel events for a person, most recent first. Events are shaped like the + # POST /events intake: attribution in context, identity in user. + # + # @overload list(person_id:, account_id: nil, after: nil, before: nil, first: nil, from: nil, to: nil, request_options: {}) + # + # @param person_id [String] The ID of the person. + # + # @param account_id [String] The ID of the account, which will look like biz\_******\*******. Optional for + # acco + # + # @param after [String] A cursor for fetching events after a previous page. + # + # @param before [String] A cursor for fetching events before a later page. + # + # @param first [Integer] The number of events to return. + # + # @param from [Integer] Start of the time range as a Unix timestamp. + # + # @param to [Integer] End of the time range as a Unix timestamp. Defaults to now. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::EventListParams + def list(params) + parsed, options = WhopSDK::EventListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "events", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::EventListResponse, + 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/experiences.rb b/lib/whop_sdk/resources/experiences.rb index 4ed46c80..f8265f98 100644 --- a/lib/whop_sdk/resources/experiences.rb +++ b/lib/whop_sdk/resources/experiences.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Experiences class Experiences # Required permissions: # diff --git a/lib/whop_sdk/resources/fee_markups.rb b/lib/whop_sdk/resources/fee_markups.rb index 845346f6..827ab163 100644 --- a/lib/whop_sdk/resources/fee_markups.rb +++ b/lib/whop_sdk/resources/fee_markups.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Fee markups class FeeMarkups # Some parameter documentations has been truncated, see # {WhopSDK::Models::FeeMarkupCreateParams} for more details. diff --git a/lib/whop_sdk/resources/files.rb b/lib/whop_sdk/resources/files.rb index b021f6f0..a8edcdd3 100644 --- a/lib/whop_sdk/resources/files.rb +++ b/lib/whop_sdk/resources/files.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Files class Files # Some parameter documentations has been truncated, see # {WhopSDK::Models::FileCreateParams} for more details. diff --git a/lib/whop_sdk/resources/financial_activity.rb b/lib/whop_sdk/resources/financial_activity.rb index b43efc2d..d84509e0 100644 --- a/lib/whop_sdk/resources/financial_activity.rb +++ b/lib/whop_sdk/resources/financial_activity.rb @@ -2,23 +2,45 @@ module WhopSDK module Resources + # A Ledger Activity row is a single financial event on an account's ledger — a + # payment, withdrawal, refund, transfer, on-chain deposit, swap, or card + # transaction. Each row is derived from the underlying ledger lines and carries a + # typed `resource` and `source` so you can present and link the event without + # extra lookups. + # + # Use Ledger Activity to build a statement or transaction feed for an account or + # user. Reconcile against your own records with `amount` (signed, in the + # currency's smallest precision units) and `posted_at`, and use `available_at` to + # know when inflows became withdrawable. 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). + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::FinancialActivityListParams} for more details. # - # @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: {}) + # Returns a paginated activity feed for one account or user, derived from ledger + # lines with typed resource and source objects for presentation. Pass exactly one + # of `account_id` (a `biz_` identifier) or `user_id` (a `user_` identifier). + # Filter by line type, currency, posted timestamp, or settlement date to reconcile + # a specific window. Pass `include_owned_accounts=true` with your own `user_id` to + # aggregate your personal ledger and the businesses you own into one feed; each + # row then carries the owning `account`. + # + # @overload list(account_id: nil, available_after: nil, available_before: nil, currency: nil, cursor: nil, include_owned_accounts: 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 available_after [Date] Only include rows whose funds became withdrawable on or after this `YYYY-MM-DD` + # + # @param available_before [Date] Only include rows whose funds became withdrawable on or before this `YYYY-MM-DD` + # + # @param currency [String] Optional currency code filter, for example `usd`. # # @param cursor [String] Cursor returned by the previous page. # + # @param include_owned_accounts [Boolean] When true, aggregates the authenticated user's personal ledger with the business + # # @param limit [Integer] Maximum number of rows to return. # - # @param line_types [Array] Optional ledger line categories to include. + # @param line_types [Array] Optional ledger line categories to include. Some categories (for example `onchai # # @param posted_after [Time] Only include rows posted after this ISO 8601 timestamp. # diff --git a/lib/whop_sdk/resources/forum_posts.rb b/lib/whop_sdk/resources/forum_posts.rb index a07e2ae4..0cb031a2 100644 --- a/lib/whop_sdk/resources/forum_posts.rb +++ b/lib/whop_sdk/resources/forum_posts.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Forum posts class ForumPosts # Some parameter documentations has been truncated, see # {WhopSDK::Models::ForumPostCreateParams} for more details. diff --git a/lib/whop_sdk/resources/forums.rb b/lib/whop_sdk/resources/forums.rb index a7f55a6d..11501f49 100644 --- a/lib/whop_sdk/resources/forums.rb +++ b/lib/whop_sdk/resources/forums.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Forums class Forums # Retrieves the details of an existing forum. # diff --git a/lib/whop_sdk/resources/invoices.rb b/lib/whop_sdk/resources/invoices.rb index 12a1cc7f..41a12c24 100644 --- a/lib/whop_sdk/resources/invoices.rb +++ b/lib/whop_sdk/resources/invoices.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Invoices class Invoices # Create an invoice for a customer. The invoice can be charged automatically using # a stored payment method, or sent to the customer for manual payment. diff --git a/lib/whop_sdk/resources/leads.rb b/lib/whop_sdk/resources/leads.rb index fead38ae..79dae075 100644 --- a/lib/whop_sdk/resources/leads.rb +++ b/lib/whop_sdk/resources/leads.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Leads class Leads # Some parameter documentations has been truncated, see # {WhopSDK::Models::LeadCreateParams} for more details. diff --git a/lib/whop_sdk/resources/ledger_accounts.rb b/lib/whop_sdk/resources/ledger_accounts.rb index c6ce38e2..43a4d6c6 100644 --- a/lib/whop_sdk/resources/ledger_accounts.rb +++ b/lib/whop_sdk/resources/ledger_accounts.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Ledger accounts class LedgerAccounts # Some parameter documentations has been truncated, see # {WhopSDK::Models::LedgerAccountRetrieveParams} for more details. diff --git a/lib/whop_sdk/resources/media.rb b/lib/whop_sdk/resources/media.rb new file mode 100644 index 00000000..3fb9b393 --- /dev/null +++ b/lib/whop_sdk/resources/media.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # A Media Asset is an AI-generated image or video created from a prompt and billed + # from an account balance. When generation finishes, the asset includes a file + # that can be attached anywhere Whop accepts files. + # + # Use the Media API to start a generation job and retrieve the asset while it + # processes or after it is ready. + class Media + # Retrieves a media asset by ID. Poll this while the asset is `processing`. + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] Media asset ID, prefixed `media_`. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::MediaAsset] + # + # @see WhopSDK::Models::MediaRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["media/%1$s", id], + model: WhopSDK::MediaAsset, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::MediaGenerateParams} for more details. + # + # Starts an AI media generation job billed from the account's balance. Generation + # is asynchronous — poll `GET /media/{id}` until the asset is `ready`, then use + # `file.id` anywhere attachments are accepted. + # + # @overload generate(prompt:, type:, account_id: nil, duration_seconds: nil, reference_media: nil, resolution: nil, request_options: {}) + # + # @param prompt [String] What to generate. Up to 2,000 characters. + # + # @param type [Symbol, WhopSDK::Models::MediaGenerateParams::Type] The kind of media to generate. + # + # @param account_id [String] Account ID, prefixed `biz_`. Defaults to the account the API key belongs to. + # + # @param duration_seconds [Integer, WhopSDK::Models::MediaGenerateParams::DurationSeconds] Video length in seconds. Video only; defaults to 5. + # + # @param reference_media [Array] Optional reference image file IDs (`file_` prefixed), up to 4. For video, a sing + # + # @param resolution [Symbol, WhopSDK::Models::MediaGenerateParams::Resolution] Video resolution. Video only; defaults to `1080p`. `1080p` is not supported by S + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::MediaAsset] + # + # @see WhopSDK::Models::MediaGenerateParams + def generate(params) + parsed, options = WhopSDK::MediaGenerateParams.dump_request(params) + @client.request( + method: :post, + path: "media/generate", + body: parsed, + model: WhopSDK::MediaAsset, + 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/members.rb b/lib/whop_sdk/resources/members.rb index b6941c11..acadf557 100644 --- a/lib/whop_sdk/resources/members.rb +++ b/lib/whop_sdk/resources/members.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Members class Members # Retrieves the details of an existing member. # diff --git a/lib/whop_sdk/resources/memberships.rb b/lib/whop_sdk/resources/memberships.rb index e61ffdc1..c563cb53 100644 --- a/lib/whop_sdk/resources/memberships.rb +++ b/lib/whop_sdk/resources/memberships.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Memberships class Memberships # Retrieves the details of an existing membership. # diff --git a/lib/whop_sdk/resources/messages.rb b/lib/whop_sdk/resources/messages.rb index f2a14de2..e2653afd 100644 --- a/lib/whop_sdk/resources/messages.rb +++ b/lib/whop_sdk/resources/messages.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Messages class Messages # Some parameter documentations has been truncated, see # {WhopSDK::Models::MessageCreateParams} for more details. diff --git a/lib/whop_sdk/resources/notifications.rb b/lib/whop_sdk/resources/notifications.rb index 95cbd6ce..b5f0e4a8 100644 --- a/lib/whop_sdk/resources/notifications.rb +++ b/lib/whop_sdk/resources/notifications.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Notifications class Notifications # Send a push notification to users in an experience or company team. The # notification is processed asynchronously and supports targeting specific users. diff --git a/lib/whop_sdk/resources/payment_methods.rb b/lib/whop_sdk/resources/payment_methods.rb index dbb6b14e..bbf085ef 100644 --- a/lib/whop_sdk/resources/payment_methods.rb +++ b/lib/whop_sdk/resources/payment_methods.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Payment methods class PaymentMethods # Some parameter documentations has been truncated, see # {WhopSDK::Models::PaymentMethodRetrieveParams} for more details. diff --git a/lib/whop_sdk/resources/payments.rb b/lib/whop_sdk/resources/payments.rb index 2dd31af4..fa1f3f77 100644 --- a/lib/whop_sdk/resources/payments.rb +++ b/lib/whop_sdk/resources/payments.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Payments class Payments # Charge an existing member off-session using one of their stored payment methods. # You can provide an existing plan, or create a new one in-line. This endpoint diff --git a/lib/whop_sdk/resources/payout_accounts.rb b/lib/whop_sdk/resources/payout_accounts.rb index 294e7107..5ef6554a 100644 --- a/lib/whop_sdk/resources/payout_accounts.rb +++ b/lib/whop_sdk/resources/payout_accounts.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Payout accounts class PayoutAccounts # Retrieves the details of an existing payout account. # diff --git a/lib/whop_sdk/resources/payout_methods.rb b/lib/whop_sdk/resources/payout_methods.rb deleted file mode 100644 index 5ff91463..00000000 --- a/lib/whop_sdk/resources/payout_methods.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Resources - # Payout methods - class PayoutMethods - # Retrieves the details of an existing payout method. - # - # Required permissions: - # - # - `payout:destination:read` - # - # @overload retrieve(id, request_options: {}) - # - # @param id [String] The unique identifier of the payout method to retrieve. - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Models::PayoutMethodRetrieveResponse] - # - # @see WhopSDK::Models::PayoutMethodRetrieveParams - def retrieve(id, params = {}) - @client.request( - method: :get, - path: ["payout_methods/%1$s", id], - model: WhopSDK::Models::PayoutMethodRetrieveResponse, - options: params[:request_options] - ) - end - - # Returns a list of active payout methods configured for a company, ordered by - # most recently created. - # - # Required permissions: - # - # - `payout:destination:read` - # - # @overload list(company_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) - # - # @param company_id [String] The unique identifier of the company to list payout methods for. - # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. - # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. - # - # @param first [Integer, nil] Returns the first _n_ elements from the list. - # - # @param last [Integer, nil] Returns the last _n_ elements from the list. - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Internal::CursorPage] - # - # @see WhopSDK::Models::PayoutMethodListParams - def list(params) - parsed, options = WhopSDK::PayoutMethodListParams.dump_request(params) - query = WhopSDK::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "payout_methods", - query: query, - page: WhopSDK::Internal::CursorPage, - model: WhopSDK::Models::PayoutMethodListResponse, - 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/payouts.rb b/lib/whop_sdk/resources/payouts.rb new file mode 100644 index 00000000..460c1963 --- /dev/null +++ b/lib/whop_sdk/resources/payouts.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # Payouts represent money sent from an account or user balance to an external + # destination, such as a bank account, wallet, or other saved payout method. + # + # Use the Payouts API to create payouts from stablecoin accounts, list payout + # history for accounts or users, monitor payout statuses, and show expected + # arrival details for funds leaving Whop. + class Payouts + # Payouts represent money sent from an account or user balance to an external + # destination, such as a bank account, wallet, or other saved payout method. + # + # Use the Payouts API to create payouts from stablecoin accounts, list payout + # history for accounts or users, monitor payout statuses, and show expected + # arrival details for funds leaving Whop. + # @return [WhopSDK::Resources::Payouts::Methods] + attr_reader :methods_ + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutCreateParams} for more details. + # + # Creates a payout from a stablecoin account to a saved payout method. The + # account's funds move from its stablecoin balance to an external bank account, + # wallet, or crypto address. Accounts that pay out from a fiat balance use POST + # /withdrawals. Requires the payouts API to be enabled for the account; contact + # support to enable it. The payout settles asynchronously; poll GET /payouts for + # the entry whose payout_request_id matches this payout's id. + # + # @overload create(account_id:, amount:, payout_method_id:, currency: nil, idempotency_key: nil, request_options: {}) + # + # @param account_id [String] The account to pay out from (a biz\_ identifier). + # + # @param amount [Float] The amount to pay out in the specified currency. + # + # @param payout_method_id [String] The saved payout method to deliver to (a potk\_ identifier). + # + # @param currency [String] The payout currency. Defaults to usd. + # + # @param idempotency_key [String] A client-generated key that makes retries safe. Retrying with the same key retur + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::PayoutCreateResponse] + # + # @see WhopSDK::Models::PayoutCreateParams + def create(params) + parsed, options = WhopSDK::PayoutCreateParams.dump_request(params) + @client.request( + method: :post, + path: "payouts", + body: parsed, + model: WhopSDK::Models::PayoutCreateResponse, + options: options + ) + end + + # Lists payouts (withdrawal requests) for an account or user, most recent first. + # Pass exactly one of account*id (a biz* identifier) or user*id (a user* + # identifier). The saved payout method on each payout additionally requires the + # payout:destination:read scope and is null without it. + # + # @overload list(account_id: nil, after: nil, before: nil, currency: nil, first: nil, last: nil, user_id: nil, request_options: {}) + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param currency [String] Optional currency code filter, for example `usd`. + # + # @param first [Integer] Number of payouts to return from the start of the window. + # + # @param last [Integer] Number of payouts to return from the end of the window. + # + # @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::Internal::CursorPage] + # + # @see WhopSDK::Models::PayoutListParams + def list(params = {}) + parsed, options = WhopSDK::PayoutListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "payouts", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::PayoutListResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + @methods_ = WhopSDK::Resources::Payouts::Methods.new(client: client) + end + end + end +end diff --git a/lib/whop_sdk/resources/payouts/methods.rb b/lib/whop_sdk/resources/payouts/methods.rb new file mode 100644 index 00000000..c355a0b5 --- /dev/null +++ b/lib/whop_sdk/resources/payouts/methods.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Payouts + # Payouts represent money sent from an account or user balance to an external + # destination, such as a bank account, wallet, or other saved payout method. + # + # Use the Payouts API to create payouts from stablecoin accounts, list payout + # history for accounts or users, monitor payout statuses, and show expected + # arrival details for funds leaving Whop. + class Methods + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Payouts::MethodListParams} for more details. + # + # Lists the saved payout methods (bank accounts, digital wallets, crypto + # addresses) that an account or user can withdraw to, most recently added first. + # Pass exactly one of account*id (a biz* identifier) or user*id (a user* + # identifier). Pass an amount to additionally get a fee and delivery quote per + # method for withdrawing that amount. + # + # @overload list(account_id: nil, after: nil, amount: nil, before: nil, currency: nil, first: nil, include_available: nil, last: nil, status: nil, user_id: nil, request_options: {}) + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param amount [Float] Optional withdrawal amount in whole currency units, for example `250.00`. When p + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param currency [String] Currency code of the amount, for example `usd`. Only meaningful with amount. + # + # @param first [Integer] Number of payout methods to return from the start of the window. Capped at 25 wh + # + # @param include_available [Boolean] When true, the response also carries available_destinations — payout rails the a + # + # @param last [Integer] Number of payout methods to return from the end of the window. + # + # @param status [Symbol, WhopSDK::Models::Payouts::MethodListParams::Status] Optional status filter. `created` means saved but unused, `active` means a payou + # + # @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::Internal::CursorPage] + # + # @see WhopSDK::Models::Payouts::MethodListParams + def list(params = {}) + parsed, options = WhopSDK::Payouts::MethodListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "payouts/methods", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::Payouts::MethodListResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/whop_sdk/resources/people.rb b/lib/whop_sdk/resources/people.rb new file mode 100644 index 00000000..0a617b02 --- /dev/null +++ b/lib/whop_sdk/resources/people.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # A Person represents a visitor or customer of an account, assembled from + # [pixel events](/api-reference/beta/events/event) and purchase activity — ad + # clicks, storefront visits, and checkouts. + # + # Use the People API to list the people of an account and retrieve a single + # person. + class People + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PersonRetrieveParams} for more details. + # + # Retrieves one person for an account, aggregated from pixel events. + # + # @overload retrieve(person_id, account_id: nil, from: nil, to: nil, request_options: {}) + # + # @param person_id [String] The ID of the person. + # + # @param account_id [String] The ID of the account, which will look like biz\_******\*******. Optional for + # acco + # + # @param from [Integer] Start of the time range as a Unix timestamp. + # + # @param to [Integer] End of the time range as a Unix timestamp. Defaults to now. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::PersonRetrieveResponse] + # + # @see WhopSDK::Models::PersonRetrieveParams + def retrieve(person_id, params = {}) + parsed, options = WhopSDK::PersonRetrieveParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["people/%1$s", person_id], + query: query, + model: WhopSDK::Models::PersonRetrieveResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PersonListParams} for more details. + # + # Lists the people (visitors and customers) of an account, aggregated from pixel + # events. The account is inferred from an account API key; other credentials must + # pass account_id. + # + # @overload list(account_id: nil, after: nil, before: nil, direction: nil, filters: nil, first: nil, from: nil, sort: nil, to: nil, request_options: {}) + # + # @param account_id [String] The ID of the account, which will look like biz\_******\*******. Optional for + # acco + # + # @param after [String] A cursor for fetching people after a previous page. + # + # @param before [String] A cursor for fetching people before a later page. + # + # @param direction [Symbol, WhopSDK::Models::PersonListParams::Direction] Sort direction. Defaults to desc. + # + # @param filters [String] A JSON-encoded array of filters, each with field, operator, and value keys. + # + # @param first [Integer] The number of people to return (default 100, max 100). + # + # @param from [Integer] Start of the time range as a Unix timestamp. Defaults to 366 days before `to`. + # + # @param sort [String] Column to sort by (e.g. last_seen_at, ltv, purchase_count). Defaults to last_see + # + # @param to [Integer] End of the time range as a Unix timestamp. Defaults to now. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::PersonListParams + def list(params = {}) + parsed, options = WhopSDK::PersonListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "people", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::PersonListResponse, + 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/plans.rb b/lib/whop_sdk/resources/plans.rb index c7034386..5ab02e5b 100644 --- a/lib/whop_sdk/resources/plans.rb +++ b/lib/whop_sdk/resources/plans.rb @@ -2,6 +2,12 @@ module WhopSDK module Resources + # A Plan defines how customers buy a product. It controls pricing, billing + # cadence, availability, tax behavior, checkout fields, and purchase visibility. + # + # Use the Plans API to create plans for products, list existing plans, retrieve or + # update plan configuration, calculate tax for checkout, and delete plans that + # should no longer be offered. class Plans # Some parameter documentations has been truncated, see # {WhopSDK::Models::PlanCreateParams} for more details. @@ -9,31 +15,29 @@ class Plans # Create a new pricing plan for a product. The plan defines the billing interval, # price, and availability for customers. # - # @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: {}) + # @overload create(account_id: nil, 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, product_id: 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. + # @param account_id [String] The unique identifier of the account to create this plan for. Defaults to the ca # # @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 billing_period [Integer, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. # # @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 [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. 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. + # @param expiration_days [Integer, nil] Access duration in days before the membership expires. # # @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, in the plan's currency (e.g., 10.43 fo + # @param initial_price [Float, nil] Initial amount charged in the plan's currency, e.g. 10.43 for $10.43. # - # @param internal_notes [String, nil] Private notes visible only to the business owner. Not shown to customers. + # @param internal_notes [String, nil] Private notes visible only to the account owner. Not shown to customers. # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls. # @@ -41,23 +45,25 @@ class Plans # # @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 payment_method_configuration [WhopSDK::Models::PlanCreateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. When not provided, the accou + # + # @param plan_type [String] Plan billing type, such as `one_time` or `renewal`. # - # @param plan_type [String] The billing type of the plan, such as one_time or renewal. + # @param product_id [String] The unique identifier of the product to attach this plan to. # - # @param release_method [String] The method used to sell this plan (e.g., buy_now, waitlist). + # @param release_method [String] Sales method for this plan, such as `buy_now` or `waitlist`. # # @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 split_pay_required_payments [Integer, nil] 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] The 3D Secure behavior for this plan. Send null to inherit the account default. + # @param three_ds_level [Symbol, WhopSDK::Models::PlanCreateParams::ThreeDSLevel] 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 trial_period_days [Integer, nil] Free trial duration before the first recurring charge. # # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. # @@ -68,7 +74,7 @@ class Plans # @return [WhopSDK::Models::Plan] # # @see WhopSDK::Models::PlanCreateParams - def create(params) + def create(params = {}) parsed, options = WhopSDK::PlanCreateParams.dump_request(params) @client.request(method: :post, path: "plans", body: parsed, model: WhopSDK::Plan, options: options) end @@ -77,7 +83,7 @@ def create(params) # # @overload retrieve(id, request_options: {}) # - # @param id [String] The unique identifier of the plan, which will look like plan\_******\*******. + # @param id [String] Plan ID, prefixed `plan_`. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -101,11 +107,11 @@ def retrieve(id, params = {}) # # @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, which will look like plan\_******\*******. + # @param id [String] Plan ID, prefixed `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 billing_period [Integer, nil] Recurring billing interval in days, such as 30 for monthly or 365 for annual. # # @param checkout_styling [Object, nil] Checkout styling overrides for this plan. # @@ -115,13 +121,13 @@ def retrieve(id, params = {}) # # @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. + # @param expiration_days [Integer, nil] Access duration in days before the membership expires. # # @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, in the plan's currency (e.g., 10.43 fo + # @param initial_price [Float, nil] Initial amount charged in the plan's currency, e.g. 10.43 for $10.43. # - # @param internal_notes [String, nil] Private notes visible only to the business owner. Not shown to customers. + # @param internal_notes [String, nil] Private notes visible only to the account owner. Not shown to customers. # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls. # @@ -131,7 +137,7 @@ def retrieve(id, params = {}) # # @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. When not provided, the compa + # @param payment_method_configuration [WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. When not provided, the accou # # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans, in the plan's curren # @@ -141,11 +147,11 @@ def retrieve(id, params = {}) # # @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] The 3D Secure behavior for this plan. Send null to inherit the account default. + # @param three_ds_level [Symbol, WhopSDK::Models::PlanUpdateParams::ThreeDSLevel] 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 trial_period_days [Integer, nil] Free trial duration before the first recurring charge. # # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. # @@ -167,12 +173,12 @@ def update(id, params = {}) ) end - # Returns a paginated list of plans belonging to a company, with optional + # Returns a paginated list of plans belonging to an account, with optional # filtering by visibility, type, release method, and product. # - # @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: {}) + # @overload list(account_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 account_id [String] The unique identifier of the account to list plans for. # # @param after [String] A cursor; returns plans after this position. # @@ -221,7 +227,7 @@ def list(params) # # @overload delete(id, request_options: {}) # - # @param id [String] The unique identifier of the plan, which will look like plan\_******\*******. + # @param id [String] Plan ID, prefixed `plan_`. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -237,6 +243,37 @@ def delete(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PlanCalculateTaxParams} for more details. + # + # Previews tax for a plan before checkout, based on the buyer's location. + # + # @overload calculate_tax(id, address: nil, ip_address: nil, tax_ids: nil, request_options: {}) + # + # @param id [String] Plan ID, prefixed `plan_`. + # + # @param address [WhopSDK::Models::PlanCalculateTaxParams::Address, nil] Buyer billing address used for tax calculation. Provide either `address.country` + # + # @param ip_address [String] Buyer IP address used to infer location when no billing address is provided. + # + # @param tax_ids [Array, nil] Optional buyer tax ID for B2B exemptions. At most one entry is supported. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::PlanCalculateTaxResponse] + # + # @see WhopSDK::Models::PlanCalculateTaxParams + def calculate_tax(id, params = {}) + parsed, options = WhopSDK::PlanCalculateTaxParams.dump_request(params) + @client.request( + method: :post, + path: ["plans/%1$s/calculate_tax", id], + body: parsed, + model: WhopSDK::Models::PlanCalculateTaxResponse, + options: options + ) + end + # @api private # # @param client [WhopSDK::Client] diff --git a/lib/whop_sdk/resources/products.rb b/lib/whop_sdk/resources/products.rb index dcdfe65e..339b576c 100644 --- a/lib/whop_sdk/resources/products.rb +++ b/lib/whop_sdk/resources/products.rb @@ -2,60 +2,55 @@ module WhopSDK module Resources - # Products + # A Product is a digital good or service sold on Whop. Products may contain plans + # for pricing and/or experiences for content delivery. + # + # Use the Products API to create products, list products visible to your + # credentials, retrieve product details, update product metadata or merchandising + # fields, and delete products that should no longer be sold. class Products # Some parameter documentations has been truncated, see # {WhopSDK::Models::ProductCreateParams} for more details. # - # Create a new product for a company. The product serves as the top-level - # container for plans and experiences. + # Creates a new product for a company. # - # Required permissions: - # - # - `access_pass:create` - # - `access_pass:basic:read` - # - # @overload create(company_id:, title:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, experience_ids: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, metadata: nil, plan_options: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, visibility: nil, request_options: {}) - # - # @param company_id [String] The unique identifier of the company to create this product for. + # @overload create(title:, collect_shipping_address: nil, company_id: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, metadata: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, visibility: nil, request_options: {}) # # @param title [String] The display name of the product. Maximum 80 characters. # - # @param collect_shipping_address [Boolean, nil] Whether the checkout flow collects a shipping address from the customer. + # @param collect_shipping_address [Boolean, nil] Whether to collect a shipping address at checkout. # - # @param custom_cta [Symbol, WhopSDK::Models::CustomCta, nil] The different types of custom CTAs that can be selected. - # - # @param custom_cta_url [String, nil] A URL that the call-to-action button links to instead of the default checkout fl + # @param company_id [String] The unique identifier of the company to create this product for. # - # @param custom_statement_descriptor [String, nil] A custom text label that appears on the customer's bank statement. Must be 5-22 + # @param custom_cta [String, nil] The call-to-action button label. # - # @param description [String, nil] A written description of the product displayed on its product page. + # @param custom_cta_url [String, nil] A URL the call-to-action button links to. # - # @param experience_ids [Array, nil] The unique identifiers of experiences to connect to this product. + # @param custom_statement_descriptor [String, nil] Custom bank statement descriptor. Must start with WHOP\*. # - # @param global_affiliate_percentage [Float, nil] The commission rate as a percentage that affiliates earn through the global affi + # @param description [String, nil] A written description displayed on the product page. # - # @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. + # @param global_affiliate_percentage [Float, nil] The commission rate affiliates earn. # - # @param headline [String, nil] A short marketing headline displayed prominently on the product page. + # @param global_affiliate_status [String] The enrollment status in the global affiliate program. # - # @param member_affiliate_percentage [Float, nil] The commission rate as a percentage that members earn through the member affilia + # @param headline [String, nil] A short marketing headline for the product page. # - # @param member_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. + # @param member_affiliate_percentage [Float, nil] The commission rate members earn. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs to store on the product. Included in webhook payloads for + # @param member_affiliate_status [String] The enrollment status in the member affiliate program. # - # @param plan_options [WhopSDK::Models::ProductCreateParams::PlanOptions, nil] Configuration for an automatically generated plan to attach to this product. + # @param metadata [Object, nil] Custom key-value pairs to store on the product. # - # @param product_tax_code_id [String, nil] The unique identifier of the tax classification code to apply to this product. + # @param product_tax_code_id [String, nil] The unique identifier of the tax classification code. See the available [product # - # @param redirect_purchase_url [String, nil] A URL to redirect the customer to after completing a purchase. + # @param redirect_purchase_url [String, nil] A URL to redirect the customer to after purchase. # # @param route [String, nil] The URL slug for the product's public link. # # @param send_welcome_message [Boolean, nil] Whether to send an automated welcome message via support chat when a user joins # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + # @param visibility [String] Whether the product is visible to customers. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -73,15 +68,12 @@ def create(params) ) end - # Retrieves the details of an existing product. - # - # Required permissions: - # - # - `access_pass:basic:read` + # Retrieves the details of an existing product. This endpoint is publicly + # accessible. # # @overload retrieve(id, request_options: {}) # - # @param id [String] The unique identifier or route slug of the product. + # @param id [String] The unique identifier of the product. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -100,54 +92,25 @@ def retrieve(id, params = {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::ProductUpdateParams} for more details. # - # Update a product's title, description, visibility, and other settings. - # - # Required permissions: - # - # - `access_pass:update` - # - `access_pass:basic:read` - # - # @overload update(id, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, gallery_images: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, metadata: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, store_page_config: nil, title: nil, visibility: nil, request_options: {}) - # - # @param id [String] The unique identifier of the product to update. - # - # @param collect_shipping_address [Boolean, nil] Whether the checkout flow collects a shipping address from the customer. - # - # @param custom_cta [Symbol, WhopSDK::Models::CustomCta, nil] The different types of custom CTAs that can be selected. - # - # @param custom_cta_url [String, nil] A URL that the call-to-action button links to instead of the default checkout fl + # Updates an existing product. # - # @param custom_statement_descriptor [String, nil] A custom text label that appears on the customer's bank statement. Must be 5-22 + # @overload update(id, description: nil, headline: nil, metadata: nil, product_tax_code_id: nil, send_welcome_message: nil, title: nil, visibility: nil, request_options: {}) # - # @param description [String, nil] A written description of the product displayed on its product page. + # @param id [String] The unique identifier of the product. # - # @param gallery_images [Array, nil] The gallery images for the product. + # @param description [String, nil] A written description displayed on the product page. # - # @param global_affiliate_percentage [Float, nil] The commission rate as a percentage that affiliates earn through the global affi + # @param headline [String, nil] A short marketing headline for the product page. # - # @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. + # @param metadata [Object, nil] Custom key-value pairs to store on the product. # - # @param headline [String, nil] A short marketing headline displayed prominently on the product page. - # - # @param member_affiliate_percentage [Float, nil] The commission rate as a percentage that members earn through the member affilia - # - # @param member_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product. - # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs to store on the product. Included in webhook payloads for - # - # @param product_tax_code_id [String, nil] The unique identifier of the tax classification code to apply to this product. - # - # @param redirect_purchase_url [String, nil] A URL to redirect the customer to after completing a purchase. - # - # @param route [String, nil] The URL slug for the product's public link. + # @param product_tax_code_id [String, nil] The unique identifier of the tax classification code. See the available [product # # @param send_welcome_message [Boolean, nil] Whether to send an automated welcome message via support chat when a user joins # - # @param store_page_config [WhopSDK::Models::ProductUpdateParams::StorePageConfig, nil] Layout and display configuration for this product on the company's store page. + # @param title [String] The display name of the product. # - # @param title [String, nil] The display name of the product. Maximum 80 characters. - # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + # @param visibility [String] Whether the product is visible to customers. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -165,36 +128,27 @@ def update(id, params = {}) ) end - # Returns a paginated list of products belonging to a company, with optional - # filtering by type, visibility, and creation date. - # - # Required permissions: + # Returns a paginated list of products belonging to a company. # - # - `access_pass:basic:read` - # - # @overload list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, product_types: nil, visibilities: nil, request_options: {}) + # @overload list(company_id:, access_pass_types: nil, after: nil, before: nil, direction: nil, first: nil, last: nil, order: nil, visibilities: nil, request_options: {}) # # @param company_id [String] The unique identifier of the company to list products for. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. - # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param access_pass_types [Array] Filter to only products matching these types. # - # @param created_after [Time, nil] Only return products created after this timestamp. + # @param after [String] A cursor; returns products after this position. # - # @param created_before [Time, nil] Only return products created before this timestamp. + # @param before [String] A cursor; returns products before this position. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param direction [Symbol, WhopSDK::Models::ProductListParams::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 products to return (default and max 100). # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param last [Integer] The number of products to return from the end of the range. # - # @param order [Symbol, WhopSDK::Models::ProductListParams::Order, nil] The ways a relation of AccessPasses can be ordered + # @param order [String] The field to sort results by. Defaults to created_at. # - # @param product_types [Array, nil] Filter to only products matching these type classifications. - # - # @param visibilities [Array, nil] Filter to only products matching these visibility states. + # @param visibilities [Array] Filter to only products matching these visibility states. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -214,15 +168,12 @@ def list(params) ) end - # Permanently delete a product and remove it from the company's catalog. - # - # Required permissions: - # - # - `access_pass:delete` + # Deletes a product. Only products with no memberships, entries, reviews, or + # invoices can be deleted. # # @overload delete(id, request_options: {}) # - # @param id [String] The unique identifier of the product to delete. + # @param id [String] The unique identifier of the product. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/whop_sdk/resources/promo_codes.rb b/lib/whop_sdk/resources/promo_codes.rb index c7eb870f..e381fcd6 100644 --- a/lib/whop_sdk/resources/promo_codes.rb +++ b/lib/whop_sdk/resources/promo_codes.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Promo codes class PromoCodes # Some parameter documentations has been truncated, see # {WhopSDK::Models::PromoCodeCreateParams} for more details. diff --git a/lib/whop_sdk/resources/reactions.rb b/lib/whop_sdk/resources/reactions.rb index fb3e8f77..32a36030 100644 --- a/lib/whop_sdk/resources/reactions.rb +++ b/lib/whop_sdk/resources/reactions.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Reactions class Reactions # Some parameter documentations has been truncated, see # {WhopSDK::Models::ReactionCreateParams} for more details. diff --git a/lib/whop_sdk/resources/referrals.rb b/lib/whop_sdk/resources/referrals.rb new file mode 100644 index 00000000..6104b08a --- /dev/null +++ b/lib/whop_sdk/resources/referrals.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Referrals + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + # @return [WhopSDK::Resources::Referrals::Businesses] + attr_reader :businesses + + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + # @return [WhopSDK::Resources::Referrals::Partners] + attr_reader :partners + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ReferralReferredUsersParams} for more details. + # + # Lists the users the caller referred onto Whop (newest first), each with the + # second-tier earnings the caller has made from that user's businesses. + # + # @overload referred_users(after: nil, before: nil, first: nil, has_businesses: nil, has_earning_businesses: nil, last: nil, request_options: {}) + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param first [Integer] Number of referred users to return from the start of the window. + # + # @param has_businesses [Boolean] When true, only referred users who brought at least one business onto Whop. + # + # @param has_earning_businesses [Boolean] When true, only referred users with at least one business that has generated ear + # + # @param last [Integer] Number of referred users to return from the end of the window. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::ReferralReferredUsersResponse] + # + # @see WhopSDK::Models::ReferralReferredUsersParams + def referred_users(params = {}) + parsed, options = WhopSDK::ReferralReferredUsersParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "partners/referred_users", + query: query, + model: WhopSDK::Models::ReferralReferredUsersResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + @businesses = WhopSDK::Resources::Referrals::Businesses.new(client: client) + @partners = WhopSDK::Resources::Referrals::Partners.new(client: client) + end + end + end +end diff --git a/lib/whop_sdk/resources/referrals/businesses.rb b/lib/whop_sdk/resources/referrals/businesses.rb new file mode 100644 index 00000000..5936ad02 --- /dev/null +++ b/lib/whop_sdk/resources/referrals/businesses.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Referrals + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Businesses + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + # @return [WhopSDK::Resources::Referrals::Businesses::Earnings] + attr_reader :earnings + + # Retrieves a single referred business and its referral terms. + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] The business referral ID (a coma\_ identifier). + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse] + # + # @see WhopSDK::Models::Referrals::BusinessRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["partners/businesses/%1$s", id], + model: WhopSDK::Models::Referrals::BusinessRetrieveResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessListParams} for more details. + # + # Lists the businesses the authenticated user referred onto Whop, most recent + # first. + # + # @overload list(after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, has_earnings: nil, last: nil, order: nil, referred_user_id: nil, referred_username: nil, status: nil, tier: nil, request_options: {}) + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param created_after [String] Only return business referrals created after this timestamp. + # + # @param created_before [String] Only return business referrals created before this timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Direction] Sort direction. + # + # @param first [Integer] Number of business referrals to return from the start of the window. + # + # @param has_earnings [Boolean] When true, only businesses with pending or completed earnings paid to the caller + # + # @param last [Integer] Number of business referrals to return from the end of the window. + # + # @param order [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Order] The field to sort business referrals by. + # + # @param referred_user_id [String] Filter to referrals attributed to this user. For first-tier referrals, this is t + # + # @param referred_username [String] Filter by the referred user's exact username. Ignored when `referred_user_id` is + # + # @param status [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Status] Filter by referral status. + # + # @param tier [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Tier] Filter to only first-tier referrals or only second-tier referrals. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::Referrals::BusinessListParams + def list(params = {}) + parsed, options = WhopSDK::Referrals::BusinessListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "partners/businesses", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::Referrals::BusinessListResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Referrals::BusinessLeaderboardParams} for more details. + # + # Ranks referrers by business referral earnings — all-time by default, or over the + # current day, month, year, or trailing 30 days — and includes the caller's own + # standing. + # + # @overload leaderboard(period: nil, request_options: {}) + # + # @param period [Symbol, WhopSDK::Models::Referrals::BusinessLeaderboardParams::Period] Time window for the rankings. `day`, `month`, and `year` count earnings since th + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse] + # + # @see WhopSDK::Models::Referrals::BusinessLeaderboardParams + def leaderboard(params = {}) + parsed, options = WhopSDK::Referrals::BusinessLeaderboardParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "partners/leaderboard", + query: query, + model: WhopSDK::Models::Referrals::BusinessLeaderboardResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + @earnings = WhopSDK::Resources::Referrals::Businesses::Earnings.new(client: client) + end + end + end + end +end diff --git a/lib/whop_sdk/resources/referrals/businesses/earnings.rb b/lib/whop_sdk/resources/referrals/businesses/earnings.rb new file mode 100644 index 00000000..53acb759 --- /dev/null +++ b/lib/whop_sdk/resources/referrals/businesses/earnings.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Referrals + class Businesses + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Earnings + # Lists the earnings Whop pays out for one referred business's activity, most + # recent first. + # + # @overload list(id, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, status: nil, request_options: {}) + # + # @param id [String] The business referral ID (a coma\_ identifier). + # + # @param after [String] + # + # @param before [String] + # + # @param created_after [String] Only return earnings created after this timestamp. + # + # @param created_before [String] Only return earnings created before this timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Direction] Sort direction. + # + # @param first [Integer] + # + # @param last [Integer] + # + # @param order [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Order] The field to sort earnings by. + # + # @param status [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Status] Filter by earning status. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::Referrals::Businesses::EarningListParams + def list(id, params = {}) + parsed, options = WhopSDK::Referrals::Businesses::EarningListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["partners/businesses/%1$s/earnings", id], + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::Referrals::Businesses::EarningListResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/whop_sdk/resources/referrals/partners.rb b/lib/whop_sdk/resources/referrals/partners.rb new file mode 100644 index 00000000..0ceb833c --- /dev/null +++ b/lib/whop_sdk/resources/referrals/partners.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Referrals + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Partners + # Enrolls the calling user in the Whop partner program, making their business + # referrals eligible for earnings. Idempotent — enrolling again keeps the original + # enrollment time. + # + # @overload create(request_options: {}) + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Referrals::PartnerCreateResponse] + # + # @see WhopSDK::Models::Referrals::PartnerCreateParams + def create(params = {}) + @client.request( + method: :post, + path: "partners", + model: WhopSDK::Models::Referrals::PartnerCreateResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/whop_sdk/resources/refunds.rb b/lib/whop_sdk/resources/refunds.rb index a0798a01..2d31cbf1 100644 --- a/lib/whop_sdk/resources/refunds.rb +++ b/lib/whop_sdk/resources/refunds.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Refunds class Refunds # Retrieves the details of an existing refund. # diff --git a/lib/whop_sdk/resources/resolution_center_cases.rb b/lib/whop_sdk/resources/resolution_center_cases.rb index 110f38fb..72debb62 100644 --- a/lib/whop_sdk/resources/resolution_center_cases.rb +++ b/lib/whop_sdk/resources/resolution_center_cases.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Resolution center cases class ResolutionCenterCases # Retrieves the details of an existing resolution center case. # diff --git a/lib/whop_sdk/resources/reviews.rb b/lib/whop_sdk/resources/reviews.rb index e7a5253d..7daacd73 100644 --- a/lib/whop_sdk/resources/reviews.rb +++ b/lib/whop_sdk/resources/reviews.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Reviews class Reviews # Retrieves the details of an existing review. # diff --git a/lib/whop_sdk/resources/setup_intents.rb b/lib/whop_sdk/resources/setup_intents.rb index 8fed0ed5..c655c4a4 100644 --- a/lib/whop_sdk/resources/setup_intents.rb +++ b/lib/whop_sdk/resources/setup_intents.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Setup intents class SetupIntents # Retrieves the details of an existing setup intent. # diff --git a/lib/whop_sdk/resources/shipments.rb b/lib/whop_sdk/resources/shipments.rb index becaea89..4c6d9826 100644 --- a/lib/whop_sdk/resources/shipments.rb +++ b/lib/whop_sdk/resources/shipments.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Shipments class Shipments # Some parameter documentations has been truncated, see # {WhopSDK::Models::ShipmentCreateParams} for more details. diff --git a/lib/whop_sdk/resources/social_accounts.rb b/lib/whop_sdk/resources/social_accounts.rb new file mode 100644 index 00000000..9597c8ea --- /dev/null +++ b/lib/whop_sdk/resources/social_accounts.rb @@ -0,0 +1,192 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # A Social Account represents an external profile connected to a Whop account or + # user, such as a Facebook page or Instagram account. Connecting a social account + # lets Whop run [ads](/api-reference/beta/ads/ad) under that profile's identity + # and promote its existing posts. + # + # Use the Social Accounts API to list connected accounts, create a Whop-managed + # Facebook page, start an OAuth connection, disconnect a social account, and list + # a connected profile's posts. + class SocialAccounts + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountCreateParams} for more details. + # + # Creates or returns a Whop-managed Facebook page for an account. + # + # @overload create(platform:, account_id: nil, request_options: {}) + # + # @param platform [Symbol, WhopSDK::Models::SocialAccountCreateParams::Platform] The platform to create the social account on. + # + # @param account_id [String] The Account (biz\_ identifier) to create the social account for. An + # account-scope + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::SocialAccount] + # + # @see WhopSDK::Models::SocialAccountCreateParams + def create(params) + parsed, options = WhopSDK::SocialAccountCreateParams.dump_request(params) + @client.request( + method: :post, + path: "social_accounts", + body: parsed, + model: WhopSDK::SocialAccount, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountListParams} for more details. + # + # Lists the social accounts linked to an account or user. + # + # @overload list(account_id: nil, after: nil, before: nil, direction: nil, first: nil, last: nil, order: nil, platform: nil, scopes: nil, user_id: nil, verified: nil, request_options: {}) + # + # @param account_id [String] The Account that the social accounts are connected to. Provide either this or us + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param direction [Symbol, WhopSDK::Models::SocialAccountListParams::Direction] Sort direction. + # + # @param first [Integer] The number of social accounts to return. + # + # @param last [Integer] The number of social accounts to return from the end of the range. + # + # @param order [Symbol, WhopSDK::Models::SocialAccountListParams::Order] The field to sort social accounts by. + # + # @param platform [Symbol, WhopSDK::Models::SocialAccountListParams::Platform] Only return social accounts for the platform that is specified. + # + # @param scopes [Array] Only return social accounts that have these scopes. + # + # @param user_id [String] The User that the social accounts are connected to. Provide either this or accou + # + # @param verified [Boolean] Only return social accounts that are verified on the platform. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::SocialAccountListParams + def list(params = {}) + parsed, options = WhopSDK::SocialAccountListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "social_accounts", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::SocialAccount, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountDeleteParams} for more details. + # + # Disconnects a social account from an account or user without deleting the + # underlying platform account. + # + # @overload delete(id, account_id: nil, user_id: nil, request_options: {}) + # + # @param id [String] The ID of the social account to disconnect. + # + # @param account_id [String] The Account that the social account is connected to. Provide either this or user + # + # @param user_id [String] The User that the social account is connected to. Provide either this or account + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Boolean] + # + # @see WhopSDK::Models::SocialAccountDeleteParams + def delete(id, params = {}) + parsed, options = WhopSDK::SocialAccountDeleteParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :delete, + path: ["social_accounts/%1$s", id], + query: query, + model: WhopSDK::Internal::Type::Boolean, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SocialAccountConnectParams} for more details. + # + # Starts an OAuth connection flow and returns an authorize_url where the user can + # connect a social account. + # + # @overload connect(platform:, account_id: nil, redirect_url: nil, scopes: nil, request_options: {}) + # + # @param platform [Symbol, WhopSDK::Models::SocialAccountConnectParams::Platform] The platform to connect the social account on. Today, the supported option is `m + # + # @param account_id [String] The Account (biz\_ identifier) to connect the social account for. An + # account-scop + # + # @param redirect_url [String] The Whop URL to redirect the user to after they finish connecting. + # + # @param scopes [Array] Capabilities to grant for the connected social account. Use `advertise` when con + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::SocialAccountConnectResponse] + # + # @see WhopSDK::Models::SocialAccountConnectParams + def connect(params) + parsed, options = WhopSDK::SocialAccountConnectParams.dump_request(params) + @client.request( + method: :post, + path: "social_accounts/connect", + body: parsed, + model: WhopSDK::Models::SocialAccountConnectResponse, + options: options + ) + end + + # Lists the existing posts of a connected Facebook page or Instagram account. + # + # @overload posts(id, account_id:, after: nil, first: nil, post_id: nil, request_options: {}) + # + # @param id [String] The social account (a sacc\_ identifier) whose posts to list. + # + # @param account_id [String] The Account (a biz\_ identifier) the social account is connected to. + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param first [Integer] The number of posts to return. + # + # @param post_id [String] Return only the single post with this platform id, instead of the full list. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::SocialAccountPostsResponse] + # + # @see WhopSDK::Models::SocialAccountPostsParams + def posts(id, params) + parsed, options = WhopSDK::SocialAccountPostsParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["social_accounts/%1$s/posts", id], + query: query, + model: WhopSDK::Models::SocialAccountPostsResponse, + 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/stats.rb b/lib/whop_sdk/resources/stats.rb new file mode 100644 index 00000000..16c21a8e --- /dev/null +++ b/lib/whop_sdk/resources/stats.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # Stats represent aggregated activity for an account over time. They help you + # understand revenue, transactions, disputes, members, referrals, and advertising + # performance across reporting periods like days, weeks, or months. + # + # Use the Stats API to list available metrics and their filterable properties, + # then retrieve time-series values for a date range. + class Stats + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::StatRetrieveParams} for more details. + # + # Retrieves a metric as a time series of points for an account over a date range. + # + # @overload retrieve(metric, from:, to:, access_level: nil, account_id: nil, ad_campaign_ids: nil, ad_group_ids: nil, ad_ids: nil, breakdown_by: nil, card_network: nil, category: nil, convert_to: nil, currency: nil, fee_type: nil, interval: nil, most_recent_action: nil, payment_method: nil, product: nil, referred_user_id: nil, segment: nil, snapshot_window: nil, source: nil, status: nil, time_zone: nil, request_options: {}) + # + # @param metric [String] The metric to retrieve, for example net_revenue. Use GET /stats to see every met + # + # @param from [Date] Start of the date range (YYYY-MM-DD). + # + # @param to [Date] End of the date range (YYYY-MM-DD). + # + # @param access_level [String] Filter to a single access level. Pair with breakdown_by=access_level. Available + # + # @param account_id [String] The account this query concerns, for example biz_AbC123. + # + # @param ad_campaign_ids [Array] Ad campaign ids (adcamp\_...) to scope the report to; stats are summed across + # the + # + # @param ad_group_ids [Array] Ad group ids (adgrp\_...) to scope the report to; stats are summed across them. + # A + # + # @param ad_ids [Array] Ad ids (ad\_...) to scope the report to; stats are summed across them. Available + # + # @param breakdown_by [String] Split the metric out by one of its properties — each point gets a breakdown arra + # + # @param card_network [String] Filter to a single card brand, for example visa. A refinement of payment_method= + # + # @param category [String] Filter to a single balance-activity category, for example payments. Pair with br + # + # @param convert_to [String] Display currency for money metrics — every amount is converted into this ISO cur + # + # @param currency [String] Filter to transactions made in this original ISO currency, for example eur — rep + # + # @param fee_type [String] Filter to a single fee type. Pair with breakdown_by=fee_type to split fees by ty + # + # @param interval [Symbol, WhopSDK::Models::StatRetrieveParams::Interval] How wide each point is. Defaults to day. Snapshot metrics are day-only. + # + # @param most_recent_action [String] Filter to a single most-recent member action. Pair with breakdown_by=most_recent + # + # @param payment_method [String] Filter to a single payment method, for example card or crypto. Available on metr + # + # @param product [String] Filter to a single product (access pass id), for example prod_AbC123. Pair with + # + # @param referred_user_id [String] Filter a referral metric to the businesses attributed to one person you referred + # + # @param segment [String] Filter to a single wallet-balance segment, for example available. Pair with brea + # + # @param snapshot_window [Symbol, WhopSDK::Models::StatRetrieveParams::SnapshotWindow] Trailing window for snapshot metrics. Only accepted by snapshot metrics (each li + # + # @param source [String] Filter to a single GMV source, for example payments. Pair with breakdown_by=sour + # + # @param status [String] Filter to a single membership status. Pair with breakdown_by=status. Available o + # + # @param time_zone [String] IANA time zone to bucket the series in, for example America/New_York. Defaults t + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::StatRetrieveResponse] + # + # @see WhopSDK::Models::StatRetrieveParams + def retrieve(metric, params) + parsed, options = WhopSDK::StatRetrieveParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["stats/%1$s", metric], + query: query, + model: WhopSDK::Models::StatRetrieveResponse, + options: options + ) + end + + # Lists every metric you can query, with its unit and the properties you can + # filter or break it down by. + # + # @overload list(request_options: {}) + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::StatListResponse] + # + # @see WhopSDK::Models::StatListParams + def list(params = {}) + @client.request( + method: :get, + path: "stats", + model: WhopSDK::Models::StatListResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/whop_sdk/resources/support_channels.rb b/lib/whop_sdk/resources/support_channels.rb index e4d58957..50fa9e0c 100644 --- a/lib/whop_sdk/resources/support_channels.rb +++ b/lib/whop_sdk/resources/support_channels.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Support channels class SupportChannels # Some parameter documentations has been truncated, see # {WhopSDK::Models::SupportChannelCreateParams} for more details. diff --git a/lib/whop_sdk/resources/swaps.rb b/lib/whop_sdk/resources/swaps.rb index 809dbc0e..fec7e8c3 100644 --- a/lib/whop_sdk/resources/swaps.rb +++ b/lib/whop_sdk/resources/swaps.rb @@ -2,25 +2,34 @@ module WhopSDK module Resources + # Swaps convert value between supported tokens, chains, or wallet destinations for + # an account. A swap quote describes the expected output, fees, and approval + # requirements before you create the swap. + # + # Use the Swaps API to quote a conversion, create the swap, list recent swaps, and + # retrieve status until the transaction completes. class Swaps - # Executes a swap from the account's wallet. Runs asynchronously — poll GET - # /swaps?account_id=... for status. + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SwapCreateParams} for more details. + # + # Executes a swap from the account's wallet. Runs asynchronously; poll GET + # /swaps/{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 amount [String] Source token amount. # - # @param from_token [String] Source token contract address. + # @param from_token [String] Source token contract address or ticker symbol, such as "USDT". # - # @param to_token [String] Destination token contract address. + # @param to_token [String] Destination token contract address or ticker symbol, such as "XAUT". # - # @param from_chain [String, Integer, nil] + # @param from_chain [String, Integer, nil] Source chain name or chain ID. Defaults to the source token's chain when omitted # - # @param slippage_bps [Integer, nil] + # @param slippage_bps [Integer, nil] Maximum slippage tolerance in basis points. # - # @param to_chain [String, Integer, nil] + # @param to_chain [String, Integer, nil] Destination chain name or chain ID. Defaults to the destination token's chain wh # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -38,50 +47,74 @@ def create(params) ) end - # Returns the status of the account's in-flight or most recent swap. + # Returns the status of a specific swap, by the id returned from POST /swaps. # - # @overload retrieve(account_id:, request_options: {}) + # @overload retrieve(id, request_options: {}) # - # @param account_id [String] Business or user account ID (biz*\* / user*\*). + # @param id [String] Swap ID returned from POST /swaps. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::SwapRetrieveResponse] # # @see WhopSDK::Models::SwapRetrieveParams - def retrieve(params) - parsed, options = WhopSDK::SwapRetrieveParams.dump_request(params) + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["swaps/%1$s", id], + model: WhopSDK::Models::SwapRetrieveResponse, + options: params[:request_options] + ) + end + + # Lists the account's swaps. Currently returns the in-flight or most recent swap, + # so zero or one rows. + # + # @overload list(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::SwapListResponse] + # + # @see WhopSDK::Models::SwapListParams + def list(params) + parsed, options = WhopSDK::SwapListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "swaps", query: query, - model: WhopSDK::Models::SwapRetrieveResponse, + model: WhopSDK::Models::SwapListResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::SwapCreateQuoteParams} for more details. + # # 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: {}) # - # @param amount [String] Input token amount. + # @param amount [String] Source token amount. # - # @param from_token [String] Source token contract address. + # @param from_token [String] Source token contract address or ticker symbol, such as "USDT". # - # @param to_token [String] Destination token contract address. + # @param to_token [String] Destination token contract address or ticker symbol, such as "XAUT". # - # @param from_address [String, nil] + # @param from_address [String, nil] Source wallet address used for the quote. # - # @param from_chain [String, Integer, nil] + # @param from_chain [String, Integer, nil] Source chain name or chain ID. Defaults to the source token's chain when omitted # - # @param metadata [Hash{Symbol=>Object}] + # @param metadata [Hash{Symbol=>Object}] Metadata to include with the quote response. # - # @param slippage_bps [Integer, nil] + # @param slippage_bps [Integer, nil] Maximum slippage tolerance in basis points. # - # @param to_address [String, nil] + # @param to_address [String, nil] Destination wallet address used for the quote. # - # @param to_chain [String, Integer, nil] + # @param to_chain [String, Integer, nil] Destination chain name or chain ID. Defaults to the destination token's chain wh # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/whop_sdk/resources/topups.rb b/lib/whop_sdk/resources/topups.rb index 07684db5..cf8e61b7 100644 --- a/lib/whop_sdk/resources/topups.rb +++ b/lib/whop_sdk/resources/topups.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Topups class Topups # Some parameter documentations has been truncated, see # {WhopSDK::Models::TopupCreateParams} for more details. diff --git a/lib/whop_sdk/resources/transfers.rb b/lib/whop_sdk/resources/transfers.rb index cf2639c1..d2060d77 100644 --- a/lib/whop_sdk/resources/transfers.rb +++ b/lib/whop_sdk/resources/transfers.rb @@ -2,37 +2,48 @@ module WhopSDK module Resources - # Transfers + # Transfers move value between identities on Whop. They are used for + # account-to-account money movement, user payouts inside Whop, crypto transfers, + # and claim links depending on the destination type. + # + # Use the Transfers API to create a transfer, list previous transfers, and + # retrieve a transfer by ID when reconciling money movement between accounts or + # users. class Transfers # Some parameter documentations has been truncated, see # {WhopSDK::Models::TransferCreateParams} for more details. # - # Transfer funds between two ledger accounts, such as from a company balance to a - # user balance. + # Moves funds out of an account. `type` selects the kind of movement (default + # `ledger`): `ledger` transfers credit between two ledger accounts and returns a + # Transfer; `wallet_send` sends USDT from the origin account's Ethereum wallet to + # a recipient; `claim_link` funds a shareable claim link anyone with the URL can + # redeem. # - # Required permissions: + # @overload create(amount:, origin_id:, currency: nil, destination_id: nil, expires_at: nil, idempotence_key: nil, metadata: nil, notes: nil, redeemable_count: nil, type: nil, request_options: {}) # - # - `payout:transfer_funds` + # @param amount [Float] The amount to move, in the transfer currency. For example 25.00. # - # @overload create(amount:, currency:, destination_id:, origin_id:, idempotence_key: nil, metadata: nil, notes: nil, request_options: {}) + # @param origin_id [String] The account sending the funds. A user ID (user_xxx), account ID (biz_xxx), or le # - # @param amount [Float] The amount to transfer in the specified currency. For example, 25.00 for $25.00 + # @param currency [String] Currency, such as `usd`. Required for ledger transfers. # - # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the transfer amount, such as 'usd'. + # @param destination_id [String] The recipient. Required for ledger and wallet*send (a user*/biz*/ldgr* ID, or — # - # @param destination_id [String] The identifier of the account receiving the funds. Accepts a user ID ('user_xxx' + # @param expires_at [Time, nil] claim_link only. Link expiry as an ISO 8601 timestamp. Defaults to 24 hours from # - # @param origin_id [String] The identifier of the account sending the funds. Accepts a user ID ('user_xxx'), + # @param idempotence_key [String, nil] Ledger transfers only. A unique key to prevent duplicate transfers. # - # @param idempotence_key [String, nil] A unique key to prevent duplicate transfers. Use a UUID or similar unique string + # @param metadata [Hash{Symbol=>Object}, nil] Ledger transfers only. Custom key-value pairs attached to the transfer. Max 50 k # - # @param metadata [Hash{Symbol=>Object}, nil] A JSON object of custom metadata to attach to the transfer for tracking purposes + # @param notes [String, nil] Ledger transfers only. A short note describing the transfer. # - # @param notes [String, nil] A short note describing the transfer, up to 50 characters. + # @param redeemable_count [Integer] claim_link only. How many different users can claim the link. Defaults to 1. + # + # @param type [Symbol, WhopSDK::Models::TransferCreateParams::Type] The kind of money movement. Defaults to ledger. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Models::Transfer] + # @return [WhopSDK::Models::TransferCreateResponse::Transfer, WhopSDK::Models::TransferCreateResponse::Send, WhopSDK::Models::TransferCreateResponse::ClaimLink] # # @see WhopSDK::Models::TransferCreateParams def create(params) @@ -41,66 +52,55 @@ def create(params) method: :post, path: "transfers", body: parsed, - model: WhopSDK::Transfer, + model: WhopSDK::Models::TransferCreateResponse, options: options ) end - # Retrieves the details of an existing transfer. - # - # Required permissions: - # - # - `payout:transfer:read` + # Retrieves a ledger transfer by ID. # # @overload retrieve(id, request_options: {}) # - # @param id [String] The unique identifier of the transfer to retrieve. + # @param id [String] The transfer ID. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Models::Transfer] + # @return [WhopSDK::Models::TransferRetrieveResponse] # # @see WhopSDK::Models::TransferRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["transfers/%1$s", id], - model: WhopSDK::Transfer, + model: WhopSDK::Models::TransferRetrieveResponse, options: params[:request_options] ) end - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::TransferListParams} for more details. - # - # Returns a paginated list of fund transfers, filtered by origin or destination - # account, with optional sorting and date filtering. - # - # Required permissions: - # - # - `payout:transfer:read` + # Lists ledger transfers for an account. You must specify an origin_id or a + # destination_id. # # @overload list(after: nil, before: nil, created_after: nil, created_before: nil, destination_id: nil, direction: nil, first: nil, last: nil, order: nil, origin_id: nil, request_options: {}) # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). # - # @param created_after [Time, nil] Only return transfers created after this timestamp. + # @param created_after [String] Only transfers created strictly after this ISO 8601 timestamp. # - # @param created_before [Time, nil] Only return transfers created before this timestamp. + # @param created_before [String] Only transfers created strictly before this ISO 8601 timestamp. # - # @param destination_id [String, nil] Filter to transfers received by this account. Accepts a user, company, or ledger + # @param destination_id [String] Filter to transfers received by this account. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param direction [Symbol, WhopSDK::Models::TransferListParams::Direction] Sort direction. Defaults to desc. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param first [Integer] Number of transfers to return from the start of the window. # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param last [Integer] Number of transfers to return from the end of the window. # - # @param order [Symbol, WhopSDK::Models::TransferListParams::Order, nil] Which columns can be used to sort. + # @param order [Symbol, WhopSDK::Models::TransferListParams::Order] Sort column. Defaults to created_at. # - # @param origin_id [String, nil] Filter to transfers sent from this account. Accepts a user, company, or ledger a + # @param origin_id [String] Filter to transfers sent from this account. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/whop_sdk/resources/users.rb b/lib/whop_sdk/resources/users.rb index 924bc65d..05a3d805 100644 --- a/lib/whop_sdk/resources/users.rb +++ b/lib/whop_sdk/resources/users.rb @@ -2,19 +2,33 @@ module WhopSDK module Resources + # A User represents a person on Whop. Users have a public profile and can buy + # products, join accounts, and access experiences. + # + # Use the Users API to search for users, retrieve or update profiles, and check + # whether a user has access to an account, product, or experience. class Users # Some parameter documentations has been truncated, see # {WhopSDK::Models::UserRetrieveParams} for more details. # # Retrieves a user's public profile by user\_ tag, username, or 'me'. # - # @overload retrieve(id, account_id: nil, request_options: {}) + # @overload retrieve(id, account_id: nil, from: nil, include_balance_history: nil, interval: nil, time_zone: nil, to: nil, request_options: {}) # - # @param id [String] The ID of the user, which will look like user\_******\*******, a username, or - # 'me' + # @param id [String] User ID (prefixed `user_`), username, or `me`. # # @param account_id [String] When set, returns the user's account-specific profile overrides for this account # + # @param from [String] Balance-history window start, ISO 8601 date or datetime. Defaults to 30 days ago + # + # @param include_balance_history [Boolean] On `GET /users/me`, also compute the caller's balance history (opt-in; runs a he + # + # @param interval [Symbol, WhopSDK::Models::UserRetrieveParams::Interval] Balance-history point granularity. Defaults to `day`. Only used with `include_ba + # + # @param time_zone [String] IANA time zone the balance-history points are bucketed in. Defaults to `UTC`. On + # + # @param to [String] Balance-history window end, ISO 8601 date or datetime. Defaults to now. Only use + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::User] @@ -40,8 +54,7 @@ def retrieve(id, params = {}) # # @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 + # @param id [String] Path param: User ID (prefixed `user_`), username, or `me`. # # @param account_id [String] Query param: The account whose profile override to update. Required for API key # @@ -106,12 +119,12 @@ def list(params = {}) ) end - # Checks whether a user has access to a company, product, or experience the caller - # can reach. + # Checks whether a user has access to an account, product, or experience the + # caller can reach. # # @overload check_access(resource_id, id:, request_options: {}) # - # @param resource_id [String] A company (biz*), product (prod*), or experience (exp\_) ID. + # @param resource_id [String] An account (biz*), product (prod*), or experience (exp\_) ID. # # @param id [String] The user\_ tag or username to check access for. # diff --git a/lib/whop_sdk/resources/verifications.rb b/lib/whop_sdk/resources/verifications.rb index 65af7443..ab18bea1 100644 --- a/lib/whop_sdk/resources/verifications.rb +++ b/lib/whop_sdk/resources/verifications.rb @@ -2,54 +2,116 @@ module WhopSDK module Resources - # Verifications + # A Verification represents an identity review for a person or business. Accounts + # and users complete verification when Whop needs to confirm who they are before + # enabling payouts or compliance-sensitive workflows. + # + # Use the Verifications API to start or resume a hosted verification session, + # check review status, and submit requested details or documents. If + # `requested_information` contains items, submit answers with + # [Update Verification](/api-reference/beta/verifications/update-verification). class Verifications - # Retrieves the details of an existing verification. + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationCreateParams} for more details. # - # Required permissions: + # Starts a hosted verification session for an account or user, or returns the + # active session when one already exists. Any fields you include in the request + # body are used to prefill the session. Send `documents` (with `document_type`) to + # instead verify the person from identity documents included in this request — no + # hosted session involved. If the account already has an `approved` verification + # the request is rejected; unlink it first to start a new one. # - # - `payout:account:read` + # @overload create(account_id:, body:, request_options: {}) # - # @overload retrieve(id, request_options: {}) + # @param account_id [String] Query param: Account or user ID whose identity you want to verify. Use a `biz_` # - # @param id [String] The unique identifier of the verification to retrieve. + # @param body [WhopSDK::Models::VerificationCreateParams::Body::Individual, WhopSDK::Models::VerificationCreateParams::Body::Business] Body param: Request body for an individual (KYC) verification. Omit `kind` or se + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::VerificationCreateResponse] + # + # @see WhopSDK::Models::VerificationCreateParams + def create(params) + parsed, options = WhopSDK::VerificationCreateParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed.except(:body)) + @client.request( + method: :post, + path: "verifications", + query: query, + body: parsed[:body], + model: WhopSDK::Models::VerificationCreateResponse, + options: options + ) + end + + # Returns verifications for an account, including their status and any required + # actions. + # + # @overload retrieve(verification_id, request_options: {}) + # + # @param verification_id [String] Verification profile ID, prefixed `idpf_`. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::VerificationRetrieveResponse] # # @see WhopSDK::Models::VerificationRetrieveParams - def retrieve(id, params = {}) + def retrieve(verification_id, params = {}) @client.request( method: :get, - path: ["verifications/%1$s", id], + path: ["verifications/%1$s", verification_id], model: WhopSDK::Models::VerificationRetrieveResponse, options: params[:request_options] ) end - # Returns a list of identity verifications for a payout account, ordered by most - # recent first. + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationUpdateParams} for more details. + # + # Updates editable profile details or submits answers for items returned in + # `requested_information`. Once a verification is `approved` its profile details + # are locked and can no longer be edited. + # + # @overload update(verification_id, body:, request_options: {}) # - # Required permissions: + # @param verification_id [String] Verification profile ID, prefixed `idpf_`. + # + # @param body [WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification, WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification] Fields that can be updated on an individual (KYC) verification. At least one fie + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # - `payout:account:read` + # @return [WhopSDK::Models::VerificationUpdateResponse] # - # @overload list(payout_account_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) + # @see WhopSDK::Models::VerificationUpdateParams + def update(verification_id, params) + parsed, options = WhopSDK::VerificationUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["verifications/%1$s", verification_id], + body: parsed[:body], + model: WhopSDK::Models::VerificationUpdateResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationListParams} for more details. # - # @param payout_account_id [String] The unique identifier of the payout account to list verifications for. + # Returns verifications for an account, including their status and any required + # actions. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @overload list(account_id:, direction: nil, order: nil, request_options: {}) # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param account_id [String] Account or user ID whose verifications you want to list. Use a `biz_` account ID # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param direction [Symbol, WhopSDK::Models::VerificationListParams::Direction] Sort direction for returned verifications. # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param order [Symbol, WhopSDK::Models::VerificationListParams::Order] Field used to sort returned verifications. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Internal::CursorPage] + # @return [WhopSDK::Models::VerificationListResponse] # # @see WhopSDK::Models::VerificationListParams def list(params) @@ -59,7 +121,6 @@ def list(params) method: :get, path: "verifications", query: query, - page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::VerificationListResponse, options: options ) diff --git a/lib/whop_sdk/resources/wallets.rb b/lib/whop_sdk/resources/wallets.rb deleted file mode 100644 index 4f3180b2..00000000 --- a/lib/whop_sdk/resources/wallets.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Resources - class Wallets - # Lists every crypto wallet linked to the authenticated resource. - # - # @overload list(request_options: {}) - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Models::WalletListResponse] - # - # @see WhopSDK::Models::WalletListParams - def list(params = {}) - @client.request( - method: :get, - path: "wallets", - model: WhopSDK::Models::WalletListResponse, - options: params[:request_options] - ) - end - - # Returns per-token balances held in an account's wallet. - # - # @overload balance(account_id:, request_options: {}) - # - # @param account_id [String] The business or user account ID whose wallet balance should be returned. - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Models::WalletBalanceResponse] - # - # @see WhopSDK::Models::WalletBalanceParams - def balance(params) - parsed, options = WhopSDK::WalletBalanceParams.dump_request(params) - query = WhopSDK::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "wallets/balance", - query: query, - model: WhopSDK::Models::WalletBalanceResponse, - 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: {}) - # - # @param account_id [String] Query param: The sending account ID. - # - # @param amount [String] Body param: USDT amount to send. - # - # @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_(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/send", - query: query, - body: parsed.except(*query_params), - model: WhopSDK::Models::WalletSendResponse, - 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/webhooks.rb b/lib/whop_sdk/resources/webhooks.rb index f3699839..affae0ae 100644 --- a/lib/whop_sdk/resources/webhooks.rb +++ b/lib/whop_sdk/resources/webhooks.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Webhooks class Webhooks # Some parameter documentations has been truncated, see # {WhopSDK::Models::WebhookCreateParams} for more details. @@ -170,7 +169,7 @@ def delete(id, params = {}) # # @param key [String, nil] The webhook signing key # - # @return [WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::IdentityProfileApprovedWebhookEvent, WhopSDK::Models::IdentityProfileNeedsActionWebhookEvent, WhopSDK::Models::IdentityProfileRejectedWebhookEvent, WhopSDK::Models::IdentityProfileUpdatedWebhookEvent, WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoiceMarkedUncollectibleWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseCreatedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseDecidedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseUpdatedWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent] + # @return [WhopSDK::Models::ChatMessageCreatedWebhookEvent, WhopSDK::Models::ChatReactionCreatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::IdentityProfileApprovedWebhookEvent, WhopSDK::Models::IdentityProfileNeedsActionWebhookEvent, WhopSDK::Models::IdentityProfileRejectedWebhookEvent, WhopSDK::Models::IdentityProfileUpdatedWebhookEvent, WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoiceMarkedUncollectibleWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::MembershipTrialEndingSoonWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseCreatedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseDecidedWebhookEvent, WhopSDK::Models::ResolutionCenterCaseUpdatedWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent] def unwrap(payload, headers:, key: @client.webhook_key) if key.nil? raise ArgumentError.new("Cannot verify a webhook without a key on either the client's webhook_key or passed in as an argument") diff --git a/lib/whop_sdk/resources/withdrawals.rb b/lib/whop_sdk/resources/withdrawals.rb index 5e04745b..1f82619c 100644 --- a/lib/whop_sdk/resources/withdrawals.rb +++ b/lib/whop_sdk/resources/withdrawals.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Withdrawals class Withdrawals # Some parameter documentations has been truncated, see # {WhopSDK::Models::WithdrawalCreateParams} for more details. @@ -24,7 +23,7 @@ class Withdrawals # # @param payout_method_id [String, nil] The ID of the payout method to use for the withdrawal. # - # @param platform_covers_fees [Boolean, nil] Whether the platform covers the payout fees instead of the connected account. + # @param platform_covers_fees [Boolean, nil] Whether the platform covers the payout fees. # # @param statement_descriptor [String, nil] Custom statement descriptor for the withdrawal. Must be between 5 and 22 charact # diff --git a/lib/whop_sdk/resources/workforce.rb b/lib/whop_sdk/resources/workforce.rb new file mode 100644 index 00000000..3ba0a393 --- /dev/null +++ b/lib/whop_sdk/resources/workforce.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Workforce + # A Workforce Bounty is a paid task posted by an account or user. The reward is + # held in escrow when the bounty publishes, workers submit proof of completed + # work, and each accepted submission is paid out until every winner slot fills. + # + # Use the Workforce Bounties API to list an account's bounties for reporting or + # dashboards, list the bounties a user can work or has participated in, and + # retrieve a single bounty by ID. + # @return [WhopSDK::Resources::Workforce::Bounties] + attr_reader :bounties + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + @bounties = WhopSDK::Resources::Workforce::Bounties.new(client: client) + end + end + end +end diff --git a/lib/whop_sdk/resources/workforce/bounties.rb b/lib/whop_sdk/resources/workforce/bounties.rb new file mode 100644 index 00000000..e3cad478 --- /dev/null +++ b/lib/whop_sdk/resources/workforce/bounties.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Workforce + # A Workforce Bounty is a paid task posted by an account or user. The reward is + # held in escrow when the bounty publishes, workers submit proof of completed + # work, and each accepted submission is paid out until every winner slot fills. + # + # Use the Workforce Bounties API to list an account's bounties for reporting or + # dashboards, list the bounties a user can work or has participated in, and + # retrieve a single bounty by ID. + class Bounties + # Retrieves one workforce bounty by ID. The bounty must be visible to the + # credential; bounties outside the caller's scope return 404. + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] Bounty ID (`bnty_` tag). + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Workforce::WorkforceBounty] + # + # @see WhopSDK::Models::Workforce::BountyRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["workforce/bounties/%1$s", id], + model: WhopSDK::Workforce::WorkforceBounty, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Workforce::BountyListParams} for more details. + # + # Lists workforce bounties visible to the credential. Account API keys return the + # account's bounties, scheduled drafts included; user tokens return the bounties + # the user can see and work. Pass account_id to view one account's bounties as a + # team member (or a connected account of the caller's), or user_id (your own) to + # list the bounties you participated in. + # + # @overload list(account_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, status: nil, user_id: nil, request_options: {}) + # + # @param account_id [String] Scope the list to this account (`biz_` tag). Requires read access to the account + # + # @param after [String] Cursor to paginate forwards from. + # + # @param before [String] Cursor to paginate backwards from. + # + # @param created_after [String] Only bounties created after this ISO 8601 timestamp. + # + # @param created_before [String] Only bounties created before this ISO 8601 timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Workforce::BountyListParams::Direction] Sort direction. + # + # @param first [Integer] Number of bounties to return from the start of the window. + # + # @param last [Integer] Number of bounties to return from the end of the window. + # + # @param order [Symbol, WhopSDK::Models::Workforce::BountyListParams::Order] Sort field. + # + # @param query [String] Substring match on the bounty title or ID. + # + # @param status [Symbol, WhopSDK::Models::Workforce::BountyListParams::Status] Filter by lifecycle state. + # + # @param user_id [String] List the bounties this user participated in (`user_` tag). Must be the authentic + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::Workforce::BountyListParams + def list(params = {}) + parsed, options = WhopSDK::Workforce::BountyListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "workforce/bounties", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Workforce::WorkforceBountyListItem, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/rbi/whop_sdk/client.rbi b/rbi/whop_sdk/client.rbi index b7b9407e..c8562a0f 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -10,7 +10,7 @@ module WhopSDK DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float) - # A company API key, company scoped JWT, app API key, or user OAuth token. You + # An account API key, account scoped JWT, app API key, or user OAuth token. You # must prepend your key/token with the word `Bearer`, which will look like # `Bearer ***************************` sig { returns(String) } @@ -29,252 +29,372 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_reader :version - # Apps + # An App is software you build on Whop. It can be a hosted web app served at + # `.whop.app` or an API integration installed as an experience, and it + # belongs to the account that owns its credentials, settings, builds, and runtime + # logs. + # + # Use the Apps API to manage app configuration and, for hosted apps, read server + # runtime logs for console output, uncaught exceptions, and failed requests. Logs + # are retained for 7 days and can be filtered by build, level, time window, and + # message text. sig { returns(WhopSDK::Resources::Apps) } attr_reader :apps - # Invoices sig { returns(WhopSDK::Resources::Invoices) } attr_reader :invoices - # Course lesson interactions sig { returns(WhopSDK::Resources::CourseLessonInteractions) } attr_reader :course_lesson_interactions - # Products + # A Product is a digital good or service sold on Whop. Products may contain plans + # for pricing and/or experiences for content delivery. + # + # Use the Products API to create products, list products visible to your + # credentials, retrieve product details, update product metadata or merchandising + # fields, and delete products that should no longer be sold. sig { returns(WhopSDK::Resources::Products) } attr_reader :products - # Companies + # A Social Account represents an external profile connected to a Whop account or + # user, such as a Facebook page or Instagram account. Connecting a social account + # lets Whop run [ads](/api-reference/beta/ads/ad) under that profile's identity + # and promote its existing posts. + # + # Use the Social Accounts API to list connected accounts, create a Whop-managed + # Facebook page, start an OAuth connection, disconnect a social account, and list + # a connected profile's posts. + sig { returns(WhopSDK::Resources::SocialAccounts) } + attr_reader :social_accounts + + # An Audience represents a customer list uploaded to Whop for ad targeting. + # Audiences belong to an account and sync to supported ad platforms as custom + # audiences. + # + # Use the Audiences API to create audiences from CSV uploads, monitor processing + # status, and list or delete audiences for an account. Created audiences are + # usable for targeting after processing reaches `ready` or `partial`. + sig { returns(WhopSDK::Resources::Audiences) } + attr_reader :audiences + + # A Media Asset is an AI-generated image or video created from a prompt and billed + # from an account balance. When generation finishes, the asset includes a file + # that can be attached anywhere Whop accepts files. + # + # Use the Media API to start a generation job and retrieve the asset while it + # processes or after it is ready. + sig { returns(WhopSDK::Resources::Media) } + attr_reader :media + + # A Person represents a visitor or customer of an account, assembled from + # [pixel events](/api-reference/beta/events/event) and purchase activity — ad + # clicks, storefront visits, and checkouts. + # + # Use the People API to list the people of an account and retrieve a single + # person. + sig { returns(WhopSDK::Resources::People) } + attr_reader :people + + # An Event records conversion or engagement activity for an account, such as page + # views, purchases, or leads. Each event ties the action to the + # [person](/api-reference/beta/people/person) who took it, so activity can be + # attributed to the ads and links that drove it. + # + # Use the Events API to send new tracking events and list the events recorded for + # a person. + sig { returns(WhopSDK::Resources::Events) } + attr_reader :events + sig { returns(WhopSDK::Resources::Companies) } attr_reader :companies - # Webhooks sig { returns(WhopSDK::Resources::Webhooks) } attr_reader :webhooks + # A Plan defines how customers buy a product. It controls pricing, billing + # cadence, availability, tax behavior, checkout fields, and purchase visibility. + # + # Use the Plans API to create plans for products, list existing plans, retrieve or + # update plan configuration, calculate tax for checkout, and delete plans that + # should no longer be offered. sig { returns(WhopSDK::Resources::Plans) } attr_reader :plans - # Entries sig { returns(WhopSDK::Resources::Entries) } attr_reader :entries - # Forum posts sig { returns(WhopSDK::Resources::ForumPosts) } attr_reader :forum_posts - # Transfers + # Transfers move value between identities on Whop. They are used for + # account-to-account money movement, user payouts inside Whop, crypto transfers, + # and claim links depending on the destination type. + # + # Use the Transfers API to create a transfer, list previous transfers, and + # retrieve a transfer by ID when reconciling money movement between accounts or + # users. sig { returns(WhopSDK::Resources::Transfers) } attr_reader :transfers - # Ledger accounts sig { returns(WhopSDK::Resources::LedgerAccounts) } attr_reader :ledger_accounts - # Memberships sig { returns(WhopSDK::Resources::Memberships) } attr_reader :memberships - # Authorized users sig { returns(WhopSDK::Resources::AuthorizedUsers) } attr_reader :authorized_users - # App builds sig { returns(WhopSDK::Resources::AppBuilds) } attr_reader :app_builds - # Shipments sig { returns(WhopSDK::Resources::Shipments) } attr_reader :shipments - # Checkout configurations + # A Checkout Configuration is a reusable checkout link owned by an account. In + # `payment` mode it sells a specific plan; in `setup` mode it collects and saves + # payment details without charging. Each configuration can also override which + # payment methods are accepted and how 3D Secure is enforced for that checkout. + # + # Use the Checkout Configurations API to create checkout links for an existing or + # inline plan, list configurations for an account, retrieve the configuration + # behind a checkout URL, and delete links that should no longer be used. sig { returns(WhopSDK::Resources::CheckoutConfigurations) } attr_reader :checkout_configurations - # Messages sig { returns(WhopSDK::Resources::Messages) } attr_reader :messages - # Chat channels sig { returns(WhopSDK::Resources::ChatChannels) } attr_reader :chat_channels + # A User represents a person on Whop. Users have a public profile and can buy + # products, join accounts, and access experiences. + # + # Use the Users API to search for users, retrieve or update profiles, and check + # whether a user has access to an account, product, or experience. sig { returns(WhopSDK::Resources::Users) } attr_reader :users - # Payments sig { returns(WhopSDK::Resources::Payments) } attr_reader :payments - # Support channels sig { returns(WhopSDK::Resources::SupportChannels) } attr_reader :support_channels - # Experiences sig { returns(WhopSDK::Resources::Experiences) } attr_reader :experiences - # Reactions sig { returns(WhopSDK::Resources::Reactions) } attr_reader :reactions - # Members sig { returns(WhopSDK::Resources::Members) } attr_reader :members - # Forums sig { returns(WhopSDK::Resources::Forums) } attr_reader :forums - # Promo codes sig { returns(WhopSDK::Resources::PromoCodes) } attr_reader :promo_codes - # Courses sig { returns(WhopSDK::Resources::Courses) } attr_reader :courses - # Course chapters sig { returns(WhopSDK::Resources::CourseChapters) } attr_reader :course_chapters - # Course lessons sig { returns(WhopSDK::Resources::CourseLessons) } attr_reader :course_lessons - # Reviews sig { returns(WhopSDK::Resources::Reviews) } attr_reader :reviews - # Course students sig { returns(WhopSDK::Resources::CourseStudents) } attr_reader :course_students - # Access tokens sig { returns(WhopSDK::Resources::AccessTokens) } attr_reader :access_tokens - # Notifications sig { returns(WhopSDK::Resources::Notifications) } attr_reader :notifications - # Disputes sig { returns(WhopSDK::Resources::Disputes) } attr_reader :disputes - # Refunds sig { returns(WhopSDK::Resources::Refunds) } attr_reader :refunds - # Withdrawals sig { returns(WhopSDK::Resources::Withdrawals) } attr_reader :withdrawals - # Account links sig { returns(WhopSDK::Resources::AccountLinks) } attr_reader :account_links + # An Account represents a person or business on Whop that can have its own + # profile, wallet, and account-scoped settings. Use accounts for customers, + # creators, merchants, sellers, or connected businesses your integration supports. + # + # Use the Accounts API to create accounts, list accounts visible to your + # credentials, retrieve or update an account, and retrieve the account associated + # with the current API key. sig { returns(WhopSDK::Resources::Accounts) } attr_reader :accounts - sig { returns(WhopSDK::Resources::Wallets) } - attr_reader :wallets - + # A Ledger Activity row is a single financial event on an account's ledger — a + # payment, withdrawal, refund, transfer, on-chain deposit, swap, or card + # transaction. Each row is derived from the underlying ledger lines and carries a + # typed `resource` and `source` so you can present and link the event without + # extra lookups. + # + # Use Ledger Activity to build a statement or transaction feed for an account or + # user. Reconcile against your own records with `amount` (signed, in the + # currency's smallest precision units) and `posted_at`, and use `available_at` to + # know when inflows became withdrawable. sig { returns(WhopSDK::Resources::FinancialActivity) } attr_reader :financial_activity + # Stats represent aggregated activity for an account over time. They help you + # understand revenue, transactions, disputes, members, referrals, and advertising + # performance across reporting periods like days, weeks, or months. + # + # Use the Stats API to list available metrics and their filterable properties, + # then retrieve time-series values for a date range. + sig { returns(WhopSDK::Resources::Stats) } + attr_reader :stats + + # Payouts represent money sent from an account or user balance to an external + # destination, such as a bank account, wallet, or other saved payout method. + # + # Use the Payouts API to create payouts from stablecoin accounts, list payout + # history for accounts or users, monitor payout statuses, and show expected + # arrival details for funds leaving Whop. + sig { returns(WhopSDK::Resources::Payouts) } + attr_reader :payouts + + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + sig { returns(WhopSDK::Resources::Referrals) } + attr_reader :referrals + + # Cards represent Whop-issued virtual payment cards that spend from an account or + # user balance. Cards can be assigned to cardholders and configured with spending + # limits for controlled spending. + # + # Use the Cards API to issue cards, list cards for an account or user, and + # retrieve active card details such as the card number and CVC. + sig { returns(WhopSDK::Resources::Cards) } + attr_reader :cards + + # Swaps convert value between supported tokens, chains, or wallet destinations for + # an account. A swap quote describes the expected output, fees, and approval + # requirements before you create the swap. + # + # Use the Swaps API to quote a conversion, create the swap, list recent swaps, and + # retrieve status until the transaction completes. sig { returns(WhopSDK::Resources::Swaps) } attr_reader :swaps + # Deposits describe ways to add funds to an account balance, including hosted + # deposit pages, bank deposit instructions, and supported crypto wallet addresses. + # + # Use the Deposits API to create deposit instructions for an account and retrieve + # existing bank deposit activity. sig { returns(WhopSDK::Resources::Deposits) } attr_reader :deposits - # Setup intents sig { returns(WhopSDK::Resources::SetupIntents) } attr_reader :setup_intents - # Payment methods sig { returns(WhopSDK::Resources::PaymentMethods) } attr_reader :payment_methods - # Fee markups sig { returns(WhopSDK::Resources::FeeMarkups) } attr_reader :fee_markups - # Payout methods - sig { returns(WhopSDK::Resources::PayoutMethods) } - attr_reader :payout_methods - - # Verifications + # A Verification represents an identity review for a person or business. Accounts + # and users complete verification when Whop needs to confirm who they are before + # enabling payouts or compliance-sensitive workflows. + # + # Use the Verifications API to start or resume a hosted verification session, + # check review status, and submit requested details or documents. If + # `requested_information` contains items, submit answers with + # [Update Verification](/api-reference/beta/verifications/update-verification). sig { returns(WhopSDK::Resources::Verifications) } attr_reader :verifications - # Leads sig { returns(WhopSDK::Resources::Leads) } attr_reader :leads - # Topups sig { returns(WhopSDK::Resources::Topups) } attr_reader :topups - # Files sig { returns(WhopSDK::Resources::Files) } attr_reader :files - # Company token transactions sig { returns(WhopSDK::Resources::CompanyTokenTransactions) } attr_reader :company_token_transactions - # Dm members sig { returns(WhopSDK::Resources::DmMembers) } attr_reader :dm_members - # Ai chats sig { returns(WhopSDK::Resources::AIChats) } attr_reader :ai_chats - # Dm channels sig { returns(WhopSDK::Resources::DmChannels) } attr_reader :dm_channels - # Dispute alerts sig { returns(WhopSDK::Resources::DisputeAlerts) } attr_reader :dispute_alerts - # Resolution center cases sig { returns(WhopSDK::Resources::ResolutionCenterCases) } attr_reader :resolution_center_cases - # Payout accounts sig { returns(WhopSDK::Resources::PayoutAccounts) } attr_reader :payout_accounts - # Affiliates sig { returns(WhopSDK::Resources::Affiliates) } attr_reader :affiliates - # Bounties sig { returns(WhopSDK::Resources::Bounties) } attr_reader :bounties - # Ad campaigns + sig { returns(WhopSDK::Resources::Workforce) } + attr_reader :workforce + + # An Ad Campaign is the top-level container for paid ads on an ad network. It sets + # the platform, objective, and budget strategy shared by its + # [ad groups](/api-reference/beta/ad-groups/ad-group) and ads. + # + # Use the Ad Campaigns API to create campaigns, list campaigns for an account, + # retrieve or update campaign settings, and pause or resume campaign delivery. sig { returns(WhopSDK::Resources::AdCampaigns) } attr_reader :ad_campaigns - # Ad groups + # An Ad Group sits inside an + # [ad campaign](/api-reference/beta/ad-campaigns/ad-campaign) and controls + # delivery for [ads](/api-reference/beta/ads/ad). It sets the audience, + # placements, schedule, budget, and optimization goal for its ads. + # + # Use the Ad Groups API to create ad groups in campaigns, list or retrieve + # targeting and delivery settings, update budgets or targeting, delete groups that + # should stop running, and pause or resume delivery. sig { returns(WhopSDK::Resources::AdGroups) } attr_reader :ad_groups - # Ads + # An Ad is the individual creative unit delivered by an + # [ad group](/api-reference/beta/ad-groups/ad-group). It holds the copy, creative + # assets, and destination URL for one ad. + # + # Use the Ads API to list ads for an account, create ads inside ad groups, + # retrieve or update creative details, delete ads that should stop running, and + # pause or resume delivery. sig { returns(WhopSDK::Resources::Ads) } attr_reader :ads - # Conversions - sig { returns(WhopSDK::Resources::Conversions) } - attr_reader :conversions - - # Ad reports sig { returns(WhopSDK::Resources::AdReports) } attr_reader :ad_reports @@ -298,7 +418,7 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # A company API key, company scoped JWT, app API key, or user OAuth token. You + # An account API key, account scoped JWT, app API key, or user OAuth token. You # must prepend your key/token with the word `Bearer`, which will look like # `Bearer ***************************` Defaults to `ENV["WHOP_API_KEY"]` api_key: ENV["WHOP_API_KEY"], @@ -309,7 +429,7 @@ module WhopSDK 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"), + version: ENV.fetch("WHOP_API_VERSION", "2026-07-08-1"), # 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 440978c8..e322a950 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -17,36 +17,42 @@ module WhopSDK AccountMeParams = WhopSDK::Models::AccountMeParams + AccountRecommendActionsParams = WhopSDK::Models::AccountRecommendActionsParams + AccountRetrieveParams = WhopSDK::Models::AccountRetrieveParams + Accounts = WhopSDK::Models::Accounts + AccountSocialLink = WhopSDK::Models::AccountSocialLink AccountUpdateParams = WhopSDK::Models::AccountUpdateParams - AccountWallet = WhopSDK::Models::AccountWallet - Ad = WhopSDK::Models::Ad - AdBudgetType = WhopSDK::Models::AdBudgetType - AdCampaign = WhopSDK::Models::AdCampaign + AdCampaignCreateParams = WhopSDK::Models::AdCampaignCreateParams + + AdCampaignDeleteParams = WhopSDK::Models::AdCampaignDeleteParams + AdCampaignListParams = WhopSDK::Models::AdCampaignListParams AdCampaignPauseParams = WhopSDK::Models::AdCampaignPauseParams - AdCampaignPlatform = WhopSDK::Models::AdCampaignPlatform - AdCampaignRetrieveParams = WhopSDK::Models::AdCampaignRetrieveParams - AdCampaignStatus = WhopSDK::Models::AdCampaignStatus - AdCampaignUnpauseParams = WhopSDK::Models::AdCampaignUnpauseParams AdCampaignUpdateParams = WhopSDK::Models::AdCampaignUpdateParams + AdCreateParams = WhopSDK::Models::AdCreateParams + + AdDeleteParams = WhopSDK::Models::AdDeleteParams + AdGroup = WhopSDK::Models::AdGroup + AdGroupCreateParams = WhopSDK::Models::AdGroupCreateParams + AdGroupDeleteParams = WhopSDK::Models::AdGroupDeleteParams AdGroupListParams = WhopSDK::Models::AdGroupListParams @@ -55,8 +61,6 @@ module WhopSDK AdGroupRetrieveParams = WhopSDK::Models::AdGroupRetrieveParams - AdGroupStatus = WhopSDK::Models::AdGroupStatus - AdGroupUnpauseParams = WhopSDK::Models::AdGroupUnpauseParams AdGroupUpdateParams = WhopSDK::Models::AdGroupUpdateParams @@ -71,6 +75,8 @@ module WhopSDK AdUnpauseParams = WhopSDK::Models::AdUnpauseParams + AdUpdateParams = WhopSDK::Models::AdUpdateParams + Affiliate = WhopSDK::Models::Affiliate AffiliateArchiveParams = WhopSDK::Models::AffiliateArchiveParams @@ -119,6 +125,8 @@ module WhopSDK AppListParams = WhopSDK::Models::AppListParams + AppLogsParams = WhopSDK::Models::AppLogsParams + AppRetrieveParams = WhopSDK::Models::AppRetrieveParams AppStatuses = WhopSDK::Models::AppStatuses @@ -131,6 +139,14 @@ module WhopSDK AssessmentQuestionTypes = WhopSDK::Models::AssessmentQuestionTypes + Audience = WhopSDK::Models::Audience + + AudienceCreateParams = WhopSDK::Models::AudienceCreateParams + + AudienceDeleteParams = WhopSDK::Models::AudienceDeleteParams + + AudienceListParams = WhopSDK::Models::AudienceListParams + AuthorizedUser = WhopSDK::Models::AuthorizedUser AuthorizedUserCreateParams = WhopSDK::Models::AuthorizedUserCreateParams @@ -155,6 +171,14 @@ module WhopSDK CardBrands = WhopSDK::Models::CardBrands + CardCreateParams = WhopSDK::Models::CardCreateParams + + CardListParams = WhopSDK::Models::CardListParams + + CardRetrieveParams = WhopSDK::Models::CardRetrieveParams + + CardUpdateParams = WhopSDK::Models::CardUpdateParams + ChatChannel = WhopSDK::Models::ChatChannel ChatChannelListParams = WhopSDK::Models::ChatChannelListParams @@ -163,11 +187,20 @@ module WhopSDK ChatChannelUpdateParams = WhopSDK::Models::ChatChannelUpdateParams + ChatMessageCreatedWebhookEvent = + WhopSDK::Models::ChatMessageCreatedWebhookEvent + + ChatReactionCreatedWebhookEvent = + WhopSDK::Models::ChatReactionCreatedWebhookEvent + CheckoutConfiguration = WhopSDK::Models::CheckoutConfiguration CheckoutConfigurationCreateParams = WhopSDK::Models::CheckoutConfigurationCreateParams + CheckoutConfigurationDeleteParams = + WhopSDK::Models::CheckoutConfigurationDeleteParams + CheckoutConfigurationListParams = WhopSDK::Models::CheckoutConfigurationListParams @@ -207,8 +240,6 @@ module WhopSDK CompanyUpdateParams = WhopSDK::Models::CompanyUpdateParams - ConversionCreateParams = WhopSDK::Models::ConversionCreateParams - Course = WhopSDK::Models::Course CourseChapter = WhopSDK::Models::CourseChapter @@ -277,6 +308,8 @@ module WhopSDK DepositCreateParams = WhopSDK::Models::DepositCreateParams + DepositListParams = WhopSDK::Models::DepositListParams + Direction = WhopSDK::Models::Direction Dispute = WhopSDK::Models::Dispute @@ -359,6 +392,10 @@ module WhopSDK EntryStatus = WhopSDK::Models::EntryStatus + EventCreateParams = WhopSDK::Models::EventCreateParams + + EventListParams = WhopSDK::Models::EventListParams + Experience = WhopSDK::Models::Experience ExperienceAttachParams = WhopSDK::Models::ExperienceAttachParams @@ -377,8 +414,6 @@ module WhopSDK ExperienceUpdateParams = WhopSDK::Models::ExperienceUpdateParams - ExternalAdStatus = WhopSDK::Models::ExternalAdStatus - FeeMarkupCreateParams = WhopSDK::Models::FeeMarkupCreateParams FeeMarkupDeleteParams = WhopSDK::Models::FeeMarkupDeleteParams @@ -479,6 +514,9 @@ module WhopSDK LeadUpdateParams = WhopSDK::Models::LeadUpdateParams + LedgerAccountFundsAvailableWebhookEvent = + WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent + LedgerAccountRetrieveParams = WhopSDK::Models::LedgerAccountRetrieveParams Lesson = WhopSDK::Models::Lesson @@ -487,6 +525,12 @@ module WhopSDK LessonVisibilities = WhopSDK::Models::LessonVisibilities + MediaAsset = WhopSDK::Models::MediaAsset + + MediaGenerateParams = WhopSDK::Models::MediaGenerateParams + + MediaRetrieveParams = WhopSDK::Models::MediaRetrieveParams + MemberListParams = WhopSDK::Models::MemberListParams MemberMostRecentActions = WhopSDK::Models::MemberMostRecentActions @@ -518,6 +562,9 @@ module WhopSDK MembershipStatus = WhopSDK::Models::MembershipStatus + MembershipTrialEndingSoonWebhookEvent = + WhopSDK::Models::MembershipTrialEndingSoonWebhookEvent + MembershipUncancelParams = WhopSDK::Models::MembershipUncancelParams MembershipUpdateParams = WhopSDK::Models::MembershipUpdateParams @@ -582,17 +629,23 @@ module WhopSDK PayoutAccountStatusUpdatedWebhookEvent = WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent - PayoutDestinationCategory = WhopSDK::Models::PayoutDestinationCategory + PayoutCreateParams = WhopSDK::Models::PayoutCreateParams + + PayoutListParams = WhopSDK::Models::PayoutListParams PayoutMethodCreatedWebhookEvent = WhopSDK::Models::PayoutMethodCreatedWebhookEvent - PayoutMethodListParams = WhopSDK::Models::PayoutMethodListParams + Payouts = WhopSDK::Models::Payouts + + PersonListParams = WhopSDK::Models::PersonListParams - PayoutMethodRetrieveParams = WhopSDK::Models::PayoutMethodRetrieveParams + PersonRetrieveParams = WhopSDK::Models::PersonRetrieveParams Plan = WhopSDK::Models::Plan + PlanCalculateTaxParams = WhopSDK::Models::PlanCalculateTaxParams + PlanCreateParams = WhopSDK::Models::PlanCreateParams PlanDeleteParams = WhopSDK::Models::PlanDeleteParams @@ -649,6 +702,10 @@ module WhopSDK ReceiptTaxBehavior = WhopSDK::Models::ReceiptTaxBehavior + ReferralReferredUsersParams = WhopSDK::Models::ReferralReferredUsersParams + + Referrals = WhopSDK::Models::Referrals + RefundCreatedWebhookEvent = WhopSDK::Models::RefundCreatedWebhookEvent RefundListParams = WhopSDK::Models::RefundListParams @@ -732,8 +789,26 @@ module WhopSDK ShipmentSubstatus = WhopSDK::Models::ShipmentSubstatus + SocialAccount = WhopSDK::Models::SocialAccount + + SocialAccountConnectParams = WhopSDK::Models::SocialAccountConnectParams + + SocialAccountCreateParams = WhopSDK::Models::SocialAccountCreateParams + + SocialAccountDeleteParams = WhopSDK::Models::SocialAccountDeleteParams + + SocialAccountListParams = WhopSDK::Models::SocialAccountListParams + + SocialAccountPost = WhopSDK::Models::SocialAccountPost + + SocialAccountPostsParams = WhopSDK::Models::SocialAccountPostsParams + SocialLinkWebsites = WhopSDK::Models::SocialLinkWebsites + StatListParams = WhopSDK::Models::StatListParams + + StatRetrieveParams = WhopSDK::Models::StatRetrieveParams + Status = WhopSDK::Models::Status SupportChannel = WhopSDK::Models::SupportChannel @@ -748,6 +823,8 @@ module WhopSDK SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + SwapListParams = WhopSDK::Models::SwapListParams + SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams TaxIdentifierType = WhopSDK::Models::TaxIdentifierType @@ -756,8 +833,6 @@ module WhopSDK TopupCreateParams = WhopSDK::Models::TopupCreateParams - Transfer = WhopSDK::Models::Transfer - TransferCreateParams = WhopSDK::Models::TransferCreateParams TransferListParams = WhopSDK::Models::TransferListParams @@ -770,6 +845,8 @@ module WhopSDK User = WhopSDK::Models::User + UserBalance = WhopSDK::Models::UserBalance + UserCheckAccessParams = WhopSDK::Models::UserCheckAccessParams UserListParams = WhopSDK::Models::UserListParams @@ -780,6 +857,8 @@ module WhopSDK UserUpdateParams = WhopSDK::Models::UserUpdateParams + VerificationCreateParams = WhopSDK::Models::VerificationCreateParams + VerificationErrorCode = WhopSDK::Models::VerificationErrorCode VerificationListParams = WhopSDK::Models::VerificationListParams @@ -791,16 +870,12 @@ module WhopSDK VerificationSucceededWebhookEvent = WhopSDK::Models::VerificationSucceededWebhookEvent + VerificationUpdateParams = WhopSDK::Models::VerificationUpdateParams + Visibility = WhopSDK::Models::Visibility VisibilityFilter = WhopSDK::Models::VisibilityFilter - WalletBalanceParams = WhopSDK::Models::WalletBalanceParams - - WalletListParams = WhopSDK::Models::WalletListParams - - WalletSendParams = WhopSDK::Models::WalletSendParams - Webhook = WhopSDK::Models::Webhook WebhookCreateParams = WhopSDK::Models::WebhookCreateParams @@ -842,4 +917,6 @@ module WhopSDK WithdrawalStatus = WhopSDK::Models::WithdrawalStatus WithdrawalUpdatedWebhookEvent = WhopSDK::Models::WithdrawalUpdatedWebhookEvent + + Workforce = WhopSDK::Models::Workforce end diff --git a/rbi/whop_sdk/models/account.rbi b/rbi/whop_sdk/models/account.rbi index 63a83df8..dcc6ec00 100644 --- a/rbi/whop_sdk/models/account.rbi +++ b/rbi/whop_sdk/models/account.rbi @@ -6,137 +6,207 @@ module WhopSDK OrHash = T.type_alias { T.any(WhopSDK::Account, WhopSDK::Internal::AnyHash) } - # The ID of the account, which will look like biz\_******\******* + # Account ID, prefixed `biz_`. sig { returns(String) } attr_accessor :id - # The URL of the account banner image + sig { returns(T::Array[WhopSDK::Account::Balance]) } + attr_accessor :balances + + # Account banner image URL. sig { returns(T.nilable(String)) } attr_accessor :banner_image_url - # The high-level business category for the account + # Account business address used to calculate tax, with `line1`, `line2`, `city`, + # `state`, `postal_code`, and `country`. `null` when no address is set. + sig { returns(T.nilable(T.anything)) } + attr_accessor :business_address + + # High-level business category for the account. sig { returns(T.nilable(String)) } attr_accessor :business_type - # The country the account is located in + # Payment rails enabled for this account, each `active`, `inactive`, or `pending` + # (onboarding or review in progress). Computed only on `retrieve` and `me` for + # callers with `company:balance:read` scope; `null` otherwise. + sig { returns(T.nilable(WhopSDK::Account::Capabilities)) } + attr_reader :capabilities + + sig do + params( + capabilities: T.nilable(WhopSDK::Account::Capabilities::OrHash) + ).void + end + attr_writer :capabilities + + # Country where the account is located. sig { returns(T.nilable(String)) } attr_accessor :country - # When the account was created, as an ISO 8601 timestamp + # When the account was created, as an ISO 8601 timestamp. sig { returns(String) } attr_accessor :created_at - # A promotional description for the account + # Account promotional description. sig { returns(T.nilable(String)) } attr_accessor :description - # The email address of the account owner + # Account owner email address. sig { returns(T.nilable(String)) } attr_accessor :email sig { returns(T::Array[String]) } attr_accessor :home_preferences - # The industry group the account belongs to + # Account industry group. sig { returns(T.nilable(String)) } attr_accessor :industry_group - # The specific industry vertical the account operates in + # Specific industry vertical for the account. sig { returns(T.nilable(String)) } attr_accessor :industry_type - # The prefix used for account invoices + # Prefix used for account invoices. sig { returns(T.nilable(String)) } attr_accessor :invoice_prefix - # The URL of the account logo image + # Account logo image URL. sig { returns(T.nilable(String)) } attr_accessor :logo_url - # Arbitrary key/value metadata supplied when the account was created + # Arbitrary key/value metadata supplied at account creation. sig { returns(T.anything) } attr_accessor :metadata - # The type of onboarding the account has completed + # Type of onboarding the account has completed. sig { returns(T.nilable(String)) } attr_accessor :onboarding_type - # The URL of the account Open Graph image + # Account Open Graph image URL. sig { returns(T.nilable(String)) } attr_accessor :opengraph_image_url - # The account Open Graph image variant + # 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 + # Business type details 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 + # Industry details when industry_type is `other`. sig { returns(T.nilable(String)) } attr_accessor :other_industry_description - # The parent account ID for connected accounts + # 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 + # Tax classification code applied by default to the account's products, with `id`, + # `name`, and `product_type`. `null` when no default is set. + sig { returns(T.nilable(T.anything)) } + attr_accessor :product_tax_code + + # DEPRECATED: Use the `GET /accounts/{account_id}/recommend_actions` endpoint + # instead. + sig { returns(T.nilable(T::Array[WhopSDK::Account::RecommendedAction])) } + attr_accessor :recommended_actions + + # Whether authorized users must enable two-factor authentication. sig { returns(T::Boolean) } attr_accessor :require_2fa - # The account's public route identifier + sig { returns(T.nilable(T::Array[WhopSDK::Account::RequiredAction])) } + attr_accessor :required_actions + + # Account public route identifier. sig { returns(String) } attr_accessor :route - # Whether Whop sends transactional emails to customers on behalf of this account + # Whether Whop sends transactional emails to customers on behalf of this account. sig { returns(T::Boolean) } attr_accessor :send_customer_emails - # Whether the account appears in joined whops on other accounts + # 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 + # 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 + # 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 + # Whether the account can operate on Whop: `active` or `suspended`. Computed only + # on `retrieve` and `me`; `null` otherwise. + sig { returns(T.nilable(String)) } + attr_accessor :status + + # Account store page display configuration. sig { returns(T.anything) } attr_accessor :store_page_config - # The target audience for this account + # Target audience for this account. sig { returns(T.nilable(String)) } attr_accessor :target_audience - # The display name of the account + # Account tax/VAT registrations, each with `id`, `tax_id_type`, and + # `tax_id_value`. Empty when none are set. + sig { returns(T::Array[T.anything]) } + attr_accessor :tax_identifiers + + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `null` until the account enrolls in the + # Whop tax service. + sig { returns(T.nilable(String)) } + attr_accessor :tax_remitted_by + + # Account display name. sig { returns(String) } attr_accessor :title - # Whether the account uses its logo as the fallback Open Graph image + # Account lifetime sales, normalized to USD. Computed only on `retrieve` and `me` + # for callers with `stats:read` scope; `null` otherwise. + sig { returns(T.nilable(Float)) } + attr_accessor :total_earned_usd + + # Total USD value across balances with known exchange rates. Computed only on + # single-account reads (`retrieve` and `me`); `null` on list responses, writes, + # missing balance-read permission, or unavailable balance source. + sig { returns(T.nilable(String)) } + attr_accessor :total_usd + + # 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)) } + # Account identity verification status for the `individual` (KYC) and `business` + # (KYB) profiles. Each is `null` until created, otherwise a `status` of + # `not_started`, `pending`, `approved`, or `rejected`. + sig { returns(T.anything) } + attr_accessor :verification + + # Account primary crypto wallet, or `null` if none has been provisioned. + sig { returns(T.nilable(WhopSDK::Account::Wallet)) } attr_reader :wallet - sig { params(wallet: T.nilable(WhopSDK::AccountWallet::OrHash)).void } + sig { params(wallet: T.nilable(WhopSDK::Account::Wallet::OrHash)).void } attr_writer :wallet sig do params( id: String, + balances: T::Array[WhopSDK::Account::Balance::OrHash], banner_image_url: T.nilable(String), + business_address: T.nilable(T.anything), business_type: T.nilable(String), + capabilities: T.nilable(WhopSDK::Account::Capabilities::OrHash), country: T.nilable(String), created_at: String, description: T.nilable(String), @@ -153,81 +223,128 @@ module WhopSDK other_business_description: T.nilable(String), other_industry_description: T.nilable(String), parent_account_id: T.nilable(String), + product_tax_code: T.nilable(T.anything), + recommended_actions: + T.nilable(T::Array[WhopSDK::Account::RecommendedAction::OrHash]), require_2fa: T::Boolean, + required_actions: + T.nilable(T::Array[WhopSDK::Account::RequiredAction::OrHash]), 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], + status: T.nilable(String), store_page_config: T.anything, target_audience: T.nilable(String), + tax_identifiers: T::Array[T.anything], + tax_remitted_by: T.nilable(String), title: String, + total_earned_usd: T.nilable(Float), + total_usd: T.nilable(String), use_logo_as_opengraph_image_fallback: T::Boolean, - wallet: T.nilable(WhopSDK::AccountWallet::OrHash) + verification: T.anything, + wallet: T.nilable(WhopSDK::Account::Wallet::OrHash) ).returns(T.attached_class) end def self.new( - # The ID of the account, which will look like biz\_******\******* + # Account ID, prefixed `biz_`. id:, - # The URL of the account banner image + balances:, + # Account banner image URL. banner_image_url:, - # The high-level business category for the account + # Account business address used to calculate tax, with `line1`, `line2`, `city`, + # `state`, `postal_code`, and `country`. `null` when no address is set. + business_address:, + # High-level business category for the account. business_type:, - # The country the account is located in + # Payment rails enabled for this account, each `active`, `inactive`, or `pending` + # (onboarding or review in progress). Computed only on `retrieve` and `me` for + # callers with `company:balance:read` scope; `null` otherwise. + capabilities:, + # Country where the account is located. country:, - # When the account was created, as an ISO 8601 timestamp + # When the account was created, as an ISO 8601 timestamp. created_at:, - # A promotional description for the account + # Account promotional description. description:, - # The email address of the account owner + # Account owner email address. email:, home_preferences:, - # The industry group the account belongs to + # Account industry group. industry_group:, - # The specific industry vertical the account operates in + # Specific industry vertical for the account. industry_type:, - # The prefix used for account invoices + # Prefix used for account invoices. invoice_prefix:, - # The URL of the account logo image + # Account logo image URL. logo_url:, - # Arbitrary key/value metadata supplied when the account was created + # Arbitrary key/value metadata supplied at account creation. metadata:, - # The type of onboarding the account has completed + # Type of onboarding the account has completed. onboarding_type:, - # The URL of the account Open Graph image + # Account Open Graph image URL. opengraph_image_url:, - # The account Open Graph image variant + # Account Open Graph image variant. opengraph_image_variant:, - # The description of the business type when business_type is other + # Business type details when business_type is `other`. other_business_description:, - # The description of the industry type when industry_type is other + # Industry details when industry_type is `other`. other_industry_description:, - # The parent account ID for connected accounts + # Parent account ID for connected accounts. parent_account_id:, - # Whether the account requires authorized users to have two-factor authentication - # enabled + # Tax classification code applied by default to the account's products, with `id`, + # `name`, and `product_type`. `null` when no default is set. + product_tax_code:, + # DEPRECATED: Use the `GET /accounts/{account_id}/recommend_actions` endpoint + # instead. + recommended_actions:, + # Whether authorized users must enable two-factor authentication. require_2fa:, - # The account's public route identifier + required_actions:, + # Account public route identifier. route:, - # Whether Whop sends transactional emails to customers on behalf of this account + # 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 + # Whether the account appears in joined whops on other accounts. show_joined_whops:, - # Whether reviews are displayed on direct-to-consumer product pages + # Whether reviews are displayed on direct-to-consumer product pages. show_reviews_dtc:, - # Whether the account shows users in the user directory + # Whether the account shows users in the user directory. show_user_directory:, social_links:, - # Store page display configuration for the account + # Whether the account can operate on Whop: `active` or `suspended`. Computed only + # on `retrieve` and `me`; `null` otherwise. + status:, + # Account store page display configuration. store_page_config:, - # The target audience for this account + # Target audience for this account. target_audience:, - # The display name of the account + # Account tax/VAT registrations, each with `id`, `tax_id_type`, and + # `tax_id_value`. Empty when none are set. + tax_identifiers:, + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `null` until the account enrolls in the + # Whop tax service. + tax_remitted_by:, + # Account display name. title:, - # Whether the account uses its logo as the fallback Open Graph image + # Account lifetime sales, normalized to USD. Computed only on `retrieve` and `me` + # for callers with `stats:read` scope; `null` otherwise. + total_earned_usd:, + # Total USD value across balances with known exchange rates. Computed only on + # single-account reads (`retrieve` and `me`); `null` on list responses, writes, + # missing balance-read permission, or unavailable balance source. + total_usd:, + # 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 + # Account identity verification status for the `individual` (KYC) and `business` + # (KYB) profiles. Each is `null` until created, otherwise a `status` of + # `not_started`, `pending`, `approved`, or `rejected`. + verification:, + # Account primary crypto wallet, or `null` if none has been provisioned. wallet: ) end @@ -236,8 +353,11 @@ module WhopSDK override.returns( { id: String, + balances: T::Array[WhopSDK::Account::Balance], banner_image_url: T.nilable(String), + business_address: T.nilable(T.anything), business_type: T.nilable(String), + capabilities: T.nilable(WhopSDK::Account::Capabilities), country: T.nilable(String), created_at: String, description: T.nilable(String), @@ -254,23 +374,1159 @@ module WhopSDK other_business_description: T.nilable(String), other_industry_description: T.nilable(String), parent_account_id: T.nilable(String), + product_tax_code: T.nilable(T.anything), + recommended_actions: + T.nilable(T::Array[WhopSDK::Account::RecommendedAction]), require_2fa: T::Boolean, + required_actions: + T.nilable(T::Array[WhopSDK::Account::RequiredAction]), 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], + status: T.nilable(String), store_page_config: T.anything, target_audience: T.nilable(String), + tax_identifiers: T::Array[T.anything], + tax_remitted_by: T.nilable(String), title: String, + total_earned_usd: T.nilable(Float), + total_usd: T.nilable(String), use_logo_as_opengraph_image_fallback: T::Boolean, - wallet: T.nilable(WhopSDK::AccountWallet) + verification: T.anything, + wallet: T.nilable(WhopSDK::Account::Wallet) } ) end def to_hash end + + class Balance < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Account::Balance, WhopSDK::Internal::AnyHash) + end + + # Total amount held in native units, as a decimal string. + sig { returns(String) } + attr_accessor :balance + + # Balance split into available, pending, and reserve amounts, as native-unit + # decimal strings. On-chain crypto is entirely available; good_funds and fiat cash + # can have pending or reserve portions. + sig { returns(T.anything) } + attr_accessor :breakdown + + # Holding icon URL. + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # The holding's display name + sig { returns(String) } + attr_accessor :name + + # USD price per unit, or `null` when no exchange rate is available. + sig { returns(T.nilable(Float)) } + attr_accessor :price_usd + + # Holding display symbol, such as `USDT`, `cbBTC`, or `EUR`. + sig { returns(String) } + attr_accessor :symbol + + # Holding USD value, or `null` when no exchange rate is available. + sig { returns(T.nilable(String)) } + attr_accessor :value_usd + + # Account holdings, each with USD value. Empty when `total_usd` is `null`. + sig do + params( + balance: String, + breakdown: T.anything, + icon_url: T.nilable(String), + name: String, + price_usd: T.nilable(Float), + symbol: String, + value_usd: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Total amount held in native units, as a decimal string. + balance:, + # Balance split into available, pending, and reserve amounts, as native-unit + # decimal strings. On-chain crypto is entirely available; good_funds and fiat cash + # can have pending or reserve portions. + breakdown:, + # Holding icon URL. + icon_url:, + # The holding's display name + name:, + # USD price per unit, or `null` when no exchange rate is available. + price_usd:, + # Holding display symbol, such as `USDT`, `cbBTC`, or `EUR`. + symbol:, + # Holding USD value, or `null` when no exchange rate is available. + value_usd: + ) + end + + sig do + override.returns( + { + balance: String, + breakdown: T.anything, + icon_url: T.nilable(String), + name: String, + price_usd: T.nilable(Float), + symbol: String, + value_usd: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Capabilities < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Account::Capabilities, WhopSDK::Internal::AnyHash) + end + + # Bank payins: debits, transfers, and local bank rails + sig do + returns( + WhopSDK::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ) + end + attr_accessor :accept_bank_payments + + # Buy-now-pay-later payins; requires approval + sig do + returns( + WhopSDK::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ) + end + attr_accessor :accept_bnpl_payments + + # Card payins, including Apple Pay and Google Pay + sig do + returns( + WhopSDK::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ) + end + attr_accessor :accept_card_payments + + # Deposits by bank wire or ACH to the account's virtual bank account + sig do + returns(WhopSDK::Account::Capabilities::BankDeposit::TaggedSymbol) + end + attr_accessor :bank_deposit + + # Balance top-ups by charging a stored payment method + sig do + returns(WhopSDK::Account::Capabilities::CardDeposit::TaggedSymbol) + end + attr_accessor :card_deposit + + # Issuing Whop cards; requires card application approval + sig do + returns(WhopSDK::Account::Capabilities::CardIssuing::TaggedSymbol) + end + attr_accessor :card_issuing + + # On-chain deposits to the account's crypto wallet + sig do + returns(WhopSDK::Account::Capabilities::CryptoDeposit::TaggedSymbol) + end + attr_accessor :crypto_deposit + + # On-chain payouts to a crypto wallet + sig do + returns(WhopSDK::Account::Capabilities::CryptoPayout::TaggedSymbol) + end + attr_accessor :crypto_payout + + # Instant payouts to an eligible payout destination + sig do + returns(WhopSDK::Account::Capabilities::InstantPayout::TaggedSymbol) + end + attr_accessor :instant_payout + + # Standard payouts to an external payout destination + sig do + returns(WhopSDK::Account::Capabilities::StandardPayout::TaggedSymbol) + end + attr_accessor :standard_payout + + # Transfers to other accounts + sig { returns(WhopSDK::Account::Capabilities::Transfer::TaggedSymbol) } + attr_accessor :transfer + + # Payment rails enabled for this account, each `active`, `inactive`, or `pending` + # (onboarding or review in progress). Computed only on `retrieve` and `me` for + # callers with `company:balance:read` scope; `null` otherwise. + sig do + params( + accept_bank_payments: + WhopSDK::Account::Capabilities::AcceptBankPayments::OrSymbol, + accept_bnpl_payments: + WhopSDK::Account::Capabilities::AcceptBnplPayments::OrSymbol, + accept_card_payments: + WhopSDK::Account::Capabilities::AcceptCardPayments::OrSymbol, + bank_deposit: WhopSDK::Account::Capabilities::BankDeposit::OrSymbol, + card_deposit: WhopSDK::Account::Capabilities::CardDeposit::OrSymbol, + card_issuing: WhopSDK::Account::Capabilities::CardIssuing::OrSymbol, + crypto_deposit: + WhopSDK::Account::Capabilities::CryptoDeposit::OrSymbol, + crypto_payout: + WhopSDK::Account::Capabilities::CryptoPayout::OrSymbol, + instant_payout: + WhopSDK::Account::Capabilities::InstantPayout::OrSymbol, + standard_payout: + WhopSDK::Account::Capabilities::StandardPayout::OrSymbol, + transfer: WhopSDK::Account::Capabilities::Transfer::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Bank payins: debits, transfers, and local bank rails + accept_bank_payments:, + # Buy-now-pay-later payins; requires approval + accept_bnpl_payments:, + # Card payins, including Apple Pay and Google Pay + accept_card_payments:, + # Deposits by bank wire or ACH to the account's virtual bank account + bank_deposit:, + # Balance top-ups by charging a stored payment method + card_deposit:, + # Issuing Whop cards; requires card application approval + card_issuing:, + # On-chain deposits to the account's crypto wallet + crypto_deposit:, + # On-chain payouts to a crypto wallet + crypto_payout:, + # Instant payouts to an eligible payout destination + instant_payout:, + # Standard payouts to an external payout destination + standard_payout:, + # Transfers to other accounts + transfer: + ) + end + + sig do + override.returns( + { + accept_bank_payments: + WhopSDK::Account::Capabilities::AcceptBankPayments::TaggedSymbol, + accept_bnpl_payments: + WhopSDK::Account::Capabilities::AcceptBnplPayments::TaggedSymbol, + accept_card_payments: + WhopSDK::Account::Capabilities::AcceptCardPayments::TaggedSymbol, + bank_deposit: + WhopSDK::Account::Capabilities::BankDeposit::TaggedSymbol, + card_deposit: + WhopSDK::Account::Capabilities::CardDeposit::TaggedSymbol, + card_issuing: + WhopSDK::Account::Capabilities::CardIssuing::TaggedSymbol, + crypto_deposit: + WhopSDK::Account::Capabilities::CryptoDeposit::TaggedSymbol, + crypto_payout: + WhopSDK::Account::Capabilities::CryptoPayout::TaggedSymbol, + instant_payout: + WhopSDK::Account::Capabilities::InstantPayout::TaggedSymbol, + standard_payout: + WhopSDK::Account::Capabilities::StandardPayout::TaggedSymbol, + transfer: WhopSDK::Account::Capabilities::Transfer::TaggedSymbol + } + ) + end + def to_hash + end + + # Bank payins: debits, transfers, and local bank rails + module AcceptBankPayments + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::AcceptBankPayments) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Buy-now-pay-later payins; requires approval + module AcceptBnplPayments + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::AcceptBnplPayments) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Card payins, including Apple Pay and Google Pay + module AcceptCardPayments + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::AcceptCardPayments) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Deposits by bank wire or ACH to the account's virtual bank account + module BankDeposit + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::BankDeposit) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::BankDeposit::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::BankDeposit::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::BankDeposit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::BankDeposit::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Balance top-ups by charging a stored payment method + module CardDeposit + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::CardDeposit) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::CardDeposit::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::CardDeposit::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::CardDeposit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::CardDeposit::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Issuing Whop cards; requires card application approval + module CardIssuing + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::CardIssuing) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::CardIssuing::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::CardIssuing::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::CardIssuing::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::CardIssuing::TaggedSymbol + ] + ) + end + def self.values + end + end + + # On-chain deposits to the account's crypto wallet + module CryptoDeposit + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::CryptoDeposit) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::CryptoDeposit::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::CryptoDeposit::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::CryptoDeposit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::CryptoDeposit::TaggedSymbol + ] + ) + end + def self.values + end + end + + # On-chain payouts to a crypto wallet + module CryptoPayout + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::CryptoPayout) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::CryptoPayout::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::CryptoPayout::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::CryptoPayout::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::CryptoPayout::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Instant payouts to an eligible payout destination + module InstantPayout + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::InstantPayout) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::InstantPayout::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::InstantPayout::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::InstantPayout::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::InstantPayout::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Standard payouts to an external payout destination + module StandardPayout + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::StandardPayout) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::StandardPayout::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::StandardPayout::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::StandardPayout::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::Capabilities::StandardPayout::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Transfers to other accounts + module Transfer + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::Capabilities::Transfer) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Account::Capabilities::Transfer::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Account::Capabilities::Transfer::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::Capabilities::Transfer::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Account::Capabilities::Transfer::TaggedSymbol] + ) + end + def self.values + end + end + end + + class RecommendedAction < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Account::RecommendedAction, + WhopSDK::Internal::AnyHash + ) + end + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + sig do + returns(WhopSDK::Account::RecommendedAction::Action::TaggedSymbol) + end + attr_accessor :action + + sig { returns(T::Array[String]) } + attr_accessor :blocked_capabilities + + # The URL the call-to-action links to + sig { returns(String) } + attr_accessor :cta + + # Button label + sig { returns(String) } + attr_accessor :cta_label + + # Supporting copy, or empty + sig { returns(String) } + attr_accessor :description + + # Illustration icon URL, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + sig { returns(T.nilable(Integer)) } + attr_accessor :impact_score + + # Why this action was recommended for this account, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :reasoning + + # Always optional — never blocking + sig do + returns(WhopSDK::Account::RecommendedAction::Status::TaggedSymbol) + end + attr_accessor :status + + # Headline for the recommendation + sig { returns(String) } + attr_accessor :title + + # Deprecated: use the `GET /accounts/{account_id}/recommend_actions` endpoint + # instead. Optional actions that unlock capabilities or grow the account, same + # shape as `required_actions`. Computed only on `retrieve` and `me`; `null` + # otherwise. + sig do + params( + action: WhopSDK::Account::RecommendedAction::Action::OrSymbol, + blocked_capabilities: T::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: T.nilable(String), + impact_score: T.nilable(Integer), + reasoning: T.nilable(String), + status: WhopSDK::Account::RecommendedAction::Status::OrSymbol, + title: String + ).returns(T.attached_class) + end + def self.new( + # The recommendation; new values may be added, so handle unknown actions + # gracefully + action:, + blocked_capabilities:, + # The URL the call-to-action links to + cta:, + # Button label + cta_label:, + # Supporting copy, or empty + description:, + # Illustration icon URL, or `null` + icon_url:, + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + impact_score:, + # Why this action was recommended for this account, or `null` + reasoning:, + # Always optional — never blocking + status:, + # Headline for the recommendation + title: + ) + end + + sig do + override.returns( + { + action: WhopSDK::Account::RecommendedAction::Action::TaggedSymbol, + blocked_capabilities: T::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: T.nilable(String), + impact_score: T.nilable(Integer), + reasoning: T.nilable(String), + status: WhopSDK::Account::RecommendedAction::Status::TaggedSymbol, + title: String + } + ) + end + def to_hash + end + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::RecommendedAction::Action) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + THEME_BUSINESS = + T.let( + :theme_business, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + CREATE_PRODUCT = + T.let( + :create_product, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + CREATE_PLAN = + T.let( + :create_plan, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + VERIFY_IDENTITY = + T.let( + :verify_identity, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + CONNECT_AFFILIATE_PROGRAM = + T.let( + :connect_affiliate_program, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + CREATE_PROMOTION = + T.let( + :create_promotion, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + SETUP_TRACKING_PIXEL = + T.let( + :setup_tracking_pixel, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + MIGRATE_FROM_STRIPE = + T.let( + :migrate_from_stripe, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + ACCEPT_FIRST_PAYMENT = + T.let( + :accept_first_payment, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + LAUNCH_FIRST_AD = + T.let( + :launch_first_ad, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + INVITE_TEAM_MEMBER = + T.let( + :invite_team_member, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + ENABLE_TAX_COLLECTION = + T.let( + :enable_tax_collection, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + CREATE_CARD = + T.let( + :create_card, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + JOIN_WHOP_UNIVERSITY = + T.let( + :join_whop_university, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + APPLY_FOR_FINANCING = + T.let( + :apply_for_financing, + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::RecommendedAction::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Always optional — never blocking + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::RecommendedAction::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPTIONAL = + T.let( + :optional, + WhopSDK::Account::RecommendedAction::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Account::RecommendedAction::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class RequiredAction < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Account::RequiredAction, WhopSDK::Internal::AnyHash) + end + + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + sig { returns(WhopSDK::Account::RequiredAction::Action::TaggedSymbol) } + attr_accessor :action + + sig { returns(T::Array[String]) } + attr_accessor :blocked_capabilities + + # The URL the call-to-action links to, or null when there is no button + sig { returns(T.nilable(String)) } + attr_accessor :cta + + # Button label, or empty when there is no button + sig { returns(String) } + attr_accessor :cta_label + + # Supporting copy, or empty + sig { returns(String) } + attr_accessor :description + + # The URL of the action's illustration icon, or null if it has none + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # required (act now) or pending (under review) + sig { returns(WhopSDK::Account::RequiredAction::Status::TaggedSymbol) } + attr_accessor :status + + # Headline for the action + sig { returns(String) } + attr_accessor :title + + # Actions the account owner must take to unblock capabilities like payouts and + # card spend, ordered by display priority. Computed only on `retrieve` and `me` + # for callers with `company:balance:read` scope; `null` otherwise. + sig do + params( + action: WhopSDK::Account::RequiredAction::Action::OrSymbol, + blocked_capabilities: T::Array[String], + cta: T.nilable(String), + cta_label: String, + description: String, + icon_url: T.nilable(String), + status: WhopSDK::Account::RequiredAction::Status::OrSymbol, + title: String + ).returns(T.attached_class) + end + def self.new( + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + action:, + blocked_capabilities:, + # The URL the call-to-action links to, or null when there is no button + cta:, + # Button label, or empty when there is no button + cta_label:, + # Supporting copy, or empty + description:, + # The URL of the action's illustration icon, or null if it has none + icon_url:, + # required (act now) or pending (under review) + status:, + # Headline for the action + title: + ) + end + + sig do + override.returns( + { + action: WhopSDK::Account::RequiredAction::Action::TaggedSymbol, + blocked_capabilities: T::Array[String], + cta: T.nilable(String), + cta_label: String, + description: String, + icon_url: T.nilable(String), + status: WhopSDK::Account::RequiredAction::Status::TaggedSymbol, + title: String + } + ) + end + def to_hash + end + + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::RequiredAction::Action) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPOSIT_FUNDS = + T.let( + :deposit_funds, + WhopSDK::Account::RequiredAction::Action::TaggedSymbol + ) + SUBMIT_INFORMATION_REQUEST = + T.let( + :submit_information_request, + WhopSDK::Account::RequiredAction::Action::TaggedSymbol + ) + VERIFY_IDENTITY = + T.let( + :verify_identity, + WhopSDK::Account::RequiredAction::Action::TaggedSymbol + ) + CONNECT_FULFILLMENT_TRACKER = + T.let( + :connect_fulfillment_tracker, + WhopSDK::Account::RequiredAction::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Account::RequiredAction::Action::TaggedSymbol] + ) + end + def self.values + end + end + + # required (act now) or pending (under review) + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Account::RequiredAction::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUIRED = + T.let( + :required, + WhopSDK::Account::RequiredAction::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Account::RequiredAction::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Account::RequiredAction::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + + class Wallet < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Account::Wallet, WhopSDK::Internal::AnyHash) + end + + # Wallet ID, prefixed `wallet_`. + sig { returns(String) } + attr_accessor :id + + # The on-chain address of the wallet + sig { returns(String) } + attr_accessor :address + + # The blockchain network the wallet lives on + sig { returns(WhopSDK::Account::Wallet::Network::TaggedSymbol) } + attr_accessor :network + + # Account primary crypto wallet, or `null` if none has been provisioned. + sig do + params( + id: String, + address: String, + network: WhopSDK::Account::Wallet::Network::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Wallet ID, prefixed `wallet_`. + id:, + # The on-chain address of the wallet + address:, + # The blockchain network the wallet lives on + network: + ) + end + + sig do + override.returns( + { + id: String, + address: String, + network: WhopSDK::Account::Wallet::Network::TaggedSymbol + } + ) + end + def to_hash + end + + # The blockchain network the wallet lives on + module Network + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::Account::Wallet::Network) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA = + T.let(:solana, WhopSDK::Account::Wallet::Network::TaggedSymbol) + ETHEREUM = + T.let(:ethereum, WhopSDK::Account::Wallet::Network::TaggedSymbol) + BITCOIN = + T.let(:bitcoin, WhopSDK::Account::Wallet::Network::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::Account::Wallet::Network::TaggedSymbol] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/whop_sdk/models/account_create_params.rbi b/rbi/whop_sdk/models/account_create_params.rbi index 079eb148..be667b72 100644 --- a/rbi/whop_sdk/models/account_create_params.rbi +++ b/rbi/whop_sdk/models/account_create_params.rbi @@ -26,10 +26,19 @@ module WhopSDK sig { params(metadata: T::Hash[Symbol, T.anything]).void } attr_writer :metadata + # The display name of the account. Defaults to `metadata.external_id` or the + # owner's email when omitted. + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + sig do params( email: String, metadata: T::Hash[Symbol, T.anything], + title: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -39,6 +48,9 @@ module WhopSDK email: nil, # Arbitrary key/value metadata to store on the account. metadata: nil, + # The display name of the account. Defaults to `metadata.external_id` or the + # owner's email when omitted. + title: nil, request_options: {} ) end @@ -48,6 +60,7 @@ module WhopSDK { email: String, metadata: T::Hash[Symbol, T.anything], + title: String, request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/account_list_params.rbi b/rbi/whop_sdk/models/account_list_params.rbi index 0e403100..74384418 100644 --- a/rbi/whop_sdk/models/account_list_params.rbi +++ b/rbi/whop_sdk/models/account_list_params.rbi @@ -11,34 +11,76 @@ module WhopSDK T.any(WhopSDK::AccountListParams, WhopSDK::Internal::AnyHash) end - # The page number to retrieve + # A cursor; returns accounts after this position. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # A cursor; returns accounts before this position. + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Sort direction. + sig do + returns(T.nilable(WhopSDK::AccountListParams::Direction::OrSymbol)) + end + attr_reader :direction + + sig do + params(direction: WhopSDK::AccountListParams::Direction::OrSymbol).void + end + attr_writer :direction + + # The number of accounts to return (default 10, max 50). sig { returns(T.nilable(Integer)) } - attr_reader :page + attr_reader :first - sig { params(page: Integer).void } - attr_writer :page + sig { params(first: Integer).void } + attr_writer :first - # The number of resources to return per page. There is a limit of 50 results per - # page. + # The number of accounts to return from the end of the range. sig { returns(T.nilable(Integer)) } - attr_reader :per + attr_reader :last - sig { params(per: Integer).void } - attr_writer :per + sig { params(last: Integer).void } + attr_writer :last + + # The field to sort accounts by. + sig { returns(T.nilable(WhopSDK::AccountListParams::Order::OrSymbol)) } + attr_reader :order + + sig { params(order: WhopSDK::AccountListParams::Order::OrSymbol).void } + attr_writer :order sig do params( - page: Integer, - per: Integer, + after: String, + before: String, + direction: WhopSDK::AccountListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AccountListParams::Order::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The page number to retrieve - page: nil, - # The number of resources to return per page. There is a limit of 50 results per - # page. - per: nil, + # A cursor; returns accounts after this position. + after: nil, + # A cursor; returns accounts before this position. + before: nil, + # Sort direction. + direction: nil, + # The number of accounts to return (default 10, max 50). + first: nil, + # The number of accounts to return from the end of the range. + last: nil, + # The field to sort accounts by. + order: nil, request_options: {} ) end @@ -46,14 +88,58 @@ module WhopSDK sig do override.returns( { - page: Integer, - per: Integer, + after: String, + before: String, + direction: WhopSDK::AccountListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AccountListParams::Order::OrSymbol, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AccountListParams::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = T.let(:asc, WhopSDK::AccountListParams::Direction::TaggedSymbol) + DESC = T.let(:desc, WhopSDK::AccountListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AccountListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # The field to sort accounts by. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AccountListParams::Order) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT = + T.let(:created_at, WhopSDK::AccountListParams::Order::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AccountListParams::Order::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/account_list_response.rbi b/rbi/whop_sdk/models/account_list_response.rbi deleted file mode 100644 index 0cb29471..00000000 --- a/rbi/whop_sdk/models/account_list_response.rbi +++ /dev/null @@ -1,115 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class AccountListResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AccountListResponse, - WhopSDK::Internal::AnyHash - ) - end - - sig { returns(T::Array[WhopSDK::Account]) } - attr_accessor :accounts - - sig { returns(WhopSDK::Models::AccountListResponse::Pagination) } - attr_reader :pagination - - sig do - params( - pagination: WhopSDK::Models::AccountListResponse::Pagination::OrHash - ).void - end - attr_writer :pagination - - sig do - params( - accounts: T::Array[WhopSDK::Account::OrHash], - pagination: WhopSDK::Models::AccountListResponse::Pagination::OrHash - ).returns(T.attached_class) - end - def self.new(accounts:, pagination:) - end - - sig do - override.returns( - { - accounts: T::Array[WhopSDK::Account], - pagination: WhopSDK::Models::AccountListResponse::Pagination - } - ) - end - def to_hash - end - - class Pagination < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AccountListResponse::Pagination, - WhopSDK::Internal::AnyHash - ) - end - - # Current page number - sig { returns(Float) } - attr_accessor :current_page - - # Next page number - sig { returns(T.nilable(Float)) } - attr_accessor :next_page - - # Previous page number - sig { returns(T.nilable(Float)) } - attr_accessor :prev_page - - # Total number of records - sig { returns(Float) } - attr_accessor :total_count - - # Total number of pages - sig { returns(Float) } - attr_accessor :total_pages - - sig do - params( - current_page: Float, - next_page: T.nilable(Float), - prev_page: T.nilable(Float), - total_count: Float, - total_pages: Float - ).returns(T.attached_class) - end - def self.new( - # Current page number - current_page:, - # Next page number - next_page:, - # Previous page number - prev_page:, - # Total number of records - total_count:, - # Total number of pages - total_pages: - ) - end - - sig do - override.returns( - { - current_page: Float, - next_page: T.nilable(Float), - prev_page: T.nilable(Float), - total_count: Float, - total_pages: Float - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/models/account_recommend_actions_params.rbi b/rbi/whop_sdk/models/account_recommend_actions_params.rbi new file mode 100644 index 00000000..33d681d0 --- /dev/null +++ b/rbi/whop_sdk/models/account_recommend_actions_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module WhopSDK + module Models + class AccountRecommendActionsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::AccountRecommendActionsParams, + 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/account_recommend_actions_response.rbi b/rbi/whop_sdk/models/account_recommend_actions_response.rbi new file mode 100644 index 00000000..92755d7c --- /dev/null +++ b/rbi/whop_sdk/models/account_recommend_actions_response.rbi @@ -0,0 +1,296 @@ +# typed: strong + +module WhopSDK + module Models + class AccountRecommendActionsResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::AccountRecommendActionsResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[WhopSDK::Models::AccountRecommendActionsResponse::Data] + ) + end + attr_accessor :data + + sig do + params( + data: + T::Array[ + WhopSDK::Models::AccountRecommendActionsResponse::Data::OrHash + ] + ).returns(T.attached_class) + end + def self.new(data:) + end + + sig do + override.returns( + { + data: + T::Array[WhopSDK::Models::AccountRecommendActionsResponse::Data] + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::AccountRecommendActionsResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + sig do + returns( + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + end + attr_accessor :action + + sig { returns(T::Array[String]) } + attr_accessor :blocked_capabilities + + # The URL the call-to-action links to + sig { returns(String) } + attr_accessor :cta + + # Button label + sig { returns(String) } + attr_accessor :cta_label + + # Supporting copy, or empty + sig { returns(String) } + attr_accessor :description + + # Illustration icon URL, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + sig { returns(T.nilable(Integer)) } + attr_accessor :impact_score + + # Why this action was recommended for this account, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :reasoning + + # Always optional — never blocking + sig do + returns( + WhopSDK::Models::AccountRecommendActionsResponse::Data::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Headline for the recommendation + sig { returns(String) } + attr_accessor :title + + sig do + params( + action: + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::OrSymbol, + blocked_capabilities: T::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: T.nilable(String), + impact_score: T.nilable(Integer), + reasoning: T.nilable(String), + status: + WhopSDK::Models::AccountRecommendActionsResponse::Data::Status::OrSymbol, + title: String + ).returns(T.attached_class) + end + def self.new( + # The recommendation; new values may be added, so handle unknown actions + # gracefully + action:, + blocked_capabilities:, + # The URL the call-to-action links to + cta:, + # Button label + cta_label:, + # Supporting copy, or empty + description:, + # Illustration icon URL, or `null` + icon_url:, + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + impact_score:, + # Why this action was recommended for this account, or `null` + reasoning:, + # Always optional — never blocking + status:, + # Headline for the recommendation + title: + ) + end + + sig do + override.returns( + { + action: + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol, + blocked_capabilities: T::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: T.nilable(String), + impact_score: T.nilable(Integer), + reasoning: T.nilable(String), + status: + WhopSDK::Models::AccountRecommendActionsResponse::Data::Status::TaggedSymbol, + title: String + } + ) + end + def to_hash + end + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + THEME_BUSINESS = + T.let( + :theme_business, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CREATE_PRODUCT = + T.let( + :create_product, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CREATE_PLAN = + T.let( + :create_plan, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + VERIFY_IDENTITY = + T.let( + :verify_identity, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CONNECT_AFFILIATE_PROGRAM = + T.let( + :connect_affiliate_program, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CREATE_PROMOTION = + T.let( + :create_promotion, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + SETUP_TRACKING_PIXEL = + T.let( + :setup_tracking_pixel, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + MIGRATE_FROM_STRIPE = + T.let( + :migrate_from_stripe, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + ACCEPT_FIRST_PAYMENT = + T.let( + :accept_first_payment, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + LAUNCH_FIRST_AD = + T.let( + :launch_first_ad, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + INVITE_TEAM_MEMBER = + T.let( + :invite_team_member, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + ENABLE_TAX_COLLECTION = + T.let( + :enable_tax_collection, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CREATE_CARD = + T.let( + :create_card, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + JOIN_WHOP_UNIVERSITY = + T.let( + :join_whop_university, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + APPLY_FOR_FINANCING = + T.let( + :apply_for_financing, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AccountRecommendActionsResponse::Data::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Always optional — never blocking + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPTIONAL = + T.let( + :optional, + WhopSDK::Models::AccountRecommendActionsResponse::Data::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AccountRecommendActionsResponse::Data::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/account_update_params.rbi b/rbi/whop_sdk/models/account_update_params.rbi index 96363611..3ffb5757 100644 --- a/rbi/whop_sdk/models/account_update_params.rbi +++ b/rbi/whop_sdk/models/account_update_params.rbi @@ -30,38 +30,51 @@ module WhopSDK sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :banner_image - # The high-level business category for the account. + # Account business address used to calculate tax. A complete address in a + # supported country is required when `tax_remitted_by` is `self`. + sig { returns(T.nilable(WhopSDK::AccountUpdateParams::BusinessAddress)) } + attr_reader :business_address + + sig do + params( + business_address: + WhopSDK::AccountUpdateParams::BusinessAddress::OrHash + ).void + end + attr_writer :business_address + + # High-level business category for the account. sig { returns(T.nilable(String)) } attr_accessor :business_type - # The country the account is located in. + # Country where the account is located. sig { returns(T.nilable(String)) } attr_accessor :country - # A promotional description for the account. + # Account promotional description. sig { returns(T.nilable(String)) } attr_accessor :description - # The ID of the product to feature for affiliates. Pass null to clear. + # The ID of the product to feature for affiliates. Pass `null` to clear. sig { returns(T.nilable(String)) } attr_accessor :featured_affiliate_product_id - # Preferences for the public business home page. + # Public account home page preferences. 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. + # Account industry group. sig { returns(T.nilable(String)) } attr_accessor :industry_group - # The specific industry vertical the account operates in. + # Specific industry vertical for the account. sig { returns(T.nilable(String)) } attr_accessor :industry_type - # The prefix to use for account invoices. + # Prefix used for account invoices. sig { returns(T.nilable(String)) } attr_accessor :invoice_prefix @@ -96,6 +109,12 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :other_industry_description + # ID of the tax classification code applied by default to the account's products. + # See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). + sig { returns(T.nilable(String)) } + attr_accessor :product_tax_code_id + # Whether the account requires authorized users to have two-factor authentication # enabled. sig { returns(T.nilable(T::Boolean)) } @@ -143,7 +162,7 @@ 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. + # Account store page display configuration. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :store_page_config @@ -151,6 +170,42 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :target_audience + # Account tax/VAT registrations to add or update. When `tax_remitted_by` is + # `self`, tax is calculated and collected only in the countries where the account + # holds a registration. + sig do + returns( + T.nilable(T::Array[WhopSDK::AccountUpdateParams::TaxIdentifier]) + ) + end + attr_reader :tax_identifiers + + sig do + params( + tax_identifiers: + T::Array[WhopSDK::AccountUpdateParams::TaxIdentifier::OrHash] + ).void + end + attr_writer :tax_identifiers + + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `self` requires a `business_address` in a + # supported country. + sig do + returns( + T.nilable(WhopSDK::AccountUpdateParams::TaxRemittedBy::OrSymbol) + ) + end + attr_reader :tax_remitted_by + + sig do + params( + tax_remitted_by: WhopSDK::AccountUpdateParams::TaxRemittedBy::OrSymbol + ).void + end + attr_writer :tax_remitted_by + # The display name of the account. sig { returns(T.nilable(String)) } attr_accessor :title @@ -168,6 +223,8 @@ module WhopSDK affiliate_application_required: T::Boolean, affiliate_instructions: T.nilable(String), banner_image: T.nilable(T::Hash[Symbol, T.anything]), + business_address: + WhopSDK::AccountUpdateParams::BusinessAddress::OrHash, business_type: T.nilable(String), country: T.nilable(String), description: T.nilable(String), @@ -183,6 +240,7 @@ module WhopSDK opengraph_image_variant: T.nilable(String), other_business_description: T.nilable(String), other_industry_description: T.nilable(String), + product_tax_code_id: T.nilable(String), require_2fa: T::Boolean, route: T.nilable(String), send_customer_emails: T::Boolean, @@ -192,6 +250,10 @@ module WhopSDK social_links: T::Array[T::Hash[Symbol, T.anything]], store_page_config: T.nilable(T::Hash[Symbol, T.anything]), target_audience: T.nilable(String), + tax_identifiers: + T::Array[WhopSDK::AccountUpdateParams::TaxIdentifier::OrHash], + tax_remitted_by: + WhopSDK::AccountUpdateParams::TaxRemittedBy::OrSymbol, title: T.nilable(String), use_logo_as_opengraph_image_fallback: T::Boolean, request_options: WhopSDK::RequestOptions::OrHash @@ -206,21 +268,24 @@ module WhopSDK affiliate_instructions: nil, # Attachment input for the account banner image. banner_image: nil, - # The high-level business category for the account. + # Account business address used to calculate tax. A complete address in a + # supported country is required when `tax_remitted_by` is `self`. + business_address: nil, + # High-level business category for the account. business_type: nil, - # The country the account is located in. + # Country where the account is located. country: nil, - # A promotional description for the account. + # Account promotional description. description: nil, - # The ID of the product to feature for affiliates. Pass null to clear. + # 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. + # Public account home page preferences. home_preferences: nil, - # The industry group the account belongs to. + # Account industry group. industry_group: nil, - # The specific industry vertical the account operates in. + # Specific industry vertical for the account. industry_type: nil, - # The prefix to use for account invoices. + # Prefix used for account invoices. invoice_prefix: nil, # Attachment input for the account logo. logo: nil, @@ -236,6 +301,10 @@ module WhopSDK other_business_description: nil, # The description of the industry type when industry_type is other. other_industry_description: nil, + # ID of the tax classification code applied by default to the account's products. + # See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). + product_tax_code_id: nil, # Whether the account requires authorized users to have two-factor authentication # enabled. require_2fa: nil, @@ -251,10 +320,19 @@ module WhopSDK 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. + # Account store page display configuration. store_page_config: nil, # The target audience for this account. target_audience: nil, + # Account tax/VAT registrations to add or update. When `tax_remitted_by` is + # `self`, tax is calculated and collected only in the countries where the account + # holds a registration. + tax_identifiers: nil, + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `self` requires a `business_address` in a + # supported country. + tax_remitted_by: nil, # The display name of the account. title: nil, # Whether the account uses its logo as the fallback Open Graph image. @@ -270,6 +348,7 @@ module WhopSDK affiliate_application_required: T::Boolean, affiliate_instructions: T.nilable(String), banner_image: T.nilable(T::Hash[Symbol, T.anything]), + business_address: WhopSDK::AccountUpdateParams::BusinessAddress, business_type: T.nilable(String), country: T.nilable(String), description: T.nilable(String), @@ -285,6 +364,7 @@ module WhopSDK opengraph_image_variant: T.nilable(String), other_business_description: T.nilable(String), other_industry_description: T.nilable(String), + product_tax_code_id: T.nilable(String), require_2fa: T::Boolean, route: T.nilable(String), send_customer_emails: T::Boolean, @@ -294,6 +374,10 @@ module WhopSDK social_links: T::Array[T::Hash[Symbol, T.anything]], store_page_config: T.nilable(T::Hash[Symbol, T.anything]), target_audience: T.nilable(String), + tax_identifiers: + T::Array[WhopSDK::AccountUpdateParams::TaxIdentifier], + tax_remitted_by: + WhopSDK::AccountUpdateParams::TaxRemittedBy::OrSymbol, title: T.nilable(String), use_logo_as_opengraph_image_fallback: T::Boolean, request_options: WhopSDK::RequestOptions @@ -302,6 +386,756 @@ module WhopSDK end def to_hash end + + class BusinessAddress < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AccountUpdateParams::BusinessAddress, + WhopSDK::Internal::AnyHash + ) + end + + # City name. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Account business address used to calculate tax. A complete address in a + # supported country is required when `tax_remitted_by` is `self`. + sig do + params( + city: T.nilable(String), + country: String, + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # City name. + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: String, + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + class TaxIdentifier < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AccountUpdateParams::TaxIdentifier, + WhopSDK::Internal::AnyHash + ) + end + + # Tax ID type, for example `eu_vat`, `gb_vat`, or `us_ein`. + sig do + returns( + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::OrSymbol + ) + end + attr_accessor :tax_id_type + + # Tax ID value, for example `DE123456789`. + sig { returns(String) } + attr_accessor :tax_id_value + + sig do + params( + tax_id_type: + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::OrSymbol, + tax_id_value: String + ).returns(T.attached_class) + end + def self.new( + # Tax ID type, for example `eu_vat`, `gb_vat`, or `us_ein`. + tax_id_type:, + # Tax ID value, for example `DE123456789`. + tax_id_value: + ) + end + + sig do + override.returns( + { + tax_id_type: + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::OrSymbol, + tax_id_value: String + } + ) + end + def to_hash + end + + # Tax ID type, for example `eu_vat`, `gb_vat`, or `us_ein`. + module TaxIDType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD_NRT = + T.let( + :ad_nrt, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AO_TIN = + T.let( + :ao_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AR_CUIT = + T.let( + :ar_cuit, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AL_TIN = + T.let( + :al_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AM_TIN = + T.let( + :am_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AW_TIN = + T.let( + :aw_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AU_ABN = + T.let( + :au_abn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AU_ARN = + T.let( + :au_arn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + EU_VAT = + T.let( + :eu_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AZ_TIN = + T.let( + :az_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BS_TIN = + T.let( + :bs_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BH_VAT = + T.let( + :bh_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BD_BIN = + T.let( + :bd_bin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BB_TIN = + T.let( + :bb_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BY_TIN = + T.let( + :by_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BJ_IFU = + T.let( + :bj_ifu, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BO_TIN = + T.let( + :bo_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BA_TIN = + T.let( + :ba_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BR_CNPJ = + T.let( + :br_cnpj, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BR_CPF = + T.let( + :br_cpf, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BG_UIC = + T.let( + :bg_uic, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + BF_IFU = + T.let( + :bf_ifu, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + KH_TIN = + T.let( + :kh_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CM_NIU = + T.let( + :cm_niu, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CA_BN = + T.let( + :ca_bn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CA_GST_HST = + T.let( + :ca_gst_hst, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CA_PST_BC = + T.let( + :ca_pst_bc, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CA_PST_MB = + T.let( + :ca_pst_mb, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CA_PST_SK = + T.let( + :ca_pst_sk, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CA_QST = + T.let( + :ca_qst, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CV_NIF = + T.let( + :cv_nif, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CL_TIN = + T.let( + :cl_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CN_TIN = + T.let( + :cn_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CO_NIT = + T.let( + :co_nit, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CD_NIF = + T.let( + :cd_nif, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CR_TIN = + T.let( + :cr_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + HR_OIB = + T.let( + :hr_oib, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + DO_RCN = + T.let( + :do_rcn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + EC_RUC = + T.let( + :ec_ruc, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + EG_TIN = + T.let( + :eg_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + SV_NIT = + T.let( + :sv_nit, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + ET_TIN = + T.let( + :et_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + EU_OSS_VAT = + T.let( + :eu_oss_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + GE_VAT = + T.let( + :ge_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + GH_TIN = + T.let( + :gh_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + DE_STN = + T.let( + :de_stn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + GB_VAT = + T.let( + :gb_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + GN_NIF = + T.let( + :gn_nif, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + HK_BR = + T.let( + :hk_br, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + HU_TIN = + T.let( + :hu_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + IS_VAT = + T.let( + :is_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + IN_GST = + T.let( + :in_gst, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + ID_NPWP = + T.let( + :id_npwp, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + IL_VAT = + T.let( + :il_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + JP_CN = + T.let( + :jp_cn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + JP_RN = + T.let( + :jp_rn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + JP_TRN = + T.let( + :jp_trn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + KZ_BIN = + T.let( + :kz_bin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + KE_PIN = + T.let( + :ke_pin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + KG_TIN = + T.let( + :kg_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + LA_TIN = + T.let( + :la_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + LI_UID = + T.let( + :li_uid, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + LI_VAT = + T.let( + :li_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + MY_FRP = + T.let( + :my_frp, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + MY_ITN = + T.let( + :my_itn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + MY_SST = + T.let( + :my_sst, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + MR_NIF = + T.let( + :mr_nif, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + MX_RFC = + T.let( + :mx_rfc, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + MD_VAT = + T.let( + :md_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + ME_PIB = + T.let( + :me_pib, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + MA_VAT = + T.let( + :ma_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + NP_PAN = + T.let( + :np_pan, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + NZ_GST = + T.let( + :nz_gst, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + NG_TIN = + T.let( + :ng_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + MK_VAT = + T.let( + :mk_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + NO_VAT = + T.let( + :no_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + NO_VOEC = + T.let( + :no_voec, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + OM_VAT = + T.let( + :om_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + PE_RUC = + T.let( + :pe_ruc, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + PH_TIN = + T.let( + :ph_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + RO_TIN = + T.let( + :ro_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + RU_INN = + T.let( + :ru_inn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + RU_KPP = + T.let( + :ru_kpp, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + SA_VAT = + T.let( + :sa_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + SN_NINEA = + T.let( + :sn_ninea, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + RS_PIB = + T.let( + :rs_pib, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + SG_GST = + T.let( + :sg_gst, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + SG_UEN = + T.let( + :sg_uen, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + SI_TIN = + T.let( + :si_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + ZA_VAT = + T.let( + :za_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + KR_BRN = + T.let( + :kr_brn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + ES_CIF = + T.let( + :es_cif, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CH_UID = + T.let( + :ch_uid, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + CH_VAT = + T.let( + :ch_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + TW_VAT = + T.let( + :tw_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + TJ_TIN = + T.let( + :tj_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + TZ_VAT = + T.let( + :tz_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + TH_VAT = + T.let( + :th_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + TR_TIN = + T.let( + :tr_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + UG_TIN = + T.let( + :ug_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + UA_VAT = + T.let( + :ua_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + AE_TRN = + T.let( + :ae_trn, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + US_EIN = + T.let( + :us_ein, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + UY_RUC = + T.let( + :uy_ruc, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + UZ_TIN = + T.let( + :uz_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + UZ_VAT = + T.let( + :uz_vat, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + VE_RIF = + T.let( + :ve_rif, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + VN_TIN = + T.let( + :vn_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + ZM_TIN = + T.let( + :zm_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + ZW_TIN = + T.let( + :zw_tin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + SR_FIN = + T.let( + :sr_fin, + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AccountUpdateParams::TaxIdentifier::TaxIDType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `self` requires a `business_address` in a + # supported country. + module TaxRemittedBy + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AccountUpdateParams::TaxRemittedBy) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WHOP = + T.let( + :whop, + WhopSDK::AccountUpdateParams::TaxRemittedBy::TaggedSymbol + ) + SELF = + T.let( + :self, + WhopSDK::AccountUpdateParams::TaxRemittedBy::TaggedSymbol + ) + NONE = + T.let( + :none, + WhopSDK::AccountUpdateParams::TaxRemittedBy::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AccountUpdateParams::TaxRemittedBy::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/account_wallet.rbi b/rbi/whop_sdk/models/account_wallet.rbi deleted file mode 100644 index b2ef1908..00000000 --- a/rbi/whop_sdk/models/account_wallet.rbi +++ /dev/null @@ -1,75 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class AccountWallet < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::AccountWallet, WhopSDK::Internal::AnyHash) - end - - # The ID of the wallet, which will look like wallet\_******\******* - sig { returns(String) } - attr_accessor :id - - # The on-chain address of the wallet - sig { returns(String) } - attr_accessor :address - - # The blockchain network the wallet lives on - sig { returns(WhopSDK::AccountWallet::Network::TaggedSymbol) } - attr_accessor :network - - sig do - params( - id: String, - address: String, - network: WhopSDK::AccountWallet::Network::OrSymbol - ).returns(T.attached_class) - end - def self.new( - # The ID of the wallet, which will look like wallet\_******\******* - id:, - # The on-chain address of the wallet - address:, - # The blockchain network the wallet lives on - network: - ) - end - - sig do - override.returns( - { - id: String, - address: String, - network: WhopSDK::AccountWallet::Network::TaggedSymbol - } - ) - end - def to_hash - end - - # The blockchain network the wallet lives on - module Network - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::AccountWallet::Network) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - SOLANA = T.let(:solana, WhopSDK::AccountWallet::Network::TaggedSymbol) - ETHEREUM = - T.let(:ethereum, WhopSDK::AccountWallet::Network::TaggedSymbol) - BITCOIN = T.let(:bitcoin, WhopSDK::AccountWallet::Network::TaggedSymbol) - - sig do - override.returns( - T::Array[WhopSDK::AccountWallet::Network::TaggedSymbol] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/whop_sdk/models/accounts/preference_retrieve_params.rbi b/rbi/whop_sdk/models/accounts/preference_retrieve_params.rbi new file mode 100644 index 00000000..29ade862 --- /dev/null +++ b/rbi/whop_sdk/models/accounts/preference_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module WhopSDK + module Models + module Accounts + class PreferenceRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Accounts::PreferenceRetrieveParams, + 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 +end diff --git a/rbi/whop_sdk/models/accounts/preference_retrieve_response.rbi b/rbi/whop_sdk/models/accounts/preference_retrieve_response.rbi new file mode 100644 index 00000000..9977dd3e --- /dev/null +++ b/rbi/whop_sdk/models/accounts/preference_retrieve_response.rbi @@ -0,0 +1,323 @@ +# typed: strong + +module WhopSDK + module Models + module Accounts + class PreferenceRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + sig do + returns( + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods + ) + ) + end + attr_reader :ads_payment_methods + + sig do + params( + ads_payment_methods: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::OrHash + ) + ).void + end + attr_writer :ads_payment_methods + + sig do + params( + ads_payment_methods: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + ads_payment_methods: + ) + end + + sig do + override.returns( + { + ads_payment_methods: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods + ) + } + ) + end + def to_hash + end + + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup + ) + ) + end + attr_reader :backup + + sig do + params( + backup: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::OrHash + ) + ).void + end + attr_writer :backup + + sig do + returns( + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary + ) + ) + end + attr_reader :primary + + sig do + params( + primary: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::OrHash + ) + ).void + end + attr_writer :primary + + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + sig do + params( + backup: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::OrHash + ), + primary: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::OrHash + ) + ).returns(T.attached_class) + end + def self.new(backup:, primary:) + end + + sig do + override.returns( + { + backup: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup + ), + primary: + T.nilable( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary + ) + } + ) + end + def to_hash + end + + class Backup < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup, + WhopSDK::Internal::AnyHash + ) + end + + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + sig { returns(String) } + attr_accessor :id + + # The funding source kind: a Whop balance or a saved card. + sig do + returns( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + id: String, + type: + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + id:, + # The funding source kind: a Whop balance or a saved card. + type: + ) + end + + sig do + override.returns( + { + id: String, + type: + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # The funding source kind: a Whop balance or a saved card. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PLATFORM_BALANCE = + T.let( + :platform_balance, + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + ) + CARD = + T.let( + :card, + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Primary < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary, + WhopSDK::Internal::AnyHash + ) + end + + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + sig { returns(String) } + attr_accessor :id + + # The funding source kind: a Whop balance or a saved card. + sig do + returns( + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + id: String, + type: + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + id:, + # The funding source kind: a Whop balance or a saved card. + type: + ) + end + + sig do + override.returns( + { + id: String, + type: + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # The funding source kind: a Whop balance or a saved card. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PLATFORM_BALANCE = + T.let( + :platform_balance, + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + ) + CARD = + T.let( + :card, + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/accounts/preference_update_params.rbi b/rbi/whop_sdk/models/accounts/preference_update_params.rbi new file mode 100644 index 00000000..312ae2b8 --- /dev/null +++ b/rbi/whop_sdk/models/accounts/preference_update_params.rbi @@ -0,0 +1,331 @@ +# typed: strong + +module WhopSDK + module Models + module Accounts + class PreferenceUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Accounts::PreferenceUpdateParams, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_id + + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. + sig do + returns( + T.nilable( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods + ) + ) + end + attr_reader :ads_payment_methods + + sig do + params( + ads_payment_methods: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::OrHash + ).void + end + attr_writer :ads_payment_methods + + sig do + params( + account_id: String, + ads_payment_methods: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::OrHash, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + account_id:, + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. + ads_payment_methods: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + ads_payment_methods: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary + ) + end + attr_reader :primary + + sig do + params( + primary: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::OrHash + ).void + end + attr_writer :primary + + # Optional when the primary is `platform_balance`; omitting it removes any + # configured card. Required (as `platform_balance`) when the primary is `card`. + sig do + returns( + T.nilable( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup + ) + ) + end + attr_reader :backup + + sig do + params( + backup: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::OrHash + ).void + end + attr_writer :backup + + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. + sig do + params( + primary: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::OrHash, + backup: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::OrHash + ).returns(T.attached_class) + end + def self.new( + primary:, + # Optional when the primary is `platform_balance`; omitting it removes any + # configured card. Required (as `platform_balance`) when the primary is `card`. + backup: nil + ) + end + + sig do + override.returns( + { + primary: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary, + backup: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup + } + ) + end + def to_hash + end + + class Primary < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary, + WhopSDK::Internal::AnyHash + ) + end + + # The funding source kind. + sig do + returns( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type::OrSymbol + ) + end + attr_accessor :type + + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. Optional for `platform_balance` — defaults + # to the account's default Whop balance. Required for `card`. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig do + params( + type: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type::OrSymbol, + id: String + ).returns(T.attached_class) + end + def self.new( + # The funding source kind. + type:, + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. Optional for `platform_balance` — defaults + # to the account's default Whop balance. Required for `card`. + id: nil + ) + end + + sig do + override.returns( + { + type: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type::OrSymbol, + id: String + } + ) + end + def to_hash + end + + # The funding source kind. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PLATFORM_BALANCE = + T.let( + :platform_balance, + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type::TaggedSymbol + ) + CARD = + T.let( + :card, + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Backup < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup, + WhopSDK::Internal::AnyHash + ) + end + + # The funding source kind. + sig do + returns( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type::OrSymbol + ) + end + attr_accessor :type + + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. Optional for `platform_balance` — defaults + # to the account's default Whop balance. Required for `card`. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Optional when the primary is `platform_balance`; omitting it removes any + # configured card. Required (as `platform_balance`) when the primary is `card`. + sig do + params( + type: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type::OrSymbol, + id: String + ).returns(T.attached_class) + end + def self.new( + # The funding source kind. + type:, + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. Optional for `platform_balance` — defaults + # to the account's default Whop balance. Required for `card`. + id: nil + ) + end + + sig do + override.returns( + { + type: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type::OrSymbol, + id: String + } + ) + end + def to_hash + end + + # The funding source kind. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PLATFORM_BALANCE = + T.let( + :platform_balance, + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type::TaggedSymbol + ) + CARD = + T.let( + :card, + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/accounts/preference_update_response.rbi b/rbi/whop_sdk/models/accounts/preference_update_response.rbi new file mode 100644 index 00000000..646c63a6 --- /dev/null +++ b/rbi/whop_sdk/models/accounts/preference_update_response.rbi @@ -0,0 +1,323 @@ +# typed: strong + +module WhopSDK + module Models + module Accounts + class PreferenceUpdateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Accounts::PreferenceUpdateResponse, + WhopSDK::Internal::AnyHash + ) + end + + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + sig do + returns( + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods + ) + ) + end + attr_reader :ads_payment_methods + + sig do + params( + ads_payment_methods: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::OrHash + ) + ).void + end + attr_writer :ads_payment_methods + + sig do + params( + ads_payment_methods: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + ads_payment_methods: + ) + end + + sig do + override.returns( + { + ads_payment_methods: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods + ) + } + ) + end + def to_hash + end + + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup + ) + ) + end + attr_reader :backup + + sig do + params( + backup: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::OrHash + ) + ).void + end + attr_writer :backup + + sig do + returns( + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary + ) + ) + end + attr_reader :primary + + sig do + params( + primary: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::OrHash + ) + ).void + end + attr_writer :primary + + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. `null` until ads billing has been + # configured. + sig do + params( + backup: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::OrHash + ), + primary: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::OrHash + ) + ).returns(T.attached_class) + end + def self.new(backup:, primary:) + end + + sig do + override.returns( + { + backup: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup + ), + primary: + T.nilable( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary + ) + } + ) + end + def to_hash + end + + class Backup < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup, + WhopSDK::Internal::AnyHash + ) + end + + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + sig { returns(String) } + attr_accessor :id + + # The funding source kind: a Whop balance or a saved card. + sig do + returns( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + id: String, + type: + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + id:, + # The funding source kind: a Whop balance or a saved card. + type: + ) + end + + sig do + override.returns( + { + id: String, + type: + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # The funding source kind: a Whop balance or a saved card. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PLATFORM_BALANCE = + T.let( + :platform_balance, + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + ) + CARD = + T.let( + :card, + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Primary < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary, + WhopSDK::Internal::AnyHash + ) + end + + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + sig { returns(String) } + attr_accessor :id + + # The funding source kind: a Whop balance or a saved card. + sig do + returns( + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + id: String, + type: + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a + # payment method (`payt_`) for `card`. + id:, + # The funding source kind: a Whop balance or a saved card. + type: + ) + end + + sig do + override.returns( + { + id: String, + type: + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # The funding source kind: a Whop balance or a saved card. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PLATFORM_BALANCE = + T.let( + :platform_balance, + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + ) + CARD = + T.let( + :card, + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/ad.rbi b/rbi/whop_sdk/models/ad.rbi index bd5c210f..556c25df 100644 --- a/rbi/whop_sdk/models/ad.rbi +++ b/rbi/whop_sdk/models/ad.rbi @@ -5,229 +5,454 @@ module WhopSDK class Ad < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias { T.any(WhopSDK::Ad, WhopSDK::Internal::AnyHash) } - # The unique identifier for this ad. + # Unique identifier for the ad. sig { returns(String) } attr_accessor :id - # The ad campaign this ad belongs to. + # The ad campaign this ad belongs to, an object with an id. sig { returns(WhopSDK::Ad::AdCampaign) } attr_reader :ad_campaign sig { params(ad_campaign: WhopSDK::Ad::AdCampaign::OrHash).void } attr_writer :ad_campaign - # The parent ad group this ad belongs to. + # The ad group this ad belongs to, an object with an id. sig { returns(WhopSDK::Ad::AdGroup) } attr_reader :ad_group 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). + # Whop pixel-attributed add-to-cart events, last-click. + sig { returns(Float) } + attr_accessor :added_to_carts + + # The call-to-action button shown on the ad. + sig { returns(T.nilable(WhopSDK::Ad::CallToAction::TaggedSymbol)) } + attr_accessor :call_to_action + + # Clicks divided by impressions, between 0 and 1. sig { returns(Float) } attr_accessor :click_through_rate - # Total clicks on this ad in the stats window. - sig { returns(Integer) } + # The number of clicks. + sig { returns(Float) } attr_accessor :clicks - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Whop pixel-attributed complete-registration events, last-click. + sig { returns(Float) } + attr_accessor :completed_registrations + + # Whop pixel-attributed contact events, last-click. + sig { returns(Float) } + attr_accessor :contacts + + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_added_to_cart + + # Spend divided by 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 + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_completed_registration + + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_contact + + # Spend divided by attributed leads; null when leads are not a goal and none are # 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. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. sig { returns(T.nilable(Float)) } attr_accessor :cost_per_result - # When the ad was created. - sig { returns(Time) } + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_schedule + + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_submitted_application + + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_viewed_content + + # When the ad was created, as an ISO 8601 timestamp. + sig { returns(String) } attr_accessor :created_at - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + sig { returns(T::Array[WhopSDK::Ad::Creative]) } + attr_accessor :creatives + + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + sig { returns(Float) } + attr_accessor :custom_conversions + + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + sig { returns(WhopSDK::Ad::DeliveryStatus::TaggedSymbol) } + attr_accessor :delivery_status + + sig { returns(T::Array[String]) } + attr_accessor :descriptions + + # Platform-reported impressions divided by reach. sig { returns(T.nilable(Float)) } attr_accessor :frequency - # Total impressions (views) on this ad in the stats window. - sig { returns(Integer) } + sig { returns(T::Array[String]) } + attr_accessor :headlines + + # The number of impressions. + sig { returns(Float) } 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) } + # The instant lead form on the ad (Meta lead ads), or null when the ad group's + # conversion_location is not an instant-form destination. An object with name, + # form_type (more_volume or higher_intent), an optional intro, questions, a + # privacy_policy, an optional completion screen, and phone_verification. + sig { returns(T.nilable(T.anything)) } + attr_accessor :lead_form + + # The Meta lead form the ad uses. Set when the ad references an existing form via + # lead_form_id, or once a form built from lead_form has been created on Meta at + # launch. + sig { returns(T.nilable(String)) } + attr_accessor :lead_form_id + + # Whop pixel-attributed leads, last-click. + sig { returns(Float) } attr_accessor :leads - # The external ad platform this ad is running on (e.g., meta, tiktok). - sig { returns(WhopSDK::AdCampaignPlatform::TaggedSymbol) } - attr_accessor :platform + # The click-to-message welcome copy, an object with message and keyword, or null + # when the ad has none. + sig { returns(T.nilable(T.anything)) } + attr_accessor :messaging_config + + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + sig { returns(T::Boolean) } + attr_accessor :multi_advertiser_ads + + # The existing post this ad promotes (a Facebook post or Instagram media), or null + # when it uses uploaded creatives. + sig { returns(T.nilable(String)) } + attr_accessor :post_id + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id) — or null when the ad uses uploaded creatives. + sig { returns(T.nilable(WhopSDK::Ad::PostSource::TaggedSymbol)) } + attr_accessor :post_source - # Total USD value of Whop pixel-attributed purchases in the stats window. + # Preview image of the existing post this ad promotes. Null for ads that use + # uploaded creatives, or until the post's media has been fetched from the network. + sig { returns(T.nilable(String)) } + attr_accessor :post_thumbnail_url + + sig { returns(T::Array[String]) } + attr_accessor :primary_texts + + # USD value of pixel-attributed purchases. sig { returns(Float) } attr_accessor :purchase_value - # Number of Whop pixel-attributed purchases (last-click) in the stats window. - sig { returns(Integer) } + # Whop pixel-attributed purchases, last-click. + sig { returns(Float) } attr_accessor :purchases - # Unique users reached in the stats window (deduplicated by the platform). - sig { returns(Integer) } + # The number of unique people who saw this. + sig { returns(Float) } 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. + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + sig { returns(T.nilable(WhopSDK::Ad::ResultEvent::TaggedSymbol)) } + attr_accessor :result_event + + # The merchant-defined event name when result_event is custom; null for the + # standard events. + sig { returns(T.nilable(String)) } + attr_accessor :result_event_name + + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. sig { returns(Float) } attr_accessor :return_on_ad_spend - # Amount charged in dollars in the stats window. + # Whop pixel-attributed schedule events, last-click. + sig { returns(Float) } + attr_accessor :schedules + + sig { returns(T::Array[T.anything]) } + attr_accessor :social_accounts + + # The amount charged, in spend_currency. sig { returns(Float) } attr_accessor :spend - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + # The ISO 4217 currency code of all monetary metrics. + sig { returns(T.nilable(String)) } attr_accessor :spend_currency - # Current delivery status of the ad. - sig { returns(WhopSDK::ExternalAdStatus::TaggedSymbol) } + # The delivery status of the ad. + sig { returns(WhopSDK::Ad::Status::TaggedSymbol) } attr_accessor :status + # Whop pixel-attributed submit-application events, last-click. + sig { returns(Float) } + attr_accessor :submitted_applications + # The display title of the ad. Falls back to the creative set caption when unset. sig { returns(T.nilable(String)) } attr_accessor :title - # Unique click-through rate as a fraction of impressions (unique clicks / - # impressions, 0–1). + # Unique clicks divided by impressions, between 0 and 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) } + # The number of unique clicks. + sig { returns(Float) } attr_accessor :unique_clicks - # When the ad was last updated. - sig { returns(Time) } + # When the ad was last updated, as an ISO 8601 timestamp. + sig { returns(String) } attr_accessor :updated_at - # An ad belonging to an ad group. + # The URL the ad links to. + sig { returns(T.nilable(String)) } + attr_accessor :url + + # Query parameters appended to the URL, as a string-to-string map. + sig { returns(T.anything) } + attr_accessor :url_parameters + + # Whop pixel-attributed view-content events, last-click. + sig { returns(Float) } + attr_accessor :viewed_contents + sig do params( id: String, ad_campaign: WhopSDK::Ad::AdCampaign::OrHash, ad_group: WhopSDK::Ad::AdGroup::OrHash, + added_to_carts: Float, + call_to_action: T.nilable(WhopSDK::Ad::CallToAction::OrSymbol), click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: T.nilable(Float), cost_per_click: Float, + cost_per_completed_registration: T.nilable(Float), + cost_per_contact: T.nilable(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, + cost_per_schedule: T.nilable(Float), + cost_per_submitted_application: T.nilable(Float), + cost_per_viewed_content: T.nilable(Float), + created_at: String, + creatives: T::Array[WhopSDK::Ad::Creative::OrHash], + custom_conversions: Float, + delivery_status: WhopSDK::Ad::DeliveryStatus::OrSymbol, + descriptions: T::Array[String], frequency: T.nilable(Float), - impressions: Integer, + headlines: T::Array[String], + impressions: Float, issues: T::Array[WhopSDK::Ad::Issue::OrHash], - leads: Integer, - platform: WhopSDK::AdCampaignPlatform::OrSymbol, + lead_form: T.nilable(T.anything), + lead_form_id: T.nilable(String), + leads: Float, + messaging_config: T.nilable(T.anything), + multi_advertiser_ads: T::Boolean, + post_id: T.nilable(String), + post_source: T.nilable(WhopSDK::Ad::PostSource::OrSymbol), + post_thumbnail_url: T.nilable(String), + primary_texts: T::Array[String], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: T.nilable(WhopSDK::Ad::ResultEvent::OrSymbol), + result_event_name: T.nilable(String), return_on_ad_spend: Float, + schedules: Float, + social_accounts: T::Array[T.anything], spend: Float, - spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), - status: WhopSDK::ExternalAdStatus::OrSymbol, + spend_currency: T.nilable(String), + status: WhopSDK::Ad::Status::OrSymbol, + submitted_applications: Float, title: T.nilable(String), unique_click_through_rate: T.nilable(Float), - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: T.nilable(String), + url_parameters: T.anything, + viewed_contents: Float ).returns(T.attached_class) end def self.new( - # The unique identifier for this ad. + # Unique identifier for the ad. id:, - # The ad campaign this ad belongs to. + # The ad campaign this ad belongs to, an object with an id. ad_campaign:, - # The parent ad group this ad belongs to. + # The ad group this ad belongs to, an object with an id. ad_group:, - # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # Whop pixel-attributed add-to-cart events, last-click. + added_to_carts:, + # The call-to-action button shown on the ad. + call_to_action:, + # Clicks divided by impressions, between 0 and 1. click_through_rate:, - # Total clicks on this ad in the stats window. + # The number of clicks. clicks:, - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Whop pixel-attributed complete-registration events, last-click. + completed_registrations:, + # Whop pixel-attributed contact events, last-click. + contacts:, + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + cost_per_added_to_cart:, + # Spend divided by 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 + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + cost_per_completed_registration:, + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + cost_per_contact:, + # Spend divided by attributed leads; null when leads are not a goal and none are # attributed. cost_per_lead:, - # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there - # are no impressions. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. cost_per_result:, - # When the ad was created. + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + cost_per_schedule:, + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + cost_per_submitted_application:, + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + cost_per_viewed_content:, + # When the ad was created, as an ISO 8601 timestamp. created_at:, - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + creatives:, + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + custom_conversions:, + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + delivery_status:, + descriptions:, + # Platform-reported impressions divided by reach. frequency:, - # Total impressions (views) on this ad in the stats window. + headlines:, + # The number of impressions. 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. + # The instant lead form on the ad (Meta lead ads), or null when the ad group's + # conversion_location is not an instant-form destination. An object with name, + # form_type (more_volume or higher_intent), an optional intro, questions, a + # privacy_policy, an optional completion screen, and phone_verification. + lead_form:, + # The Meta lead form the ad uses. Set when the ad references an existing form via + # lead_form_id, or once a form built from lead_form has been created on Meta at + # launch. + lead_form_id:, + # Whop pixel-attributed leads, last-click. 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. + # The click-to-message welcome copy, an object with message and keyword, or null + # when the ad has none. + messaging_config:, + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + multi_advertiser_ads:, + # The existing post this ad promotes (a Facebook post or Instagram media), or null + # when it uses uploaded creatives. + post_id:, + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id) — or null when the ad uses uploaded creatives. + post_source:, + # Preview image of the existing post this ad promotes. Null for ads that use + # uploaded creatives, or until the post's media has been fetched from the network. + post_thumbnail_url:, + primary_texts:, + # USD value of pixel-attributed purchases. purchase_value:, - # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # Whop pixel-attributed purchases, last-click. purchases:, - # Unique users reached in the stats window (deduplicated by the platform). + # The number of unique people who saw this. 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. + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + result_event:, + # The merchant-defined event name when result_event is custom; null for the + # standard events. + result_event_name:, + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. return_on_ad_spend:, - # Amount charged in dollars in the stats window. + # Whop pixel-attributed schedule events, last-click. + schedules:, + social_accounts:, + # The amount charged, in spend_currency. spend:, - # The available currencies on the platform + # The ISO 4217 currency code of all monetary metrics. spend_currency:, - # Current delivery status of the ad. + # The delivery status of the ad. status:, + # Whop pixel-attributed submit-application events, last-click. + submitted_applications:, # 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 clicks divided by impressions, between 0 and 1. unique_click_through_rate:, - # Unique clicks (deduplicated by the platform) in the stats window. + # The number of unique clicks. unique_clicks:, - # When the ad was last updated. - updated_at: + # When the ad was last updated, as an ISO 8601 timestamp. + updated_at:, + # The URL the ad links to. + url:, + # Query parameters appended to the URL, as a string-to-string map. + url_parameters:, + # Whop pixel-attributed view-content events, last-click. + viewed_contents: ) end @@ -237,30 +462,60 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: T.nilable(WhopSDK::Ad::CallToAction::TaggedSymbol), click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: T.nilable(Float), cost_per_click: Float, + cost_per_completed_registration: T.nilable(Float), + cost_per_contact: T.nilable(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, + cost_per_schedule: T.nilable(Float), + cost_per_submitted_application: T.nilable(Float), + cost_per_viewed_content: T.nilable(Float), + created_at: String, + creatives: T::Array[WhopSDK::Ad::Creative], + custom_conversions: Float, + delivery_status: WhopSDK::Ad::DeliveryStatus::TaggedSymbol, + descriptions: T::Array[String], frequency: T.nilable(Float), - impressions: Integer, + headlines: T::Array[String], + impressions: Float, issues: T::Array[WhopSDK::Ad::Issue], - leads: Integer, - platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + lead_form: T.nilable(T.anything), + lead_form_id: T.nilable(String), + leads: Float, + messaging_config: T.nilable(T.anything), + multi_advertiser_ads: T::Boolean, + post_id: T.nilable(String), + post_source: T.nilable(WhopSDK::Ad::PostSource::TaggedSymbol), + post_thumbnail_url: T.nilable(String), + primary_texts: T::Array[String], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: T.nilable(WhopSDK::Ad::ResultEvent::TaggedSymbol), + result_event_name: T.nilable(String), return_on_ad_spend: Float, + schedules: Float, + social_accounts: T::Array[T.anything], spend: Float, - spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), - status: WhopSDK::ExternalAdStatus::TaggedSymbol, + spend_currency: T.nilable(String), + status: WhopSDK::Ad::Status::TaggedSymbol, + submitted_applications: Float, title: T.nilable(String), unique_click_through_rate: T.nilable(Float), - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: T.nilable(String), + url_parameters: T.anything, + viewed_contents: Float } ) end @@ -273,14 +528,14 @@ module WhopSDK T.any(WhopSDK::Ad::AdCampaign, WhopSDK::Internal::AnyHash) end - # The unique identifier for this ad campaign. + # The referenced entity's id. sig { returns(String) } attr_accessor :id - # The ad campaign this ad belongs to. + # The ad campaign this ad belongs to, an object with an id. sig { params(id: String).returns(T.attached_class) } def self.new( - # The unique identifier for this ad campaign. + # The referenced entity's id. id: ) end @@ -296,14 +551,14 @@ module WhopSDK T.any(WhopSDK::Ad::AdGroup, WhopSDK::Internal::AnyHash) end - # The unique identifier for this ad group. + # The referenced entity's id. sig { returns(String) } attr_accessor :id - # The parent ad group this ad belongs to. + # The ad group this ad belongs to, an object with an id. sig { params(id: String).returns(T.attached_class) } def self.new( - # The unique identifier for this ad group. + # The referenced entity's id. id: ) end @@ -313,139 +568,386 @@ module WhopSDK end end - class Issue < WhopSDK::Internal::Type::BaseModel + # The call-to-action button shown on the ad. + module CallToAction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Ad::CallToAction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LEARN_MORE = T.let(:learn_more, WhopSDK::Ad::CallToAction::TaggedSymbol) + SHOP_NOW = T.let(:shop_now, WhopSDK::Ad::CallToAction::TaggedSymbol) + SIGN_UP = T.let(:sign_up, WhopSDK::Ad::CallToAction::TaggedSymbol) + SUBSCRIBE = T.let(:subscribe, WhopSDK::Ad::CallToAction::TaggedSymbol) + GET_STARTED = + T.let(:get_started, WhopSDK::Ad::CallToAction::TaggedSymbol) + BOOK_NOW = T.let(:book_now, WhopSDK::Ad::CallToAction::TaggedSymbol) + APPLY_NOW = T.let(:apply_now, WhopSDK::Ad::CallToAction::TaggedSymbol) + CONTACT_US = T.let(:contact_us, WhopSDK::Ad::CallToAction::TaggedSymbol) + DOWNLOAD = T.let(:download, WhopSDK::Ad::CallToAction::TaggedSymbol) + ORDER_NOW = T.let(:order_now, WhopSDK::Ad::CallToAction::TaggedSymbol) + BUY_NOW = T.let(:buy_now, WhopSDK::Ad::CallToAction::TaggedSymbol) + GET_QUOTE = T.let(:get_quote, WhopSDK::Ad::CallToAction::TaggedSymbol) + MESSAGE_PAGE = + T.let(:message_page, WhopSDK::Ad::CallToAction::TaggedSymbol) + WHATSAPP_MESSAGE = + T.let(:whatsapp_message, WhopSDK::Ad::CallToAction::TaggedSymbol) + INSTAGRAM_MESSAGE = + T.let(:instagram_message, WhopSDK::Ad::CallToAction::TaggedSymbol) + CALL_NOW = T.let(:call_now, WhopSDK::Ad::CallToAction::TaggedSymbol) + GET_DIRECTIONS = + T.let(:get_directions, WhopSDK::Ad::CallToAction::TaggedSymbol) + SEND_UPDATES = + T.let(:send_updates, WhopSDK::Ad::CallToAction::TaggedSymbol) + GET_OFFER = T.let(:get_offer, WhopSDK::Ad::CallToAction::TaggedSymbol) + WATCH_MORE = T.let(:watch_more, WhopSDK::Ad::CallToAction::TaggedSymbol) + LISTEN_NOW = T.let(:listen_now, WhopSDK::Ad::CallToAction::TaggedSymbol) + PLAY_GAME = T.let(:play_game, WhopSDK::Ad::CallToAction::TaggedSymbol) + OPEN_LINK = T.let(:open_link, WhopSDK::Ad::CallToAction::TaggedSymbol) + NO_BUTTON = T.let(:no_button, WhopSDK::Ad::CallToAction::TaggedSymbol) + GET_OFFER_VIEW = + T.let(:get_offer_view, WhopSDK::Ad::CallToAction::TaggedSymbol) + GET_EVENT_TICKETS = + T.let(:get_event_tickets, WhopSDK::Ad::CallToAction::TaggedSymbol) + SEE_MENU = T.let(:see_menu, WhopSDK::Ad::CallToAction::TaggedSymbol) + REQUEST_TIME = + T.let(:request_time, WhopSDK::Ad::CallToAction::TaggedSymbol) + EVENT_RSVP = T.let(:event_rsvp, WhopSDK::Ad::CallToAction::TaggedSymbol) + SEE_DETAILS = + T.let(:see_details, WhopSDK::Ad::CallToAction::TaggedSymbol) + VIEW_INSTAGRAM_PROFILE = + T.let( + :view_instagram_profile, + WhopSDK::Ad::CallToAction::TaggedSymbol + ) + + sig do + override.returns(T::Array[WhopSDK::Ad::CallToAction::TaggedSymbol]) + end + def self.values + end + end + + class Creative < WhopSDK::Internal::Type::BaseModel OrHash = - T.type_alias { T.any(WhopSDK::Ad::Issue, WhopSDK::Internal::AnyHash) } + T.type_alias do + T.any(WhopSDK::Ad::Creative, WhopSDK::Internal::AnyHash) + end - # Whop's canonical category that a raw platform issue is bucketed into. - sig { returns(T.nilable(WhopSDK::Ad::Issue::Category::TaggedSymbol)) } - attr_accessor :category + # The creative attachment's file id. + sig { returns(String) } + attr_accessor :id - # When the issue was first reported. - sig { returns(Time) } - attr_accessor :created_at + # The saved crop window for this creative, in source image pixels. Null for the + # original asset or a format that has not been cropped. + sig { returns(T.nilable(WhopSDK::Ad::Creative::Crop)) } + attr_reader :crop + + sig do + params(crop: T.nilable(WhopSDK::Ad::Creative::Crop::OrHash)).void + end + attr_writer :crop - # Current resolution status. - sig { returns(WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol) } - attr_accessor :resolution_status + # The placement variant this asset covers, or null for the original asset. + sig { returns(T.nilable(WhopSDK::Ad::Creative::Format::TaggedSymbol)) } + attr_accessor :format_ - # 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. + # The kind of asset, image or video. 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 + attr_accessor :media_type - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). + # CDN url of the asset. sig { returns(T.nilable(String)) } - attr_accessor :subtype + attr_accessor :url - # A platform-reported issue on an ad object (rejection, policy flag, etc.). + # The creative assets used by this ad. The original asset has a null format; + # square, vertical, and horizontal entries are placement-specific variants. sig do params( - category: T.nilable(WhopSDK::Ad::Issue::Category::OrSymbol), - created_at: Time, - resolution_status: WhopSDK::Ad::Issue::ResolutionStatus::OrSymbol, - resource_id: T.nilable(String), - resource_type: String, - subtype: T.nilable(String) + id: String, + crop: T.nilable(WhopSDK::Ad::Creative::Crop::OrHash), + format_: T.nilable(WhopSDK::Ad::Creative::Format::OrSymbol), + media_type: T.nilable(String), + url: 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:, - # 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:, - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). - subtype: + # The creative attachment's file id. + id:, + # The saved crop window for this creative, in source image pixels. Null for the + # original asset or a format that has not been cropped. + crop:, + # The placement variant this asset covers, or null for the original asset. + format_:, + # The kind of asset, image or video. + media_type:, + # CDN url of the asset. + url: ) end sig do override.returns( { - category: T.nilable(WhopSDK::Ad::Issue::Category::TaggedSymbol), - created_at: Time, - resolution_status: - WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol, - resource_id: T.nilable(String), - resource_type: String, - subtype: T.nilable(String) + id: String, + crop: T.nilable(WhopSDK::Ad::Creative::Crop), + format_: T.nilable(WhopSDK::Ad::Creative::Format::TaggedSymbol), + media_type: T.nilable(String), + url: T.nilable(String) } ) end def to_hash end - # Whop's canonical category that a raw platform issue is bucketed into. - module Category + class Crop < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Ad::Creative::Crop, WhopSDK::Internal::AnyHash) + end + + # Height of the crop window in source pixels. + sig { returns(Float) } + attr_accessor :height + + # Width of the crop window in source pixels. + sig { returns(Float) } + attr_accessor :width + + # Left edge of the crop window in source pixels. + sig { returns(Float) } + attr_accessor :x + + # Top edge of the crop window in source pixels. + sig { returns(Float) } + attr_accessor :y_ + + # The saved crop window for this creative, in source image pixels. Null for the + # original asset or a format that has not been cropped. + sig do + params(height: Float, width: Float, x: Float, y_: Float).returns( + T.attached_class + ) + end + def self.new( + # Height of the crop window in source pixels. + height:, + # Width of the crop window in source pixels. + width:, + # Left edge of the crop window in source pixels. + x:, + # Top edge of the crop window in source pixels. + y_: + ) + end + + sig do + override.returns( + { height: Float, width: Float, x: Float, y_: Float } + ) + end + def to_hash + end + end + + # The placement variant this asset covers, or null for the original asset. + module Format extend WhopSDK::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::Ad::Issue::Category) } + T.type_alias { T.all(Symbol, WhopSDK::Ad::Creative::Format) } 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) + SQUARE = T.let(:square, WhopSDK::Ad::Creative::Format::TaggedSymbol) + VERTICAL = + T.let(:vertical, WhopSDK::Ad::Creative::Format::TaggedSymbol) + HORIZONTAL = + T.let(:horizontal, WhopSDK::Ad::Creative::Format::TaggedSymbol) sig do override.returns( - T::Array[WhopSDK::Ad::Issue::Category::TaggedSymbol] + T::Array[WhopSDK::Ad::Creative::Format::TaggedSymbol] ) end def self.values end end + end - # Current resolution status. - module ResolutionStatus + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::Ad::DeliveryStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REJECTED = T.let(:rejected, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + IN_REVIEW = T.let(:in_review, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + DRAFT = T.let(:draft, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + CAMPAIGN_PAUSED = + T.let(:campaign_paused, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + AD_GROUP_PAUSED = + T.let(:ad_group_paused, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + PAUSED = T.let(:paused, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + PROCESSING = + T.let(:processing, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + ISSUES = T.let(:issues, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + LEARNING_LIMITED = + T.let(:learning_limited, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + LEARNING = T.let(:learning, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + ACTIVE = T.let(:active, WhopSDK::Ad::DeliveryStatus::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::Ad::DeliveryStatus::TaggedSymbol]) + end + def self.values + end + end + + class Issue < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(WhopSDK::Ad::Issue, WhopSDK::Internal::AnyHash) } + + # Unique identifier for the issue. + sig { returns(String) } + attr_accessor :id + + # A description of what the issue is and how it can be resolved. + sig { returns(String) } + attr_accessor :message + + # The ID of the campaign, ad group, or ad the issue is attached to. + sig { returns(T.nilable(String)) } + attr_accessor :resource_id + + # The type of resource the issue is attached to. + sig { returns(WhopSDK::Ad::Issue::ResourceType::TaggedSymbol) } + attr_accessor :resource_type + + # Open issues affecting this ad. Empty when there are none. + sig do + params( + id: String, + message: String, + resource_id: T.nilable(String), + resource_type: WhopSDK::Ad::Issue::ResourceType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the issue. + id:, + # A description of what the issue is and how it can be resolved. + message:, + # The ID of the campaign, ad group, or ad the issue is attached to. + resource_id:, + # The type of resource the issue is attached to. + resource_type: + ) + end + + sig do + override.returns( + { + id: String, + message: String, + resource_id: T.nilable(String), + resource_type: WhopSDK::Ad::Issue::ResourceType::TaggedSymbol + } + ) + end + def to_hash + end + + # The type of resource the issue is attached to. + module ResourceType extend WhopSDK::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::Ad::Issue::ResolutionStatus) } + T.type_alias { T.all(Symbol, WhopSDK::Ad::Issue::ResourceType) } 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 - ) + AD_CAMPAIGN = + T.let(:ad_campaign, WhopSDK::Ad::Issue::ResourceType::TaggedSymbol) + AD_GROUP = + T.let(:ad_group, WhopSDK::Ad::Issue::ResourceType::TaggedSymbol) + AD = T.let(:ad, WhopSDK::Ad::Issue::ResourceType::TaggedSymbol) sig do override.returns( - T::Array[WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol] + T::Array[WhopSDK::Ad::Issue::ResourceType::TaggedSymbol] ) end def self.values end end end + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id) — or null when the ad uses uploaded creatives. + module PostSource + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Ad::PostSource) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FACEBOOK = T.let(:facebook, WhopSDK::Ad::PostSource::TaggedSymbol) + INSTAGRAM = T.let(:instagram, WhopSDK::Ad::PostSource::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::Ad::PostSource::TaggedSymbol]) + end + def self.values + end + end + + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Ad::ResultEvent) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PURCHASE = T.let(:purchase, WhopSDK::Ad::ResultEvent::TaggedSymbol) + LEAD = T.let(:lead, WhopSDK::Ad::ResultEvent::TaggedSymbol) + SCHEDULE = T.let(:schedule, WhopSDK::Ad::ResultEvent::TaggedSymbol) + SUBMIT_APPLICATION = + T.let(:submit_application, WhopSDK::Ad::ResultEvent::TaggedSymbol) + CONTACT = T.let(:contact, WhopSDK::Ad::ResultEvent::TaggedSymbol) + COMPLETE_REGISTRATION = + T.let(:complete_registration, WhopSDK::Ad::ResultEvent::TaggedSymbol) + VIEW_CONTENT = + T.let(:view_content, WhopSDK::Ad::ResultEvent::TaggedSymbol) + ADD_TO_CART = + T.let(:add_to_cart, WhopSDK::Ad::ResultEvent::TaggedSymbol) + CUSTOM = T.let(:custom, WhopSDK::Ad::ResultEvent::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::Ad::ResultEvent::TaggedSymbol]) + end + def self.values + end + end + + # The delivery status of the ad. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Ad::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = T.let(:active, WhopSDK::Ad::Status::TaggedSymbol) + PAUSED = T.let(:paused, WhopSDK::Ad::Status::TaggedSymbol) + IN_REVIEW = T.let(:in_review, WhopSDK::Ad::Status::TaggedSymbol) + REJECTED = T.let(:rejected, WhopSDK::Ad::Status::TaggedSymbol) + + sig { override.returns(T::Array[WhopSDK::Ad::Status::TaggedSymbol]) } + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/ad_budget_type.rbi b/rbi/whop_sdk/models/ad_budget_type.rbi deleted file mode 100644 index 2f17d02f..00000000 --- a/rbi/whop_sdk/models/ad_budget_type.rbi +++ /dev/null @@ -1,20 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - # The budget type for an ad campaign or ad group. - module AdBudgetType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::AdBudgetType) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - DAILY = T.let(:daily, WhopSDK::AdBudgetType::TaggedSymbol) - LIFETIME = T.let(:lifetime, WhopSDK::AdBudgetType::TaggedSymbol) - - sig { override.returns(T::Array[WhopSDK::AdBudgetType::TaggedSymbol]) } - def self.values - end - end - end -end diff --git a/rbi/whop_sdk/models/ad_campaign.rbi b/rbi/whop_sdk/models/ad_campaign.rbi index 5e6c36be..fc8ebd15 100644 --- a/rbi/whop_sdk/models/ad_campaign.rbi +++ b/rbi/whop_sdk/models/ad_campaign.rbi @@ -6,223 +6,383 @@ module WhopSDK OrHash = T.type_alias { T.any(WhopSDK::AdCampaign, WhopSDK::Internal::AnyHash) } - # The unique identifier for this ad campaign. + # Unique identifier for the ad campaign. sig { returns(String) } attr_accessor :id - # Total budget in dollars. + # Whop pixel-attributed add-to-cart events, last-click. + sig { returns(Float) } + attr_accessor :added_to_carts + + # The bidding strategy the campaign uses. + sig { returns(T.nilable(WhopSDK::AdCampaign::BidType::TaggedSymbol)) } + attr_accessor :bid_type + + # The campaign budget in USD. Null when budget is set at the ad group level (ABO). sig { returns(T.nilable(Float)) } - attr_accessor :budget + attr_accessor :budget_amount - # The budget type for an ad campaign or ad group. - sig { returns(T.nilable(WhopSDK::AdBudgetType::TaggedSymbol)) } + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + sig do + returns( + T.nilable(WhopSDK::AdCampaign::BudgetOptimization::TaggedSymbol) + ) + end + attr_accessor :budget_optimization + + # Whether the budget is spent per day or over the campaign's lifetime. + sig { returns(T.nilable(WhopSDK::AdCampaign::BudgetType::TaggedSymbol)) } attr_accessor :budget_type - # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # Clicks divided by impressions, between 0 and 1. sig { returns(Float) } attr_accessor :click_through_rate - # Total clicks on the campaign's ads in the stats window. - sig { returns(Integer) } + # The number of clicks. + sig { returns(Float) } attr_accessor :clicks - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Whop pixel-attributed complete-registration events, last-click. + sig { returns(Float) } + attr_accessor :completed_registrations + + # Whop pixel-attributed contact events, last-click. + sig { returns(Float) } + attr_accessor :contacts + + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_added_to_cart + + # Spend divided by 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 + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_completed_registration + + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_contact + + # Spend divided by attributed leads; null when leads are not a goal and none are # 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. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. sig { returns(T.nilable(Float)) } attr_accessor :cost_per_result - # When the ad campaign was created. - sig { returns(Time) } + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_schedule + + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_submitted_application + + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_viewed_content + + # When the campaign was created, as an ISO 8601 timestamp. + sig { returns(String) } attr_accessor :created_at - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + sig { returns(Float) } + attr_accessor :custom_conversions + + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + sig { returns(WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) } + attr_accessor :delivery_status + + # Platform-reported impressions divided by reach. sig { returns(T.nilable(Float)) } attr_accessor :frequency - # Total impressions (views) on the campaign's ads in the stats window. - sig { returns(Integer) } + # The number of impressions. + sig { returns(Float) } 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::AdCampaign::Issue]) } attr_accessor :issues - # Number of Whop pixel-attributed leads (last-click) in the stats window. - sig { returns(Integer) } + # Whop pixel-attributed leads, last-click. + sig { returns(Float) } attr_accessor :leads - # The external ad platform this campaign is running on (e.g., meta, tiktok). - sig { returns(WhopSDK::AdCampaignPlatform::TaggedSymbol) } + # The goal the campaign optimizes toward. + sig { returns(T.nilable(WhopSDK::AdCampaign::Objective::TaggedSymbol)) } + attr_accessor :objective + + # The specific event the campaign optimizes for. If the campaign is CBO, then all + # ad groups will have the same optimization goal, which will be returned here. + sig { returns(T.nilable(String)) } + attr_accessor :optimization_goal + + # The ad network the campaign runs on. + sig { returns(WhopSDK::AdCampaign::Platform::TaggedSymbol) } attr_accessor :platform - # Total USD value of Whop pixel-attributed purchases in the stats window. + # USD value of pixel-attributed purchases. sig { returns(Float) } attr_accessor :purchase_value - # Number of Whop pixel-attributed purchases (last-click) in the stats window. - sig { returns(Integer) } + # Whop pixel-attributed purchases, last-click. + sig { returns(Float) } attr_accessor :purchases - # Unique users reached in the stats window (deduplicated by the platform). - sig { returns(Integer) } + # The number of unique people who saw this. + sig { returns(Float) } 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. + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + sig { returns(T.nilable(WhopSDK::AdCampaign::ResultEvent::TaggedSymbol)) } + attr_accessor :result_event + + # The merchant-defined event name when result_event is custom; null for the + # standard events. + sig { returns(T.nilable(String)) } + attr_accessor :result_event_name + + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. sig { returns(Float) } attr_accessor :return_on_ad_spend - # Amount charged in dollars in the stats window. + # Whop pixel-attributed schedule events, last-click. + sig { returns(Float) } + attr_accessor :schedules + + sig do + returns(T::Array[WhopSDK::AdCampaign::SpecialAdCategory::TaggedSymbol]) + end + attr_accessor :special_ad_categories + + # The amount charged, in spend_currency. sig { returns(Float) } attr_accessor :spend - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + # The ISO 4217 currency code of all monetary metrics. + sig { returns(T.nilable(String)) } attr_accessor :spend_currency - # Current status of the campaign. - sig { returns(WhopSDK::AdCampaignStatus::TaggedSymbol) } + # The lifecycle status of the ad campaign. + sig { returns(WhopSDK::AdCampaign::Status::TaggedSymbol) } attr_accessor :status - # The campaign name shown in the Whop dashboard. + # Whop pixel-attributed submit-application events, last-click. + sig { returns(Float) } + attr_accessor :submitted_applications + + # The title of the ad campaign. sig { returns(String) } attr_accessor :title - # Unique click-through rate as a fraction of impressions (unique clicks / - # impressions, 0–1). + # Unique clicks divided by impressions, between 0 and 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) } + # The number of unique clicks. + sig { returns(Float) } attr_accessor :unique_clicks - # When the ad campaign was last updated. - sig { returns(Time) } + # When the campaign was last updated, as an ISO 8601 timestamp. + sig { returns(String) } attr_accessor :updated_at - # An advertising campaign running on an external platform or within Whop. + # Whop pixel-attributed view-content events, last-click. + sig { returns(Float) } + attr_accessor :viewed_contents + sig do params( id: String, - budget: T.nilable(Float), - budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), + added_to_carts: Float, + bid_type: T.nilable(WhopSDK::AdCampaign::BidType::OrSymbol), + budget_amount: T.nilable(Float), + budget_optimization: + T.nilable(WhopSDK::AdCampaign::BudgetOptimization::OrSymbol), + budget_type: T.nilable(WhopSDK::AdCampaign::BudgetType::OrSymbol), click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: T.nilable(Float), cost_per_click: Float, + cost_per_completed_registration: T.nilable(Float), + cost_per_contact: T.nilable(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, + cost_per_schedule: T.nilable(Float), + cost_per_submitted_application: T.nilable(Float), + cost_per_viewed_content: T.nilable(Float), + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdCampaign::DeliveryStatus::OrSymbol, frequency: T.nilable(Float), - impressions: Integer, + impressions: Float, issues: T::Array[WhopSDK::AdCampaign::Issue::OrHash], - leads: Integer, - platform: WhopSDK::AdCampaignPlatform::OrSymbol, + leads: Float, + objective: T.nilable(WhopSDK::AdCampaign::Objective::OrSymbol), + optimization_goal: T.nilable(String), + platform: WhopSDK::AdCampaign::Platform::OrSymbol, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: T.nilable(WhopSDK::AdCampaign::ResultEvent::OrSymbol), + result_event_name: T.nilable(String), return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: + T::Array[WhopSDK::AdCampaign::SpecialAdCategory::OrSymbol], spend: Float, - spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), - status: WhopSDK::AdCampaignStatus::OrSymbol, + spend_currency: T.nilable(String), + status: WhopSDK::AdCampaign::Status::OrSymbol, + submitted_applications: Float, title: String, unique_click_through_rate: T.nilable(Float), - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float ).returns(T.attached_class) end def self.new( - # The unique identifier for this ad campaign. + # Unique identifier for the ad campaign. id:, - # Total budget in dollars. - budget:, - # The budget type for an ad campaign or ad group. + # Whop pixel-attributed add-to-cart events, last-click. + added_to_carts:, + # The bidding strategy the campaign uses. + bid_type:, + # The campaign budget in USD. Null when budget is set at the ad group level (ABO). + budget_amount:, + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + budget_optimization:, + # Whether the budget is spent per day or over the campaign's lifetime. budget_type:, - # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # Clicks divided by impressions, between 0 and 1. click_through_rate:, - # Total clicks on the campaign's ads in the stats window. + # The number of clicks. clicks:, - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Whop pixel-attributed complete-registration events, last-click. + completed_registrations:, + # Whop pixel-attributed contact events, last-click. + contacts:, + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + cost_per_added_to_cart:, + # Spend divided by 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 + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + cost_per_completed_registration:, + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + cost_per_contact:, + # Spend divided by attributed leads; null when leads are not a goal and none are # attributed. cost_per_lead:, - # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there - # are no impressions. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. cost_per_result:, - # When the ad campaign was created. + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + cost_per_schedule:, + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + cost_per_submitted_application:, + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + cost_per_viewed_content:, + # When the campaign was created, as an ISO 8601 timestamp. created_at:, - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + custom_conversions:, + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + delivery_status:, + # Platform-reported impressions divided by reach. frequency:, - # Total impressions (views) on the campaign's ads in the stats window. + # The number of impressions. 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. + # Whop pixel-attributed leads, last-click. leads:, - # The external ad platform this campaign is running on (e.g., meta, tiktok). + # The goal the campaign optimizes toward. + objective:, + # The specific event the campaign optimizes for. If the campaign is CBO, then all + # ad groups will have the same optimization goal, which will be returned here. + optimization_goal:, + # The ad network the campaign runs on. platform:, - # Total USD value of Whop pixel-attributed purchases in the stats window. + # USD value of pixel-attributed purchases. purchase_value:, - # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # Whop pixel-attributed purchases, last-click. purchases:, - # Unique users reached in the stats window (deduplicated by the platform). + # The number of unique people who saw this. 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. + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + result_event:, + # The merchant-defined event name when result_event is custom; null for the + # standard events. + result_event_name:, + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. return_on_ad_spend:, - # Amount charged in dollars in the stats window. + # Whop pixel-attributed schedule events, last-click. + schedules:, + special_ad_categories:, + # The amount charged, in spend_currency. spend:, - # The available currencies on the platform + # The ISO 4217 currency code of all monetary metrics. spend_currency:, - # Current status of the campaign. + # The lifecycle status of the ad campaign. status:, - # The campaign name shown in the Whop dashboard. + # Whop pixel-attributed submit-application events, last-click. + submitted_applications:, + # The title of the ad campaign. title:, - # Unique click-through rate as a fraction of impressions (unique clicks / - # impressions, 0–1). + # Unique clicks divided by impressions, between 0 and 1. unique_click_through_rate:, - # Unique clicks (deduplicated by the platform) in the stats window. + # The number of unique clicks. unique_clicks:, - # When the ad campaign was last updated. - updated_at: + # When the campaign was last updated, as an ISO 8601 timestamp. + updated_at:, + # Whop pixel-attributed view-content events, last-click. + viewed_contents: ) end @@ -230,196 +390,425 @@ module WhopSDK override.returns( { id: String, - budget: T.nilable(Float), - budget_type: T.nilable(WhopSDK::AdBudgetType::TaggedSymbol), + added_to_carts: Float, + bid_type: T.nilable(WhopSDK::AdCampaign::BidType::TaggedSymbol), + budget_amount: T.nilable(Float), + budget_optimization: + T.nilable(WhopSDK::AdCampaign::BudgetOptimization::TaggedSymbol), + budget_type: + T.nilable(WhopSDK::AdCampaign::BudgetType::TaggedSymbol), click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: T.nilable(Float), cost_per_click: Float, + cost_per_completed_registration: T.nilable(Float), + cost_per_contact: T.nilable(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, + cost_per_schedule: T.nilable(Float), + cost_per_submitted_application: T.nilable(Float), + cost_per_viewed_content: T.nilable(Float), + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol, frequency: T.nilable(Float), - impressions: Integer, + impressions: Float, issues: T::Array[WhopSDK::AdCampaign::Issue], - leads: Integer, - platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + leads: Float, + objective: T.nilable(WhopSDK::AdCampaign::Objective::TaggedSymbol), + optimization_goal: T.nilable(String), + platform: WhopSDK::AdCampaign::Platform::TaggedSymbol, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: + T.nilable(WhopSDK::AdCampaign::ResultEvent::TaggedSymbol), + result_event_name: T.nilable(String), return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: + T::Array[WhopSDK::AdCampaign::SpecialAdCategory::TaggedSymbol], spend: Float, - spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), - status: WhopSDK::AdCampaignStatus::TaggedSymbol, + spend_currency: T.nilable(String), + status: WhopSDK::AdCampaign::Status::TaggedSymbol, + submitted_applications: Float, title: String, unique_click_through_rate: T.nilable(Float), - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } ) end def to_hash end - class Issue < WhopSDK::Internal::Type::BaseModel - OrHash = + # The bidding strategy the campaign uses. + module BidType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::BidType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MINIMUM_COST = + T.let(:minimum_cost, WhopSDK::AdCampaign::BidType::TaggedSymbol) + AVERAGE_TARGET = + T.let(:average_target, WhopSDK::AdCampaign::BidType::TaggedSymbol) + MAXIMUM_TARGET = + T.let(:maximum_target, WhopSDK::AdCampaign::BidType::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::AdCampaign::BidType::TaggedSymbol]) + end + def self.values + end + end + + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias do - T.any(WhopSDK::AdCampaign::Issue, WhopSDK::Internal::AnyHash) + T.all(Symbol, WhopSDK::AdCampaign::BudgetOptimization) end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD_CAMPAIGN = + T.let( + :ad_campaign, + WhopSDK::AdCampaign::BudgetOptimization::TaggedSymbol + ) + AD_GROUP = + T.let( + :ad_group, + WhopSDK::AdCampaign::BudgetOptimization::TaggedSymbol + ) - # Whop's canonical category that a raw platform issue is bucketed into. sig do - returns(T.nilable(WhopSDK::AdCampaign::Issue::Category::TaggedSymbol)) + override.returns( + T::Array[WhopSDK::AdCampaign::BudgetOptimization::TaggedSymbol] + ) + end + def self.values end - attr_accessor :category + end + + # Whether the budget is spent per day or over the campaign's lifetime. + module BudgetType + extend WhopSDK::Internal::Type::Enum - # When the issue was first reported. - sig { returns(Time) } - attr_accessor :created_at + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::BudgetType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAILY = T.let(:daily, WhopSDK::AdCampaign::BudgetType::TaggedSymbol) + LIFETIME = + T.let(:lifetime, WhopSDK::AdCampaign::BudgetType::TaggedSymbol) - # Current resolution status. sig do - returns(WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol) + override.returns( + T::Array[WhopSDK::AdCampaign::BudgetType::TaggedSymbol] + ) end - attr_accessor :resolution_status + def self.values + end + end - # 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 current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::DeliveryStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYMENT_FAILED = + T.let( + :payment_failed, + WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol + ) + ALL_ADS_REJECTED = + T.let( + :all_ads_rejected, + WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol + ) + DRAFT = T.let(:draft, WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) + NO_AD_GROUPS = + T.let( + :no_ad_groups, + WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol + ) + NO_ADS = + T.let(:no_ads, WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) + PAUSED = + T.let(:paused, WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) + PROCESSING = + T.let(:processing, WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) + ISSUES = + T.let(:issues, WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) + SCHEDULED = + T.let(:scheduled, WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) + COMPLETED = + T.let(:completed, WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) + AD_GROUPS_OFF = + T.let( + :ad_groups_off, + WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol + ) + ACTIVE = + T.let(:active, WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol] + ) + end + def self.values + end + end + + class Issue < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::AdCampaign::Issue, WhopSDK::Internal::AnyHash) + end - # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. - # Pairs with `resourceId`. + # Unique identifier for the issue. sig { returns(String) } - attr_accessor :resource_type + attr_accessor :id + + # A description of what the issue is and how it can be resolved. + sig { returns(String) } + attr_accessor :message - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). + # The ID of the campaign, ad group, or ad the issue is attached to. sig { returns(T.nilable(String)) } - attr_accessor :subtype + attr_accessor :resource_id + + # The type of resource the issue is attached to. + sig { returns(WhopSDK::AdCampaign::Issue::ResourceType::TaggedSymbol) } + attr_accessor :resource_type - # A platform-reported issue on an ad object (rejection, policy flag, etc.). + # Open issues affecting the campaign and its descendant ad groups and ads. sig do params( - category: T.nilable(WhopSDK::AdCampaign::Issue::Category::OrSymbol), - created_at: Time, - resolution_status: - WhopSDK::AdCampaign::Issue::ResolutionStatus::OrSymbol, + id: String, + message: String, resource_id: T.nilable(String), - resource_type: String, - subtype: T.nilable(String) + resource_type: WhopSDK::AdCampaign::Issue::ResourceType::OrSymbol ).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:, - # 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. + # Unique identifier for the issue. + id:, + # A description of what the issue is and how it can be resolved. + message:, + # The ID of the campaign, ad group, or ad the issue is attached to. resource_id:, - # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. - # Pairs with `resourceId`. - resource_type:, - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). - subtype: + # The type of resource the issue is attached to. + resource_type: ) end sig do override.returns( { - category: - T.nilable(WhopSDK::AdCampaign::Issue::Category::TaggedSymbol), - created_at: Time, - resolution_status: - WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol, + id: String, + message: String, resource_id: T.nilable(String), - resource_type: String, - subtype: T.nilable(String) + resource_type: + WhopSDK::AdCampaign::Issue::ResourceType::TaggedSymbol } ) end def to_hash end - # Whop's canonical category that a raw platform issue is bucketed into. - module Category + # The type of resource the issue is attached to. + module ResourceType extend WhopSDK::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::Issue::Category) } + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaign::Issue::ResourceType) + end OrSymbol = T.type_alias { T.any(Symbol, String) } - POLICY_REJECTION = + AD_CAMPAIGN = T.let( - :policy_rejection, - WhopSDK::AdCampaign::Issue::Category::TaggedSymbol + :ad_campaign, + WhopSDK::AdCampaign::Issue::ResourceType::TaggedSymbol ) - CREATIVE_MEDIA = + AD_GROUP = 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 + :ad_group, + WhopSDK::AdCampaign::Issue::ResourceType::TaggedSymbol ) + AD = + T.let(:ad, WhopSDK::AdCampaign::Issue::ResourceType::TaggedSymbol) sig do override.returns( - T::Array[WhopSDK::AdCampaign::Issue::Category::TaggedSymbol] + T::Array[WhopSDK::AdCampaign::Issue::ResourceType::TaggedSymbol] ) end def self.values end end + end - # Current resolution status. - module ResolutionStatus - extend WhopSDK::Internal::Type::Enum + # The goal the campaign optimizes toward. + module Objective + extend WhopSDK::Internal::Type::Enum - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::AdCampaign::Issue::ResolutionStatus) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::Objective) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - OPEN = - T.let( - :open, - WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol - ) - RESOLVED = - T.let( - :resolved, - WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol - ) - ACKNOWLEDGED = - T.let( - :acknowledged, - WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol - ) + AWARENESS = + T.let(:awareness, WhopSDK::AdCampaign::Objective::TaggedSymbol) + TRAFFIC = T.let(:traffic, WhopSDK::AdCampaign::Objective::TaggedSymbol) + ENGAGEMENT = + T.let(:engagement, WhopSDK::AdCampaign::Objective::TaggedSymbol) + LEADS = T.let(:leads, WhopSDK::AdCampaign::Objective::TaggedSymbol) + SALES = T.let(:sales, WhopSDK::AdCampaign::Objective::TaggedSymbol) - sig do - override.returns( - T::Array[ - WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol - ] - ) - end - def self.values - end + sig do + override.returns( + T::Array[WhopSDK::AdCampaign::Objective::TaggedSymbol] + ) + end + def self.values + end + end + + # The ad network the campaign runs on. + module Platform + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::Platform) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + META = T.let(:meta, WhopSDK::AdCampaign::Platform::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaign::Platform::TaggedSymbol] + ) + end + def self.values + end + end + + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::ResultEvent) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PURCHASE = + T.let(:purchase, WhopSDK::AdCampaign::ResultEvent::TaggedSymbol) + LEAD = T.let(:lead, WhopSDK::AdCampaign::ResultEvent::TaggedSymbol) + SCHEDULE = + T.let(:schedule, WhopSDK::AdCampaign::ResultEvent::TaggedSymbol) + SUBMIT_APPLICATION = + T.let( + :submit_application, + WhopSDK::AdCampaign::ResultEvent::TaggedSymbol + ) + CONTACT = + T.let(:contact, WhopSDK::AdCampaign::ResultEvent::TaggedSymbol) + COMPLETE_REGISTRATION = + T.let( + :complete_registration, + WhopSDK::AdCampaign::ResultEvent::TaggedSymbol + ) + VIEW_CONTENT = + T.let(:view_content, WhopSDK::AdCampaign::ResultEvent::TaggedSymbol) + ADD_TO_CART = + T.let(:add_to_cart, WhopSDK::AdCampaign::ResultEvent::TaggedSymbol) + CUSTOM = T.let(:custom, WhopSDK::AdCampaign::ResultEvent::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaign::ResultEvent::TaggedSymbol] + ) + end + def self.values + end + end + + # Regulated categories the campaign is declared under. Ads in these categories are + # subject to extra targeting restrictions. Empty when none apply. + module SpecialAdCategory + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::SpecialAdCategory) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOUSING = + T.let(:housing, WhopSDK::AdCampaign::SpecialAdCategory::TaggedSymbol) + EMPLOYMENT = + T.let( + :employment, + WhopSDK::AdCampaign::SpecialAdCategory::TaggedSymbol + ) + FINANCIAL_PRODUCTS = + T.let( + :financial_products, + WhopSDK::AdCampaign::SpecialAdCategory::TaggedSymbol + ) + POLITICS = + T.let(:politics, WhopSDK::AdCampaign::SpecialAdCategory::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaign::SpecialAdCategory::TaggedSymbol] + ) + end + def self.values + end + end + + # The lifecycle status of the ad campaign. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = T.let(:active, WhopSDK::AdCampaign::Status::TaggedSymbol) + PAUSED = T.let(:paused, WhopSDK::AdCampaign::Status::TaggedSymbol) + INACTIVE = T.let(:inactive, WhopSDK::AdCampaign::Status::TaggedSymbol) + STALE = T.let(:stale, WhopSDK::AdCampaign::Status::TaggedSymbol) + PENDING_REFUND = + T.let(:pending_refund, WhopSDK::AdCampaign::Status::TaggedSymbol) + PAYMENT_FAILED = + T.let(:payment_failed, WhopSDK::AdCampaign::Status::TaggedSymbol) + DRAFT = T.let(:draft, WhopSDK::AdCampaign::Status::TaggedSymbol) + IN_REVIEW = T.let(:in_review, WhopSDK::AdCampaign::Status::TaggedSymbol) + FLAGGED = T.let(:flagged, WhopSDK::AdCampaign::Status::TaggedSymbol) + IMPORTING = T.let(:importing, WhopSDK::AdCampaign::Status::TaggedSymbol) + IMPORTED = T.let(:imported, WhopSDK::AdCampaign::Status::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::AdCampaign::Status::TaggedSymbol]) + end + def self.values end end end diff --git a/rbi/whop_sdk/models/ad_campaign_create_params.rbi b/rbi/whop_sdk/models/ad_campaign_create_params.rbi new file mode 100644 index 00000000..a103b152 --- /dev/null +++ b/rbi/whop_sdk/models/ad_campaign_create_params.rbi @@ -0,0 +1,428 @@ +# typed: strong + +module WhopSDK + module Models + class AdCampaignCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AdCampaignCreateParams, WhopSDK::Internal::AnyHash) + end + + # The goal the campaign optimizes toward. + sig { returns(WhopSDK::AdCampaignCreateParams::Objective::OrSymbol) } + attr_accessor :objective + + # The ad network the campaign runs on. + sig { returns(WhopSDK::AdCampaignCreateParams::Platform::OrSymbol) } + attr_accessor :platform + + # The title of the campaign. + sig { returns(String) } + attr_accessor :title + + # The account to create the campaign under. Defaults to the account-scoped key's + # own account. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). CBO only. + sig do + returns(T.nilable(WhopSDK::AdCampaignCreateParams::BidType::OrSymbol)) + end + attr_reader :bid_type + + sig do + params( + bid_type: WhopSDK::AdCampaignCreateParams::BidType::OrSymbol + ).void + end + attr_writer :bid_type + + # The campaign budget, in USD. Required for CBO (budget_optimization: + # ad_campaign); omit for ABO. + sig { returns(T.nilable(Float)) } + attr_reader :budget_amount + + sig { params(budget_amount: Float).void } + attr_writer :budget_amount + + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + # Defaults to ad_group. + sig do + returns( + T.nilable( + WhopSDK::AdCampaignCreateParams::BudgetOptimization::OrSymbol + ) + ) + end + attr_reader :budget_optimization + + sig do + params( + budget_optimization: + WhopSDK::AdCampaignCreateParams::BudgetOptimization::OrSymbol + ).void + end + attr_writer :budget_optimization + + # Whether the budget is spent per day or over the campaign's lifetime. Defaults to + # daily. + sig do + returns( + T.nilable(WhopSDK::AdCampaignCreateParams::BudgetType::OrSymbol) + ) + end + attr_reader :budget_type + + sig do + params( + budget_type: WhopSDK::AdCampaignCreateParams::BudgetType::OrSymbol + ).void + end + attr_writer :budget_type + + # Target/cap cost per result in USD for average_target / maximum_target bidding. + # CBO only. + sig { returns(T.nilable(Float)) } + attr_reader :desired_cost_per_result + + sig { params(desired_cost_per_result: Float).void } + attr_writer :desired_cost_per_result + + # Campaign schedule end (ISO 8601). CBO only. + sig { returns(T.nilable(String)) } + attr_reader :ends_at + + sig { params(ends_at: String).void } + attr_writer :ends_at + + # Regulated categories the campaign falls under. Ads in these categories are + # subject to extra targeting restrictions. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::OrSymbol + ] + ) + ) + end + attr_reader :special_ad_categories + + sig do + params( + special_ad_categories: + T::Array[ + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::OrSymbol + ] + ).void + end + attr_writer :special_ad_categories + + # Campaign schedule start (ISO 8601). CBO only. + sig { returns(T.nilable(String)) } + attr_reader :starts_at + + sig { params(starts_at: String).void } + attr_writer :starts_at + + sig do + params( + objective: WhopSDK::AdCampaignCreateParams::Objective::OrSymbol, + platform: WhopSDK::AdCampaignCreateParams::Platform::OrSymbol, + title: String, + account_id: String, + bid_type: WhopSDK::AdCampaignCreateParams::BidType::OrSymbol, + budget_amount: Float, + budget_optimization: + WhopSDK::AdCampaignCreateParams::BudgetOptimization::OrSymbol, + budget_type: WhopSDK::AdCampaignCreateParams::BudgetType::OrSymbol, + desired_cost_per_result: Float, + ends_at: String, + special_ad_categories: + T::Array[ + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::OrSymbol + ], + starts_at: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The goal the campaign optimizes toward. + objective:, + # The ad network the campaign runs on. + platform:, + # The title of the campaign. + title:, + # The account to create the campaign under. Defaults to the account-scoped key's + # own account. + account_id: nil, + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). CBO only. + bid_type: nil, + # The campaign budget, in USD. Required for CBO (budget_optimization: + # ad_campaign); omit for ABO. + budget_amount: nil, + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + # Defaults to ad_group. + budget_optimization: nil, + # Whether the budget is spent per day or over the campaign's lifetime. Defaults to + # daily. + budget_type: nil, + # Target/cap cost per result in USD for average_target / maximum_target bidding. + # CBO only. + desired_cost_per_result: nil, + # Campaign schedule end (ISO 8601). CBO only. + ends_at: nil, + # Regulated categories the campaign falls under. Ads in these categories are + # subject to extra targeting restrictions. + special_ad_categories: nil, + # Campaign schedule start (ISO 8601). CBO only. + starts_at: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + objective: WhopSDK::AdCampaignCreateParams::Objective::OrSymbol, + platform: WhopSDK::AdCampaignCreateParams::Platform::OrSymbol, + title: String, + account_id: String, + bid_type: WhopSDK::AdCampaignCreateParams::BidType::OrSymbol, + budget_amount: Float, + budget_optimization: + WhopSDK::AdCampaignCreateParams::BudgetOptimization::OrSymbol, + budget_type: WhopSDK::AdCampaignCreateParams::BudgetType::OrSymbol, + desired_cost_per_result: Float, + ends_at: String, + special_ad_categories: + T::Array[ + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::OrSymbol + ], + starts_at: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # The goal the campaign optimizes toward. + module Objective + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignCreateParams::Objective) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AWARENESS = + T.let( + :awareness, + WhopSDK::AdCampaignCreateParams::Objective::TaggedSymbol + ) + TRAFFIC = + T.let( + :traffic, + WhopSDK::AdCampaignCreateParams::Objective::TaggedSymbol + ) + ENGAGEMENT = + T.let( + :engagement, + WhopSDK::AdCampaignCreateParams::Objective::TaggedSymbol + ) + LEADS = + T.let( + :leads, + WhopSDK::AdCampaignCreateParams::Objective::TaggedSymbol + ) + SALES = + T.let( + :sales, + WhopSDK::AdCampaignCreateParams::Objective::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignCreateParams::Objective::TaggedSymbol] + ) + end + def self.values + end + end + + # The ad network the campaign runs on. + module Platform + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignCreateParams::Platform) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + META = + T.let(:meta, WhopSDK::AdCampaignCreateParams::Platform::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignCreateParams::Platform::TaggedSymbol] + ) + end + def self.values + end + end + + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). CBO only. + module BidType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignCreateParams::BidType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MINIMUM_COST = + T.let( + :minimum_cost, + WhopSDK::AdCampaignCreateParams::BidType::TaggedSymbol + ) + AVERAGE_TARGET = + T.let( + :average_target, + WhopSDK::AdCampaignCreateParams::BidType::TaggedSymbol + ) + MAXIMUM_TARGET = + T.let( + :maximum_target, + WhopSDK::AdCampaignCreateParams::BidType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignCreateParams::BidType::TaggedSymbol] + ) + end + def self.values + end + end + + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + # Defaults to ad_group. + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignCreateParams::BudgetOptimization) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD_CAMPAIGN = + T.let( + :ad_campaign, + WhopSDK::AdCampaignCreateParams::BudgetOptimization::TaggedSymbol + ) + AD_GROUP = + T.let( + :ad_group, + WhopSDK::AdCampaignCreateParams::BudgetOptimization::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdCampaignCreateParams::BudgetOptimization::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Whether the budget is spent per day or over the campaign's lifetime. Defaults to + # daily. + module BudgetType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignCreateParams::BudgetType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAILY = + T.let( + :daily, + WhopSDK::AdCampaignCreateParams::BudgetType::TaggedSymbol + ) + LIFETIME = + T.let( + :lifetime, + WhopSDK::AdCampaignCreateParams::BudgetType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignCreateParams::BudgetType::TaggedSymbol] + ) + end + def self.values + end + end + + module SpecialAdCategory + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignCreateParams::SpecialAdCategory) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOUSING = + T.let( + :housing, + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::TaggedSymbol + ) + EMPLOYMENT = + T.let( + :employment, + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::TaggedSymbol + ) + FINANCIAL_PRODUCTS = + T.let( + :financial_products, + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::TaggedSymbol + ) + POLITICS = + T.let( + :politics, + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_method_retrieve_params.rbi b/rbi/whop_sdk/models/ad_campaign_delete_params.rbi similarity index 81% rename from rbi/whop_sdk/models/payout_method_retrieve_params.rbi rename to rbi/whop_sdk/models/ad_campaign_delete_params.rbi index 6fc0d22e..9f7780a5 100644 --- a/rbi/whop_sdk/models/payout_method_retrieve_params.rbi +++ b/rbi/whop_sdk/models/ad_campaign_delete_params.rbi @@ -2,13 +2,13 @@ module WhopSDK module Models - class PayoutMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel + class AdCampaignDeleteParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters OrHash = T.type_alias do - T.any(WhopSDK::PayoutMethodRetrieveParams, WhopSDK::Internal::AnyHash) + T.any(WhopSDK::AdCampaignDeleteParams, WhopSDK::Internal::AnyHash) end sig { returns(String) } diff --git a/rbi/whop_sdk/models/ad_campaign_delete_response.rbi b/rbi/whop_sdk/models/ad_campaign_delete_response.rbi new file mode 100644 index 00000000..84c76879 --- /dev/null +++ b/rbi/whop_sdk/models/ad_campaign_delete_response.rbi @@ -0,0 +1,8 @@ +# typed: strong + +module WhopSDK + module Models + AdCampaignDeleteResponse = + T.let(T::Boolean, WhopSDK::Internal::Type::Converter) + 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 5a5b1765..581023c4 100644 --- a/rbi/whop_sdk/models/ad_campaign_list_params.rbi +++ b/rbi/whop_sdk/models/ad_campaign_list_params.rbi @@ -11,93 +11,174 @@ module WhopSDK T.any(WhopSDK::AdCampaignListParams, WhopSDK::Internal::AnyHash) end - # Returns the elements in the list that come after the specified cursor. + # The account the campaigns belong to. Defaults to the account-scoped key's own + # account. sig { returns(T.nilable(String)) } - attr_accessor :after + attr_reader :account_id - # Returns the elements in the list that come before the specified cursor. + sig { params(account_id: String).void } + attr_writer :account_id + + # Cursor to fetch the page after (from page_info.end_cursor). sig { returns(T.nilable(String)) } - attr_accessor :before + attr_reader :after + + sig { params(after: String).void } + attr_writer :after - # The unique identifier of the company to list ad campaigns for. + # Cursor to fetch the page before (from page_info.start_cursor). sig { returns(T.nilable(String)) } - attr_accessor :company_id + attr_reader :before - # Only return ad campaigns created after this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_after + sig { params(before: String).void } + attr_writer :before + + # Only return campaigns created after this timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_after + + sig { params(created_after: String).void } + attr_writer :created_after + + # Only return campaigns created before this timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_before - # Only return ad campaigns created before this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_before + sig { params(created_before: String).void } + attr_writer :created_before + + # The sort direction. Defaults to desc. + sig do + returns(T.nilable(WhopSDK::AdCampaignListParams::Direction::OrSymbol)) + end + attr_reader :direction + + sig do + params( + direction: WhopSDK::AdCampaignListParams::Direction::OrSymbol + ).void + end + attr_writer :direction - # Returns the first _n_ elements from the list. + # The number of campaigns to return. 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 campaigns 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 field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + sig { returns(T.nilable(WhopSDK::AdCampaignListParams::Order::OrSymbol)) } + attr_reader :order - # Case-insensitive substring match against the campaign title or ID. + sig { params(order: WhopSDK::AdCampaignListParams::Order::OrSymbol).void } + attr_writer :order + + # Filter campaigns by a title or ID substring. sig { returns(T.nilable(String)) } - attr_accessor :query + attr_reader :query + + sig { params(query: String).void } + attr_writer :query + + # Start of the stats window. Defaults to all-time. + sig { returns(T.nilable(String)) } + attr_reader :stats_from + + sig { params(stats_from: String).void } + attr_writer :stats_from + + # End of the stats window. Defaults to now. + sig { returns(T.nilable(String)) } + attr_reader :stats_to + + sig { params(stats_to: String).void } + attr_writer :stats_to + + # Only return campaigns with this status. + sig do + returns(T.nilable(WhopSDK::AdCampaignListParams::Status::OrSymbol)) + end + attr_reader :status - # 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 + sig do + params(status: WhopSDK::AdCampaignListParams::Status::OrSymbol).void + end + attr_writer :status - # 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 + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + sig { returns(T.nilable(String)) } + attr_reader :time_zone - # The status of an ad campaign. - sig { returns(T.nilable(WhopSDK::AdCampaignStatus::OrSymbol)) } - attr_accessor :status + sig { params(time_zone: String).void } + attr_writer :time_zone sig do params( - after: T.nilable(String), - before: T.nilable(String), - company_id: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - 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), + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdCampaignListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdCampaignListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::AdCampaignListParams::Status::OrSymbol, + time_zone: 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. + # The account the campaigns belong to. Defaults to the account-scoped key's own + # account. + account_id: nil, + # Cursor to fetch the page after (from page_info.end_cursor). after: nil, - # Returns the elements in the list that come before the specified cursor. + # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # The unique identifier of the company to list ad campaigns for. - company_id: nil, - # Only return ad campaigns created after this timestamp. + # Only return campaigns created after this timestamp. created_after: nil, - # Only return ad campaigns created before this timestamp. + # Only return campaigns created before this timestamp. created_before: nil, - # Returns the first _n_ elements from the list. + # The sort direction. Defaults to desc. + direction: nil, + # The number of campaigns to return. first: nil, - # Returns the last _n_ elements from the list. + # The number of campaigns to return from the end of the range. last: nil, - # Case-insensitive substring match against the campaign title or ID. + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + order: nil, + # Filter campaigns by a title or ID substring. query: nil, - # Inclusive start of the window for each campaign's metric fields (spend, - # impressions, …). Omit both statsFrom and statsTo for all-time stats. + # Start of the stats window. Defaults to all-time. stats_from: nil, - # Inclusive end of the window for each campaign's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. Defaults to now. stats_to: nil, - # The status of an ad campaign. + # Only return campaigns with this status. status: nil, + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + time_zone: nil, request_options: {} ) end @@ -105,23 +186,149 @@ module WhopSDK sig do override.returns( { - after: T.nilable(String), - before: T.nilable(String), - company_id: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - 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), + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdCampaignListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdCampaignListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::AdCampaignListParams::Status::OrSymbol, + time_zone: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # The sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignListParams::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let(:asc, WhopSDK::AdCampaignListParams::Direction::TaggedSymbol) + DESC = + T.let(:desc, WhopSDK::AdCampaignListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaignListParams::Order) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT = + T.let(:created_at, WhopSDK::AdCampaignListParams::Order::TaggedSymbol) + UPDATED_AT = + T.let(:updated_at, WhopSDK::AdCampaignListParams::Order::TaggedSymbol) + SPEND = + T.let(:spend, WhopSDK::AdCampaignListParams::Order::TaggedSymbol) + IMPRESSIONS = + T.let( + :impressions, + WhopSDK::AdCampaignListParams::Order::TaggedSymbol + ) + REACH = + T.let(:reach, WhopSDK::AdCampaignListParams::Order::TaggedSymbol) + CLICKS = + T.let(:clicks, WhopSDK::AdCampaignListParams::Order::TaggedSymbol) + UNIQUE_CLICKS = + T.let( + :unique_clicks, + WhopSDK::AdCampaignListParams::Order::TaggedSymbol + ) + FREQUENCY = + T.let(:frequency, WhopSDK::AdCampaignListParams::Order::TaggedSymbol) + CLICK_THROUGH_RATE = + T.let( + :click_through_rate, + WhopSDK::AdCampaignListParams::Order::TaggedSymbol + ) + RESULTS = + T.let(:results, WhopSDK::AdCampaignListParams::Order::TaggedSymbol) + COST_PER_MILLE = + T.let( + :cost_per_mille, + WhopSDK::AdCampaignListParams::Order::TaggedSymbol + ) + COST_PER_CLICK = + T.let( + :cost_per_click, + WhopSDK::AdCampaignListParams::Order::TaggedSymbol + ) + COST_PER_RESULT = + T.let( + :cost_per_result, + WhopSDK::AdCampaignListParams::Order::TaggedSymbol + ) + RETURN_ON_AD_SPEND = + T.let( + :return_on_ad_spend, + WhopSDK::AdCampaignListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignListParams::Order::TaggedSymbol] + ) + end + def self.values + end + end + + # Only return campaigns with this status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaignListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DRAFT = + T.let(:draft, WhopSDK::AdCampaignListParams::Status::TaggedSymbol) + ACTIVE = + T.let(:active, WhopSDK::AdCampaignListParams::Status::TaggedSymbol) + PAUSED = + T.let(:paused, WhopSDK::AdCampaignListParams::Status::TaggedSymbol) + PAYMENT_FAILED = + T.let( + :payment_failed, + WhopSDK::AdCampaignListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/ad_campaign_list_response.rbi b/rbi/whop_sdk/models/ad_campaign_list_response.rbi deleted file mode 100644 index fc79dcd9..00000000 --- a/rbi/whop_sdk/models/ad_campaign_list_response.rbi +++ /dev/null @@ -1,457 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class AdCampaignListResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AdCampaignListResponse, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for this ad campaign. - sig { returns(String) } - attr_accessor :id - - # Total budget in dollars. - sig { returns(T.nilable(Float)) } - attr_accessor :budget - - # The budget type for an ad campaign or ad group. - 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 - - # 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 - - # The campaign name shown in the Whop dashboard. - sig { returns(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 campaign was last updated. - sig { returns(Time) } - attr_accessor :updated_at - - # An advertising campaign running on an external platform or within Whop. - sig do - params( - 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, - unique_click_through_rate: T.nilable(Float), - unique_clicks: Integer, - updated_at: Time - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for this ad campaign. - id:, - # Total budget in dollars. - 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:, - # 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:, - # 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: - ) - end - - sig do - override.returns( - { - 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, - 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 - - # 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 - - # 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 - - # 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, - resolution_status: - WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::OrSymbol, - resource_id: T.nilable(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:, - # 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:, - # 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, - resolution_status: - WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::TaggedSymbol, - resource_id: T.nilable(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 - - 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_platform.rbi b/rbi/whop_sdk/models/ad_campaign_platform.rbi deleted file mode 100644 index 17c5a732..00000000 --- a/rbi/whop_sdk/models/ad_campaign_platform.rbi +++ /dev/null @@ -1,22 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - # The platforms where an ad campaign can run. - module AdCampaignPlatform - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::AdCampaignPlatform) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - META = T.let(:meta, WhopSDK::AdCampaignPlatform::TaggedSymbol) - TIKTOK = T.let(:tiktok, WhopSDK::AdCampaignPlatform::TaggedSymbol) - - sig do - override.returns(T::Array[WhopSDK::AdCampaignPlatform::TaggedSymbol]) - end - def self.values - 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 5591f1b3..3479bcab 100644 --- a/rbi/whop_sdk/models/ad_campaign_retrieve_params.rbi +++ b/rbi/whop_sdk/models/ad_campaign_retrieve_params.rbi @@ -14,32 +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 + # Start of the stats window. + sig { returns(T.nilable(String)) } + attr_reader :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 { params(stats_from: String).void } + attr_writer :stats_from + + # End of the stats window. + sig { returns(T.nilable(String)) } + attr_reader :stats_to + + sig { params(stats_to: String).void } + attr_writer :stats_to + + # IANA timezone the stats window is interpreted in. Defaults to UTC. + sig { returns(T.nilable(String)) } + attr_reader :time_zone + + sig { params(time_zone: String).void } + attr_writer :time_zone sig do params( id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end 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. + # Start of the stats window. stats_from: nil, - # Inclusive end of the window for the campaign's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. stats_to: nil, + # IANA timezone the stats window is interpreted in. Defaults to UTC. + time_zone: nil, request_options: {} ) end @@ -48,8 +60,9 @@ module WhopSDK override.returns( { id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/ad_campaign_status.rbi b/rbi/whop_sdk/models/ad_campaign_status.rbi deleted file mode 100644 index c3ed8798..00000000 --- a/rbi/whop_sdk/models/ad_campaign_status.rbi +++ /dev/null @@ -1,27 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - # The status of an ad campaign. - module AdCampaignStatus - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::AdCampaignStatus) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ACTIVE = T.let(:active, WhopSDK::AdCampaignStatus::TaggedSymbol) - PAUSED = T.let(:paused, WhopSDK::AdCampaignStatus::TaggedSymbol) - PAYMENT_FAILED = - T.let(:payment_failed, WhopSDK::AdCampaignStatus::TaggedSymbol) - DRAFT = T.let(:draft, WhopSDK::AdCampaignStatus::TaggedSymbol) - IN_REVIEW = T.let(:in_review, WhopSDK::AdCampaignStatus::TaggedSymbol) - FLAGGED = T.let(:flagged, WhopSDK::AdCampaignStatus::TaggedSymbol) - - sig do - override.returns(T::Array[WhopSDK::AdCampaignStatus::TaggedSymbol]) - end - def self.values - end - end - end -end diff --git a/rbi/whop_sdk/models/ad_campaign_update_params.rbi b/rbi/whop_sdk/models/ad_campaign_update_params.rbi index f214a112..d5bb6b1d 100644 --- a/rbi/whop_sdk/models/ad_campaign_update_params.rbi +++ b/rbi/whop_sdk/models/ad_campaign_update_params.rbi @@ -14,23 +14,120 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The campaign budget in dollars. The interpretation (daily or lifetime) follows - # the campaign's existing budget type. + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). Switching to minimum_cost clears the cap amounts + # stored on the campaign's ad groups. CBO only. + sig do + returns(T.nilable(WhopSDK::AdCampaignUpdateParams::BidType::OrSymbol)) + end + attr_reader :bid_type + + sig do + params( + bid_type: WhopSDK::AdCampaignUpdateParams::BidType::OrSymbol + ).void + end + attr_writer :bid_type + + # The campaign budget, in the account's currency. Interpreted as daily or lifetime + # per the campaign's existing budget type. sig { returns(T.nilable(Float)) } - attr_accessor :budget + attr_reader :budget_amount + + sig { params(budget_amount: Float).void } + attr_writer :budget_amount + + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). Only + # changeable before the campaign is live on Meta; switching to ad_campaign + # requires budget_amount in the same request, and switching to ad_group clears the + # campaign budget. + sig do + returns( + T.nilable( + WhopSDK::AdCampaignUpdateParams::BudgetOptimization::OrSymbol + ) + ) + end + attr_reader :budget_optimization + + sig do + params( + budget_optimization: + WhopSDK::AdCampaignUpdateParams::BudgetOptimization::OrSymbol + ).void + end + attr_writer :budget_optimization + + # Campaign schedule end (ISO 8601). CBO only. + sig { returns(T.nilable(String)) } + attr_reader :ends_at + + sig { params(ends_at: String).void } + attr_writer :ends_at + + # Campaign schedule start (ISO 8601). CBO only. + sig { returns(T.nilable(String)) } + attr_reader :starts_at + + sig { params(starts_at: String).void } + attr_writer :starts_at + + # Set to active to launch a draft campaign (moderates and pushes it live). + # Live-campaign pause and resume use the pause and unpause actions. + sig do + returns(T.nilable(WhopSDK::AdCampaignUpdateParams::Status::OrSymbol)) + end + attr_reader :status + + sig do + params(status: WhopSDK::AdCampaignUpdateParams::Status::OrSymbol).void + end + attr_writer :status + + # The name of the campaign. + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title sig do params( id: String, - budget: T.nilable(Float), + bid_type: WhopSDK::AdCampaignUpdateParams::BidType::OrSymbol, + budget_amount: Float, + budget_optimization: + WhopSDK::AdCampaignUpdateParams::BudgetOptimization::OrSymbol, + ends_at: String, + starts_at: String, + status: WhopSDK::AdCampaignUpdateParams::Status::OrSymbol, + title: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, - # The campaign budget in dollars. The interpretation (daily or lifetime) follows - # the campaign's existing budget type. - budget: nil, + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). Switching to minimum_cost clears the cap amounts + # stored on the campaign's ad groups. CBO only. + bid_type: nil, + # The campaign budget, in the account's currency. Interpreted as daily or lifetime + # per the campaign's existing budget type. + budget_amount: nil, + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). Only + # changeable before the campaign is live on Meta; switching to ad_campaign + # requires budget_amount in the same request, and switching to ad_group clears the + # campaign budget. + budget_optimization: nil, + # Campaign schedule end (ISO 8601). CBO only. + ends_at: nil, + # Campaign schedule start (ISO 8601). CBO only. + starts_at: nil, + # Set to active to launch a draft campaign (moderates and pushes it live). + # Live-campaign pause and resume use the pause and unpause actions. + status: nil, + # The name of the campaign. + title: nil, request_options: {} ) end @@ -39,13 +136,115 @@ module WhopSDK override.returns( { id: String, - budget: T.nilable(Float), + bid_type: WhopSDK::AdCampaignUpdateParams::BidType::OrSymbol, + budget_amount: Float, + budget_optimization: + WhopSDK::AdCampaignUpdateParams::BudgetOptimization::OrSymbol, + ends_at: String, + starts_at: String, + status: WhopSDK::AdCampaignUpdateParams::Status::OrSymbol, + title: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). Switching to minimum_cost clears the cap amounts + # stored on the campaign's ad groups. CBO only. + module BidType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignUpdateParams::BidType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MINIMUM_COST = + T.let( + :minimum_cost, + WhopSDK::AdCampaignUpdateParams::BidType::TaggedSymbol + ) + AVERAGE_TARGET = + T.let( + :average_target, + WhopSDK::AdCampaignUpdateParams::BidType::TaggedSymbol + ) + MAXIMUM_TARGET = + T.let( + :maximum_target, + WhopSDK::AdCampaignUpdateParams::BidType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignUpdateParams::BidType::TaggedSymbol] + ) + end + def self.values + end + end + + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). Only + # changeable before the campaign is live on Meta; switching to ad_campaign + # requires budget_amount in the same request, and switching to ad_group clears the + # campaign budget. + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignUpdateParams::BudgetOptimization) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD_CAMPAIGN = + T.let( + :ad_campaign, + WhopSDK::AdCampaignUpdateParams::BudgetOptimization::TaggedSymbol + ) + AD_GROUP = + T.let( + :ad_group, + WhopSDK::AdCampaignUpdateParams::BudgetOptimization::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdCampaignUpdateParams::BudgetOptimization::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Set to active to launch a draft campaign (moderates and pushes it live). + # Live-campaign pause and resume use the pause and unpause actions. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCampaignUpdateParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let(:active, WhopSDK::AdCampaignUpdateParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaignUpdateParams::Status::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/ad_create_params.rbi b/rbi/whop_sdk/models/ad_create_params.rbi new file mode 100644 index 00000000..226b3f78 --- /dev/null +++ b/rbi/whop_sdk/models/ad_create_params.rbi @@ -0,0 +1,1491 @@ +# typed: strong + +module WhopSDK + module Models + class AdCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AdCreateParams, WhopSDK::Internal::AnyHash) + end + + # An inline ad group to create (same shape as POST /ad_groups, including + # ad_campaign_id). Creates the ad group and the ad together. Provide this OR + # ad_group_id. + sig { returns(T.nilable(T.anything)) } + attr_reader :ad_group + + sig { params(ad_group: T.anything).void } + attr_writer :ad_group + + # The existing ad group to create the ad in. Provide this OR ad_group, not both. + sig { returns(T.nilable(String)) } + attr_reader :ad_group_id + + sig { params(ad_group_id: String).void } + attr_writer :ad_group_id + + # The call-to-action button shown on the ad. + sig do + returns(T.nilable(WhopSDK::AdCreateParams::CallToAction::OrSymbol)) + end + attr_reader :call_to_action + + sig do + params( + call_to_action: WhopSDK::AdCreateParams::CallToAction::OrSymbol + ).void + end + attr_writer :call_to_action + + # The ad's creative assets. Each entry is an uploaded file id with an optional + # format; omit format for the original asset. + sig { returns(T.nilable(T::Array[WhopSDK::AdCreateParams::Creative])) } + attr_reader :creatives + + sig do + params( + creatives: T::Array[WhopSDK::AdCreateParams::Creative::OrHash] + ).void + end + attr_writer :creatives + + # The description variants shown on the ad. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :descriptions + + sig { params(descriptions: T::Array[String]).void } + attr_writer :descriptions + + # The headline variants shown on the ad. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :headlines + + sig { params(headlines: T::Array[String]).void } + attr_writer :headlines + + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + sig { returns(T.nilable(WhopSDK::AdCreateParams::LeadForm)) } + attr_reader :lead_form + + sig { params(lead_form: WhopSDK::AdCreateParams::LeadForm::OrHash).void } + attr_writer :lead_form + + # Use an existing Meta instant form instead of creating one — the form's Meta id, + # from a form already on the ad's Facebook page. Only allowed when the ad group's + # conversion_location is an instant-form destination. Mutually exclusive with + # lead_form. + sig { returns(T.nilable(String)) } + attr_reader :lead_form_id + + sig { params(lead_form_id: String).void } + attr_writer :lead_form_id + + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + sig { returns(T.nilable(WhopSDK::AdCreateParams::MessagingConfig)) } + attr_reader :messaging_config + + sig do + params( + messaging_config: WhopSDK::AdCreateParams::MessagingConfig::OrHash + ).void + end + attr_writer :messaging_config + + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :multi_advertiser_ads + + sig { params(multi_advertiser_ads: T::Boolean).void } + attr_writer :multi_advertiser_ads + + # Promote an existing post instead of uploading creatives — a Facebook post or + # Instagram media id. Mutually exclusive with creatives. Pair with post_source. + sig { returns(T.nilable(String)) } + attr_reader :post_id + + sig { params(post_id: String).void } + attr_writer :post_id + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + sig { returns(T.nilable(WhopSDK::AdCreateParams::PostSource::OrSymbol)) } + attr_reader :post_source + + sig do + params(post_source: WhopSDK::AdCreateParams::PostSource::OrSymbol).void + end + attr_writer :post_source + + # The primary text variants shown in the ad body. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :primary_texts + + sig { params(primary_texts: T::Array[String]).void } + attr_writer :primary_texts + + # The social accounts (Facebook page, Instagram profile) the ad runs under. + sig do + returns(T.nilable(T::Array[WhopSDK::AdCreateParams::SocialAccount])) + end + attr_reader :social_accounts + + sig do + params( + social_accounts: + T::Array[WhopSDK::AdCreateParams::SocialAccount::OrHash] + ).void + end + attr_writer :social_accounts + + # The display name of the ad. + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + # The URL the ad links to. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Query parameters appended to the destination URL, as a string-to-string map. + sig { returns(T.nilable(T.anything)) } + attr_reader :url_parameters + + sig { params(url_parameters: T.anything).void } + attr_writer :url_parameters + + sig do + params( + ad_group: T.anything, + ad_group_id: String, + call_to_action: WhopSDK::AdCreateParams::CallToAction::OrSymbol, + creatives: T::Array[WhopSDK::AdCreateParams::Creative::OrHash], + descriptions: T::Array[String], + headlines: T::Array[String], + lead_form: WhopSDK::AdCreateParams::LeadForm::OrHash, + lead_form_id: String, + messaging_config: WhopSDK::AdCreateParams::MessagingConfig::OrHash, + multi_advertiser_ads: T::Boolean, + post_id: String, + post_source: WhopSDK::AdCreateParams::PostSource::OrSymbol, + primary_texts: T::Array[String], + social_accounts: + T::Array[WhopSDK::AdCreateParams::SocialAccount::OrHash], + title: String, + url: String, + url_parameters: T.anything, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # An inline ad group to create (same shape as POST /ad_groups, including + # ad_campaign_id). Creates the ad group and the ad together. Provide this OR + # ad_group_id. + ad_group: nil, + # The existing ad group to create the ad in. Provide this OR ad_group, not both. + ad_group_id: nil, + # The call-to-action button shown on the ad. + call_to_action: nil, + # The ad's creative assets. Each entry is an uploaded file id with an optional + # format; omit format for the original asset. + creatives: nil, + # The description variants shown on the ad. + descriptions: nil, + # The headline variants shown on the ad. + headlines: nil, + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + lead_form: nil, + # Use an existing Meta instant form instead of creating one — the form's Meta id, + # from a form already on the ad's Facebook page. Only allowed when the ad group's + # conversion_location is an instant-form destination. Mutually exclusive with + # lead_form. + lead_form_id: nil, + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + messaging_config: nil, + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + multi_advertiser_ads: nil, + # Promote an existing post instead of uploading creatives — a Facebook post or + # Instagram media id. Mutually exclusive with creatives. Pair with post_source. + post_id: nil, + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + post_source: nil, + # The primary text variants shown in the ad body. + primary_texts: nil, + # The social accounts (Facebook page, Instagram profile) the ad runs under. + social_accounts: nil, + # The display name of the ad. + title: nil, + # The URL the ad links to. + url: nil, + # Query parameters appended to the destination URL, as a string-to-string map. + url_parameters: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + ad_group: T.anything, + ad_group_id: String, + call_to_action: WhopSDK::AdCreateParams::CallToAction::OrSymbol, + creatives: T::Array[WhopSDK::AdCreateParams::Creative], + descriptions: T::Array[String], + headlines: T::Array[String], + lead_form: WhopSDK::AdCreateParams::LeadForm, + lead_form_id: String, + messaging_config: WhopSDK::AdCreateParams::MessagingConfig, + multi_advertiser_ads: T::Boolean, + post_id: String, + post_source: WhopSDK::AdCreateParams::PostSource::OrSymbol, + primary_texts: T::Array[String], + social_accounts: T::Array[WhopSDK::AdCreateParams::SocialAccount], + title: String, + url: String, + url_parameters: T.anything, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # The call-to-action button shown on the ad. + module CallToAction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCreateParams::CallToAction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPLY_NOW = + T.let(:apply_now, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + BOOK_NOW = + T.let(:book_now, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + CALL_NOW = + T.let(:call_now, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + CONTACT_US = + T.let( + :contact_us, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + DOWNLOAD = + T.let(:download, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + GET_DIRECTIONS = + T.let( + :get_directions, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + GET_OFFER = + T.let(:get_offer, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + GET_QUOTE = + T.let(:get_quote, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + LEARN_MORE = + T.let( + :learn_more, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + LISTEN_NOW = + T.let( + :listen_now, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + MESSAGE_PAGE = + T.let( + :message_page, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + NO_BUTTON = + T.let(:no_button, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + OPEN_LINK = + T.let(:open_link, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + ORDER_NOW = + T.let(:order_now, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + REQUEST_TIME = + T.let( + :request_time, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + SEE_DETAILS = + T.let( + :see_details, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + SEE_MENU = + T.let(:see_menu, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + SEND_UPDATES = + T.let( + :send_updates, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + SHOP_NOW = + T.let(:shop_now, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + SIGN_UP = + T.let(:sign_up, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + SUBSCRIBE = + T.let(:subscribe, WhopSDK::AdCreateParams::CallToAction::TaggedSymbol) + WATCH_MORE = + T.let( + :watch_more, + WhopSDK::AdCreateParams::CallToAction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCreateParams::CallToAction::TaggedSymbol] + ) + end + def self.values + end + end + + class Creative < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::AdCreateParams::Creative, WhopSDK::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + sig { returns(T.nilable(WhopSDK::AdCreateParams::Creative::Crop)) } + attr_reader :crop + + sig do + params(crop: WhopSDK::AdCreateParams::Creative::Crop::OrHash).void + end + attr_writer :crop + + sig do + returns( + T.nilable(WhopSDK::AdCreateParams::Creative::Format::OrSymbol) + ) + end + attr_reader :format_ + + sig do + params( + format_: WhopSDK::AdCreateParams::Creative::Format::OrSymbol + ).void + end + attr_writer :format_ + + sig do + params( + id: String, + crop: WhopSDK::AdCreateParams::Creative::Crop::OrHash, + format_: WhopSDK::AdCreateParams::Creative::Format::OrSymbol + ).returns(T.attached_class) + end + def self.new( + id: nil, + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + crop: nil, + format_: nil + ) + end + + sig do + override.returns( + { + id: String, + crop: WhopSDK::AdCreateParams::Creative::Crop, + format_: WhopSDK::AdCreateParams::Creative::Format::OrSymbol + } + ) + end + def to_hash + end + + class Crop < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::Creative::Crop, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Float)) } + attr_reader :height + + sig { params(height: Float).void } + attr_writer :height + + sig { returns(T.nilable(Float)) } + attr_reader :width + + sig { params(width: Float).void } + attr_writer :width + + sig { returns(T.nilable(Float)) } + attr_reader :x + + sig { params(x: Float).void } + attr_writer :x + + sig { returns(T.nilable(Float)) } + attr_reader :y_ + + sig { params(y_: Float).void } + attr_writer :y_ + + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + sig do + params(height: Float, width: Float, x: Float, y_: Float).returns( + T.attached_class + ) + end + def self.new(height: nil, width: nil, x: nil, y_: nil) + end + + sig do + override.returns( + { height: Float, width: Float, x: Float, y_: Float } + ) + end + def to_hash + end + end + + module Format + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCreateParams::Creative::Format) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SQUARE = + T.let( + :square, + WhopSDK::AdCreateParams::Creative::Format::TaggedSymbol + ) + VERTICAL = + T.let( + :vertical, + WhopSDK::AdCreateParams::Creative::Format::TaggedSymbol + ) + HORIZONTAL = + T.let( + :horizontal, + WhopSDK::AdCreateParams::Creative::Format::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCreateParams::Creative::Format::TaggedSymbol] + ) + end + def self.values + end + end + end + + class LeadForm < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::AdCreateParams::LeadForm, WhopSDK::Internal::AnyHash) + end + + # Optional completion screen shown after submission; url sets the follow-up + # website button. + sig do + returns(T.nilable(WhopSDK::AdCreateParams::LeadForm::Completion)) + end + attr_reader :completion + + sig do + params( + completion: WhopSDK::AdCreateParams::LeadForm::Completion::OrHash + ).void + end + attr_writer :completion + + # Optional custom consent disclaimer with checkboxes. + sig do + returns(T.nilable(WhopSDK::AdCreateParams::LeadForm::Disclaimer)) + end + attr_reader :disclaimer + + sig do + params( + disclaimer: WhopSDK::AdCreateParams::LeadForm::Disclaimer::OrHash + ).void + end + attr_writer :disclaimer + + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + sig do + returns( + T.nilable(WhopSDK::AdCreateParams::LeadForm::FormType::OrSymbol) + ) + end + attr_reader :form_type + + sig do + params( + form_type: WhopSDK::AdCreateParams::LeadForm::FormType::OrSymbol + ).void + end + attr_writer :form_type + + # Optional intro screen shown before the questions. + sig { returns(T.nilable(WhopSDK::AdCreateParams::LeadForm::Intro)) } + attr_reader :intro + + sig do + params(intro: WhopSDK::AdCreateParams::LeadForm::Intro::OrHash).void + end + attr_writer :intro + + # Internal name for the form. Auto-generated if omitted. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # Require SMS verification of the phone number (higher_intent forms). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :phone_verification + + sig { params(phone_verification: T::Boolean).void } + attr_writer :phone_verification + + # Your privacy policy. url is required by Meta. + sig do + returns(T.nilable(WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy)) + end + attr_reader :privacy_policy + + sig do + params( + privacy_policy: + WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy::OrHash + ).void + end + attr_writer :privacy_policy + + # The questions on the form. Standard prefill types need only a type; a custom + # question needs a label and a format (plus options for multiple_choice). Options + # carry an optional key and answer-routing logic. + sig do + returns( + T.nilable(T::Array[WhopSDK::AdCreateParams::LeadForm::Question]) + ) + end + attr_reader :questions + + sig do + params( + questions: + T::Array[WhopSDK::AdCreateParams::LeadForm::Question::OrHash] + ).void + end + attr_writer :questions + + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + sig do + params( + completion: WhopSDK::AdCreateParams::LeadForm::Completion::OrHash, + disclaimer: WhopSDK::AdCreateParams::LeadForm::Disclaimer::OrHash, + form_type: WhopSDK::AdCreateParams::LeadForm::FormType::OrSymbol, + intro: WhopSDK::AdCreateParams::LeadForm::Intro::OrHash, + name: String, + phone_verification: T::Boolean, + privacy_policy: + WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy::OrHash, + questions: + T::Array[WhopSDK::AdCreateParams::LeadForm::Question::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Optional completion screen shown after submission; url sets the follow-up + # website button. + completion: nil, + # Optional custom consent disclaimer with checkboxes. + disclaimer: nil, + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + form_type: nil, + # Optional intro screen shown before the questions. + intro: nil, + # Internal name for the form. Auto-generated if omitted. + name: nil, + # Require SMS verification of the phone number (higher_intent forms). + phone_verification: nil, + # Your privacy policy. url is required by Meta. + privacy_policy: nil, + # The questions on the form. Standard prefill types need only a type; a custom + # question needs a label and a format (plus options for multiple_choice). Options + # carry an optional key and answer-routing logic. + questions: nil + ) + end + + sig do + override.returns( + { + completion: WhopSDK::AdCreateParams::LeadForm::Completion, + disclaimer: WhopSDK::AdCreateParams::LeadForm::Disclaimer, + form_type: WhopSDK::AdCreateParams::LeadForm::FormType::OrSymbol, + intro: WhopSDK::AdCreateParams::LeadForm::Intro, + name: String, + phone_verification: T::Boolean, + privacy_policy: WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy, + questions: T::Array[WhopSDK::AdCreateParams::LeadForm::Question] + } + ) + end + def to_hash + end + + class Completion < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::LeadForm::Completion, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :button_text + + sig { params(button_text: String).void } + attr_writer :button_text + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig { returns(T.nilable(String)) } + attr_reader :headline + + sig { params(headline: String).void } + attr_writer :headline + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Optional completion screen shown after submission; url sets the follow-up + # website button. + sig do + params( + button_text: String, + description: String, + headline: String, + url: String + ).returns(T.attached_class) + end + def self.new( + button_text: nil, + description: nil, + headline: nil, + url: nil + ) + end + + sig do + override.returns( + { + button_text: String, + description: String, + headline: String, + url: String + } + ) + end + def to_hash + end + end + + class Disclaimer < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::LeadForm::Disclaimer, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :body + + sig { params(body: String).void } + attr_writer :body + + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox + ] + ) + ) + end + attr_reader :checkboxes + + sig do + params( + checkboxes: + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox::OrHash + ] + ).void + end + attr_writer :checkboxes + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + # Optional custom consent disclaimer with checkboxes. + sig do + params( + body: String, + checkboxes: + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox::OrHash + ], + title: String + ).returns(T.attached_class) + end + def self.new(body: nil, checkboxes: nil, title: nil) + end + + sig do + override.returns( + { + body: String, + checkboxes: + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox + ], + title: String + } + ) + end + def to_hash + end + + class Checkbox < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :checked_by_default + + sig { params(checked_by_default: T::Boolean).void } + attr_writer :checked_by_default + + sig { returns(T.nilable(String)) } + attr_reader :key + + sig { params(key: String).void } + attr_writer :key + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :required + + sig { params(required: T::Boolean).void } + attr_writer :required + + sig { returns(T.nilable(String)) } + attr_reader :text + + sig { params(text: String).void } + attr_writer :text + + sig do + params( + checked_by_default: T::Boolean, + key: String, + required: T::Boolean, + text: String + ).returns(T.attached_class) + end + def self.new( + checked_by_default: nil, + key: nil, + required: nil, + text: nil + ) + end + + sig do + override.returns( + { + checked_by_default: T::Boolean, + key: String, + required: T::Boolean, + text: String + } + ) + end + def to_hash + end + end + end + + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + module FormType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCreateParams::LeadForm::FormType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MORE_VOLUME = + T.let( + :more_volume, + WhopSDK::AdCreateParams::LeadForm::FormType::TaggedSymbol + ) + HIGHER_INTENT = + T.let( + :higher_intent, + WhopSDK::AdCreateParams::LeadForm::FormType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdCreateParams::LeadForm::FormType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Intro < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::LeadForm::Intro, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig { returns(T.nilable(String)) } + attr_reader :headline + + sig { params(headline: String).void } + attr_writer :headline + + # Optional intro screen shown before the questions. + sig do + params(description: String, headline: String).returns( + T.attached_class + ) + end + def self.new(description: nil, headline: nil) + end + + sig { override.returns({ description: String, headline: String }) } + def to_hash + end + end + + class PrivacyPolicy < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :link_text + + sig { params(link_text: String).void } + attr_writer :link_text + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Your privacy policy. url is required by Meta. + sig do + params(link_text: String, url: String).returns(T.attached_class) + end + def self.new(link_text: nil, url: nil) + end + + sig { override.returns({ link_text: String, url: String }) } + def to_hash + end + end + + class Question < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::LeadForm::Question, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + WhopSDK::AdCreateParams::LeadForm::Question::Format::OrSymbol + ) + ) + end + attr_reader :format_ + + sig do + params( + format_: + WhopSDK::AdCreateParams::LeadForm::Question::Format::OrSymbol + ).void + end + attr_writer :format_ + + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + sig do + returns( + T.nilable( + T::Array[WhopSDK::AdCreateParams::LeadForm::Question::Option] + ) + ) + end + attr_reader :options + + sig do + params( + options: + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Question::Option::OrHash + ] + ).void + end + attr_writer :options + + sig do + returns( + T.nilable( + WhopSDK::AdCreateParams::LeadForm::Question::Type::OrSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: WhopSDK::AdCreateParams::LeadForm::Question::Type::OrSymbol + ).void + end + attr_writer :type + + sig do + params( + format_: + WhopSDK::AdCreateParams::LeadForm::Question::Format::OrSymbol, + label: String, + options: + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Question::Option::OrHash + ], + type: WhopSDK::AdCreateParams::LeadForm::Question::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(format_: nil, label: nil, options: nil, type: nil) + end + + sig do + override.returns( + { + format_: + WhopSDK::AdCreateParams::LeadForm::Question::Format::OrSymbol, + label: String, + options: + T::Array[WhopSDK::AdCreateParams::LeadForm::Question::Option], + type: + WhopSDK::AdCreateParams::LeadForm::Question::Type::OrSymbol + } + ) + end + def to_hash + end + + module Format + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::AdCreateParams::LeadForm::Question::Format + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SHORT_ANSWER = + T.let( + :short_answer, + WhopSDK::AdCreateParams::LeadForm::Question::Format::TaggedSymbol + ) + MULTIPLE_CHOICE = + T.let( + :multiple_choice, + WhopSDK::AdCreateParams::LeadForm::Question::Format::TaggedSymbol + ) + APPOINTMENT = + T.let( + :appointment, + WhopSDK::AdCreateParams::LeadForm::Question::Format::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Question::Format::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Option < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::LeadForm::Question::Option, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :key + + sig { params(key: String).void } + attr_writer :key + + sig do + returns( + T.nilable( + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic + ) + ) + end + attr_reader :logic + + sig do + params( + logic: + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::OrHash + ).void + end + attr_writer :logic + + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + sig do + params( + key: String, + logic: + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::OrHash, + value: String + ).returns(T.attached_class) + end + def self.new(key: nil, logic: nil, value: nil) + end + + sig do + override.returns( + { + key: String, + logic: + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic, + value: String + } + ) + end + def to_hash + end + + class Logic < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action::OrSymbol + ) + ) + end + attr_reader :action + + sig do + params( + action: + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action::OrSymbol + ).void + end + attr_writer :action + + sig { returns(T.nilable(Integer)) } + attr_reader :target_end_page_index + + sig { params(target_end_page_index: Integer).void } + attr_writer :target_end_page_index + + sig { returns(T.nilable(Integer)) } + attr_reader :target_question_index + + sig { params(target_question_index: Integer).void } + attr_writer :target_question_index + + sig do + params( + action: + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action::OrSymbol, + target_end_page_index: Integer, + target_question_index: Integer + ).returns(T.attached_class) + end + def self.new( + action: nil, + target_end_page_index: nil, + target_question_index: nil + ) + end + + sig do + override.returns( + { + action: + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action::OrSymbol, + target_end_page_index: Integer, + target_question_index: Integer + } + ) + end + def to_hash + end + + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GO_TO_QUESTION = + T.let( + :go_to_question, + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action::TaggedSymbol + ) + SUBMIT_FORM = + T.let( + :submit_form, + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action::TaggedSymbol + ) + CLOSE_FORM = + T.let( + :close_form, + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdCreateParams::LeadForm::Question::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL = + T.let( + :email, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + PHONE = + T.let( + :phone, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + FULL_NAME = + T.let( + :full_name, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + FIRST_NAME = + T.let( + :first_name, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + LAST_NAME = + T.let( + :last_name, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + CITY = + T.let( + :city, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + STATE = + T.let( + :state, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + ZIP = + T.let( + :zip, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + COUNTRY = + T.let( + :country, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + STREET_ADDRESS = + T.let( + :street_address, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + JOB_TITLE = + T.let( + :job_title, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + COMPANY_NAME = + T.let( + :company_name, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + WORK_EMAIL = + T.let( + :work_email, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + WORK_PHONE_NUMBER = + T.let( + :work_phone_number, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + DOB = + T.let( + :dob, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + GENDER = + T.let( + :gender, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + MARITAL_STATUS = + T.let( + :marital_status, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + RELATIONSHIP_STATUS = + T.let( + :relationship_status, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + MILITARY_STATUS = + T.let( + :military_status, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + DATE_TIME = + T.let( + :date_time, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdCreateParams::LeadForm::Question::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class MessagingConfig < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::MessagingConfig, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :keyword + + sig { params(keyword: String).void } + attr_writer :keyword + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + sig do + params(keyword: String, message: String).returns(T.attached_class) + end + def self.new(keyword: nil, message: nil) + end + + sig { override.returns({ keyword: String, message: String }) } + def to_hash + end + end + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + module PostSource + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCreateParams::PostSource) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FACEBOOK = + T.let(:facebook, WhopSDK::AdCreateParams::PostSource::TaggedSymbol) + INSTAGRAM = + T.let(:instagram, WhopSDK::AdCreateParams::PostSource::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdCreateParams::PostSource::TaggedSymbol] + ) + end + def self.values + end + end + + class SocialAccount < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdCreateParams::SocialAccount, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { params(id: String).returns(T.attached_class) } + def self.new(id: nil) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/ad_delete_params.rbi b/rbi/whop_sdk/models/ad_delete_params.rbi new file mode 100644 index 00000000..e7a562bf --- /dev/null +++ b/rbi/whop_sdk/models/ad_delete_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module WhopSDK + module Models + class AdDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AdDeleteParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/ad_delete_response.rbi b/rbi/whop_sdk/models/ad_delete_response.rbi new file mode 100644 index 00000000..05d1b023 --- /dev/null +++ b/rbi/whop_sdk/models/ad_delete_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module WhopSDK + module Models + AdDeleteResponse = T.let(T::Boolean, WhopSDK::Internal::Type::Converter) + end +end diff --git a/rbi/whop_sdk/models/ad_group.rbi b/rbi/whop_sdk/models/ad_group.rbi index 16b1c1f2..8f638171 100644 --- a/rbi/whop_sdk/models/ad_group.rbi +++ b/rbi/whop_sdk/models/ad_group.rbi @@ -6,233 +6,470 @@ module WhopSDK OrHash = T.type_alias { T.any(WhopSDK::AdGroup, WhopSDK::Internal::AnyHash) } - # The unique identifier for this ad group. + # Unique identifier for the ad group. sig { returns(String) } attr_accessor :id - # The ad campaign this ad group belongs to. + # The ad campaign this ad group belongs to, an object with an id. sig { returns(WhopSDK::AdGroup::AdCampaign) } attr_reader :ad_campaign sig { params(ad_campaign: WhopSDK::AdGroup::AdCampaign::OrHash).void } attr_writer :ad_campaign - # Budget amount in dollars. + # Whop pixel-attributed add-to-cart events, last-click. + sig { returns(Float) } + attr_accessor :added_to_carts + + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + sig { returns(T.anything) } + attr_accessor :audiences + + # Bid strategy. + sig { returns(T.nilable(WhopSDK::AdGroup::BidType::TaggedSymbol)) } + attr_accessor :bid_type + + # Ad-set budget; null when the campaign owns budget (CBO). sig { returns(T.nilable(Float)) } - attr_accessor :budget + attr_accessor :budget_amount - # The budget type for an ad campaign or ad group. - sig { returns(T.nilable(WhopSDK::AdBudgetType::TaggedSymbol)) } + # Whether the budget is daily or lifetime. + sig { returns(T.nilable(WhopSDK::AdGroup::BudgetType::TaggedSymbol)) } attr_accessor :budget_type - # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # Clicks divided by impressions, between 0 and 1. sig { returns(Float) } attr_accessor :click_through_rate - # Total clicks on this ad group's ads in the stats window. - sig { returns(Integer) } + # The number of clicks. + sig { returns(Float) } attr_accessor :clicks - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Whop pixel-attributed complete-registration events, last-click. + sig { returns(Float) } + attr_accessor :completed_registrations + + # Whop pixel-attributed contact events, last-click. + sig { returns(Float) } + attr_accessor :contacts + + # The pixel event optimized for. A standard event, or any custom pixel event name. + sig { returns(T.nilable(WhopSDK::AdGroup::ConversionEvent::Variants)) } + attr_accessor :conversion_event + + # Where results happen: website, profile (IG/FB), messaging (DM), on_ad + # (engagement), or the lead destinations (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). + sig do + returns(T.nilable(WhopSDK::AdGroup::ConversionLocation::TaggedSymbol)) + end + attr_accessor :conversion_location + + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_added_to_cart + + # Spend divided by 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 + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_completed_registration + + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_contact + + # Spend divided by attributed leads; null when leads are not a goal and none are # 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. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. sig { returns(T.nilable(Float)) } attr_accessor :cost_per_result - # When the ad group was created. - sig { returns(Time) } + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_schedule + + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_submitted_application + + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_viewed_content + + # When the ad group was created, ISO 8601. + sig { returns(String) } attr_accessor :created_at - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + sig { returns(Float) } + attr_accessor :custom_conversions + + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + sig { returns(WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) } + attr_accessor :delivery_status + + # Demographic targeting: automatic (Advantage+), age range, gender. + sig { returns(T.anything) } + attr_accessor :demographics + + # Target/cap cost for average_target / maximum_target. + sig { returns(T.nilable(Float)) } + attr_accessor :desired_cost_per_result + + # Device targeting: platforms and operating systems. + sig { returns(T.anything) } + attr_accessor :devices + + # Whether ads within this ad group have their creatives and copy dynamically AB + # tested. + sig { returns(T::Boolean) } + attr_accessor :dynamic_creative + + # Schedule end, ISO 8601. + sig { returns(T.nilable(String)) } + attr_accessor :ends_at + + # Platform-reported impressions divided by reach. sig { returns(T.nilable(Float)) } attr_accessor :frequency - # Total impressions (views) on this ad group's ads in the stats window. - sig { returns(Integer) } + # Impression cap; only valid for reach optimization. + sig { returns(T.nilable(T.anything)) } + attr_accessor :frequency_cap + + # The number of impressions. + sig { returns(Float) } 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) } + sig { returns(T::Array[String]) } + attr_accessor :languages + + # Whop pixel-attributed leads, last-click. + sig { returns(Float) } 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 + sig { returns(T::Array[String]) } + attr_accessor :message_apps + + # Daily spend floor within the budget. + sig { returns(T.nilable(Float)) } + attr_accessor :minimum_daily_spend - # Total USD value of Whop pixel-attributed purchases in the stats window. + # What the ad group optimizes for. + sig { returns(T.nilable(String)) } + attr_accessor :optimization_goal + + sig { returns(T::Array[T.anything]) } + attr_accessor :placements + + # USD value of pixel-attributed purchases. sig { returns(Float) } attr_accessor :purchase_value - # Number of Whop pixel-attributed purchases (last-click) in the stats window. - sig { returns(Integer) } + # Whop pixel-attributed purchases, last-click. + sig { returns(Float) } attr_accessor :purchases - # Unique users reached in the stats window (deduplicated by the platform). - sig { returns(Integer) } + # The number of unique people who saw this. + sig { returns(Float) } 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. + # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. + # US-CA), cities, zips. + sig { returns(T.anything) } + attr_accessor :regions + + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + sig { returns(T.nilable(WhopSDK::AdGroup::ResultEvent::TaggedSymbol)) } + attr_accessor :result_event + + # The merchant-defined event name when result_event is custom; null for the + # standard events. + sig { returns(T.nilable(String)) } + attr_accessor :result_event_name + + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. sig { returns(Float) } attr_accessor :return_on_ad_spend - # Amount charged in dollars in the stats window. + # Whop pixel-attributed schedule events, last-click. + sig { returns(Float) } + attr_accessor :schedules + + # The amount charged, in spend_currency. sig { returns(Float) } attr_accessor :spend - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + # The ISO 4217 currency code of all monetary metrics. + sig { returns(T.nilable(String)) } attr_accessor :spend_currency - # Current operational status of the ad group. - sig { returns(WhopSDK::AdGroupStatus::TaggedSymbol) } + # Schedule start, ISO 8601. + sig { returns(T.nilable(String)) } + attr_accessor :starts_at + + # Delivery status of the ad group. + sig { returns(WhopSDK::AdGroup::Status::TaggedSymbol) } attr_accessor :status - # The ad group name shown in the Whop dashboard. + # Whop pixel-attributed submit-application events, last-click. + sig { returns(Float) } + attr_accessor :submitted_applications + + # The display title of the ad group. sig { returns(T.nilable(String)) } attr_accessor :title - # Unique click-through rate as a fraction of impressions (unique clicks / - # impressions, 0–1). + # Unique clicks divided by impressions, between 0 and 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) } + # The number of unique clicks. + sig { returns(Float) } attr_accessor :unique_clicks - # When the ad group was last updated. - sig { returns(Time) } + # When the ad group was last updated, ISO 8601. + sig { returns(String) } attr_accessor :updated_at - # An ad group belonging to an ad campaign. + # Whop pixel-attributed view-content events, last-click. + sig { returns(Float) } + attr_accessor :viewed_contents + sig do params( id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign::OrHash, - budget: T.nilable(Float), - budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), + added_to_carts: Float, + audiences: T.anything, + bid_type: T.nilable(WhopSDK::AdGroup::BidType::OrSymbol), + budget_amount: T.nilable(Float), + budget_type: T.nilable(WhopSDK::AdGroup::BudgetType::OrSymbol), click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: + T.nilable( + T.any(WhopSDK::AdGroup::ConversionEvent::OrSymbol, String) + ), + conversion_location: + T.nilable(WhopSDK::AdGroup::ConversionLocation::OrSymbol), + cost_per_added_to_cart: T.nilable(Float), cost_per_click: Float, + cost_per_completed_registration: T.nilable(Float), + cost_per_contact: T.nilable(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, + cost_per_schedule: T.nilable(Float), + cost_per_submitted_application: T.nilable(Float), + cost_per_viewed_content: T.nilable(Float), + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdGroup::DeliveryStatus::OrSymbol, + demographics: T.anything, + desired_cost_per_result: T.nilable(Float), + devices: T.anything, + dynamic_creative: T::Boolean, + ends_at: T.nilable(String), frequency: T.nilable(Float), - impressions: Integer, + frequency_cap: T.nilable(T.anything), + impressions: Float, issues: T::Array[WhopSDK::AdGroup::Issue::OrHash], - leads: Integer, - platform: WhopSDK::AdCampaignPlatform::OrSymbol, + languages: T::Array[String], + leads: Float, + message_apps: T::Array[String], + minimum_daily_spend: T.nilable(Float), + optimization_goal: T.nilable(String), + placements: T::Array[T.anything], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: T.anything, + result_event: T.nilable(WhopSDK::AdGroup::ResultEvent::OrSymbol), + result_event_name: T.nilable(String), return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), - status: WhopSDK::AdGroupStatus::OrSymbol, + spend_currency: T.nilable(String), + starts_at: T.nilable(String), + status: WhopSDK::AdGroup::Status::OrSymbol, + submitted_applications: Float, title: T.nilable(String), unique_click_through_rate: T.nilable(Float), - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float ).returns(T.attached_class) end def self.new( - # The unique identifier for this ad group. + # Unique identifier for the ad group. id:, - # The ad campaign this ad group belongs to. + # The ad campaign this ad group belongs to, an object with an id. ad_campaign:, - # Budget amount in dollars. - budget:, - # The budget type for an ad campaign or ad group. + # Whop pixel-attributed add-to-cart events, last-click. + added_to_carts:, + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + audiences:, + # Bid strategy. + bid_type:, + # Ad-set budget; null when the campaign owns budget (CBO). + budget_amount:, + # Whether the budget is daily or lifetime. budget_type:, - # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # Clicks divided by impressions, between 0 and 1. click_through_rate:, - # Total clicks on this ad group's ads in the stats window. + # The number of clicks. clicks:, - # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # Whop pixel-attributed complete-registration events, last-click. + completed_registrations:, + # Whop pixel-attributed contact events, last-click. + contacts:, + # The pixel event optimized for. A standard event, or any custom pixel event name. + conversion_event:, + # Where results happen: website, profile (IG/FB), messaging (DM), on_ad + # (engagement), or the lead destinations (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). + conversion_location:, + # Spend divided by attributed add-to-cart events; null when they are not the goal + # and none are attributed. + cost_per_added_to_cart:, + # Spend divided by 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 + # Spend divided by attributed complete-registration events; null when they are not + # the goal and none are attributed. + cost_per_completed_registration:, + # Spend divided by attributed contact events; null when contacts are not the goal + # and none are attributed. + cost_per_contact:, + # Spend divided by attributed leads; null when leads are not a goal and none are # attributed. cost_per_lead:, - # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there - # are no impressions. + # Spend per 1,000 impressions; 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. + # Spend divided by attributed purchases; null when purchases are not a goal and + # none are 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. + # Spend divided by Whop pixel-attributed results; null when nothing + # Whop-attributable is being optimized for. cost_per_result:, - # When the ad group was created. + # Spend divided by attributed schedule events; null when schedules are not the + # goal and none are attributed. + cost_per_schedule:, + # Spend divided by attributed submit-application events; null when they are not + # the goal and none are attributed. + cost_per_submitted_application:, + # Spend divided by attributed view-content events; null when they are not the goal + # and none are attributed. + cost_per_viewed_content:, + # When the ad group was created, ISO 8601. created_at:, - # Average number of times each person saw an ad (impressions / reach), as reported - # by the platform. + # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, + # across all custom event names. + custom_conversions:, + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + delivery_status:, + # Demographic targeting: automatic (Advantage+), age range, gender. + demographics:, + # Target/cap cost for average_target / maximum_target. + desired_cost_per_result:, + # Device targeting: platforms and operating systems. + devices:, + # Whether ads within this ad group have their creatives and copy dynamically AB + # tested. + dynamic_creative:, + # Schedule end, ISO 8601. + ends_at:, + # Platform-reported impressions divided by reach. frequency:, - # Total impressions (views) on this ad group's ads in the stats window. + # Impression cap; only valid for reach optimization. + frequency_cap:, + # The number of impressions. 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. + languages:, + # Whop pixel-attributed leads, last-click. 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. + message_apps:, + # Daily spend floor within the budget. + minimum_daily_spend:, + # What the ad group optimizes for. + optimization_goal:, + placements:, + # USD value of pixel-attributed purchases. purchase_value:, - # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # Whop pixel-attributed purchases, last-click. purchases:, - # Unique users reached in the stats window (deduplicated by the platform). + # The number of unique people who saw this. 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. + # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. + # US-CA), cities, zips. + regions:, + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + result_event:, + # The merchant-defined event name when result_event is custom; null for the + # standard events. + result_event_name:, + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when + # there is no spend. return_on_ad_spend:, - # Amount charged in dollars in the stats window. + # Whop pixel-attributed schedule events, last-click. + schedules:, + # The amount charged, in spend_currency. spend:, - # The available currencies on the platform + # The ISO 4217 currency code of all monetary metrics. spend_currency:, - # Current operational status of the ad group. + # Schedule start, ISO 8601. + starts_at:, + # Delivery status of the ad group. status:, - # The ad group name shown in the Whop dashboard. + # Whop pixel-attributed submit-application events, last-click. + submitted_applications:, + # The display title of the ad group. title:, - # Unique click-through rate as a fraction of impressions (unique clicks / - # impressions, 0–1). + # Unique clicks divided by impressions, between 0 and 1. unique_click_through_rate:, - # Unique clicks (deduplicated by the platform) in the stats window. + # The number of unique clicks. unique_clicks:, - # When the ad group was last updated. - updated_at: + # When the ad group was last updated, ISO 8601. + updated_at:, + # Whop pixel-attributed view-content events, last-click. + viewed_contents: ) end @@ -241,32 +478,67 @@ module WhopSDK { id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign, - budget: T.nilable(Float), - budget_type: T.nilable(WhopSDK::AdBudgetType::TaggedSymbol), + added_to_carts: Float, + audiences: T.anything, + bid_type: T.nilable(WhopSDK::AdGroup::BidType::TaggedSymbol), + budget_amount: T.nilable(Float), + budget_type: T.nilable(WhopSDK::AdGroup::BudgetType::TaggedSymbol), click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: + T.nilable(WhopSDK::AdGroup::ConversionEvent::Variants), + conversion_location: + T.nilable(WhopSDK::AdGroup::ConversionLocation::TaggedSymbol), + cost_per_added_to_cart: T.nilable(Float), cost_per_click: Float, + cost_per_completed_registration: T.nilable(Float), + cost_per_contact: T.nilable(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, + cost_per_schedule: T.nilable(Float), + cost_per_submitted_application: T.nilable(Float), + cost_per_viewed_content: T.nilable(Float), + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol, + demographics: T.anything, + desired_cost_per_result: T.nilable(Float), + devices: T.anything, + dynamic_creative: T::Boolean, + ends_at: T.nilable(String), frequency: T.nilable(Float), - impressions: Integer, + frequency_cap: T.nilable(T.anything), + impressions: Float, issues: T::Array[WhopSDK::AdGroup::Issue], - leads: Integer, - platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + languages: T::Array[String], + leads: Float, + message_apps: T::Array[String], + minimum_daily_spend: T.nilable(Float), + optimization_goal: T.nilable(String), + placements: T::Array[T.anything], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: T.anything, + result_event: + T.nilable(WhopSDK::AdGroup::ResultEvent::TaggedSymbol), + result_event_name: T.nilable(String), return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), - status: WhopSDK::AdGroupStatus::TaggedSymbol, + spend_currency: T.nilable(String), + starts_at: T.nilable(String), + status: WhopSDK::AdGroup::Status::TaggedSymbol, + submitted_applications: Float, title: T.nilable(String), unique_click_through_rate: T.nilable(Float), - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } ) end @@ -279,14 +551,14 @@ module WhopSDK T.any(WhopSDK::AdGroup::AdCampaign, WhopSDK::Internal::AnyHash) end - # The unique identifier for this ad campaign. + # The referenced entity's id. sig { returns(String) } attr_accessor :id - # The ad campaign this ad group belongs to. + # The ad campaign this ad group belongs to, an object with an id. sig { params(id: String).returns(T.attached_class) } def self.new( - # The unique identifier for this ad campaign. + # The referenced entity's id. id: ) end @@ -296,160 +568,349 @@ module WhopSDK end end - class Issue < WhopSDK::Internal::Type::BaseModel - OrHash = + # Bid strategy. + module BidType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::AdGroup::BidType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MINIMUM_COST = + T.let(:minimum_cost, WhopSDK::AdGroup::BidType::TaggedSymbol) + AVERAGE_TARGET = + T.let(:average_target, WhopSDK::AdGroup::BidType::TaggedSymbol) + MAXIMUM_TARGET = + T.let(:maximum_target, WhopSDK::AdGroup::BidType::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::AdGroup::BidType::TaggedSymbol]) + end + def self.values + end + end + + # Whether the budget is daily or lifetime. + module BudgetType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroup::BudgetType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAILY = T.let(:daily, WhopSDK::AdGroup::BudgetType::TaggedSymbol) + LIFETIME = T.let(:lifetime, WhopSDK::AdGroup::BudgetType::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::AdGroup::BudgetType::TaggedSymbol]) + end + def self.values + end + end + + # The pixel event optimized for. A standard event, or any custom pixel event name. + module ConversionEvent + extend WhopSDK::Internal::Type::Union + + Variants = T.type_alias do - T.any(WhopSDK::AdGroup::Issue, WhopSDK::Internal::AnyHash) + T.any(WhopSDK::AdGroup::ConversionEvent::TaggedSymbol, String) end - # Whop's canonical category that a raw platform issue is bucketed into. sig do - returns(T.nilable(WhopSDK::AdGroup::Issue::Category::TaggedSymbol)) + override.returns( + T::Array[WhopSDK::AdGroup::ConversionEvent::Variants] + ) + end + def self.variants end - attr_accessor :category - # When the issue was first reported. - sig { returns(Time) } - attr_accessor :created_at + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroup::ConversionEvent) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PURCHASE = + T.let(:purchase, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + ADD_TO_CART = + T.let(:add_to_cart, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + INITIATED_CHECKOUT = + T.let( + :initiated_checkout, + WhopSDK::AdGroup::ConversionEvent::TaggedSymbol + ) + ADD_PAYMENT_INFO = + T.let( + :add_payment_info, + WhopSDK::AdGroup::ConversionEvent::TaggedSymbol + ) + COMPLETE_REGISTRATION = + T.let( + :complete_registration, + WhopSDK::AdGroup::ConversionEvent::TaggedSymbol + ) + LEAD = T.let(:lead, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + CONTENT_VIEW = + T.let(:content_view, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + SEARCH = T.let(:search, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + CONTACT = + T.let(:contact, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + CUSTOMIZE_PRODUCT = + T.let( + :customize_product, + WhopSDK::AdGroup::ConversionEvent::TaggedSymbol + ) + DONATE = T.let(:donate, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + FIND_LOCATION = + T.let(:find_location, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + SCHEDULE = + T.let(:schedule, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + START_TRIAL = + T.let(:start_trial, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + SUBMIT_APPLICATION = + T.let( + :submit_application, + WhopSDK::AdGroup::ConversionEvent::TaggedSymbol + ) + SUBSCRIBE = + T.let(:subscribe, WhopSDK::AdGroup::ConversionEvent::TaggedSymbol) + end - # Current resolution status. - sig { returns(WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol) } - attr_accessor :resolution_status + # Where results happen: website, profile (IG/FB), messaging (DM), on_ad + # (engagement), or the lead destinations (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). + module ConversionLocation + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroup::ConversionLocation) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WEBSITE = + T.let(:website, WhopSDK::AdGroup::ConversionLocation::TaggedSymbol) + PROFILE = + T.let(:profile, WhopSDK::AdGroup::ConversionLocation::TaggedSymbol) + MESSAGING = + T.let(:messaging, WhopSDK::AdGroup::ConversionLocation::TaggedSymbol) + ON_AD = + T.let(:on_ad, WhopSDK::AdGroup::ConversionLocation::TaggedSymbol) + INSTANT_FORMS = + T.let( + :instant_forms, + WhopSDK::AdGroup::ConversionLocation::TaggedSymbol + ) + INSTANT_FORMS_AND_MESSENGER = + T.let( + :instant_forms_and_messenger, + WhopSDK::AdGroup::ConversionLocation::TaggedSymbol + ) + WEBSITE_AND_INSTANT_FORMS = + T.let( + :website_and_instant_forms, + WhopSDK::AdGroup::ConversionLocation::TaggedSymbol + ) - # 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 + sig do + override.returns( + T::Array[WhopSDK::AdGroup::ConversionLocation::TaggedSymbol] + ) + end + def self.values + end + end + + # The current delivery state, mirroring the Delivery column in the ads dashboard. + # When several states apply at once, the highest-precedence one is returned. + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroup::DeliveryStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. - # Pairs with `resourceId`. + ALL_ADS_REJECTED = + T.let( + :all_ads_rejected, + WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol + ) + REJECTED = + T.let(:rejected, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + DRAFT = T.let(:draft, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + NO_ADS = T.let(:no_ads, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + CAMPAIGN_PAUSED = + T.let( + :campaign_paused, + WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol + ) + PAUSED = T.let(:paused, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + PROCESSING = + T.let(:processing, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + ISSUES = T.let(:issues, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + SCHEDULED = + T.let(:scheduled, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + COMPLETED = + T.let(:completed, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + ADS_OFF = + T.let(:ads_off, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + LEARNING_LIMITED = + T.let( + :learning_limited, + WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol + ) + LEARNING = + T.let(:learning, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + ACTIVE = T.let(:active, WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol] + ) + end + def self.values + end + end + + class Issue < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::AdGroup::Issue, WhopSDK::Internal::AnyHash) + end + + # Unique identifier for the issue. sig { returns(String) } - attr_accessor :resource_type + attr_accessor :id + + # A description of what the issue is and how it can be resolved. + sig { returns(String) } + attr_accessor :message - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). + # The ID of the campaign, ad group, or ad the issue is attached to. sig { returns(T.nilable(String)) } - attr_accessor :subtype + attr_accessor :resource_id + + # The type of resource the issue is attached to. + sig { returns(WhopSDK::AdGroup::Issue::ResourceType::TaggedSymbol) } + attr_accessor :resource_type - # A platform-reported issue on an ad object (rejection, policy flag, etc.). + # Open issues affecting this ad group and its descendant ads. Empty when there are + # none. sig do params( - category: T.nilable(WhopSDK::AdGroup::Issue::Category::OrSymbol), - created_at: Time, - resolution_status: - WhopSDK::AdGroup::Issue::ResolutionStatus::OrSymbol, + id: String, + message: String, resource_id: T.nilable(String), - resource_type: String, - subtype: T.nilable(String) + resource_type: WhopSDK::AdGroup::Issue::ResourceType::OrSymbol ).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:, - # 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. + # Unique identifier for the issue. + id:, + # A description of what the issue is and how it can be resolved. + message:, + # The ID of the campaign, ad group, or ad the issue is attached to. resource_id:, - # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. - # Pairs with `resourceId`. - resource_type:, - # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for - # a rejection). - subtype: + # The type of resource the issue is attached to. + resource_type: ) end sig do override.returns( { - category: - T.nilable(WhopSDK::AdGroup::Issue::Category::TaggedSymbol), - created_at: Time, - resolution_status: - WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol, + id: String, + message: String, resource_id: T.nilable(String), - resource_type: String, - subtype: T.nilable(String) + resource_type: WhopSDK::AdGroup::Issue::ResourceType::TaggedSymbol } ) end def to_hash end - # Whop's canonical category that a raw platform issue is bucketed into. - module Category + # The type of resource the issue is attached to. + module ResourceType extend WhopSDK::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::AdGroup::Issue::Category) } + T.type_alias do + T.all(Symbol, WhopSDK::AdGroup::Issue::ResourceType) + end 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 = + AD_CAMPAIGN = T.let( - :audience_targeting, - WhopSDK::AdGroup::Issue::Category::TaggedSymbol + :ad_campaign, + WhopSDK::AdGroup::Issue::ResourceType::TaggedSymbol ) - AD_VOLUME_LIMIT = + AD_GROUP = T.let( - :ad_volume_limit, - WhopSDK::AdGroup::Issue::Category::TaggedSymbol + :ad_group, + WhopSDK::AdGroup::Issue::ResourceType::TaggedSymbol ) + AD = T.let(:ad, WhopSDK::AdGroup::Issue::ResourceType::TaggedSymbol) sig do override.returns( - T::Array[WhopSDK::AdGroup::Issue::Category::TaggedSymbol] + T::Array[WhopSDK::AdGroup::Issue::ResourceType::TaggedSymbol] ) end def self.values end end + end - # Current resolution status. - module ResolutionStatus - extend WhopSDK::Internal::Type::Enum + # The Whop pixel conversion event whose attributed count represents results — the + # optimization goal, or the highest-volume attributed event for campaigns that + # budget per ad group. Null when the goal isn't a Whop-attributed event. + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroup::ResultEvent) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PURCHASE = T.let(:purchase, WhopSDK::AdGroup::ResultEvent::TaggedSymbol) + LEAD = T.let(:lead, WhopSDK::AdGroup::ResultEvent::TaggedSymbol) + SCHEDULE = T.let(:schedule, WhopSDK::AdGroup::ResultEvent::TaggedSymbol) + SUBMIT_APPLICATION = + T.let( + :submit_application, + WhopSDK::AdGroup::ResultEvent::TaggedSymbol + ) + CONTACT = T.let(:contact, WhopSDK::AdGroup::ResultEvent::TaggedSymbol) + COMPLETE_REGISTRATION = + T.let( + :complete_registration, + WhopSDK::AdGroup::ResultEvent::TaggedSymbol + ) + VIEW_CONTENT = + T.let(:view_content, WhopSDK::AdGroup::ResultEvent::TaggedSymbol) + ADD_TO_CART = + T.let(:add_to_cart, WhopSDK::AdGroup::ResultEvent::TaggedSymbol) + CUSTOM = T.let(:custom, WhopSDK::AdGroup::ResultEvent::TaggedSymbol) - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::AdGroup::Issue::ResolutionStatus) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + sig do + override.returns( + T::Array[WhopSDK::AdGroup::ResultEvent::TaggedSymbol] + ) + end + def self.values + end + end - 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 - ) + # Delivery status of the ad group. + module Status + extend WhopSDK::Internal::Type::Enum - sig do - override.returns( - T::Array[WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol] - ) - end - def self.values - end + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::AdGroup::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = T.let(:active, WhopSDK::AdGroup::Status::TaggedSymbol) + PAUSED = T.let(:paused, WhopSDK::AdGroup::Status::TaggedSymbol) + REJECTED = T.let(:rejected, WhopSDK::AdGroup::Status::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::AdGroup::Status::TaggedSymbol]) + end + def self.values end end end diff --git a/rbi/whop_sdk/models/ad_group_create_params.rbi b/rbi/whop_sdk/models/ad_group_create_params.rbi new file mode 100644 index 00000000..1ff2d788 --- /dev/null +++ b/rbi/whop_sdk/models/ad_group_create_params.rbi @@ -0,0 +1,654 @@ +# typed: strong + +module WhopSDK + module Models + class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AdGroupCreateParams, WhopSDK::Internal::AnyHash) + end + + # The ad campaign to create the ad group in. + sig { returns(String) } + attr_accessor :ad_campaign_id + + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # Incompatible with demographics.automatic (Advantage+). + sig { returns(T.nilable(T.anything)) } + attr_reader :audiences + + sig { params(audiences: T.anything).void } + attr_writer :audiences + + # Bid strategy. + sig do + returns(T.nilable(WhopSDK::AdGroupCreateParams::BidType::OrSymbol)) + end + attr_reader :bid_type + + sig do + params(bid_type: WhopSDK::AdGroupCreateParams::BidType::OrSymbol).void + end + attr_writer :bid_type + + # Ad-set budget in dollars (ABO only; omit under CBO). + sig { returns(T.nilable(Float)) } + attr_reader :budget_amount + + sig { params(budget_amount: Float).void } + attr_writer :budget_amount + + # Whether the budget is daily or lifetime. + sig do + returns(T.nilable(WhopSDK::AdGroupCreateParams::BudgetType::OrSymbol)) + end + attr_reader :budget_type + + sig do + params( + budget_type: WhopSDK::AdGroupCreateParams::BudgetType::OrSymbol + ).void + end + attr_writer :budget_type + + # The pixel event optimized for. A standard event, or any custom pixel event name. + sig do + returns( + T.nilable( + T.any( + WhopSDK::AdGroupCreateParams::ConversionEvent::OrSymbol, + String + ) + ) + ) + end + attr_accessor :conversion_event + + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + sig do + returns( + T.nilable(WhopSDK::AdGroupCreateParams::ConversionLocation::OrSymbol) + ) + end + attr_reader :conversion_location + + sig do + params( + conversion_location: + WhopSDK::AdGroupCreateParams::ConversionLocation::OrSymbol + ).void + end + attr_writer :conversion_location + + # Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + sig { returns(T.nilable(T.anything)) } + attr_reader :demographics + + sig { params(demographics: T.anything).void } + attr_writer :demographics + + # Target/cap cost for average_target / maximum_target. + sig { returns(T.nilable(Float)) } + attr_reader :desired_cost_per_result + + sig { params(desired_cost_per_result: Float).void } + attr_writer :desired_cost_per_result + + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + sig { returns(T.nilable(T.anything)) } + attr_reader :devices + + sig { params(devices: T.anything).void } + attr_writer :devices + + # Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; + # immutable afterward. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :dynamic_creative + + sig { params(dynamic_creative: T::Boolean).void } + attr_writer :dynamic_creative + + # Schedule end, ISO 8601. + sig { returns(T.nilable(String)) } + attr_reader :ends_at + + sig { params(ends_at: String).void } + attr_writer :ends_at + + # { maximum_impressions, per_days } — only valid for reach optimization. + sig { returns(T.nilable(T.anything)) } + attr_reader :frequency_cap + + sig { params(frequency_cap: T.anything).void } + attr_writer :frequency_cap + + # Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all + # languages. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :languages + + sig { params(languages: T::Array[String]).void } + attr_writer :languages + + # Required when conversion_location is messaging: which apps to message on. + # Combinations map to the matching Meta destination. + sig do + returns( + T.nilable( + T::Array[WhopSDK::AdGroupCreateParams::MessageApp::OrSymbol] + ) + ) + end + attr_reader :message_apps + + sig do + params( + message_apps: + T::Array[WhopSDK::AdGroupCreateParams::MessageApp::OrSymbol] + ).void + end + attr_writer :message_apps + + # Daily spend floor within the budget. + sig { returns(T.nilable(Float)) } + attr_reader :minimum_daily_spend + + sig { params(minimum_daily_spend: Float).void } + attr_writer :minimum_daily_spend + + # What the ad group optimizes for (e.g. conversions, link_clicks, reach). + sig { returns(T.nilable(String)) } + attr_reader :optimization_goal + + sig { params(optimization_goal: String).void } + attr_writer :optimization_goal + + # 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # target all of a platform's. + # + # Valid positions per platform: + # + # - `facebook`: `feed`, `right_hand_column`, `marketplace`, `search`, + # `profile_feed`, `notification`, `story`, `instream_video`, `facebook_reels`, + # `facebook_reels_overlay`, `biz_disco_feed` + # - `instagram`: `stream`, `story`, `explore`, `explore_home`, `reels`, + # `profile_feed`, `profile_reels`, `ig_search` + # - `messenger`: `story` + # - `audience_network`: `classic`, `rewarded_video` + # - `threads`: `threads_stream` + # - `whatsapp`: `status` + sig { returns(T.nilable(T.anything)) } + attr_reader :placements + + sig { params(placements: T.anything).void } + attr_writer :placements + + # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + sig { returns(T.nilable(T.anything)) } + attr_reader :regions + + sig { params(regions: T.anything).void } + attr_writer :regions + + # Schedule start, ISO 8601. + sig { returns(T.nilable(String)) } + attr_reader :starts_at + + sig { params(starts_at: String).void } + attr_writer :starts_at + + # Initial status (default: active). + sig { returns(T.nilable(WhopSDK::AdGroupCreateParams::Status::OrSymbol)) } + attr_reader :status + + sig do + params(status: WhopSDK::AdGroupCreateParams::Status::OrSymbol).void + end + attr_writer :status + + # The display name of the ad group. + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + sig do + params( + ad_campaign_id: String, + audiences: T.anything, + bid_type: WhopSDK::AdGroupCreateParams::BidType::OrSymbol, + budget_amount: Float, + budget_type: WhopSDK::AdGroupCreateParams::BudgetType::OrSymbol, + conversion_event: + T.nilable( + T.any( + WhopSDK::AdGroupCreateParams::ConversionEvent::OrSymbol, + String + ) + ), + conversion_location: + WhopSDK::AdGroupCreateParams::ConversionLocation::OrSymbol, + demographics: T.anything, + desired_cost_per_result: Float, + devices: T.anything, + dynamic_creative: T::Boolean, + ends_at: String, + frequency_cap: T.anything, + languages: T::Array[String], + message_apps: + T::Array[WhopSDK::AdGroupCreateParams::MessageApp::OrSymbol], + minimum_daily_spend: Float, + optimization_goal: String, + placements: T.anything, + regions: T.anything, + starts_at: String, + status: WhopSDK::AdGroupCreateParams::Status::OrSymbol, + title: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ad campaign to create the ad group in. + ad_campaign_id:, + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # Incompatible with demographics.automatic (Advantage+). + audiences: nil, + # Bid strategy. + bid_type: nil, + # Ad-set budget in dollars (ABO only; omit under CBO). + budget_amount: nil, + # Whether the budget is daily or lifetime. + budget_type: nil, + # The pixel event optimized for. A standard event, or any custom pixel event name. + conversion_event: nil, + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + conversion_location: nil, + # Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + demographics: nil, + # Target/cap cost for average_target / maximum_target. + desired_cost_per_result: nil, + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + devices: nil, + # Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; + # immutable afterward. + dynamic_creative: nil, + # Schedule end, ISO 8601. + ends_at: nil, + # { maximum_impressions, per_days } — only valid for reach optimization. + frequency_cap: nil, + # Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all + # languages. + languages: nil, + # Required when conversion_location is messaging: which apps to message on. + # Combinations map to the matching Meta destination. + message_apps: nil, + # Daily spend floor within the budget. + minimum_daily_spend: nil, + # What the ad group optimizes for (e.g. conversions, link_clicks, reach). + optimization_goal: nil, + # 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # target all of a platform's. + # + # Valid positions per platform: + # + # - `facebook`: `feed`, `right_hand_column`, `marketplace`, `search`, + # `profile_feed`, `notification`, `story`, `instream_video`, `facebook_reels`, + # `facebook_reels_overlay`, `biz_disco_feed` + # - `instagram`: `stream`, `story`, `explore`, `explore_home`, `reels`, + # `profile_feed`, `profile_reels`, `ig_search` + # - `messenger`: `story` + # - `audience_network`: `classic`, `rewarded_video` + # - `threads`: `threads_stream` + # - `whatsapp`: `status` + placements: nil, + # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + regions: nil, + # Schedule start, ISO 8601. + starts_at: nil, + # Initial status (default: active). + status: nil, + # The display name of the ad group. + title: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + ad_campaign_id: String, + audiences: T.anything, + bid_type: WhopSDK::AdGroupCreateParams::BidType::OrSymbol, + budget_amount: Float, + budget_type: WhopSDK::AdGroupCreateParams::BudgetType::OrSymbol, + conversion_event: + T.nilable( + T.any( + WhopSDK::AdGroupCreateParams::ConversionEvent::OrSymbol, + String + ) + ), + conversion_location: + WhopSDK::AdGroupCreateParams::ConversionLocation::OrSymbol, + demographics: T.anything, + desired_cost_per_result: Float, + devices: T.anything, + dynamic_creative: T::Boolean, + ends_at: String, + frequency_cap: T.anything, + languages: T::Array[String], + message_apps: + T::Array[WhopSDK::AdGroupCreateParams::MessageApp::OrSymbol], + minimum_daily_spend: Float, + optimization_goal: String, + placements: T.anything, + regions: T.anything, + starts_at: String, + status: WhopSDK::AdGroupCreateParams::Status::OrSymbol, + title: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Bid strategy. + module BidType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroupCreateParams::BidType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MINIMUM_COST = + T.let( + :minimum_cost, + WhopSDK::AdGroupCreateParams::BidType::TaggedSymbol + ) + AVERAGE_TARGET = + T.let( + :average_target, + WhopSDK::AdGroupCreateParams::BidType::TaggedSymbol + ) + MAXIMUM_TARGET = + T.let( + :maximum_target, + WhopSDK::AdGroupCreateParams::BidType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdGroupCreateParams::BidType::TaggedSymbol] + ) + end + def self.values + end + end + + # Whether the budget is daily or lifetime. + module BudgetType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroupCreateParams::BudgetType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAILY = + T.let(:daily, WhopSDK::AdGroupCreateParams::BudgetType::TaggedSymbol) + LIFETIME = + T.let( + :lifetime, + WhopSDK::AdGroupCreateParams::BudgetType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdGroupCreateParams::BudgetType::TaggedSymbol] + ) + end + def self.values + end + end + + # The pixel event optimized for. A standard event, or any custom pixel event name. + module ConversionEvent + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol, + String + ) + end + + sig do + override.returns( + T::Array[WhopSDK::AdGroupCreateParams::ConversionEvent::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroupCreateParams::ConversionEvent) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PURCHASE = + T.let( + :purchase, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + ADD_TO_CART = + T.let( + :add_to_cart, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + INITIATED_CHECKOUT = + T.let( + :initiated_checkout, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + ADD_PAYMENT_INFO = + T.let( + :add_payment_info, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + COMPLETE_REGISTRATION = + T.let( + :complete_registration, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + LEAD = + T.let( + :lead, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + CONTENT_VIEW = + T.let( + :content_view, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + SEARCH = + T.let( + :search, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + CONTACT = + T.let( + :contact, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + CUSTOMIZE_PRODUCT = + T.let( + :customize_product, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + DONATE = + T.let( + :donate, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + FIND_LOCATION = + T.let( + :find_location, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + SCHEDULE = + T.let( + :schedule, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + START_TRIAL = + T.let( + :start_trial, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + SUBMIT_APPLICATION = + T.let( + :submit_application, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + SUBSCRIBE = + T.let( + :subscribe, + WhopSDK::AdGroupCreateParams::ConversionEvent::TaggedSymbol + ) + end + + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + module ConversionLocation + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroupCreateParams::ConversionLocation) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WEBSITE = + T.let( + :website, + WhopSDK::AdGroupCreateParams::ConversionLocation::TaggedSymbol + ) + PROFILE = + T.let( + :profile, + WhopSDK::AdGroupCreateParams::ConversionLocation::TaggedSymbol + ) + MESSAGING = + T.let( + :messaging, + WhopSDK::AdGroupCreateParams::ConversionLocation::TaggedSymbol + ) + ON_AD = + T.let( + :on_ad, + WhopSDK::AdGroupCreateParams::ConversionLocation::TaggedSymbol + ) + INSTANT_FORMS = + T.let( + :instant_forms, + WhopSDK::AdGroupCreateParams::ConversionLocation::TaggedSymbol + ) + INSTANT_FORMS_AND_MESSENGER = + T.let( + :instant_forms_and_messenger, + WhopSDK::AdGroupCreateParams::ConversionLocation::TaggedSymbol + ) + WEBSITE_AND_INSTANT_FORMS = + T.let( + :website_and_instant_forms, + WhopSDK::AdGroupCreateParams::ConversionLocation::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdGroupCreateParams::ConversionLocation::TaggedSymbol + ] + ) + end + def self.values + end + end + + module MessageApp + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroupCreateParams::MessageApp) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSENGER = + T.let( + :messenger, + WhopSDK::AdGroupCreateParams::MessageApp::TaggedSymbol + ) + INSTAGRAM = + T.let( + :instagram, + WhopSDK::AdGroupCreateParams::MessageApp::TaggedSymbol + ) + WHATSAPP = + T.let( + :whatsapp, + WhopSDK::AdGroupCreateParams::MessageApp::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdGroupCreateParams::MessageApp::TaggedSymbol] + ) + end + def self.values + end + end + + # Initial status (default: active). + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroupCreateParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let(:active, WhopSDK::AdGroupCreateParams::Status::TaggedSymbol) + PAUSED = + T.let(:paused, WhopSDK::AdGroupCreateParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdGroupCreateParams::Status::TaggedSymbol] + ) + end + def self.values + 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 8df5ea8a..896353c8 100644 --- a/rbi/whop_sdk/models/ad_group_list_params.rbi +++ b/rbi/whop_sdk/models/ad_group_list_params.rbi @@ -11,116 +11,176 @@ module WhopSDK T.any(WhopSDK::AdGroupListParams, WhopSDK::Internal::AnyHash) end - # Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + # Account whose ad groups to list. Defaults to the authenticated account. sig { returns(T.nilable(String)) } - attr_accessor :ad_campaign_id + attr_reader :account_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 + sig { params(account_id: String).void } + attr_writer :account_id - # Returns the elements in the list that come after the specified cursor. + # Filter to ad groups in this campaign. sig { returns(T.nilable(String)) } - attr_accessor :after + attr_reader :ad_campaign_id - # Returns the elements in the list that come before the specified cursor. - sig { returns(T.nilable(String)) } - attr_accessor :before + sig { params(ad_campaign_id: String).void } + attr_writer :ad_campaign_id - # Filter by campaign. + # Cursor to fetch the page after (from page_info.end_cursor). sig { returns(T.nilable(String)) } - attr_accessor :campaign_id + attr_reader :after + + sig { params(after: String).void } + attr_writer :after - # Filter by company. Provide companyId or adCampaignIds. + # Cursor to fetch the page before (from page_info.start_cursor). sig { returns(T.nilable(String)) } - attr_accessor :company_id + attr_reader :before + + sig { params(before: String).void } + attr_writer :before # Only return ad groups 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 ad groups created before this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_before + sig { returns(T.nilable(String)) } + attr_reader :created_before - # Returns the first _n_ elements from the list. + sig { params(created_before: String).void } + attr_writer :created_before + + # The sort direction. Defaults to desc. + sig do + returns(T.nilable(WhopSDK::AdGroupListParams::Direction::OrSymbol)) + end + attr_reader :direction + + sig do + params(direction: WhopSDK::AdGroupListParams::Direction::OrSymbol).void + end + attr_writer :direction + + # The number of ad groups to return. 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 ad groups 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 field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + sig { returns(T.nilable(WhopSDK::AdGroupListParams::Order::OrSymbol)) } + attr_reader :order - # Case-insensitive substring match against the ad group name or ID. + sig { params(order: WhopSDK::AdGroupListParams::Order::OrSymbol).void } + attr_writer :order + + # Filter ad groups by a title or ID substring. sig { returns(T.nilable(String)) } - attr_accessor :query + attr_reader :query + + sig { params(query: String).void } + attr_writer :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 + # Start of the stats window. Defaults to all-time. + sig { returns(T.nilable(String)) } + attr_reader :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 + sig { params(stats_from: String).void } + attr_writer :stats_from + + # End of the stats window. Defaults to now. + sig { returns(T.nilable(String)) } + attr_reader :stats_to - # The status of an external ad group. - sig { returns(T.nilable(WhopSDK::AdGroupStatus::OrSymbol)) } - attr_accessor :status + sig { params(stats_to: String).void } + attr_writer :stats_to + + # Filter to a status (active, paused, in_review, rejected). + sig { returns(T.nilable(String)) } + attr_reader :status + + sig { params(status: String).void } + attr_writer :status + + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + sig { returns(T.nilable(String)) } + attr_reader :time_zone + + sig { params(time_zone: String).void } + attr_writer :time_zone 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), - company_id: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - 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::AdGroupStatus::OrSymbol), + account_id: String, + ad_campaign_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdGroupListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdGroupListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: String, + time_zone: String, 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. + # Account whose ad groups to list. Defaults to the authenticated account. + account_id: nil, + # Filter to ad groups in this campaign. 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. + # Cursor to fetch the page after (from page_info.end_cursor). after: nil, - # Returns the elements in the list that come before the specified cursor. + # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # Filter by campaign. - campaign_id: nil, - # Filter by company. Provide companyId or adCampaignIds. - company_id: nil, # Only return ad groups created after this timestamp. created_after: nil, # Only return ad groups created before this timestamp. created_before: nil, - # Returns the first _n_ elements from the list. + # The sort direction. Defaults to desc. + direction: nil, + # The number of ad groups to return. first: nil, - # Returns the last _n_ elements from the list. + # The number of ad groups to return from the end of the range. last: nil, - # Case-insensitive substring match against the ad group name or ID. + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + order: nil, + # Filter ad groups by a title or ID substring. 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. + # Start of the stats window. Defaults to all-time. stats_from: nil, - # Inclusive end of the window for each ad group's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. Defaults to now. stats_to: nil, - # The status of an external ad group. + # Filter to a status (active, paused, in_review, rejected). status: nil, + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + time_zone: nil, request_options: {} ) end @@ -128,26 +188,108 @@ 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), - company_id: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - 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::AdGroupStatus::OrSymbol), + account_id: String, + ad_campaign_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdGroupListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdGroupListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: String, + time_zone: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # The sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroupListParams::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = T.let(:asc, WhopSDK::AdGroupListParams::Direction::TaggedSymbol) + DESC = T.let(:desc, WhopSDK::AdGroupListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdGroupListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroupListParams::Order) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT = + T.let(:created_at, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + UPDATED_AT = + T.let(:updated_at, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + SPEND = T.let(:spend, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + IMPRESSIONS = + T.let(:impressions, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + REACH = T.let(:reach, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + CLICKS = T.let(:clicks, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + UNIQUE_CLICKS = + T.let(:unique_clicks, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + FREQUENCY = + T.let(:frequency, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + CLICK_THROUGH_RATE = + T.let( + :click_through_rate, + WhopSDK::AdGroupListParams::Order::TaggedSymbol + ) + RESULTS = + T.let(:results, WhopSDK::AdGroupListParams::Order::TaggedSymbol) + COST_PER_MILLE = + T.let( + :cost_per_mille, + WhopSDK::AdGroupListParams::Order::TaggedSymbol + ) + COST_PER_CLICK = + T.let( + :cost_per_click, + WhopSDK::AdGroupListParams::Order::TaggedSymbol + ) + COST_PER_RESULT = + T.let( + :cost_per_result, + WhopSDK::AdGroupListParams::Order::TaggedSymbol + ) + RETURN_ON_AD_SPEND = + T.let( + :return_on_ad_spend, + WhopSDK::AdGroupListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdGroupListParams::Order::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/ad_group_list_response.rbi b/rbi/whop_sdk/models/ad_group_list_response.rbi deleted file mode 100644 index 3d01cbd8..00000000 --- a/rbi/whop_sdk/models/ad_group_list_response.rbi +++ /dev/null @@ -1,497 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class AdGroupListResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AdGroupListResponse, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for this ad group. - sig { returns(String) } - attr_accessor :id - - # The ad campaign this ad group belongs to. - sig { returns(WhopSDK::Models::AdGroupListResponse::AdCampaign) } - attr_reader :ad_campaign - - sig do - params( - ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign::OrHash - ).void - end - attr_writer :ad_campaign - - # Budget amount in dollars. - sig { returns(T.nilable(Float)) } - attr_accessor :budget - - # The budget type for an ad campaign or ad group. - 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 - - # 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 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 - def self.new( - # The unique identifier for this ad group. - id:, - # The ad campaign this ad group belongs to. - ad_campaign:, - # Budget amount in dollars. - 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:, - # 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: - ) - end - - sig do - override.returns( - { - id: String, - 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 - } - ) - end - def to_hash - end - - class AdCampaign < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AdGroupListResponse::AdCampaign, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for this ad campaign. - sig { returns(String) } - attr_accessor :id - - # The ad campaign this ad group belongs to. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The unique identifier for this ad campaign. - id: - ) - end - - sig { override.returns({ id: String }) } - 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 - - # 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 - - # 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 - - # 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, - resolution_status: - WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::OrSymbol, - resource_id: T.nilable(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:, - # 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:, - # 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, - resolution_status: - WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::TaggedSymbol, - resource_id: T.nilable(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 - - 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 76a2d130..0057a204 100644 --- a/rbi/whop_sdk/models/ad_group_retrieve_params.rbi +++ b/rbi/whop_sdk/models/ad_group_retrieve_params.rbi @@ -14,32 +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 + # Start of the stats window. + sig { returns(T.nilable(String)) } + attr_reader :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 { params(stats_from: String).void } + attr_writer :stats_from + + # End of the stats window. + sig { returns(T.nilable(String)) } + attr_reader :stats_to + + sig { params(stats_to: String).void } + attr_writer :stats_to + + # IANA timezone the stats window is interpreted in. Defaults to UTC. + sig { returns(T.nilable(String)) } + attr_reader :time_zone + + sig { params(time_zone: String).void } + attr_writer :time_zone sig do params( id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end 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. + # Start of the stats window. stats_from: nil, - # Inclusive end of the window for the ad group's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. stats_to: nil, + # IANA timezone the stats window is interpreted in. Defaults to UTC. + time_zone: nil, request_options: {} ) end @@ -48,8 +60,9 @@ module WhopSDK override.returns( { id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/ad_group_status.rbi b/rbi/whop_sdk/models/ad_group_status.rbi deleted file mode 100644 index 328dc809..00000000 --- a/rbi/whop_sdk/models/ad_group_status.rbi +++ /dev/null @@ -1,24 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - # The status of an external ad group. - module AdGroupStatus - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::AdGroupStatus) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ACTIVE = T.let(:active, WhopSDK::AdGroupStatus::TaggedSymbol) - PAUSED = T.let(:paused, WhopSDK::AdGroupStatus::TaggedSymbol) - INACTIVE = T.let(:inactive, WhopSDK::AdGroupStatus::TaggedSymbol) - IN_REVIEW = T.let(:in_review, WhopSDK::AdGroupStatus::TaggedSymbol) - REJECTED = T.let(:rejected, WhopSDK::AdGroupStatus::TaggedSymbol) - FLAGGED = T.let(:flagged, WhopSDK::AdGroupStatus::TaggedSymbol) - - sig { override.returns(T::Array[WhopSDK::AdGroupStatus::TaggedSymbol]) } - def self.values - end - end - end -end diff --git a/rbi/whop_sdk/models/ad_group_update_params.rbi b/rbi/whop_sdk/models/ad_group_update_params.rbi index d7f8cf93..237a78c9 100644 --- a/rbi/whop_sdk/models/ad_group_update_params.rbi +++ b/rbi/whop_sdk/models/ad_group_update_params.rbi @@ -14,85 +14,299 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Budget amount in dollars. + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # Incompatible with demographics.automatic (Advantage+). + sig { returns(T.nilable(T.anything)) } + attr_reader :audiences + + sig { params(audiences: T.anything).void } + attr_writer :audiences + + # Bid strategy. + sig do + returns(T.nilable(WhopSDK::AdGroupUpdateParams::BidType::OrSymbol)) + end + attr_reader :bid_type + + sig do + params(bid_type: WhopSDK::AdGroupUpdateParams::BidType::OrSymbol).void + end + attr_writer :bid_type + + # Ad-set budget in dollars (ABO only; omit under CBO). sig { returns(T.nilable(Float)) } - attr_accessor :budget + attr_reader :budget_amount + + sig { params(budget_amount: Float).void } + attr_writer :budget_amount + + # Whether the budget is daily or lifetime. + sig do + returns(T.nilable(WhopSDK::AdGroupUpdateParams::BudgetType::OrSymbol)) + end + attr_reader :budget_type + + sig do + params( + budget_type: WhopSDK::AdGroupUpdateParams::BudgetType::OrSymbol + ).void + end + attr_writer :budget_type - # The budget type for an ad campaign or ad group. - sig { returns(T.nilable(WhopSDK::AdBudgetType::OrSymbol)) } - attr_accessor :budget_type + # The pixel event optimized for. A standard event, or any custom pixel event name. + sig do + returns( + T.nilable( + T.any( + WhopSDK::AdGroupUpdateParams::ConversionEvent::OrSymbol, + String + ) + ) + ) + end + attr_accessor :conversion_event - # Unified ad group configuration (bidding, optimization, targeting). - sig { returns(T.nilable(WhopSDK::AdGroupUpdateParams::Config)) } - attr_reader :config + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + sig do + returns( + T.nilable(WhopSDK::AdGroupUpdateParams::ConversionLocation::OrSymbol) + ) + end + attr_reader :conversion_location sig do params( - config: T.nilable(WhopSDK::AdGroupUpdateParams::Config::OrHash) + conversion_location: + WhopSDK::AdGroupUpdateParams::ConversionLocation::OrSymbol ).void end - attr_writer :config + attr_writer :conversion_location + + # Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + sig { returns(T.nilable(T.anything)) } + attr_reader :demographics + + sig { params(demographics: T.anything).void } + attr_writer :demographics - # Daily budget in dollars. + # Target/cap cost for average_target / maximum_target. sig { returns(T.nilable(Float)) } - attr_accessor :daily_budget + attr_reader :desired_cost_per_result - # Human-readable ad group name. + sig { params(desired_cost_per_result: Float).void } + attr_writer :desired_cost_per_result + + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + sig { returns(T.nilable(T.anything)) } + attr_reader :devices + + sig { params(devices: T.anything).void } + attr_writer :devices + + # Schedule end, ISO 8601. sig { returns(T.nilable(String)) } - attr_accessor :name + attr_reader :ends_at + + sig { params(ends_at: String).void } + attr_writer :ends_at - # Platform-specific ad group configuration. - sig { returns(T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig)) } - attr_reader :platform_config + # { maximum_impressions, per_days } — only valid for reach optimization. + sig { returns(T.nilable(T.anything)) } + attr_reader :frequency_cap + + sig { params(frequency_cap: T.anything).void } + attr_writer :frequency_cap + + # Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all + # languages. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :languages + + sig { params(languages: T::Array[String]).void } + attr_writer :languages + + # Required when conversion_location is messaging: which apps to message on. + # Combinations map to the matching Meta destination. + sig do + returns( + T.nilable( + T::Array[WhopSDK::AdGroupUpdateParams::MessageApp::OrSymbol] + ) + ) + end + attr_reader :message_apps sig do params( - platform_config: - T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::OrHash) + message_apps: + T::Array[WhopSDK::AdGroupUpdateParams::MessageApp::OrSymbol] ).void end - attr_writer :platform_config + attr_writer :message_apps + + # Daily spend floor within the budget. + sig { returns(T.nilable(Float)) } + attr_reader :minimum_daily_spend + + sig { params(minimum_daily_spend: Float).void } + attr_writer :minimum_daily_spend + + # What the ad group optimizes for (e.g. conversions, link_clicks, reach). + sig { returns(T.nilable(String)) } + attr_reader :optimization_goal + + sig { params(optimization_goal: String).void } + attr_writer :optimization_goal + + # 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # target all of a platform's. + # + # Valid positions per platform: + # + # - `facebook`: `feed`, `right_hand_column`, `marketplace`, `search`, + # `profile_feed`, `notification`, `story`, `instream_video`, `facebook_reels`, + # `facebook_reels_overlay`, `biz_disco_feed` + # - `instagram`: `stream`, `story`, `explore`, `explore_home`, `reels`, + # `profile_feed`, `profile_reels`, `ig_search` + # - `messenger`: `story` + # - `audience_network`: `classic`, `rewarded_video` + # - `threads`: `threads_stream` + # - `whatsapp`: `status` + sig { returns(T.nilable(T.anything)) } + attr_reader :placements + + sig { params(placements: T.anything).void } + attr_writer :placements + + # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + sig { returns(T.nilable(T.anything)) } + attr_reader :regions + + sig { params(regions: T.anything).void } + attr_writer :regions + + # Schedule start, ISO 8601. + sig { returns(T.nilable(String)) } + attr_reader :starts_at + + sig { params(starts_at: String).void } + attr_writer :starts_at + + # Initial status (default: active). + sig { returns(T.nilable(WhopSDK::AdGroupUpdateParams::Status::OrSymbol)) } + attr_reader :status - # The status of an external ad group. - sig { returns(T.nilable(WhopSDK::AdGroupStatus::OrSymbol)) } - attr_accessor :status + sig do + params(status: WhopSDK::AdGroupUpdateParams::Status::OrSymbol).void + end + attr_writer :status - # Human-readable ad group title. + # The display name of the ad group. sig { returns(T.nilable(String)) } - attr_accessor :title + attr_reader :title + + sig { params(title: String).void } + attr_writer :title sig do params( id: String, - budget: T.nilable(Float), - budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), - config: T.nilable(WhopSDK::AdGroupUpdateParams::Config::OrHash), - daily_budget: T.nilable(Float), - name: T.nilable(String), - platform_config: - T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::OrHash), - status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), - title: T.nilable(String), + audiences: T.anything, + bid_type: WhopSDK::AdGroupUpdateParams::BidType::OrSymbol, + budget_amount: Float, + budget_type: WhopSDK::AdGroupUpdateParams::BudgetType::OrSymbol, + conversion_event: + T.nilable( + T.any( + WhopSDK::AdGroupUpdateParams::ConversionEvent::OrSymbol, + String + ) + ), + conversion_location: + WhopSDK::AdGroupUpdateParams::ConversionLocation::OrSymbol, + demographics: T.anything, + desired_cost_per_result: Float, + devices: T.anything, + ends_at: String, + frequency_cap: T.anything, + languages: T::Array[String], + message_apps: + T::Array[WhopSDK::AdGroupUpdateParams::MessageApp::OrSymbol], + minimum_daily_spend: Float, + optimization_goal: String, + placements: T.anything, + regions: T.anything, + starts_at: String, + status: WhopSDK::AdGroupUpdateParams::Status::OrSymbol, + title: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, - # Budget amount in dollars. - budget: nil, - # The budget type for an ad campaign or ad group. + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # Incompatible with demographics.automatic (Advantage+). + audiences: nil, + # Bid strategy. + bid_type: nil, + # Ad-set budget in dollars (ABO only; omit under CBO). + budget_amount: nil, + # Whether the budget is daily or lifetime. budget_type: nil, - # Unified ad group configuration (bidding, optimization, targeting). - config: nil, - # Daily budget in dollars. - daily_budget: nil, - # Human-readable ad group name. - name: nil, - # Platform-specific ad group configuration. - platform_config: nil, - # The status of an external ad group. + # The pixel event optimized for. A standard event, or any custom pixel event name. + conversion_event: nil, + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + conversion_location: nil, + # Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + demographics: nil, + # Target/cap cost for average_target / maximum_target. + desired_cost_per_result: nil, + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + devices: nil, + # Schedule end, ISO 8601. + ends_at: nil, + # { maximum_impressions, per_days } — only valid for reach optimization. + frequency_cap: nil, + # Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all + # languages. + languages: nil, + # Required when conversion_location is messaging: which apps to message on. + # Combinations map to the matching Meta destination. + message_apps: nil, + # Daily spend floor within the budget. + minimum_daily_spend: nil, + # What the ad group optimizes for (e.g. conversions, link_clicks, reach). + optimization_goal: nil, + # 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # target all of a platform's. + # + # Valid positions per platform: + # + # - `facebook`: `feed`, `right_hand_column`, `marketplace`, `search`, + # `profile_feed`, `notification`, `story`, `instream_video`, `facebook_reels`, + # `facebook_reels_overlay`, `biz_disco_feed` + # - `instagram`: `stream`, `story`, `explore`, `explore_home`, `reels`, + # `profile_feed`, `profile_reels`, `ig_search` + # - `messenger`: `story` + # - `audience_network`: `classic`, `rewarded_video` + # - `threads`: `threads_stream` + # - `whatsapp`: `status` + placements: nil, + # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + regions: nil, + # Schedule start, ISO 8601. + starts_at: nil, + # Initial status (default: active). status: nil, - # Human-readable ad group title. + # The display name of the ad group. title: nil, request_options: {} ) @@ -102,15 +316,34 @@ module WhopSDK override.returns( { id: String, - budget: T.nilable(Float), - budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), - config: T.nilable(WhopSDK::AdGroupUpdateParams::Config), - daily_budget: T.nilable(Float), - name: T.nilable(String), - platform_config: - T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig), - status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), - title: T.nilable(String), + audiences: T.anything, + bid_type: WhopSDK::AdGroupUpdateParams::BidType::OrSymbol, + budget_amount: Float, + budget_type: WhopSDK::AdGroupUpdateParams::BudgetType::OrSymbol, + conversion_event: + T.nilable( + T.any( + WhopSDK::AdGroupUpdateParams::ConversionEvent::OrSymbol, + String + ) + ), + conversion_location: + WhopSDK::AdGroupUpdateParams::ConversionLocation::OrSymbol, + demographics: T.anything, + desired_cost_per_result: Float, + devices: T.anything, + ends_at: String, + frequency_cap: T.anything, + languages: T::Array[String], + message_apps: + T::Array[WhopSDK::AdGroupUpdateParams::MessageApp::OrSymbol], + minimum_daily_spend: Float, + optimization_goal: String, + placements: T.anything, + regions: T.anything, + starts_at: String, + status: WhopSDK::AdGroupUpdateParams::Status::OrSymbol, + title: String, request_options: WhopSDK::RequestOptions } ) @@ -118,5971 +351,287 @@ module WhopSDK def to_hash end - class Config < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::Config, - WhopSDK::Internal::AnyHash - ) - end + # Bid strategy. + module BidType + extend WhopSDK::Internal::Type::Enum - # Bid cap amount in cents. Used when bid_strategy is bid_cap or cost_cap. - sig { returns(T.nilable(Integer)) } - attr_accessor :bid_amount + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroupUpdateParams::BidType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - # Bid strategy: lowest_cost, bid_cap, or cost_cap. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::BidStrategy::OrSymbol - ) + MINIMUM_COST = + T.let( + :minimum_cost, + WhopSDK::AdGroupUpdateParams::BidType::TaggedSymbol + ) + AVERAGE_TARGET = + T.let( + :average_target, + WhopSDK::AdGroupUpdateParams::BidType::TaggedSymbol + ) + MAXIMUM_TARGET = + T.let( + :maximum_target, + WhopSDK::AdGroupUpdateParams::BidType::TaggedSymbol ) - end - attr_accessor :bid_strategy - # How you are billed (e.g., impressions, clicks). sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::BillingEvent::OrSymbol - ) + override.returns( + T::Array[WhopSDK::AdGroupUpdateParams::BidType::TaggedSymbol] ) end - attr_accessor :billing_event - - # Scheduled end time (ISO8601). Required for lifetime budgets. - sig { returns(T.nilable(String)) } - attr_accessor :end_time + def self.values + end + end - # Maximum number of times to show ads to each person in the frequency interval. - sig { returns(T.nilable(Integer)) } - attr_accessor :frequency_cap + # Whether the budget is daily or lifetime. + module BudgetType + extend WhopSDK::Internal::Type::Enum - # Number of days for the frequency cap interval. - sig { returns(T.nilable(Integer)) } - attr_accessor :frequency_cap_interval_days + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroupUpdateParams::BudgetType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } - # What the ad group optimizes for (e.g., conversions, link_clicks, reach). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::OrSymbol - ) + DAILY = + T.let(:daily, WhopSDK::AdGroupUpdateParams::BudgetType::TaggedSymbol) + LIFETIME = + T.let( + :lifetime, + WhopSDK::AdGroupUpdateParams::BudgetType::TaggedSymbol ) - end - attr_accessor :optimization_goal - # Budget pacing: standard (even) or accelerated (fast). sig do - returns( - T.nilable(WhopSDK::AdGroupUpdateParams::Config::Pacing::OrSymbol) + override.returns( + T::Array[WhopSDK::AdGroupUpdateParams::BudgetType::TaggedSymbol] ) end - attr_accessor :pacing - - # Scheduled start time (ISO8601). - sig { returns(T.nilable(String)) } - attr_accessor :start_time - - # Audience targeting settings (demographics, geo, interests, audiences, devices). - sig do - returns(T.nilable(WhopSDK::AdGroupUpdateParams::Config::Targeting)) + def self.values end - attr_reader :targeting + end - sig do - params( - targeting: - T.nilable(WhopSDK::AdGroupUpdateParams::Config::Targeting::OrHash) - ).void - end - attr_writer :targeting + # The pixel event optimized for. A standard event, or any custom pixel event name. + module ConversionEvent + extend WhopSDK::Internal::Type::Union - # Unified ad group configuration (bidding, optimization, targeting). - sig do - params( - bid_amount: T.nilable(Integer), - bid_strategy: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::BidStrategy::OrSymbol - ), - billing_event: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::BillingEvent::OrSymbol - ), - end_time: T.nilable(String), - frequency_cap: T.nilable(Integer), - frequency_cap_interval_days: T.nilable(Integer), - optimization_goal: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::OrSymbol - ), - pacing: - T.nilable(WhopSDK::AdGroupUpdateParams::Config::Pacing::OrSymbol), - start_time: T.nilable(String), - targeting: - T.nilable(WhopSDK::AdGroupUpdateParams::Config::Targeting::OrHash) - ).returns(T.attached_class) - end - def self.new( - # Bid cap amount in cents. Used when bid_strategy is bid_cap or cost_cap. - bid_amount: nil, - # Bid strategy: lowest_cost, bid_cap, or cost_cap. - bid_strategy: nil, - # How you are billed (e.g., impressions, clicks). - billing_event: nil, - # Scheduled end time (ISO8601). Required for lifetime budgets. - end_time: nil, - # Maximum number of times to show ads to each person in the frequency interval. - frequency_cap: nil, - # Number of days for the frequency cap interval. - frequency_cap_interval_days: nil, - # What the ad group optimizes for (e.g., conversions, link_clicks, reach). - optimization_goal: nil, - # Budget pacing: standard (even) or accelerated (fast). - pacing: nil, - # Scheduled start time (ISO8601). - start_time: nil, - # Audience targeting settings (demographics, geo, interests, audiences, devices). - targeting: nil - ) - end + Variants = + T.type_alias do + T.any( + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol, + String + ) + end sig do override.returns( - { - bid_amount: T.nilable(Integer), - bid_strategy: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::BidStrategy::OrSymbol - ), - billing_event: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::BillingEvent::OrSymbol - ), - end_time: T.nilable(String), - frequency_cap: T.nilable(Integer), - frequency_cap_interval_days: T.nilable(Integer), - optimization_goal: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::OrSymbol - ), - pacing: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::Pacing::OrSymbol - ), - start_time: T.nilable(String), - targeting: - T.nilable(WhopSDK::AdGroupUpdateParams::Config::Targeting) - } + T::Array[WhopSDK::AdGroupUpdateParams::ConversionEvent::Variants] ) end - def to_hash + def self.variants end - # Bid strategy: lowest_cost, bid_cap, or cost_cap. - module BidStrategy - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::AdGroupUpdateParams::Config::BidStrategy) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - LOWEST_COST = - T.let( - :lowest_cost, - WhopSDK::AdGroupUpdateParams::Config::BidStrategy::TaggedSymbol - ) - BID_CAP = - T.let( - :bid_cap, - WhopSDK::AdGroupUpdateParams::Config::BidStrategy::TaggedSymbol - ) - COST_CAP = - T.let( - :cost_cap, - WhopSDK::AdGroupUpdateParams::Config::BidStrategy::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::BidStrategy::TaggedSymbol - ] - ) - end - def self.values + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroupUpdateParams::ConversionEvent) end - end + OrSymbol = T.type_alias { T.any(Symbol, String) } - # How you are billed (e.g., impressions, clicks). - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::AdGroupUpdateParams::Config::BillingEvent) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + PURCHASE = + T.let( + :purchase, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + ADD_TO_CART = + T.let( + :add_to_cart, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + INITIATED_CHECKOUT = + T.let( + :initiated_checkout, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + ADD_PAYMENT_INFO = + T.let( + :add_payment_info, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + COMPLETE_REGISTRATION = + T.let( + :complete_registration, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + LEAD = + T.let( + :lead, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + CONTENT_VIEW = + T.let( + :content_view, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + SEARCH = + T.let( + :search, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + CONTACT = + T.let( + :contact, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + CUSTOMIZE_PRODUCT = + T.let( + :customize_product, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + DONATE = + T.let( + :donate, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + FIND_LOCATION = + T.let( + :find_location, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + SCHEDULE = + T.let( + :schedule, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + START_TRIAL = + T.let( + :start_trial, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + SUBMIT_APPLICATION = + T.let( + :submit_application, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + SUBSCRIBE = + T.let( + :subscribe, + WhopSDK::AdGroupUpdateParams::ConversionEvent::TaggedSymbol + ) + end - IMPRESSIONS = - T.let( - :impressions, - WhopSDK::AdGroupUpdateParams::Config::BillingEvent::TaggedSymbol - ) - CLICKS = - T.let( - :clicks, - WhopSDK::AdGroupUpdateParams::Config::BillingEvent::TaggedSymbol - ) - OPTIMIZED_CPM = - T.let( - :optimized_cpm, - WhopSDK::AdGroupUpdateParams::Config::BillingEvent::TaggedSymbol - ) - VIDEO_VIEWS = - T.let( - :video_views, - WhopSDK::AdGroupUpdateParams::Config::BillingEvent::TaggedSymbol - ) + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + module ConversionLocation + extend WhopSDK::Internal::Type::Enum - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::BillingEvent::TaggedSymbol - ] - ) - end - def self.values + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroupUpdateParams::ConversionLocation) end - end + OrSymbol = T.type_alias { T.any(Symbol, String) } - # What the ad group optimizes for (e.g., conversions, link_clicks, reach). - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CONVERSIONS = - T.let( - :conversions, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - LINK_CLICKS = - T.let( - :link_clicks, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - LANDING_PAGE_VIEWS = - T.let( - :landing_page_views, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - REACH = - T.let( - :reach, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - IMPRESSIONS = - T.let( - :impressions, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - APP_INSTALLS = - T.let( - :app_installs, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - VIDEO_VIEWS = - T.let( - :video_views, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - LEAD_GENERATION = - T.let( - :lead_generation, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - VALUE = - T.let( - :value, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - PAGE_LIKES = - T.let( - :page_likes, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - CONVERSATIONS = - T.let( - :conversations, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - AD_RECALL_LIFT = - T.let( - :ad_recall_lift, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - TWO_SECOND_CONTINUOUS_VIDEO_VIEWS = - T.let( - :two_second_continuous_video_views, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - POST_ENGAGEMENT = - T.let( - :post_engagement, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - EVENT_RESPONSES = - T.let( - :event_responses, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - REMINDERS_SET = - T.let( - :reminders_set, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) - QUALITY_LEAD = - T.let( - :quality_lead, - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ) + WEBSITE = + T.let( + :website, + WhopSDK::AdGroupUpdateParams::ConversionLocation::TaggedSymbol + ) + PROFILE = + T.let( + :profile, + WhopSDK::AdGroupUpdateParams::ConversionLocation::TaggedSymbol + ) + MESSAGING = + T.let( + :messaging, + WhopSDK::AdGroupUpdateParams::ConversionLocation::TaggedSymbol + ) + ON_AD = + T.let( + :on_ad, + WhopSDK::AdGroupUpdateParams::ConversionLocation::TaggedSymbol + ) + INSTANT_FORMS = + T.let( + :instant_forms, + WhopSDK::AdGroupUpdateParams::ConversionLocation::TaggedSymbol + ) + INSTANT_FORMS_AND_MESSENGER = + T.let( + :instant_forms_and_messenger, + WhopSDK::AdGroupUpdateParams::ConversionLocation::TaggedSymbol + ) + WEBSITE_AND_INSTANT_FORMS = + T.let( + :website_and_instant_forms, + WhopSDK::AdGroupUpdateParams::ConversionLocation::TaggedSymbol + ) - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::OptimizationGoal::TaggedSymbol - ] - ) - end - def self.values - end + sig do + override.returns( + T::Array[ + WhopSDK::AdGroupUpdateParams::ConversionLocation::TaggedSymbol + ] + ) end - - # Budget pacing: standard (even) or accelerated (fast). - module Pacing - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::AdGroupUpdateParams::Config::Pacing) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - STANDARD = - T.let( - :standard, - WhopSDK::AdGroupUpdateParams::Config::Pacing::TaggedSymbol - ) - ACCELERATED = - T.let( - :accelerated, - WhopSDK::AdGroupUpdateParams::Config::Pacing::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Pacing::TaggedSymbol - ] - ) - end - def self.values - end + def self.values end + end - class Targeting < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::Config::Targeting, - WhopSDK::Internal::AnyHash - ) - end - - # Maximum age for demographic targeting. - sig { returns(T.nilable(Integer)) } - attr_accessor :age_max - - # Minimum age for demographic targeting. - sig { returns(T.nilable(Integer)) } - attr_accessor :age_min - - # ISO 3166-1 alpha-2 country codes to target. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :countries - - # Device platforms to target. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::DevicePlatform::OrSymbol - ] - ) - ) - end - attr_accessor :device_platforms - - # Platform audience IDs to exclude. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :exclude_audience_ids - - # Genders to target. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender::OrSymbol - ] - ) - ) - end - attr_accessor :genders - - # Platform audience IDs to include. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :include_audience_ids - - # Platform-specific interest IDs to target. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :interest_ids - - # Language codes to target. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :languages + module MessageApp + extend WhopSDK::Internal::Type::Enum - # Placement strategy for ad delivery. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::Targeting::PlacementType::OrSymbol - ) - ) + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroupUpdateParams::MessageApp) end - attr_accessor :placement_type + OrSymbol = T.type_alias { T.any(Symbol, String) } - # Audience targeting settings (demographics, geo, interests, audiences, devices). - sig do - params( - age_max: T.nilable(Integer), - age_min: T.nilable(Integer), - countries: T.nilable(T::Array[String]), - device_platforms: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::DevicePlatform::OrSymbol - ] - ), - exclude_audience_ids: T.nilable(T::Array[String]), - genders: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender::OrSymbol - ] - ), - include_audience_ids: T.nilable(T::Array[String]), - interest_ids: T.nilable(T::Array[String]), - languages: T.nilable(T::Array[String]), - placement_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::Targeting::PlacementType::OrSymbol - ) - ).returns(T.attached_class) - end - def self.new( - # Maximum age for demographic targeting. - age_max: nil, - # Minimum age for demographic targeting. - age_min: nil, - # ISO 3166-1 alpha-2 country codes to target. - countries: nil, - # Device platforms to target. - device_platforms: nil, - # Platform audience IDs to exclude. - exclude_audience_ids: nil, - # Genders to target. - genders: nil, - # Platform audience IDs to include. - include_audience_ids: nil, - # Platform-specific interest IDs to target. - interest_ids: nil, - # Language codes to target. - languages: nil, - # Placement strategy for ad delivery. - placement_type: nil + MESSENGER = + T.let( + :messenger, + WhopSDK::AdGroupUpdateParams::MessageApp::TaggedSymbol + ) + INSTAGRAM = + T.let( + :instagram, + WhopSDK::AdGroupUpdateParams::MessageApp::TaggedSymbol + ) + WHATSAPP = + T.let( + :whatsapp, + WhopSDK::AdGroupUpdateParams::MessageApp::TaggedSymbol ) - end - - sig do - override.returns( - { - age_max: T.nilable(Integer), - age_min: T.nilable(Integer), - countries: T.nilable(T::Array[String]), - device_platforms: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::DevicePlatform::OrSymbol - ] - ), - exclude_audience_ids: T.nilable(T::Array[String]), - genders: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender::OrSymbol - ] - ), - include_audience_ids: T.nilable(T::Array[String]), - interest_ids: T.nilable(T::Array[String]), - languages: T.nilable(T::Array[String]), - placement_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::Config::Targeting::PlacementType::OrSymbol - ) - } - ) - end - def to_hash - end - - # Device platform targeting options. - module DevicePlatform - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::Config::Targeting::DevicePlatform - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MOBILE = - T.let( - :mobile, - WhopSDK::AdGroupUpdateParams::Config::Targeting::DevicePlatform::TaggedSymbol - ) - DESKTOP = - T.let( - :desktop, - WhopSDK::AdGroupUpdateParams::Config::Targeting::DevicePlatform::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::DevicePlatform::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Gender targeting options. - module Gender - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MALE = - T.let( - :male, - WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender::TaggedSymbol - ) - FEMALE = - T.let( - :female, - WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender::TaggedSymbol - ) - ALL = - T.let( - :all, - WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::Gender::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Placement strategy for ad delivery. - module PlacementType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::Config::Targeting::PlacementType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTOMATIC = - T.let( - :automatic, - WhopSDK::AdGroupUpdateParams::Config::Targeting::PlacementType::TaggedSymbol - ) - MANUAL = - T.let( - :manual, - WhopSDK::AdGroupUpdateParams::Config::Targeting::PlacementType::TaggedSymbol - ) - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::Config::Targeting::PlacementType::TaggedSymbol - ] - ) - end - def self.values - end - end + sig do + override.returns( + T::Array[WhopSDK::AdGroupUpdateParams::MessageApp::TaggedSymbol] + ) + end + def self.values end end - class PlatformConfig < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig, - WhopSDK::Internal::AnyHash - ) - end + # Initial status (default: active). + module Status + extend WhopSDK::Internal::Type::Enum - # Meta (Facebook/Instagram) ad set configuration. - sig do - returns(T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta)) - end - attr_reader :meta + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroupUpdateParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - sig do - params( - meta: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OrHash - ) - ).void - end - attr_writer :meta + ACTIVE = + T.let(:active, WhopSDK::AdGroupUpdateParams::Status::TaggedSymbol) + PAUSED = + T.let(:paused, WhopSDK::AdGroupUpdateParams::Status::TaggedSymbol) - # TikTok ad group configuration. sig do - returns( - T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok) + override.returns( + T::Array[WhopSDK::AdGroupUpdateParams::Status::TaggedSymbol] ) end - attr_reader :tiktok - - sig do - params( - tiktok: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OrHash - ) - ).void - end - attr_writer :tiktok - - # Platform-specific ad group configuration. - sig do - params( - meta: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OrHash - ), - tiktok: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OrHash - ) - ).returns(T.attached_class) - end - def self.new( - # Meta (Facebook/Instagram) ad set configuration. - meta: nil, - # TikTok ad group configuration. - tiktok: nil - ) - end - - sig do - override.returns( - { - meta: - T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta), - tiktok: - T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok) - } - ) - end - def to_hash - end - - class Meta < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta, - WhopSDK::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :android_devices - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :attribution_setting - - # Conversion attribution windows. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec - ] - ) - ) - end - attr_accessor :attribution_spec - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :audience_network_positions - - # Audience type for retargeting. - sig { returns(T.nilable(String)) } - attr_accessor :audience_type - - # Bid amount in cents. - sig { returns(T.nilable(Integer)) } - attr_accessor :bid_amount - - # Meta bid strategy. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy::OrSymbol - ) - ) - end - attr_accessor :bid_strategy - - # How you are billed on Meta. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::OrSymbol - ) - ) - end - attr_accessor :billing_event - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :brand_safety_content_filter_levels - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :budget_remaining - - # Represents signed double-precision fractional values as specified by - # [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). - sig { returns(T.nilable(Float)) } - attr_accessor :cost_per_result_goal - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :created_time - - # Daily budget in cents. - sig { returns(T.nilable(Integer)) } - attr_accessor :daily_budget - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :daily_min_spend_target - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :daily_spend_cap - - # Where ads in this ad set direct people. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::OrSymbol - ) - ) - end - attr_accessor :destination_type - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :dsa_beneficiary - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :dsa_payor - - # End time (ISO8601). Required for lifetime budgets. - sig { returns(T.nilable(String)) } - attr_accessor :end_time - - # Geo locations to exclude. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations - ) - ) - end - attr_reader :excluded_geo_locations - - sig do - params( - excluded_geo_locations: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::OrHash - ) - ).void - end - attr_writer :excluded_geo_locations - - # Facebook ad placements (feed, reels, stories, etc.). - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :facebook_positions - - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - sig { returns(T.nilable(Integer)) } - attr_accessor :frequency_control_count - - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - sig { returns(T.nilable(Integer)) } - attr_accessor :frequency_control_days - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :frequency_control_type - - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity - ] - ) - ) - end - attr_accessor :geo_cities - - # Geo targeting (countries, regions, cities, zips). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations - ) - ) - end - attr_reader :geo_locations - - sig do - params( - geo_locations: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::OrHash - ) - ).void - end - attr_writer :geo_locations - - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion - ] - ) - ) - end - attr_accessor :geo_regions - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :geo_zips - - # Instagram account ID for this ad set. - sig { returns(T.nilable(String)) } - attr_accessor :instagram_actor_id - - # Instagram ad placements (stream, story, reels, etc.). - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :instagram_positions - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :ios_devices - - # Represents `true` or `false` values. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_dynamic_creative - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::OrSymbol - ) - ) - end - attr_accessor :lead_conversion_location - - # Configuration for a Meta lead gen instant form. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig - ) - ) - end - attr_reader :lead_form_config - - sig do - params( - lead_form_config: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::OrHash - ) - ).void - end - attr_writer :lead_form_config - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :lead_gen_form_id - - # Lifetime budget in cents. - sig { returns(T.nilable(Integer)) } - attr_accessor :lifetime_budget - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :lifetime_min_spend_target - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :lifetime_spend_cap - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :location_types - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :messenger_positions - - # What this ad set optimizes for on Meta. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::OrSymbol - ) - ) - end - attr_accessor :optimization_goal - - # Facebook Page ID for this ad set. - sig { returns(T.nilable(String)) } - attr_accessor :page_id - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :pixel_id - - # The object this ad set promotes (pixel, page, etc.). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject - ) - ) - end - attr_reader :promoted_object - - sig do - params( - promoted_object: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject::OrHash - ) - ).void - end - attr_writer :promoted_object - - # Platforms to publish on (facebook, instagram, messenger, audience_network). - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :publisher_platforms - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :source_adset_id - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :start_time - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::Status::OrSymbol - ) - ) - end - attr_accessor :status - - # Advantage+ audience expansion settings. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation - ) - ) - end - attr_reader :targeting_automation - - sig do - params( - targeting_automation: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation::OrHash - ) - ).void - end - attr_writer :targeting_automation - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :threads_positions - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :updated_time - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :user_device - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :user_os - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :whatsapp_phone_number - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :whatsapp_positions - - # Meta (Facebook/Instagram) ad set configuration. - sig do - params( - android_devices: T.nilable(T::Array[String]), - attribution_setting: T.nilable(String), - attribution_spec: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec::OrHash - ] - ), - audience_network_positions: T.nilable(T::Array[String]), - audience_type: T.nilable(String), - bid_amount: T.nilable(Integer), - bid_strategy: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy::OrSymbol - ), - billing_event: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::OrSymbol - ), - brand_safety_content_filter_levels: T.nilable(T::Array[String]), - budget_remaining: T.nilable(String), - cost_per_result_goal: T.nilable(Float), - created_time: T.nilable(String), - daily_budget: T.nilable(Integer), - daily_min_spend_target: T.nilable(String), - daily_spend_cap: T.nilable(String), - destination_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::OrSymbol - ), - dsa_beneficiary: T.nilable(String), - dsa_payor: T.nilable(String), - end_time: T.nilable(String), - excluded_geo_locations: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::OrHash - ), - facebook_positions: T.nilable(T::Array[String]), - frequency_control_count: T.nilable(Integer), - frequency_control_days: T.nilable(Integer), - frequency_control_type: T.nilable(String), - geo_cities: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity::OrHash - ] - ), - geo_locations: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::OrHash - ), - geo_regions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion::OrHash - ] - ), - geo_zips: T.nilable(T::Array[String]), - instagram_actor_id: T.nilable(String), - instagram_positions: T.nilable(T::Array[String]), - ios_devices: T.nilable(T::Array[String]), - is_dynamic_creative: T.nilable(T::Boolean), - lead_conversion_location: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::OrSymbol - ), - lead_form_config: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::OrHash - ), - lead_gen_form_id: T.nilable(String), - lifetime_budget: T.nilable(Integer), - lifetime_min_spend_target: T.nilable(String), - lifetime_spend_cap: T.nilable(String), - location_types: T.nilable(T::Array[String]), - messenger_positions: T.nilable(T::Array[String]), - optimization_goal: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::OrSymbol - ), - page_id: T.nilable(String), - pixel_id: T.nilable(String), - promoted_object: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject::OrHash - ), - publisher_platforms: T.nilable(T::Array[String]), - source_adset_id: T.nilable(String), - start_time: T.nilable(String), - status: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::Status::OrSymbol - ), - targeting_automation: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation::OrHash - ), - threads_positions: T.nilable(T::Array[String]), - updated_time: T.nilable(String), - user_device: T.nilable(T::Array[String]), - user_os: T.nilable(T::Array[String]), - whatsapp_phone_number: T.nilable(String), - whatsapp_positions: T.nilable(T::Array[String]) - ).returns(T.attached_class) - end - def self.new( - android_devices: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - attribution_setting: nil, - # Conversion attribution windows. - attribution_spec: nil, - audience_network_positions: nil, - # Audience type for retargeting. - audience_type: nil, - # Bid amount in cents. - bid_amount: nil, - # Meta bid strategy. - bid_strategy: nil, - # How you are billed on Meta. - billing_event: nil, - brand_safety_content_filter_levels: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - budget_remaining: nil, - # Represents signed double-precision fractional values as specified by - # [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). - cost_per_result_goal: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - created_time: nil, - # Daily budget in cents. - daily_budget: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - daily_min_spend_target: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - daily_spend_cap: nil, - # Where ads in this ad set direct people. - destination_type: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - dsa_beneficiary: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - dsa_payor: nil, - # End time (ISO8601). Required for lifetime budgets. - end_time: nil, - # Geo locations to exclude. - excluded_geo_locations: nil, - # Facebook ad placements (feed, reels, stories, etc.). - facebook_positions: nil, - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - frequency_control_count: nil, - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - frequency_control_days: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - frequency_control_type: nil, - geo_cities: nil, - # Geo targeting (countries, regions, cities, zips). - geo_locations: nil, - geo_regions: nil, - geo_zips: nil, - # Instagram account ID for this ad set. - instagram_actor_id: nil, - # Instagram ad placements (stream, story, reels, etc.). - instagram_positions: nil, - ios_devices: nil, - # Represents `true` or `false` values. - is_dynamic_creative: nil, - lead_conversion_location: nil, - # Configuration for a Meta lead gen instant form. - lead_form_config: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - lead_gen_form_id: nil, - # Lifetime budget in cents. - lifetime_budget: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - lifetime_min_spend_target: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - lifetime_spend_cap: nil, - location_types: nil, - messenger_positions: nil, - # What this ad set optimizes for on Meta. - optimization_goal: nil, - # Facebook Page ID for this ad set. - page_id: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - pixel_id: nil, - # The object this ad set promotes (pixel, page, etc.). - promoted_object: nil, - # Platforms to publish on (facebook, instagram, messenger, audience_network). - publisher_platforms: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - source_adset_id: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - start_time: nil, - status: nil, - # Advantage+ audience expansion settings. - targeting_automation: nil, - threads_positions: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - updated_time: nil, - user_device: nil, - user_os: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - whatsapp_phone_number: nil, - whatsapp_positions: nil - ) - end - - sig do - override.returns( - { - android_devices: T.nilable(T::Array[String]), - attribution_setting: T.nilable(String), - attribution_spec: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec - ] - ), - audience_network_positions: T.nilable(T::Array[String]), - audience_type: T.nilable(String), - bid_amount: T.nilable(Integer), - bid_strategy: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy::OrSymbol - ), - billing_event: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::OrSymbol - ), - brand_safety_content_filter_levels: T.nilable(T::Array[String]), - budget_remaining: T.nilable(String), - cost_per_result_goal: T.nilable(Float), - created_time: T.nilable(String), - daily_budget: T.nilable(Integer), - daily_min_spend_target: T.nilable(String), - daily_spend_cap: T.nilable(String), - destination_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::OrSymbol - ), - dsa_beneficiary: T.nilable(String), - dsa_payor: T.nilable(String), - end_time: T.nilable(String), - excluded_geo_locations: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations - ), - facebook_positions: T.nilable(T::Array[String]), - frequency_control_count: T.nilable(Integer), - frequency_control_days: T.nilable(Integer), - frequency_control_type: T.nilable(String), - geo_cities: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity - ] - ), - geo_locations: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations - ), - geo_regions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion - ] - ), - geo_zips: T.nilable(T::Array[String]), - instagram_actor_id: T.nilable(String), - instagram_positions: T.nilable(T::Array[String]), - ios_devices: T.nilable(T::Array[String]), - is_dynamic_creative: T.nilable(T::Boolean), - lead_conversion_location: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::OrSymbol - ), - lead_form_config: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig - ), - lead_gen_form_id: T.nilable(String), - lifetime_budget: T.nilable(Integer), - lifetime_min_spend_target: T.nilable(String), - lifetime_spend_cap: T.nilable(String), - location_types: T.nilable(T::Array[String]), - messenger_positions: T.nilable(T::Array[String]), - optimization_goal: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::OrSymbol - ), - page_id: T.nilable(String), - pixel_id: T.nilable(String), - promoted_object: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject - ), - publisher_platforms: T.nilable(T::Array[String]), - source_adset_id: T.nilable(String), - start_time: T.nilable(String), - status: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::Status::OrSymbol - ), - targeting_automation: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation - ), - threads_positions: T.nilable(T::Array[String]), - updated_time: T.nilable(String), - user_device: T.nilable(T::Array[String]), - user_os: T.nilable(T::Array[String]), - whatsapp_phone_number: T.nilable(String), - whatsapp_positions: T.nilable(T::Array[String]) - } - ) - end - def to_hash - end - - class AttributionSpec < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec, - WhopSDK::Internal::AnyHash - ) - end - - # Attribution event type (e.g., CLICK_THROUGH, VIEW_THROUGH). - sig { returns(String) } - attr_accessor :event_type - - # Attribution window in days (1, 7, 28). - sig { returns(Integer) } - attr_accessor :window_days - - # Meta conversion attribution window. - sig do - params(event_type: String, window_days: Integer).returns( - T.attached_class - ) - end - def self.new( - # Attribution event type (e.g., CLICK_THROUGH, VIEW_THROUGH). - event_type:, - # Attribution window in days (1, 7, 28). - window_days: - ) - end - - sig do - override.returns({ event_type: String, window_days: Integer }) - end - def to_hash - end - end - - # Meta bid strategy. - module BidStrategy - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - LOWEST_COST_WITHOUT_CAP = - T.let( - :LOWEST_COST_WITHOUT_CAP, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy::TaggedSymbol - ) - LOWEST_COST_WITH_BID_CAP = - T.let( - :LOWEST_COST_WITH_BID_CAP, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy::TaggedSymbol - ) - COST_CAP = - T.let( - :COST_CAP, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy::TaggedSymbol - ) - LOWEST_COST_WITH_MIN_ROAS = - T.let( - :LOWEST_COST_WITH_MIN_ROAS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BidStrategy::TaggedSymbol - ] - ) - end - def self.values - end - end - - # How you are billed on Meta. - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - APP_INSTALLS = - T.let( - :APP_INSTALLS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - CLICKS = - T.let( - :CLICKS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - IMPRESSIONS = - T.let( - :IMPRESSIONS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - LINK_CLICKS = - T.let( - :LINK_CLICKS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - NONE = - T.let( - :NONE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - OFFER_CLAIMS = - T.let( - :OFFER_CLAIMS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - PAGE_LIKES = - T.let( - :PAGE_LIKES, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - POST_ENGAGEMENT = - T.let( - :POST_ENGAGEMENT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - THRUPLAY = - T.let( - :THRUPLAY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - PURCHASE = - T.let( - :PURCHASE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - LISTING_INTERACTION = - T.let( - :LISTING_INTERACTION, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::BillingEvent::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Where ads in this ad set direct people. - module DestinationType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - UNDEFINED = - T.let( - :UNDEFINED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - WEBSITE = - T.let( - :WEBSITE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - APP = - T.let( - :APP, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - FACEBOOK = - T.let( - :FACEBOOK, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - MESSENGER = - T.let( - :MESSENGER, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - WHATSAPP = - T.let( - :WHATSAPP, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - INSTAGRAM_DIRECT = - T.let( - :INSTAGRAM_DIRECT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - INSTAGRAM_PROFILE = - T.let( - :INSTAGRAM_PROFILE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - PHONE_CALL = - T.let( - :PHONE_CALL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - SHOP_AUTOMATIC = - T.let( - :SHOP_AUTOMATIC, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - APPLINKS_AUTOMATIC = - T.let( - :APPLINKS_AUTOMATIC, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - ON_AD = - T.let( - :ON_AD, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - ON_POST = - T.let( - :ON_POST, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - ON_VIDEO = - T.let( - :ON_VIDEO, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - ON_PAGE = - T.let( - :ON_PAGE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - ON_EVENT = - T.let( - :ON_EVENT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - MESSAGING_MESSENGER_WHATSAPP = - T.let( - :MESSAGING_MESSENGER_WHATSAPP, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - MESSAGING_INSTAGRAM_DIRECT_MESSENGER = - T.let( - :MESSAGING_INSTAGRAM_DIRECT_MESSENGER, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - MESSAGING_INSTAGRAM_DIRECT_WHATSAPP = - T.let( - :MESSAGING_INSTAGRAM_DIRECT_WHATSAPP, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP = - T.let( - :MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE = - T.let( - :INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - FACEBOOK_PAGE = - T.let( - :FACEBOOK_PAGE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - INSTAGRAM_LIVE = - T.let( - :INSTAGRAM_LIVE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - FACEBOOK_LIVE = - T.let( - :FACEBOOK_LIVE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - IMAGINE = - T.let( - :IMAGINE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - LEAD_FROM_IG_DIRECT = - T.let( - :LEAD_FROM_IG_DIRECT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - LEAD_FROM_MESSENGER = - T.let( - :LEAD_FROM_MESSENGER, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - LEAD_FORM_MESSENGER = - T.let( - :LEAD_FORM_MESSENGER, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - WEBSITE_AND_LEAD_FORM = - T.let( - :WEBSITE_AND_LEAD_FORM, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - WEBSITE_AND_PHONE_CALL = - T.let( - :WEBSITE_AND_PHONE_CALL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - BROADCAST_CHANNEL = - T.let( - :BROADCAST_CHANNEL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::DestinationType::TaggedSymbol - ] - ) - end - def self.values - end - end - - class ExcludedGeoLocations < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations, - WhopSDK::Internal::AnyHash - ) - end - - # City targets. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City - ] - ) - ) - end - attr_accessor :cities - - # ISO 3166-1 alpha-2 country codes. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :countries - - # Location types (home, recent, travel_in). - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :location_types - - # Region/state targets. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region - ] - ) - ) - end - attr_accessor :regions - - # Zip/postal code targets. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip - ] - ) - ) - end - attr_accessor :zips - - # Geo locations to exclude. - sig do - params( - cities: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City::OrHash - ] - ), - countries: T.nilable(T::Array[String]), - location_types: T.nilable(T::Array[String]), - regions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region::OrHash - ] - ), - zips: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip::OrHash - ] - ) - ).returns(T.attached_class) - end - def self.new( - # City targets. - cities: nil, - # ISO 3166-1 alpha-2 country codes. - countries: nil, - # Location types (home, recent, travel_in). - location_types: nil, - # Region/state targets. - regions: nil, - # Zip/postal code targets. - zips: nil - ) - end - - sig do - override.returns( - { - cities: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City - ] - ), - countries: T.nilable(T::Array[String]), - location_types: T.nilable(T::Array[String]), - regions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region - ] - ), - zips: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip - ] - ) - } - ) - end - def to_hash - end - - class City < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City, - WhopSDK::Internal::AnyHash - ) - end - - # Meta geo target key/ID. - sig { returns(String) } - attr_accessor :key - - # Country code for this entry. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # Display name. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Radius in miles (cities only). - sig { returns(T.nilable(Integer)) } - attr_accessor :radius - - # A Meta geo target entry (region, city, or zip). - sig do - params( - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Meta geo target key/ID. - key:, - # Country code for this entry. - country: nil, - # Display name. - name: nil, - # Radius in miles (cities only). - radius: nil - ) - end - - sig do - override.returns( - { - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - } - ) - end - def to_hash - end - end - - class Region < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region, - WhopSDK::Internal::AnyHash - ) - end - - # Meta geo target key/ID. - sig { returns(String) } - attr_accessor :key - - # Country code for this entry. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # Display name. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Radius in miles (cities only). - sig { returns(T.nilable(Integer)) } - attr_accessor :radius - - # A Meta geo target entry (region, city, or zip). - sig do - params( - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Meta geo target key/ID. - key:, - # Country code for this entry. - country: nil, - # Display name. - name: nil, - # Radius in miles (cities only). - radius: nil - ) - end - - sig do - override.returns( - { - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - } - ) - end - def to_hash - end - end - - class Zip < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip, - WhopSDK::Internal::AnyHash - ) - end - - # Meta geo target key/ID. - sig { returns(String) } - attr_accessor :key - - # Country code for this entry. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # Display name. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Radius in miles (cities only). - sig { returns(T.nilable(Integer)) } - attr_accessor :radius - - # A Meta geo target entry (region, city, or zip). - sig do - params( - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Meta geo target key/ID. - key:, - # Country code for this entry. - country: nil, - # Display name. - name: nil, - # Radius in miles (cities only). - radius: nil - ) - end - - sig do - override.returns( - { - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - } - ) - end - def to_hash - end - end - end - - class GeoCity < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity, - WhopSDK::Internal::AnyHash - ) - end - - # Meta geo target key/ID. - sig { returns(String) } - attr_accessor :key - - # Country code for this entry. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # Display name. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Radius in miles (cities only). - sig { returns(T.nilable(Integer)) } - attr_accessor :radius - - # A Meta geo target entry (region, city, or zip). - sig do - params( - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Meta geo target key/ID. - key:, - # Country code for this entry. - country: nil, - # Display name. - name: nil, - # Radius in miles (cities only). - radius: nil - ) - end - - sig do - override.returns( - { - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - } - ) - end - def to_hash - end - end - - class GeoLocations < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations, - WhopSDK::Internal::AnyHash - ) - end - - # City targets. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City - ] - ) - ) - end - attr_accessor :cities - - # ISO 3166-1 alpha-2 country codes. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :countries - - # Location types (home, recent, travel_in). - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :location_types - - # Region/state targets. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region - ] - ) - ) - end - attr_accessor :regions - - # Zip/postal code targets. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip - ] - ) - ) - end - attr_accessor :zips - - # Geo targeting (countries, regions, cities, zips). - sig do - params( - cities: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City::OrHash - ] - ), - countries: T.nilable(T::Array[String]), - location_types: T.nilable(T::Array[String]), - regions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region::OrHash - ] - ), - zips: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip::OrHash - ] - ) - ).returns(T.attached_class) - end - def self.new( - # City targets. - cities: nil, - # ISO 3166-1 alpha-2 country codes. - countries: nil, - # Location types (home, recent, travel_in). - location_types: nil, - # Region/state targets. - regions: nil, - # Zip/postal code targets. - zips: nil - ) - end - - sig do - override.returns( - { - cities: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City - ] - ), - countries: T.nilable(T::Array[String]), - location_types: T.nilable(T::Array[String]), - regions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region - ] - ), - zips: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip - ] - ) - } - ) - end - def to_hash - end - - class City < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City, - WhopSDK::Internal::AnyHash - ) - end - - # Meta geo target key/ID. - sig { returns(String) } - attr_accessor :key - - # Country code for this entry. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # Display name. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Radius in miles (cities only). - sig { returns(T.nilable(Integer)) } - attr_accessor :radius - - # A Meta geo target entry (region, city, or zip). - sig do - params( - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Meta geo target key/ID. - key:, - # Country code for this entry. - country: nil, - # Display name. - name: nil, - # Radius in miles (cities only). - radius: nil - ) - end - - sig do - override.returns( - { - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - } - ) - end - def to_hash - end - end - - class Region < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region, - WhopSDK::Internal::AnyHash - ) - end - - # Meta geo target key/ID. - sig { returns(String) } - attr_accessor :key - - # Country code for this entry. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # Display name. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Radius in miles (cities only). - sig { returns(T.nilable(Integer)) } - attr_accessor :radius - - # A Meta geo target entry (region, city, or zip). - sig do - params( - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Meta geo target key/ID. - key:, - # Country code for this entry. - country: nil, - # Display name. - name: nil, - # Radius in miles (cities only). - radius: nil - ) - end - - sig do - override.returns( - { - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - } - ) - end - def to_hash - end - end - - class Zip < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip, - WhopSDK::Internal::AnyHash - ) - end - - # Meta geo target key/ID. - sig { returns(String) } - attr_accessor :key - - # Country code for this entry. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # Display name. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Radius in miles (cities only). - sig { returns(T.nilable(Integer)) } - attr_accessor :radius - - # A Meta geo target entry (region, city, or zip). - sig do - params( - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Meta geo target key/ID. - key:, - # Country code for this entry. - country: nil, - # Display name. - name: nil, - # Radius in miles (cities only). - radius: nil - ) - end - - sig do - override.returns( - { - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - } - ) - end - def to_hash - end - end - end - - class GeoRegion < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion, - WhopSDK::Internal::AnyHash - ) - end - - # Meta geo target key/ID. - sig { returns(String) } - attr_accessor :key - - # Country code for this entry. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # Display name. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Radius in miles (cities only). - sig { returns(T.nilable(Integer)) } - attr_accessor :radius - - # A Meta geo target entry (region, city, or zip). - sig do - params( - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Meta geo target key/ID. - key:, - # Country code for this entry. - country: nil, - # Display name. - name: nil, - # Radius in miles (cities only). - radius: nil - ) - end - - sig do - override.returns( - { - key: String, - country: T.nilable(String), - name: T.nilable(String), - radius: T.nilable(Integer) - } - ) - end - def to_hash - end - end - - module LeadConversionLocation - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - WEBSITE = - T.let( - :website, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::TaggedSymbol - ) - INSTANT_FORMS = - T.let( - :instant_forms, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::TaggedSymbol - ) - WEBSITE_AND_INSTANT_FORMS = - T.let( - :website_and_instant_forms, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::TaggedSymbol - ) - MESSENGER = - T.let( - :messenger, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::TaggedSymbol - ) - INSTAGRAM = - T.let( - :instagram, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::TaggedSymbol - ) - CALLS = - T.let( - :calls, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::TaggedSymbol - ) - APP = - T.let( - :app, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadConversionLocation::TaggedSymbol - ] - ) - end - def self.values - end - end - - class LeadFormConfig < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig, - WhopSDK::Internal::AnyHash - ) - end - - # Name of the lead form. - sig { returns(String) } - attr_accessor :name - - # URL to your privacy policy. Required by Meta. - sig { returns(String) } - attr_accessor :privacy_policy_url - - # Questions to ask on the form. - sig do - returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question - ] - ) - end - attr_accessor :questions - - # Background image source: from_ad or custom. - sig { returns(T.nilable(String)) } - attr_accessor :background_image_source - - # URL of custom background image. - sig { returns(T.nilable(String)) } - attr_accessor :background_image_url - - # Whether conditional logic is enabled for questions. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :conditional_logic_enabled - - # CTA button text on the greeting card. - sig { returns(T.nilable(String)) } - attr_accessor :context_card_button_text - - # Optional greeting card bullet points. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :context_card_content - - # Greeting layout: PARAGRAPH_STYLE or LIST_STYLE. - sig { returns(T.nilable(String)) } - attr_accessor :context_card_style - - # Optional greeting card title. - sig { returns(T.nilable(String)) } - attr_accessor :context_card_title - - # Custom disclaimer body text. - sig { returns(T.nilable(String)) } - attr_accessor :custom_disclaimer_body - - # Consent checkboxes for the custom disclaimer. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox - ] - ) - ) - end - attr_accessor :custom_disclaimer_checkboxes - - # Custom disclaimer section title. - sig { returns(T.nilable(String)) } - attr_accessor :custom_disclaimer_title - - # Form type: more_volume, higher_intent, or rich_creative. - sig { returns(T.nilable(String)) } - attr_accessor :form_type - - # Enable Messenger follow-up after form submission. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :messenger_enabled - - # Require phone number verification via OTP (higher_intent only). - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verification_enabled - - # Custom link text for privacy policy (max 70 chars). - sig { returns(T.nilable(String)) } - attr_accessor :privacy_policy_link_text - - # Custom headline for the questions page. - sig { returns(T.nilable(String)) } - attr_accessor :question_page_custom_headline - - # Headline for rich creative form intro. - sig { returns(T.nilable(String)) } - attr_accessor :rich_creative_headline - - # Overview description for rich creative form intro. - sig { returns(T.nilable(String)) } - attr_accessor :rich_creative_overview - - # Uploaded image URL for rich creative form type. - sig { returns(T.nilable(String)) } - attr_accessor :rich_creative_url - - # Thank you / ending pages (supports multiple for conditional routing). - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage - ] - ) - ) - end - attr_accessor :thank_you_pages - - # Configuration for a Meta lead gen instant form. - sig do - params( - name: String, - privacy_policy_url: String, - questions: - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::OrHash - ], - background_image_source: T.nilable(String), - background_image_url: T.nilable(String), - conditional_logic_enabled: T.nilable(T::Boolean), - context_card_button_text: T.nilable(String), - context_card_content: T.nilable(T::Array[String]), - context_card_style: T.nilable(String), - context_card_title: T.nilable(String), - custom_disclaimer_body: T.nilable(String), - custom_disclaimer_checkboxes: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox::OrHash - ] - ), - custom_disclaimer_title: T.nilable(String), - form_type: T.nilable(String), - messenger_enabled: T.nilable(T::Boolean), - phone_verification_enabled: T.nilable(T::Boolean), - privacy_policy_link_text: T.nilable(String), - question_page_custom_headline: T.nilable(String), - rich_creative_headline: T.nilable(String), - rich_creative_overview: T.nilable(String), - rich_creative_url: T.nilable(String), - thank_you_pages: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage::OrHash - ] - ) - ).returns(T.attached_class) - end - def self.new( - # Name of the lead form. - name:, - # URL to your privacy policy. Required by Meta. - privacy_policy_url:, - # Questions to ask on the form. - questions:, - # Background image source: from_ad or custom. - background_image_source: nil, - # URL of custom background image. - background_image_url: nil, - # Whether conditional logic is enabled for questions. - conditional_logic_enabled: nil, - # CTA button text on the greeting card. - context_card_button_text: nil, - # Optional greeting card bullet points. - context_card_content: nil, - # Greeting layout: PARAGRAPH_STYLE or LIST_STYLE. - context_card_style: nil, - # Optional greeting card title. - context_card_title: nil, - # Custom disclaimer body text. - custom_disclaimer_body: nil, - # Consent checkboxes for the custom disclaimer. - custom_disclaimer_checkboxes: nil, - # Custom disclaimer section title. - custom_disclaimer_title: nil, - # Form type: more_volume, higher_intent, or rich_creative. - form_type: nil, - # Enable Messenger follow-up after form submission. - messenger_enabled: nil, - # Require phone number verification via OTP (higher_intent only). - phone_verification_enabled: nil, - # Custom link text for privacy policy (max 70 chars). - privacy_policy_link_text: nil, - # Custom headline for the questions page. - question_page_custom_headline: nil, - # Headline for rich creative form intro. - rich_creative_headline: nil, - # Overview description for rich creative form intro. - rich_creative_overview: nil, - # Uploaded image URL for rich creative form type. - rich_creative_url: nil, - # Thank you / ending pages (supports multiple for conditional routing). - thank_you_pages: nil - ) - end - - sig do - override.returns( - { - name: String, - privacy_policy_url: String, - questions: - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question - ], - background_image_source: T.nilable(String), - background_image_url: T.nilable(String), - conditional_logic_enabled: T.nilable(T::Boolean), - context_card_button_text: T.nilable(String), - context_card_content: T.nilable(T::Array[String]), - context_card_style: T.nilable(String), - context_card_title: T.nilable(String), - custom_disclaimer_body: T.nilable(String), - custom_disclaimer_checkboxes: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox - ] - ), - custom_disclaimer_title: T.nilable(String), - form_type: T.nilable(String), - messenger_enabled: T.nilable(T::Boolean), - phone_verification_enabled: T.nilable(T::Boolean), - privacy_policy_link_text: T.nilable(String), - question_page_custom_headline: T.nilable(String), - rich_creative_headline: T.nilable(String), - rich_creative_overview: T.nilable(String), - rich_creative_url: T.nilable(String), - thank_you_pages: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage - ] - ) - } - ) - end - def to_hash - end - - class Question < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question, - WhopSDK::Internal::AnyHash - ) - end - - # Question type (EMAIL, FULL_NAME, PHONE, CUSTOM, DATE_TIME, etc.). - sig { returns(String) } - attr_accessor :type - - # Group ID for conditional question routing. - sig { returns(T.nilable(String)) } - attr_accessor :conditional_questions_group_id - - # Questions shown conditionally based on this question's answer. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion - ] - ) - ) - end - attr_accessor :dependent_conditional_questions - - # Helper text shown below the question. - sig { returns(T.nilable(String)) } - attr_accessor :inline_context - - # Unique key for this question. - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Custom label for CUSTOM questions. - sig { returns(T.nilable(String)) } - attr_accessor :label - - # Answer options for multiple choice CUSTOM questions. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option - ] - ) - ) - end - attr_accessor :options - - # UI hint: short_answer, multiple_choice, or appointment. - sig { returns(T.nilable(String)) } - attr_accessor :question_format - - # A question on a Meta lead gen form. - sig do - params( - type: String, - conditional_questions_group_id: T.nilable(String), - dependent_conditional_questions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::OrHash - ] - ), - inline_context: T.nilable(String), - key: T.nilable(String), - label: T.nilable(String), - options: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::OrHash - ] - ), - question_format: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Question type (EMAIL, FULL_NAME, PHONE, CUSTOM, DATE_TIME, etc.). - type:, - # Group ID for conditional question routing. - conditional_questions_group_id: nil, - # Questions shown conditionally based on this question's answer. - dependent_conditional_questions: nil, - # Helper text shown below the question. - inline_context: nil, - # Unique key for this question. - key: nil, - # Custom label for CUSTOM questions. - label: nil, - # Answer options for multiple choice CUSTOM questions. - options: nil, - # UI hint: short_answer, multiple_choice, or appointment. - question_format: nil - ) - end - - sig do - override.returns( - { - type: String, - conditional_questions_group_id: T.nilable(String), - dependent_conditional_questions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion - ] - ), - inline_context: T.nilable(String), - key: T.nilable(String), - label: T.nilable(String), - options: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option - ] - ), - question_format: T.nilable(String) - } - ) - end - def to_hash - end - - class DependentConditionalQuestion < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion, - WhopSDK::Internal::AnyHash - ) - end - - # Question type (EMAIL, FULL_NAME, PHONE, CUSTOM, DATE_TIME, etc.). - sig { returns(String) } - attr_accessor :type - - # Helper text shown below the question. - sig { returns(T.nilable(String)) } - attr_accessor :inline_context - - # Unique key for this question. - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Custom label for CUSTOM questions. - sig { returns(T.nilable(String)) } - attr_accessor :label - - # Answer options for multiple choice questions. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option - ] - ) - ) - end - attr_accessor :options - - # A dependent conditional question (non-recursive to avoid schema recursion). - sig do - params( - type: String, - inline_context: T.nilable(String), - key: T.nilable(String), - label: T.nilable(String), - options: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::OrHash - ] - ) - ).returns(T.attached_class) - end - def self.new( - # Question type (EMAIL, FULL_NAME, PHONE, CUSTOM, DATE_TIME, etc.). - type:, - # Helper text shown below the question. - inline_context: nil, - # Unique key for this question. - key: nil, - # Custom label for CUSTOM questions. - label: nil, - # Answer options for multiple choice questions. - options: nil - ) - end - - sig do - override.returns( - { - type: String, - inline_context: T.nilable(String), - key: T.nilable(String), - label: T.nilable(String), - options: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option - ] - ) - } - ) - end - def to_hash - end - - class Option < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option, - WhopSDK::Internal::AnyHash - ) - end - - # Unique key for this option. - sig { returns(String) } - attr_accessor :key - - # Display text for this option. - sig { returns(String) } - attr_accessor :value - - # Conditional logic routing for this answer option. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic - ) - ) - end - attr_reader :logic - - sig do - params( - logic: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic::OrHash - ) - ).void - end - attr_writer :logic - - # An answer option for a multiple choice lead form question. - sig do - params( - key: String, - value: String, - logic: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic::OrHash - ) - ).returns(T.attached_class) - end - def self.new( - # Unique key for this option. - key:, - # Display text for this option. - value:, - # Conditional logic routing for this answer option. - logic: nil - ) - end - - sig do - override.returns( - { - key: String, - value: String, - logic: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic - ) - } - ) - end - def to_hash - end - - class Logic < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic, - WhopSDK::Internal::AnyHash - ) - end - - # Logic type: go_to_question, submit_form, or close_form. - sig { returns(String) } - attr_accessor :type - - # Index of the end page to route to (for submit_form type). - sig { returns(T.nilable(Integer)) } - attr_accessor :target_end_page_index - - # Index of the question to route to (for go_to_question type). - sig { returns(T.nilable(Integer)) } - attr_accessor :target_question_index - - # Conditional logic routing for this answer option. - sig do - params( - type: String, - target_end_page_index: T.nilable(Integer), - target_question_index: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Logic type: go_to_question, submit_form, or close_form. - type:, - # Index of the end page to route to (for submit_form type). - target_end_page_index: nil, - # Index of the question to route to (for go_to_question type). - target_question_index: nil - ) - end - - sig do - override.returns( - { - type: String, - target_end_page_index: T.nilable(Integer), - target_question_index: T.nilable(Integer) - } - ) - end - def to_hash - end - end - end - end - - class Option < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option, - WhopSDK::Internal::AnyHash - ) - end - - # Unique key for this option. - sig { returns(String) } - attr_accessor :key - - # Display text for this option. - sig { returns(String) } - attr_accessor :value - - # Conditional logic routing for this answer option. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic - ) - ) - end - attr_reader :logic - - sig do - params( - logic: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic::OrHash - ) - ).void - end - attr_writer :logic - - # An answer option for a multiple choice lead form question. - sig do - params( - key: String, - value: String, - logic: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic::OrHash - ) - ).returns(T.attached_class) - end - def self.new( - # Unique key for this option. - key:, - # Display text for this option. - value:, - # Conditional logic routing for this answer option. - logic: nil - ) - end - - sig do - override.returns( - { - key: String, - value: String, - logic: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic - ) - } - ) - end - def to_hash - end - - class Logic < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic, - WhopSDK::Internal::AnyHash - ) - end - - # Logic type: go_to_question, submit_form, or close_form. - sig { returns(String) } - attr_accessor :type - - # Index of the end page to route to (for submit_form type). - sig { returns(T.nilable(Integer)) } - attr_accessor :target_end_page_index - - # Index of the question to route to (for go_to_question type). - sig { returns(T.nilable(Integer)) } - attr_accessor :target_question_index - - # Conditional logic routing for this answer option. - sig do - params( - type: String, - target_end_page_index: T.nilable(Integer), - target_question_index: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - # Logic type: go_to_question, submit_form, or close_form. - type:, - # Index of the end page to route to (for submit_form type). - target_end_page_index: nil, - # Index of the question to route to (for go_to_question type). - target_question_index: nil - ) - end - - sig do - override.returns( - { - type: String, - target_end_page_index: T.nilable(Integer), - target_question_index: T.nilable(Integer) - } - ) - end - def to_hash - end - end - end - end - - class CustomDisclaimerCheckbox < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox, - WhopSDK::Internal::AnyHash - ) - end - - # Unique key for this checkbox. - sig { returns(String) } - attr_accessor :key - - # Label text for the checkbox. - sig { returns(String) } - attr_accessor :text - - # Whether the checkbox is checked by default. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_checked_by_default - - # Whether the checkbox must be checked to submit. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_required - - # A consent checkbox for the custom disclaimer section. - sig do - params( - key: String, - text: String, - is_checked_by_default: T.nilable(T::Boolean), - is_required: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Unique key for this checkbox. - key:, - # Label text for the checkbox. - text:, - # Whether the checkbox is checked by default. - is_checked_by_default: nil, - # Whether the checkbox must be checked to submit. - is_required: nil - ) - end - - sig do - override.returns( - { - key: String, - text: String, - is_checked_by_default: T.nilable(T::Boolean), - is_required: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class ThankYouPage < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage, - WhopSDK::Internal::AnyHash - ) - end - - # Body text for this ending page. - sig { returns(T.nilable(String)) } - attr_accessor :body - - # Business phone number for call CTA. - sig { returns(T.nilable(String)) } - attr_accessor :business_phone - - # Custom button text. - sig { returns(T.nilable(String)) } - attr_accessor :button_text - - # CTA button type: VIEW_WEBSITE, CALL_BUSINESS, DOWNLOAD. - sig { returns(T.nilable(String)) } - attr_accessor :button_type - - # Question group ID for conditional routing to this page. - sig { returns(T.nilable(String)) } - attr_accessor :conditional_question_group_id - - # Enable Messenger follow-up. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :enable_messenger - - # Uploaded file URL for gated content download. - sig { returns(T.nilable(String)) } - attr_accessor :gated_file_url - - # URL the button links to. - sig { returns(T.nilable(String)) } - attr_accessor :link - - # Internal name for this ending page. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Headline for this ending page. - sig { returns(T.nilable(String)) } - attr_accessor :title - - # A thank-you / ending page for a Meta lead gen form. - sig do - params( - body: T.nilable(String), - business_phone: T.nilable(String), - button_text: T.nilable(String), - button_type: T.nilable(String), - conditional_question_group_id: T.nilable(String), - enable_messenger: T.nilable(T::Boolean), - gated_file_url: T.nilable(String), - link: T.nilable(String), - name: T.nilable(String), - title: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Body text for this ending page. - body: nil, - # Business phone number for call CTA. - business_phone: nil, - # Custom button text. - button_text: nil, - # CTA button type: VIEW_WEBSITE, CALL_BUSINESS, DOWNLOAD. - button_type: nil, - # Question group ID for conditional routing to this page. - conditional_question_group_id: nil, - # Enable Messenger follow-up. - enable_messenger: nil, - # Uploaded file URL for gated content download. - gated_file_url: nil, - # URL the button links to. - link: nil, - # Internal name for this ending page. - name: nil, - # Headline for this ending page. - title: nil - ) - end - - sig do - override.returns( - { - body: T.nilable(String), - business_phone: T.nilable(String), - button_text: T.nilable(String), - button_type: T.nilable(String), - conditional_question_group_id: T.nilable(String), - enable_messenger: T.nilable(T::Boolean), - gated_file_url: T.nilable(String), - link: T.nilable(String), - name: T.nilable(String), - title: T.nilable(String) - } - ) - end - def to_hash - end - end - end - - # What this ad set optimizes for on Meta. - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - NONE = - T.let( - :NONE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - APP_INSTALLS = - T.let( - :APP_INSTALLS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - AD_RECALL_LIFT = - T.let( - :AD_RECALL_LIFT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - ENGAGED_USERS = - T.let( - :ENGAGED_USERS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - EVENT_RESPONSES = - T.let( - :EVENT_RESPONSES, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - IMPRESSIONS = - T.let( - :IMPRESSIONS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - LEAD_GENERATION = - T.let( - :LEAD_GENERATION, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - QUALITY_LEAD = - T.let( - :QUALITY_LEAD, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - LINK_CLICKS = - T.let( - :LINK_CLICKS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - OFFSITE_CONVERSIONS = - T.let( - :OFFSITE_CONVERSIONS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - PAGE_LIKES = - T.let( - :PAGE_LIKES, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - POST_ENGAGEMENT = - T.let( - :POST_ENGAGEMENT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - QUALITY_CALL = - T.let( - :QUALITY_CALL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - REACH = - T.let( - :REACH, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - LANDING_PAGE_VIEWS = - T.let( - :LANDING_PAGE_VIEWS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - VISIT_INSTAGRAM_PROFILE = - T.let( - :VISIT_INSTAGRAM_PROFILE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - VALUE = - T.let( - :VALUE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - THRUPLAY = - T.let( - :THRUPLAY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - DERIVED_EVENTS = - T.let( - :DERIVED_EVENTS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - APP_INSTALLS_AND_OFFSITE_CONVERSIONS = - T.let( - :APP_INSTALLS_AND_OFFSITE_CONVERSIONS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - CONVERSATIONS = - T.let( - :CONVERSATIONS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - IN_APP_VALUE = - T.let( - :IN_APP_VALUE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - MESSAGING_PURCHASE_CONVERSION = - T.let( - :MESSAGING_PURCHASE_CONVERSION, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - SUBSCRIBERS = - T.let( - :SUBSCRIBERS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - REMINDERS_SET = - T.let( - :REMINDERS_SET, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - MEANINGFUL_CALL_ATTEMPT = - T.let( - :MEANINGFUL_CALL_ATTEMPT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - PROFILE_VISIT = - T.let( - :PROFILE_VISIT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - PROFILE_AND_PAGE_ENGAGEMENT = - T.let( - :PROFILE_AND_PAGE_ENGAGEMENT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - TWO_SECOND_CONTINUOUS_VIDEO_VIEWS = - T.let( - :TWO_SECOND_CONTINUOUS_VIDEO_VIEWS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - ENGAGED_REACH = - T.let( - :ENGAGED_REACH, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - ENGAGED_PAGE_VIEWS = - T.let( - :ENGAGED_PAGE_VIEWS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - MESSAGING_DEEP_CONVERSATION_AND_FOLLOW = - T.let( - :MESSAGING_DEEP_CONVERSATION_AND_FOLLOW, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - ADVERTISER_SILOED_VALUE = - T.let( - :ADVERTISER_SILOED_VALUE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - AUTOMATIC_OBJECTIVE = - T.let( - :AUTOMATIC_OBJECTIVE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - MESSAGING_APPOINTMENT_CONVERSION = - T.let( - :MESSAGING_APPOINTMENT_CONVERSION, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::OptimizationGoal::TaggedSymbol - ] - ) - end - def self.values - end - end - - class PromotedObject < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject, - WhopSDK::Internal::AnyHash - ) - end - - # Custom conversion rule ID (numeric, from Meta Events Manager). - sig { returns(T.nilable(String)) } - attr_accessor :custom_conversion_id - - # Pixel event name, used when custom_event_type is OTHER. - sig { returns(T.nilable(String)) } - attr_accessor :custom_event_str - - # Custom event type (e.g., PURCHASE, COMPLETE_REGISTRATION, OTHER). - sig { returns(T.nilable(String)) } - attr_accessor :custom_event_type - - # Facebook Page ID. - sig { returns(T.nilable(String)) } - attr_accessor :page_id - - # Meta Pixel ID for conversion tracking. - sig { returns(T.nilable(String)) } - attr_accessor :pixel_id - - # WhatsApp phone number for messaging campaigns. - sig { returns(T.nilable(String)) } - attr_accessor :whatsapp_phone_number - - # The object this ad set promotes (pixel, page, etc.). - sig do - params( - custom_conversion_id: T.nilable(String), - custom_event_str: T.nilable(String), - custom_event_type: T.nilable(String), - page_id: T.nilable(String), - pixel_id: T.nilable(String), - whatsapp_phone_number: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Custom conversion rule ID (numeric, from Meta Events Manager). - custom_conversion_id: nil, - # Pixel event name, used when custom_event_type is OTHER. - custom_event_str: nil, - # Custom event type (e.g., PURCHASE, COMPLETE_REGISTRATION, OTHER). - custom_event_type: nil, - # Facebook Page ID. - page_id: nil, - # Meta Pixel ID for conversion tracking. - pixel_id: nil, - # WhatsApp phone number for messaging campaigns. - whatsapp_phone_number: nil - ) - end - - sig do - override.returns( - { - custom_conversion_id: T.nilable(String), - custom_event_str: T.nilable(String), - custom_event_type: T.nilable(String), - page_id: T.nilable(String), - pixel_id: T.nilable(String), - whatsapp_phone_number: T.nilable(String) - } - ) - end - def to_hash - end - end - - module Status - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ACTIVE = - T.let( - :ACTIVE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::Status::TaggedSymbol - ) - PAUSED = - T.let( - :PAUSED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TargetingAutomation < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation, - WhopSDK::Internal::AnyHash - ) - end - - # 0 = off (use exact targeting), 1 = on (let Meta expand audience). - sig { returns(T.nilable(Integer)) } - attr_accessor :advantage_audience - - # Advantage+ audience expansion settings. - sig do - params(advantage_audience: T.nilable(Integer)).returns( - T.attached_class - ) - end - def self.new( - # 0 = off (use exact targeting), 1 = on (let Meta expand audience). - advantage_audience: nil - ) - end - - sig { override.returns({ advantage_audience: T.nilable(Integer) }) } - def to_hash - end - end - end - - class Tiktok < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok, - WhopSDK::Internal::AnyHash - ) - end - - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action - ] - ) - ) - end - attr_accessor :actions - - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::OrSymbol - ] - ) - ) - end - attr_accessor :age_groups - - # App ID for app promotion campaigns. - sig { returns(T.nilable(String)) } - attr_accessor :app_id - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount::OrSymbol - ) - ) - end - attr_accessor :attribution_event_count - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :audience_ids - - # Represents untyped JSON - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :audience_rule - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType::OrSymbol - ) - ) - end - attr_accessor :audience_type - - # Bid price (cost per result for Cost Cap). - sig { returns(T.nilable(Float)) } - attr_accessor :bid_price - - # Bidding strategy (BID_TYPE_NO_BID, BID_TYPE_CUSTOM). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType::OrSymbol - ) - ) - end - attr_accessor :bid_type - - # How you are billed on TikTok (CPC, CPM, OCPM, CPV). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent::OrSymbol - ) - ) - end - attr_accessor :billing_event - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::OrSymbol - ) - ) - end - attr_accessor :brand_safety_type - - # Budget mode (BUDGET_MODE_DAY, BUDGET_MODE_TOTAL, - # BUDGET_MODE_DYNAMIC_DAILY_BUDGET). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode::OrSymbol - ) - ) - end - attr_accessor :budget_mode - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :carrier_ids - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :category_exclusion_ids - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::OrSymbol - ) - ) - end - attr_accessor :click_attribution_window - - # Represents `true` or `false` values. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :comment_disabled - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :contextual_tag_ids - - # Target cost per conversion for oCPM. - sig { returns(T.nilable(Float)) } - attr_accessor :conversion_bid_price - - # Creative delivery strategy. - sig { returns(T.nilable(String)) } - attr_accessor :creative_material_mode - - # Ad delivery schedule (48x7 character string). - sig { returns(T.nilable(String)) } - attr_accessor :dayparting - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :deep_funnel_event_source - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :deep_funnel_event_source_id - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus::OrSymbol - ) - ) - end - attr_accessor :deep_funnel_optimization_status - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :device_model_ids - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :device_price_ranges - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow::OrSymbol - ) - ) - end - attr_accessor :engaged_view_attribution_window - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :excluded_audience_ids - - # TikTok location/region IDs to exclude. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :excluded_location_ids - - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - sig { returns(T.nilable(Integer)) } - attr_accessor :frequency - - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - sig { returns(T.nilable(Integer)) } - attr_accessor :frequency_schedule - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender::OrSymbol - ) - ) - end - attr_accessor :gender - - # Business Center ID for BC_AUTH_TT identity. - sig { returns(T.nilable(String)) } - attr_accessor :identity_authorized_bc_id - - # TikTok identity ID for the ad group. - sig { returns(T.nilable(String)) } - attr_accessor :identity_id - - # Identity type (AUTH_CODE, TT_USER, BC_AUTH_TT). - sig { returns(T.nilable(String)) } - attr_accessor :identity_type - - # Instant form configuration for lead generation campaigns. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig - ) - ) - end - attr_reader :instant_form_config - - sig do - params( - instant_form_config: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::OrHash - ) - ).void - end - attr_writer :instant_form_config - - # TikTok instant form ID (set automatically when instant_form_config is provided). - sig { returns(T.nilable(String)) } - attr_accessor :instant_form_id - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :interest_category_ids - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :interest_keyword_ids - - # Represents `true` or `false` values. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :inventory_filter_enabled - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting::OrSymbol - ) - ) - end - attr_accessor :ios14_targeting - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :isp_ids - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :languages - - # TikTok location/region IDs for geo targeting. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :location_ids - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :min_android_version - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :min_ios_version - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :network_types - - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperatingSystem::OrSymbol - ] - ) - ) - end - attr_accessor :operating_systems - - # Initial status (ENABLE, DISABLE). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus::OrSymbol - ) - ) - end - attr_accessor :operation_status - - # Conversion event (e.g., COMPLETE_PAYMENT). - sig { returns(T.nilable(String)) } - attr_accessor :optimization_event - - # What this ad group optimizes for on TikTok. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::OrSymbol - ) - ) - end - attr_accessor :optimization_goal - - # Budget pacing (PACING_MODE_SMOOTH, PACING_MODE_FAST). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing::OrSymbol - ) - ) - end - attr_accessor :pacing - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :pangle_audience_package_exclude_ids - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :pangle_audience_package_include_ids - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :pangle_block_app_ids - - # TikTok Pixel ID for conversion tracking. - sig { returns(T.nilable(String)) } - attr_accessor :pixel_id - - # Placement strategy (PLACEMENT_TYPE_AUTOMATIC, PLACEMENT_TYPE_NORMAL). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType::OrSymbol - ) - ) - end - attr_accessor :placement_type - - # Placements (PLACEMENT_TIKTOK, PLACEMENT_PANGLE, etc.). - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :placements - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :product_set_id - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource::OrSymbol - ) - ) - end - attr_accessor :product_source - - # Promotion type (optimization location). - sig { returns(T.nilable(String)) } - attr_accessor :promotion_type - - # Schedule end time (UTC, YYYY-MM-DD HH:MM:SS). - sig { returns(T.nilable(String)) } - attr_accessor :schedule_end_time - - # Schedule start time (UTC, YYYY-MM-DD HH:MM:SS). - sig { returns(T.nilable(String)) } - attr_accessor :schedule_start_time - - # Schedule type (SCHEDULE_START_END, SCHEDULE_FROM_NOW). - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType::OrSymbol - ) - ) - end - attr_accessor :schedule_type - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :secondary_optimization_event - - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - sig { returns(T.nilable(Integer)) } - attr_accessor :shopping_ads_retargeting_actions_days - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::OrSymbol - ) - ) - end - attr_accessor :shopping_ads_retargeting_type - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower::OrSymbol - ) - ) - end - attr_accessor :spending_power - - # TikTok subplacements (IN_FEED, SEARCH_FEED, etc.). - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :tiktok_subplacements - - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - sig { returns(T.nilable(String)) } - attr_accessor :vertical_sensitivity_id - - # Represents `true` or `false` values. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :video_download_disabled - - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :video_user_actions - - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow::OrSymbol - ) - ) - end - attr_accessor :view_attribution_window - - # TikTok ad group configuration. - sig do - params( - actions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::OrHash - ] - ), - age_groups: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::OrSymbol - ] - ), - app_id: T.nilable(String), - attribution_event_count: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount::OrSymbol - ), - audience_ids: T.nilable(T::Array[String]), - audience_rule: T.nilable(T::Hash[Symbol, T.anything]), - audience_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType::OrSymbol - ), - bid_price: T.nilable(Float), - bid_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType::OrSymbol - ), - billing_event: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent::OrSymbol - ), - brand_safety_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::OrSymbol - ), - budget_mode: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode::OrSymbol - ), - carrier_ids: T.nilable(T::Array[String]), - category_exclusion_ids: T.nilable(T::Array[String]), - click_attribution_window: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::OrSymbol - ), - comment_disabled: T.nilable(T::Boolean), - contextual_tag_ids: T.nilable(T::Array[String]), - conversion_bid_price: T.nilable(Float), - creative_material_mode: T.nilable(String), - dayparting: T.nilable(String), - deep_funnel_event_source: T.nilable(String), - deep_funnel_event_source_id: T.nilable(String), - deep_funnel_optimization_status: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus::OrSymbol - ), - device_model_ids: T.nilable(T::Array[String]), - device_price_ranges: T.nilable(T::Array[String]), - engaged_view_attribution_window: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow::OrSymbol - ), - excluded_audience_ids: T.nilable(T::Array[String]), - excluded_location_ids: T.nilable(T::Array[String]), - frequency: T.nilable(Integer), - frequency_schedule: T.nilable(Integer), - gender: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender::OrSymbol - ), - identity_authorized_bc_id: T.nilable(String), - identity_id: T.nilable(String), - identity_type: T.nilable(String), - instant_form_config: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::OrHash - ), - instant_form_id: T.nilable(String), - interest_category_ids: T.nilable(T::Array[String]), - interest_keyword_ids: T.nilable(T::Array[String]), - inventory_filter_enabled: T.nilable(T::Boolean), - ios14_targeting: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting::OrSymbol - ), - isp_ids: T.nilable(T::Array[String]), - languages: T.nilable(T::Array[String]), - location_ids: T.nilable(T::Array[String]), - min_android_version: T.nilable(String), - min_ios_version: T.nilable(String), - network_types: T.nilable(T::Array[String]), - operating_systems: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperatingSystem::OrSymbol - ] - ), - operation_status: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus::OrSymbol - ), - optimization_event: T.nilable(String), - optimization_goal: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::OrSymbol - ), - pacing: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing::OrSymbol - ), - pangle_audience_package_exclude_ids: T.nilable(T::Array[String]), - pangle_audience_package_include_ids: T.nilable(T::Array[String]), - pangle_block_app_ids: T.nilable(T::Array[String]), - pixel_id: T.nilable(String), - placement_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType::OrSymbol - ), - placements: T.nilable(T::Array[String]), - product_set_id: T.nilable(String), - product_source: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource::OrSymbol - ), - promotion_type: T.nilable(String), - schedule_end_time: T.nilable(String), - schedule_start_time: T.nilable(String), - schedule_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType::OrSymbol - ), - secondary_optimization_event: T.nilable(String), - shopping_ads_retargeting_actions_days: T.nilable(Integer), - shopping_ads_retargeting_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::OrSymbol - ), - spending_power: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower::OrSymbol - ), - tiktok_subplacements: T.nilable(T::Array[String]), - vertical_sensitivity_id: T.nilable(String), - video_download_disabled: T.nilable(T::Boolean), - video_user_actions: T.nilable(T::Array[String]), - view_attribution_window: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow::OrSymbol - ) - ).returns(T.attached_class) - end - def self.new( - actions: nil, - age_groups: nil, - # App ID for app promotion campaigns. - app_id: nil, - attribution_event_count: nil, - audience_ids: nil, - # Represents untyped JSON - audience_rule: nil, - audience_type: nil, - # Bid price (cost per result for Cost Cap). - bid_price: nil, - # Bidding strategy (BID_TYPE_NO_BID, BID_TYPE_CUSTOM). - bid_type: nil, - # How you are billed on TikTok (CPC, CPM, OCPM, CPV). - billing_event: nil, - brand_safety_type: nil, - # Budget mode (BUDGET_MODE_DAY, BUDGET_MODE_TOTAL, - # BUDGET_MODE_DYNAMIC_DAILY_BUDGET). - budget_mode: nil, - carrier_ids: nil, - category_exclusion_ids: nil, - click_attribution_window: nil, - # Represents `true` or `false` values. - comment_disabled: nil, - contextual_tag_ids: nil, - # Target cost per conversion for oCPM. - conversion_bid_price: nil, - # Creative delivery strategy. - creative_material_mode: nil, - # Ad delivery schedule (48x7 character string). - dayparting: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - deep_funnel_event_source: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - deep_funnel_event_source_id: nil, - deep_funnel_optimization_status: nil, - device_model_ids: nil, - device_price_ranges: nil, - engaged_view_attribution_window: nil, - excluded_audience_ids: nil, - # TikTok location/region IDs to exclude. - excluded_location_ids: nil, - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - frequency: nil, - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - frequency_schedule: nil, - gender: nil, - # Business Center ID for BC_AUTH_TT identity. - identity_authorized_bc_id: nil, - # TikTok identity ID for the ad group. - identity_id: nil, - # Identity type (AUTH_CODE, TT_USER, BC_AUTH_TT). - identity_type: nil, - # Instant form configuration for lead generation campaigns. - instant_form_config: nil, - # TikTok instant form ID (set automatically when instant_form_config is provided). - instant_form_id: nil, - interest_category_ids: nil, - interest_keyword_ids: nil, - # Represents `true` or `false` values. - inventory_filter_enabled: nil, - ios14_targeting: nil, - isp_ids: nil, - languages: nil, - # TikTok location/region IDs for geo targeting. - location_ids: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - min_android_version: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - min_ios_version: nil, - network_types: nil, - operating_systems: nil, - # Initial status (ENABLE, DISABLE). - operation_status: nil, - # Conversion event (e.g., COMPLETE_PAYMENT). - optimization_event: nil, - # What this ad group optimizes for on TikTok. - optimization_goal: nil, - # Budget pacing (PACING_MODE_SMOOTH, PACING_MODE_FAST). - pacing: nil, - pangle_audience_package_exclude_ids: nil, - pangle_audience_package_include_ids: nil, - pangle_block_app_ids: nil, - # TikTok Pixel ID for conversion tracking. - pixel_id: nil, - # Placement strategy (PLACEMENT_TYPE_AUTOMATIC, PLACEMENT_TYPE_NORMAL). - placement_type: nil, - # Placements (PLACEMENT_TIKTOK, PLACEMENT_PANGLE, etc.). - placements: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - product_set_id: nil, - product_source: nil, - # Promotion type (optimization location). - promotion_type: nil, - # Schedule end time (UTC, YYYY-MM-DD HH:MM:SS). - schedule_end_time: nil, - # Schedule start time (UTC, YYYY-MM-DD HH:MM:SS). - schedule_start_time: nil, - # Schedule type (SCHEDULE_START_END, SCHEDULE_FROM_NOW). - schedule_type: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - secondary_optimization_event: nil, - # Represents non-fractional signed whole numeric values. Int can represent values - # between -(2^31) and 2^31 - 1. - shopping_ads_retargeting_actions_days: nil, - shopping_ads_retargeting_type: nil, - spending_power: nil, - # TikTok subplacements (IN_FEED, SEARCH_FEED, etc.). - tiktok_subplacements: nil, - # Represents textual data as UTF-8 character sequences. This type is most often - # used by GraphQL to represent free-form human-readable text. - vertical_sensitivity_id: nil, - # Represents `true` or `false` values. - video_download_disabled: nil, - video_user_actions: nil, - view_attribution_window: nil - ) - end - - sig do - override.returns( - { - actions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action - ] - ), - age_groups: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::OrSymbol - ] - ), - app_id: T.nilable(String), - attribution_event_count: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount::OrSymbol - ), - audience_ids: T.nilable(T::Array[String]), - audience_rule: T.nilable(T::Hash[Symbol, T.anything]), - audience_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType::OrSymbol - ), - bid_price: T.nilable(Float), - bid_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType::OrSymbol - ), - billing_event: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent::OrSymbol - ), - brand_safety_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::OrSymbol - ), - budget_mode: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode::OrSymbol - ), - carrier_ids: T.nilable(T::Array[String]), - category_exclusion_ids: T.nilable(T::Array[String]), - click_attribution_window: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::OrSymbol - ), - comment_disabled: T.nilable(T::Boolean), - contextual_tag_ids: T.nilable(T::Array[String]), - conversion_bid_price: T.nilable(Float), - creative_material_mode: T.nilable(String), - dayparting: T.nilable(String), - deep_funnel_event_source: T.nilable(String), - deep_funnel_event_source_id: T.nilable(String), - deep_funnel_optimization_status: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus::OrSymbol - ), - device_model_ids: T.nilable(T::Array[String]), - device_price_ranges: T.nilable(T::Array[String]), - engaged_view_attribution_window: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow::OrSymbol - ), - excluded_audience_ids: T.nilable(T::Array[String]), - excluded_location_ids: T.nilable(T::Array[String]), - frequency: T.nilable(Integer), - frequency_schedule: T.nilable(Integer), - gender: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender::OrSymbol - ), - identity_authorized_bc_id: T.nilable(String), - identity_id: T.nilable(String), - identity_type: T.nilable(String), - instant_form_config: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig - ), - instant_form_id: T.nilable(String), - interest_category_ids: T.nilable(T::Array[String]), - interest_keyword_ids: T.nilable(T::Array[String]), - inventory_filter_enabled: T.nilable(T::Boolean), - ios14_targeting: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting::OrSymbol - ), - isp_ids: T.nilable(T::Array[String]), - languages: T.nilable(T::Array[String]), - location_ids: T.nilable(T::Array[String]), - min_android_version: T.nilable(String), - min_ios_version: T.nilable(String), - network_types: T.nilable(T::Array[String]), - operating_systems: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperatingSystem::OrSymbol - ] - ), - operation_status: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus::OrSymbol - ), - optimization_event: T.nilable(String), - optimization_goal: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::OrSymbol - ), - pacing: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing::OrSymbol - ), - pangle_audience_package_exclude_ids: - T.nilable(T::Array[String]), - pangle_audience_package_include_ids: - T.nilable(T::Array[String]), - pangle_block_app_ids: T.nilable(T::Array[String]), - pixel_id: T.nilable(String), - placement_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType::OrSymbol - ), - placements: T.nilable(T::Array[String]), - product_set_id: T.nilable(String), - product_source: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource::OrSymbol - ), - promotion_type: T.nilable(String), - schedule_end_time: T.nilable(String), - schedule_start_time: T.nilable(String), - schedule_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType::OrSymbol - ), - secondary_optimization_event: T.nilable(String), - shopping_ads_retargeting_actions_days: T.nilable(Integer), - shopping_ads_retargeting_type: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::OrSymbol - ), - spending_power: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower::OrSymbol - ), - tiktok_subplacements: T.nilable(T::Array[String]), - vertical_sensitivity_id: T.nilable(String), - video_download_disabled: T.nilable(T::Boolean), - video_user_actions: T.nilable(T::Array[String]), - view_attribution_window: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow::OrSymbol - ) - } - ) - end - def to_hash - end - - class Action < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action, - WhopSDK::Internal::AnyHash - ) - end - - # Behavioral category IDs. Use /tool/action_category/ to list them. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :action_category_ids - - # Lookback window in days. TikTok accepts 7, 15, 30, 60, 90, or 180. - sig { returns(T.nilable(Integer)) } - attr_accessor :action_period - - # The category of TikTok content a behavioral targeting rule applies to. See - # docs/tiktok_api/ad_group.md § actions. - sig do - returns( - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene::OrSymbol - ) - ) - end - attr_accessor :action_scene - - # Specific video interactions (WATCHED_TO_END, LIKED, COMMENTED, SHARED, FOLLOWED, - # PROFILE_VISITED). - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::OrSymbol - ] - ) - ) - end - attr_accessor :video_user_actions - - # A single TikTok behavioral targeting entry. One category of past user behavior - # (what they did, over what window, on which kind of content). See - # docs/tiktok_api/ad_group.md § actions. - sig do - params( - action_category_ids: T.nilable(T::Array[String]), - action_period: T.nilable(Integer), - action_scene: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene::OrSymbol - ), - video_user_actions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::OrSymbol - ] - ) - ).returns(T.attached_class) - end - def self.new( - # Behavioral category IDs. Use /tool/action_category/ to list them. - action_category_ids: nil, - # Lookback window in days. TikTok accepts 7, 15, 30, 60, 90, or 180. - action_period: nil, - # The category of TikTok content a behavioral targeting rule applies to. See - # docs/tiktok_api/ad_group.md § actions. - action_scene: nil, - # Specific video interactions (WATCHED_TO_END, LIKED, COMMENTED, SHARED, FOLLOWED, - # PROFILE_VISITED). - video_user_actions: nil - ) - end - - sig do - override.returns( - { - action_category_ids: T.nilable(T::Array[String]), - action_period: T.nilable(Integer), - action_scene: - T.nilable( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene::OrSymbol - ), - video_user_actions: - T.nilable( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::OrSymbol - ] - ) - } - ) - end - def to_hash - end - - # The category of TikTok content a behavioral targeting rule applies to. See - # docs/tiktok_api/ad_group.md § actions. - module ActionScene - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - VIDEO_RELATED = - T.let( - :VIDEO_RELATED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene::TaggedSymbol - ) - CREATOR_RELATED = - T.let( - :CREATOR_RELATED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene::TaggedSymbol - ) - HASHTAG_RELATED = - T.let( - :HASHTAG_RELATED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene::TaggedSymbol - ) - LIVE_RELATED = - T.let( - :LIVE_RELATED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::ActionScene::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Specific past video interactions used for behavioral targeting. See - # docs/tiktok_api/ad_group.md § actions.video_user_actions. - module VideoUserAction - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - WATCHED_TO_END = - T.let( - :WATCHED_TO_END, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::TaggedSymbol - ) - LIKED = - T.let( - :LIKED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::TaggedSymbol - ) - COMMENTED = - T.let( - :COMMENTED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::TaggedSymbol - ) - SHARED = - T.let( - :SHARED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::TaggedSymbol - ) - FOLLOWED = - T.let( - :FOLLOWED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::TaggedSymbol - ) - PROFILE_VISITED = - T.let( - :PROFILE_VISITED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::VideoUserAction::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - # Age groups targetable on TikTok. See docs/tiktok_api/ad_group.md § age_groups. - module AgeGroup - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AGE_13_17 = - T.let( - :AGE_13_17, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::TaggedSymbol - ) - AGE_18_24 = - T.let( - :AGE_18_24, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::TaggedSymbol - ) - AGE_25_34 = - T.let( - :AGE_25_34, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::TaggedSymbol - ) - AGE_35_44 = - T.let( - :AGE_35_44, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::TaggedSymbol - ) - AGE_45_54 = - T.let( - :AGE_45_54, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::TaggedSymbol - ) - AGE_55_100 = - T.let( - :AGE_55_100, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AgeGroup::TaggedSymbol - ] - ) - end - def self.values - end - end - - module AttributionEventCount - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - UNSET = - T.let( - :UNSET, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount::TaggedSymbol - ) - EVERY = - T.let( - :EVERY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount::TaggedSymbol - ) - ONCE = - T.let( - :ONCE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AttributionEventCount::TaggedSymbol - ] - ) - end - def self.values - end - end - - module AudienceType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - NORMAL = - T.let( - :NORMAL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType::TaggedSymbol - ) - SMART_INTERESTS_BEHAVIORS = - T.let( - :SMART_INTERESTS_BEHAVIORS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::AudienceType::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Bidding strategy (BID_TYPE_NO_BID, BID_TYPE_CUSTOM). - module BidType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BID_TYPE_NO_BID = - T.let( - :BID_TYPE_NO_BID, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType::TaggedSymbol - ) - BID_TYPE_CUSTOM = - T.let( - :BID_TYPE_CUSTOM, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BidType::TaggedSymbol - ] - ) - end - def self.values - end - end - - # How you are billed on TikTok (CPC, CPM, OCPM, CPV). - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CPC = - T.let( - :CPC, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent::TaggedSymbol - ) - CPM = - T.let( - :CPM, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent::TaggedSymbol - ) - OCPM = - T.let( - :OCPM, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent::TaggedSymbol - ) - CPV = - T.let( - :CPV, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BillingEvent::TaggedSymbol - ] - ) - end - def self.values - end - end - - module BrandSafetyType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - NO_BRAND_SAFETY = - T.let( - :NO_BRAND_SAFETY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::TaggedSymbol - ) - STANDARD_INVENTORY = - T.let( - :STANDARD_INVENTORY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::TaggedSymbol - ) - LIMITED_INVENTORY = - T.let( - :LIMITED_INVENTORY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::TaggedSymbol - ) - FULL_INVENTORY = - T.let( - :FULL_INVENTORY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::TaggedSymbol - ) - EXPANDED_INVENTORY = - T.let( - :EXPANDED_INVENTORY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BrandSafetyType::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Budget mode (BUDGET_MODE_DAY, BUDGET_MODE_TOTAL, - # BUDGET_MODE_DYNAMIC_DAILY_BUDGET). - module BudgetMode - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BUDGET_MODE_DAY = - T.let( - :BUDGET_MODE_DAY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode::TaggedSymbol - ) - BUDGET_MODE_TOTAL = - T.let( - :BUDGET_MODE_TOTAL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode::TaggedSymbol - ) - BUDGET_MODE_DYNAMIC_DAILY_BUDGET = - T.let( - :BUDGET_MODE_DYNAMIC_DAILY_BUDGET, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::BudgetMode::TaggedSymbol - ] - ) - end - def self.values - end - end - - module ClickAttributionWindow - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OFF = - T.let( - :OFF, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::TaggedSymbol - ) - ONE_DAY = - T.let( - :ONE_DAY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::TaggedSymbol - ) - SEVEN_DAYS = - T.let( - :SEVEN_DAYS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::TaggedSymbol - ) - FOURTEEN_DAYS = - T.let( - :FOURTEEN_DAYS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::TaggedSymbol - ) - TWENTY_EIGHT_DAYS = - T.let( - :TWENTY_EIGHT_DAYS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ClickAttributionWindow::TaggedSymbol - ] - ) - end - def self.values - end - end - - module DeepFunnelOptimizationStatus - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ON = - T.let( - :ON, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus::TaggedSymbol - ) - OFF = - T.let( - :OFF, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::DeepFunnelOptimizationStatus::TaggedSymbol - ] - ) - end - def self.values - end - end - - module EngagedViewAttributionWindow - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OFF = - T.let( - :OFF, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow::TaggedSymbol - ) - ONE_DAY = - T.let( - :ONE_DAY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow::TaggedSymbol - ) - SEVEN_DAYS = - T.let( - :SEVEN_DAYS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::EngagedViewAttributionWindow::TaggedSymbol - ] - ) - end - def self.values - end - end - - module Gender - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - GENDER_UNLIMITED = - T.let( - :GENDER_UNLIMITED, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender::TaggedSymbol - ) - GENDER_MALE = - T.let( - :GENDER_MALE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender::TaggedSymbol - ) - GENDER_FEMALE = - T.let( - :GENDER_FEMALE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Gender::TaggedSymbol - ] - ) - end - def self.values - end - end - - class InstantFormConfig < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig, - WhopSDK::Internal::AnyHash - ) - end - - # URL to your privacy policy. - sig { returns(String) } - attr_accessor :privacy_policy_url - - # Form questions (at least one required). - sig do - returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question - ] - ) - end - attr_accessor :questions - - # Submit button text. - sig { returns(T.nilable(String)) } - attr_accessor :button_text - - # Greeting text shown at the top of the form. - sig { returns(T.nilable(String)) } - attr_accessor :greeting - - # Form name. Auto-generated if omitted. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Instant form configuration for lead generation campaigns. - sig do - params( - privacy_policy_url: String, - questions: - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question::OrHash - ], - button_text: T.nilable(String), - greeting: T.nilable(String), - name: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # URL to your privacy policy. - privacy_policy_url:, - # Form questions (at least one required). - questions:, - # Submit button text. - button_text: nil, - # Greeting text shown at the top of the form. - greeting: nil, - # Form name. Auto-generated if omitted. - name: nil - ) - end - - sig do - override.returns( - { - privacy_policy_url: String, - questions: - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question - ], - button_text: T.nilable(String), - greeting: T.nilable(String), - name: T.nilable(String) - } - ) - end - def to_hash - end - - class Question < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question, - WhopSDK::Internal::AnyHash - ) - end - - # Question type (EMAIL, PHONE_NUMBER, NAME, CUSTOM). - sig { returns(String) } - attr_accessor :field_type - - # Custom label for the question. - sig { returns(T.nilable(String)) } - attr_accessor :label - - # A question for a TikTok instant form. - sig do - params(field_type: String, label: T.nilable(String)).returns( - T.attached_class - ) - end - def self.new( - # Question type (EMAIL, PHONE_NUMBER, NAME, CUSTOM). - field_type:, - # Custom label for the question. - label: nil - ) - end - - sig do - override.returns( - { field_type: String, label: T.nilable(String) } - ) - end - def to_hash - end - end - end - - module Ios14Targeting - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - UNSET = - T.let( - :UNSET, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting::TaggedSymbol - ) - IOS14_MINUS = - T.let( - :IOS14_MINUS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting::TaggedSymbol - ) - IOS14_PLUS = - T.let( - :IOS14_PLUS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting::TaggedSymbol - ) - ALL = - T.let( - :ALL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Ios14Targeting::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Device operating systems targetable on TikTok. See docs/tiktok_api/ad_group.md § - # operating_systems. - module OperatingSystem - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperatingSystem - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ANDROID = - T.let( - :ANDROID, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperatingSystem::TaggedSymbol - ) - IOS = - T.let( - :IOS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperatingSystem::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperatingSystem::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Initial status (ENABLE, DISABLE). - module OperationStatus - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLE = - T.let( - :ENABLE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus::TaggedSymbol - ) - DISABLE = - T.let( - :DISABLE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OperationStatus::TaggedSymbol - ] - ) - end - def self.values - end - end - - # What this ad group optimizes for on TikTok. - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CLICK = - T.let( - :CLICK, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - CONVERT = - T.let( - :CONVERT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - INSTALL = - T.let( - :INSTALL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - IN_APP_EVENT = - T.let( - :IN_APP_EVENT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - REACH = - T.let( - :REACH, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - SHOW = - T.let( - :SHOW, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - VIDEO_VIEW = - T.let( - :VIDEO_VIEW, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - ENGAGED_VIEW = - T.let( - :ENGAGED_VIEW, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - ENGAGED_VIEW_FIFTEEN = - T.let( - :ENGAGED_VIEW_FIFTEEN, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - LEAD_GENERATION = - T.let( - :LEAD_GENERATION, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - PREFERRED_LEAD = - T.let( - :PREFERRED_LEAD, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - CONVERSATION = - T.let( - :CONVERSATION, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - FOLLOWERS = - T.let( - :FOLLOWERS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - PROFILE_VIEWS = - T.let( - :PROFILE_VIEWS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - PAGE_VISIT = - T.let( - :PAGE_VISIT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - VALUE = - T.let( - :VALUE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - AUTOMATIC_VALUE_OPTIMIZATION = - T.let( - :AUTOMATIC_VALUE_OPTIMIZATION, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - TRAFFIC_LANDING_PAGE_VIEW = - T.let( - :TRAFFIC_LANDING_PAGE_VIEW, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - DESTINATION_VISIT = - T.let( - :DESTINATION_VISIT, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - MT_LIVE_ROOM = - T.let( - :MT_LIVE_ROOM, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - PRODUCT_CLICK_IN_LIVE = - T.let( - :PRODUCT_CLICK_IN_LIVE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::OptimizationGoal::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Budget pacing (PACING_MODE_SMOOTH, PACING_MODE_FAST). - module Pacing - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PACING_MODE_SMOOTH = - T.let( - :PACING_MODE_SMOOTH, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing::TaggedSymbol - ) - PACING_MODE_FAST = - T.let( - :PACING_MODE_FAST, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Pacing::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Placement strategy (PLACEMENT_TYPE_AUTOMATIC, PLACEMENT_TYPE_NORMAL). - module PlacementType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PLACEMENT_TYPE_AUTOMATIC = - T.let( - :PLACEMENT_TYPE_AUTOMATIC, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType::TaggedSymbol - ) - PLACEMENT_TYPE_NORMAL = - T.let( - :PLACEMENT_TYPE_NORMAL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::PlacementType::TaggedSymbol - ] - ) - end - def self.values - end - end - - module ProductSource - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CATALOG = - T.let( - :CATALOG, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource::TaggedSymbol - ) - STORE = - T.let( - :STORE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource::TaggedSymbol - ) - SHOWCASE = - T.let( - :SHOWCASE, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ProductSource::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Schedule type (SCHEDULE_START_END, SCHEDULE_FROM_NOW). - module ScheduleType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - SCHEDULE_START_END = - T.let( - :SCHEDULE_START_END, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType::TaggedSymbol - ) - SCHEDULE_FROM_NOW = - T.let( - :SCHEDULE_FROM_NOW, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ScheduleType::TaggedSymbol - ] - ) - end - def self.values - end - end - - module ShoppingAdsRetargetingType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OFF = - T.let( - :OFF, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::TaggedSymbol - ) - LAB1 = - T.let( - :LAB1, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::TaggedSymbol - ) - LAB2 = - T.let( - :LAB2, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::TaggedSymbol - ) - LAB3 = - T.let( - :LAB3, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::TaggedSymbol - ) - LAB4 = - T.let( - :LAB4, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::TaggedSymbol - ) - LAB5 = - T.let( - :LAB5, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ShoppingAdsRetargetingType::TaggedSymbol - ] - ) - end - def self.values - end - end - - module SpendingPower - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL = - T.let( - :ALL, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower::TaggedSymbol - ) - HIGH = - T.let( - :HIGH, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::SpendingPower::TaggedSymbol - ] - ) - end - def self.values - end - end - - module ViewAttributionWindow - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OFF = - T.let( - :OFF, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow::TaggedSymbol - ) - ONE_DAY = - T.let( - :ONE_DAY, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow::TaggedSymbol - ) - SEVEN_DAYS = - T.let( - :SEVEN_DAYS, - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::ViewAttributionWindow::TaggedSymbol - ] - ) - end - def self.values - end - end + def self.values end end end diff --git a/rbi/whop_sdk/models/ad_list_params.rbi b/rbi/whop_sdk/models/ad_list_params.rbi index 9107b322..d2fb87c4 100644 --- a/rbi/whop_sdk/models/ad_list_params.rbi +++ b/rbi/whop_sdk/models/ad_list_params.rbi @@ -11,168 +11,182 @@ module WhopSDK T.any(WhopSDK::AdListParams, WhopSDK::Internal::AnyHash) end - # Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or - # company_id. + # The account the ads belong to. Defaults to the account-scoped key's own account. sig { returns(T.nilable(String)) } - attr_accessor :ad_campaign_id + attr_reader :account_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 + sig { params(account_id: String).void } + attr_writer :account_id - # Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or - # company_id. + # Only return ads in this ad campaign. sig { returns(T.nilable(String)) } - attr_accessor :ad_group_id + attr_reader :ad_campaign_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 + sig { params(ad_campaign_id: String).void } + attr_writer :ad_campaign_id - # Returns the elements in the list that come after the specified cursor. + # Only return ads in this ad group. sig { returns(T.nilable(String)) } - attr_accessor :after + attr_reader :ad_group_id - # Returns the elements in the list that come before the specified cursor. - sig { returns(T.nilable(String)) } - attr_accessor :before + sig { params(ad_group_id: String).void } + attr_writer :ad_group_id - # Filter by campaign. + # Cursor to fetch the page after (from page_info.end_cursor). sig { returns(T.nilable(String)) } - attr_accessor :campaign_id + attr_reader :after + + sig { params(after: String).void } + attr_writer :after - # Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or - # company_id. + # Cursor to fetch the page before (from page_info.start_cursor). sig { returns(T.nilable(String)) } - attr_accessor :company_id + attr_reader :before + + sig { params(before: String).void } + attr_writer :before # Only return ads 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 ads created before this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_before + sig { returns(T.nilable(String)) } + attr_reader :created_before + + sig { params(created_before: String).void } + attr_writer :created_before - # The direction of the sort. - sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) } - attr_accessor :direction + # The sort direction. Defaults to desc. + sig { returns(T.nilable(WhopSDK::AdListParams::Direction::OrSymbol)) } + attr_reader :direction - # Returns the first _n_ elements from the list. + sig { params(direction: WhopSDK::AdListParams::Direction::OrSymbol).void } + attr_writer :direction + + # The number of ads to return. 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 ads to return from the end of the range. sig { returns(T.nilable(Integer)) } - attr_accessor :last + attr_reader :last - # The fields ad resources can be ordered by. + sig { params(last: Integer).void } + attr_writer :last + + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. sig { returns(T.nilable(WhopSDK::AdListParams::Order::OrSymbol)) } - attr_accessor :order + attr_reader :order + + sig { params(order: WhopSDK::AdListParams::Order::OrSymbol).void } + attr_writer :order + + # Filter ads by a title or ID substring. + sig { returns(T.nilable(String)) } + attr_reader :query - # Columns that the listAds query can sort by. Deprecated — use AdOrder. - sig { returns(T.nilable(WhopSDK::AdListParams::OrderBy::OrSymbol)) } - attr_accessor :order_by + sig { params(query: String).void } + attr_writer :query - # The direction of the sort. - sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) } - attr_accessor :order_direction + # Start of the stats window. Defaults to all-time. + sig { returns(T.nilable(String)) } + attr_reader :stats_from + + sig { params(stats_from: String).void } + attr_writer :stats_from - # Case-insensitive substring match against the ad title or ID. + # End of the stats window. Defaults to now. sig { returns(T.nilable(String)) } - attr_accessor :query + attr_reader :stats_to + + sig { params(stats_to: String).void } + attr_writer :stats_to + + # Only return ads with this status. + sig { returns(T.nilable(WhopSDK::AdListParams::Status::OrSymbol)) } + attr_reader :status - # 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 + sig { params(status: WhopSDK::AdListParams::Status::OrSymbol).void } + attr_writer :status - # 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 + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + sig { returns(T.nilable(String)) } + attr_reader :time_zone - # The status of an external ad. - sig { returns(T.nilable(WhopSDK::ExternalAdStatus::OrSymbol)) } - attr_accessor :status + sig { params(time_zone: String).void } + attr_writer :time_zone 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), - 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), - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), - status: T.nilable(WhopSDK::ExternalAdStatus::OrSymbol), + account_id: String, + ad_campaign_id: String, + ad_group_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::AdListParams::Status::OrSymbol, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or - # company_id. + # The account the ads belong to. Defaults to the account-scoped key's own account. + account_id: nil, + # Only return ads in this ad campaign. 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. + # Only return ads in this ad group. 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. + # Cursor to fetch the page after (from page_info.end_cursor). after: nil, - # Returns the elements in the list that come before the specified cursor. + # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # Filter by campaign. - campaign_id: nil, - # 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. + # The sort direction. Defaults to desc. direction: nil, - # Returns the first _n_ elements from the list. + # The number of ads to return. first: nil, - # Returns the last _n_ elements from the list. + # The number of ads to return from the end of the range. last: nil, - # The fields ad resources can be ordered by. + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. 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 ID. + # Filter ads by a title or ID substring. query: nil, - # 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. + # Start of the stats window. Defaults to all-time. stats_from: nil, - # 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. + # End of the stats window. Defaults to now. stats_to: nil, - # The status of an external ad. + # Only return ads with this status. status: nil, + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + time_zone: nil, request_options: {} ) end @@ -180,26 +194,22 @@ 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), - 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), - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), - status: T.nilable(WhopSDK::ExternalAdStatus::OrSymbol), + account_id: String, + ad_campaign_id: String, + ad_group_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::AdListParams::Status::OrSymbol, + time_zone: String, request_options: WhopSDK::RequestOptions } ) @@ -207,7 +217,30 @@ module WhopSDK def to_hash end - # The fields ad resources can be ordered by. + # The sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdListParams::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = T.let(:asc, WhopSDK::AdListParams::Direction::TaggedSymbol) + DESC = T.let(:desc, WhopSDK::AdListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. module Order extend WhopSDK::Internal::Type::Enum @@ -217,7 +250,26 @@ module WhopSDK CREATED_AT = T.let(:created_at, WhopSDK::AdListParams::Order::TaggedSymbol) + UPDATED_AT = + T.let(:updated_at, WhopSDK::AdListParams::Order::TaggedSymbol) SPEND = T.let(:spend, WhopSDK::AdListParams::Order::TaggedSymbol) + IMPRESSIONS = + T.let(:impressions, WhopSDK::AdListParams::Order::TaggedSymbol) + REACH = T.let(:reach, WhopSDK::AdListParams::Order::TaggedSymbol) + CLICKS = T.let(:clicks, WhopSDK::AdListParams::Order::TaggedSymbol) + UNIQUE_CLICKS = + T.let(:unique_clicks, WhopSDK::AdListParams::Order::TaggedSymbol) + FREQUENCY = + T.let(:frequency, WhopSDK::AdListParams::Order::TaggedSymbol) + CLICK_THROUGH_RATE = + T.let(:click_through_rate, WhopSDK::AdListParams::Order::TaggedSymbol) + RESULTS = T.let(:results, WhopSDK::AdListParams::Order::TaggedSymbol) + COST_PER_MILLE = + T.let(:cost_per_mille, WhopSDK::AdListParams::Order::TaggedSymbol) + COST_PER_CLICK = + T.let(:cost_per_click, WhopSDK::AdListParams::Order::TaggedSymbol) + COST_PER_RESULT = + T.let(:cost_per_result, WhopSDK::AdListParams::Order::TaggedSymbol) RETURN_ON_AD_SPEND = T.let(:return_on_ad_spend, WhopSDK::AdListParams::Order::TaggedSymbol) @@ -228,25 +280,23 @@ module WhopSDK end end - # Columns that the listAds query can sort by. Deprecated — use AdOrder. - module OrderBy + # Only return ads with this status. + module Status extend WhopSDK::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::AdListParams::OrderBy) } + T.type_alias { T.all(Symbol, WhopSDK::AdListParams::Status) } 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) + ACTIVE = T.let(:active, WhopSDK::AdListParams::Status::TaggedSymbol) + PAUSED = T.let(:paused, WhopSDK::AdListParams::Status::TaggedSymbol) + IN_REVIEW = + T.let(:in_review, WhopSDK::AdListParams::Status::TaggedSymbol) + REJECTED = T.let(:rejected, WhopSDK::AdListParams::Status::TaggedSymbol) sig do override.returns( - T::Array[WhopSDK::AdListParams::OrderBy::TaggedSymbol] + T::Array[WhopSDK::AdListParams::Status::TaggedSymbol] ) end def self.values diff --git a/rbi/whop_sdk/models/ad_list_response.rbi b/rbi/whop_sdk/models/ad_list_response.rbi deleted file mode 100644 index 638577f6..00000000 --- a/rbi/whop_sdk/models/ad_list_response.rbi +++ /dev/null @@ -1,514 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class AdListResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Models::AdListResponse, WhopSDK::Internal::AnyHash) - end - - # The unique identifier for this ad. - sig { returns(String) } - attr_accessor :id - - # The ad campaign this ad belongs to. - sig { returns(WhopSDK::Models::AdListResponse::AdCampaign) } - attr_reader :ad_campaign - - sig do - params( - ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign::OrHash - ).void - end - attr_writer :ad_campaign - - # The parent ad group this ad belongs to. - sig { returns(WhopSDK::Models::AdListResponse::AdGroup) } - attr_reader :ad_group - - sig do - params(ad_group: WhopSDK::Models::AdListResponse::AdGroup::OrHash).void - 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 - - # The display title of the ad. Falls back to the creative set caption when unset. - 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 - - # An ad belonging to an ad group. - sig do - params( - 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 - def self.new( - # The unique identifier for this ad. - id:, - # The ad campaign this ad belongs to. - 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: - ) - end - - sig do - override.returns( - { - 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 - } - ) - end - def to_hash - end - - class AdCampaign < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AdListResponse::AdCampaign, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for this ad campaign. - sig { returns(String) } - attr_accessor :id - - # The ad campaign this ad belongs to. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The unique identifier for this ad campaign. - id: - ) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - - class AdGroup < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AdListResponse::AdGroup, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for this ad group. - sig { returns(String) } - attr_accessor :id - - # The parent ad group this ad belongs to. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The unique identifier for this ad group. - id: - ) - end - - sig { override.returns({ id: String }) } - 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 - - # 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 - - # 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 - - # 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, - resolution_status: - WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::OrSymbol, - resource_id: T.nilable(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:, - # 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:, - # 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, - resolution_status: - WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::TaggedSymbol, - resource_id: T.nilable(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 - - 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_retrieve_params.rbi b/rbi/whop_sdk/models/ad_retrieve_params.rbi index 4308c21f..0e867c75 100644 --- a/rbi/whop_sdk/models/ad_retrieve_params.rbi +++ b/rbi/whop_sdk/models/ad_retrieve_params.rbi @@ -14,32 +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 + # Start of the stats window. + sig { returns(T.nilable(String)) } + attr_reader :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 { params(stats_from: String).void } + attr_writer :stats_from + + # End of the stats window. + sig { returns(T.nilable(String)) } + attr_reader :stats_to + + sig { params(stats_to: String).void } + attr_writer :stats_to + + # IANA timezone the stats window is interpreted in. Defaults to UTC. + sig { returns(T.nilable(String)) } + attr_reader :time_zone + + sig { params(time_zone: String).void } + attr_writer :time_zone sig do params( id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end 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. + # Start of the stats window. stats_from: nil, - # Inclusive end of the window for the ad's metric fields. Omit both statsFrom and - # statsTo for all-time stats. + # End of the stats window. stats_to: nil, + # IANA timezone the stats window is interpreted in. Defaults to UTC. + time_zone: nil, request_options: {} ) end @@ -48,8 +60,9 @@ module WhopSDK override.returns( { id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/ad_update_params.rbi b/rbi/whop_sdk/models/ad_update_params.rbi new file mode 100644 index 00000000..ad02369e --- /dev/null +++ b/rbi/whop_sdk/models/ad_update_params.rbi @@ -0,0 +1,1473 @@ +# typed: strong + +module WhopSDK + module Models + class AdUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AdUpdateParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + # The call-to-action button shown on the ad. + sig do + returns(T.nilable(WhopSDK::AdUpdateParams::CallToAction::OrSymbol)) + end + attr_reader :call_to_action + + sig do + params( + call_to_action: WhopSDK::AdUpdateParams::CallToAction::OrSymbol + ).void + end + attr_writer :call_to_action + + # The ad's creative assets. Each entry is an uploaded file id with an optional + # format; omit format for the original asset. Replaces a live ad's creative on the + # platform. + sig { returns(T.nilable(T::Array[WhopSDK::AdUpdateParams::Creative])) } + attr_reader :creatives + + sig do + params( + creatives: T::Array[WhopSDK::AdUpdateParams::Creative::OrHash] + ).void + end + attr_writer :creatives + + # The description variants shown on the ad. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :descriptions + + sig { params(descriptions: T::Array[String]).void } + attr_writer :descriptions + + # The headline variants shown on the ad. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :headlines + + sig { params(headlines: T::Array[String]).void } + attr_writer :headlines + + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + sig { returns(T.nilable(WhopSDK::AdUpdateParams::LeadForm)) } + attr_reader :lead_form + + sig { params(lead_form: WhopSDK::AdUpdateParams::LeadForm::OrHash).void } + attr_writer :lead_form + + # Use an existing Meta instant form instead of creating one — the form's Meta id, + # from a form already on the ad's Facebook page. Only allowed when the ad group's + # conversion_location is an instant-form destination. Mutually exclusive with + # lead_form. Replaces a stored lead_form. + sig { returns(T.nilable(String)) } + attr_reader :lead_form_id + + sig { params(lead_form_id: String).void } + attr_writer :lead_form_id + + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + sig { returns(T.nilable(WhopSDK::AdUpdateParams::MessagingConfig)) } + attr_reader :messaging_config + + sig do + params( + messaging_config: WhopSDK::AdUpdateParams::MessagingConfig::OrHash + ).void + end + attr_writer :messaging_config + + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :multi_advertiser_ads + + sig { params(multi_advertiser_ads: T::Boolean).void } + attr_writer :multi_advertiser_ads + + # Promote an existing post instead of uploading creatives — a Facebook post or + # Instagram media id. Mutually exclusive with creatives. Pair with post_source. + sig { returns(T.nilable(String)) } + attr_reader :post_id + + sig { params(post_id: String).void } + attr_writer :post_id + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + sig { returns(T.nilable(WhopSDK::AdUpdateParams::PostSource::OrSymbol)) } + attr_reader :post_source + + sig do + params(post_source: WhopSDK::AdUpdateParams::PostSource::OrSymbol).void + end + attr_writer :post_source + + # The primary text variants shown in the ad body. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :primary_texts + + sig { params(primary_texts: T::Array[String]).void } + attr_writer :primary_texts + + # The social accounts the ad runs under. + sig do + returns(T.nilable(T::Array[WhopSDK::AdUpdateParams::SocialAccount])) + end + attr_reader :social_accounts + + sig do + params( + social_accounts: + T::Array[WhopSDK::AdUpdateParams::SocialAccount::OrHash] + ).void + end + attr_writer :social_accounts + + # The display name of the ad. + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + # The URL the ad links to. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Query parameters appended to the destination URL, as a string-to-string map. + sig { returns(T.nilable(T.anything)) } + attr_reader :url_parameters + + sig { params(url_parameters: T.anything).void } + attr_writer :url_parameters + + sig do + params( + id: String, + call_to_action: WhopSDK::AdUpdateParams::CallToAction::OrSymbol, + creatives: T::Array[WhopSDK::AdUpdateParams::Creative::OrHash], + descriptions: T::Array[String], + headlines: T::Array[String], + lead_form: WhopSDK::AdUpdateParams::LeadForm::OrHash, + lead_form_id: String, + messaging_config: WhopSDK::AdUpdateParams::MessagingConfig::OrHash, + multi_advertiser_ads: T::Boolean, + post_id: String, + post_source: WhopSDK::AdUpdateParams::PostSource::OrSymbol, + primary_texts: T::Array[String], + social_accounts: + T::Array[WhopSDK::AdUpdateParams::SocialAccount::OrHash], + title: String, + url: String, + url_parameters: T.anything, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # The call-to-action button shown on the ad. + call_to_action: nil, + # The ad's creative assets. Each entry is an uploaded file id with an optional + # format; omit format for the original asset. Replaces a live ad's creative on the + # platform. + creatives: nil, + # The description variants shown on the ad. + descriptions: nil, + # The headline variants shown on the ad. + headlines: nil, + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + lead_form: nil, + # Use an existing Meta instant form instead of creating one — the form's Meta id, + # from a form already on the ad's Facebook page. Only allowed when the ad group's + # conversion_location is an instant-form destination. Mutually exclusive with + # lead_form. Replaces a stored lead_form. + lead_form_id: nil, + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + messaging_config: nil, + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + multi_advertiser_ads: nil, + # Promote an existing post instead of uploading creatives — a Facebook post or + # Instagram media id. Mutually exclusive with creatives. Pair with post_source. + post_id: nil, + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + post_source: nil, + # The primary text variants shown in the ad body. + primary_texts: nil, + # The social accounts the ad runs under. + social_accounts: nil, + # The display name of the ad. + title: nil, + # The URL the ad links to. + url: nil, + # Query parameters appended to the destination URL, as a string-to-string map. + url_parameters: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + call_to_action: WhopSDK::AdUpdateParams::CallToAction::OrSymbol, + creatives: T::Array[WhopSDK::AdUpdateParams::Creative], + descriptions: T::Array[String], + headlines: T::Array[String], + lead_form: WhopSDK::AdUpdateParams::LeadForm, + lead_form_id: String, + messaging_config: WhopSDK::AdUpdateParams::MessagingConfig, + multi_advertiser_ads: T::Boolean, + post_id: String, + post_source: WhopSDK::AdUpdateParams::PostSource::OrSymbol, + primary_texts: T::Array[String], + social_accounts: T::Array[WhopSDK::AdUpdateParams::SocialAccount], + title: String, + url: String, + url_parameters: T.anything, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # The call-to-action button shown on the ad. + module CallToAction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdUpdateParams::CallToAction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPLY_NOW = + T.let(:apply_now, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + BOOK_NOW = + T.let(:book_now, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + CALL_NOW = + T.let(:call_now, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + CONTACT_US = + T.let( + :contact_us, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + DOWNLOAD = + T.let(:download, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + GET_DIRECTIONS = + T.let( + :get_directions, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + GET_OFFER = + T.let(:get_offer, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + GET_QUOTE = + T.let(:get_quote, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + LEARN_MORE = + T.let( + :learn_more, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + LISTEN_NOW = + T.let( + :listen_now, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + MESSAGE_PAGE = + T.let( + :message_page, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + NO_BUTTON = + T.let(:no_button, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + OPEN_LINK = + T.let(:open_link, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + ORDER_NOW = + T.let(:order_now, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + REQUEST_TIME = + T.let( + :request_time, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + SEE_DETAILS = + T.let( + :see_details, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + SEE_MENU = + T.let(:see_menu, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + SEND_UPDATES = + T.let( + :send_updates, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + SHOP_NOW = + T.let(:shop_now, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + SIGN_UP = + T.let(:sign_up, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + SUBSCRIBE = + T.let(:subscribe, WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol) + WATCH_MORE = + T.let( + :watch_more, + WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdUpdateParams::CallToAction::TaggedSymbol] + ) + end + def self.values + end + end + + class Creative < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::AdUpdateParams::Creative, WhopSDK::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + sig { returns(T.nilable(WhopSDK::AdUpdateParams::Creative::Crop)) } + attr_reader :crop + + sig do + params(crop: WhopSDK::AdUpdateParams::Creative::Crop::OrHash).void + end + attr_writer :crop + + sig do + returns( + T.nilable(WhopSDK::AdUpdateParams::Creative::Format::OrSymbol) + ) + end + attr_reader :format_ + + sig do + params( + format_: WhopSDK::AdUpdateParams::Creative::Format::OrSymbol + ).void + end + attr_writer :format_ + + sig do + params( + id: String, + crop: WhopSDK::AdUpdateParams::Creative::Crop::OrHash, + format_: WhopSDK::AdUpdateParams::Creative::Format::OrSymbol + ).returns(T.attached_class) + end + def self.new( + id: nil, + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + crop: nil, + format_: nil + ) + end + + sig do + override.returns( + { + id: String, + crop: WhopSDK::AdUpdateParams::Creative::Crop, + format_: WhopSDK::AdUpdateParams::Creative::Format::OrSymbol + } + ) + end + def to_hash + end + + class Crop < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::Creative::Crop, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Float)) } + attr_reader :height + + sig { params(height: Float).void } + attr_writer :height + + sig { returns(T.nilable(Float)) } + attr_reader :width + + sig { params(width: Float).void } + attr_writer :width + + sig { returns(T.nilable(Float)) } + attr_reader :x + + sig { params(x: Float).void } + attr_writer :x + + sig { returns(T.nilable(Float)) } + attr_reader :y_ + + sig { params(y_: Float).void } + attr_writer :y_ + + # The saved crop window for this creative, in source image pixels. Omit it for the + # original asset or for a format that has not been cropped. + sig do + params(height: Float, width: Float, x: Float, y_: Float).returns( + T.attached_class + ) + end + def self.new(height: nil, width: nil, x: nil, y_: nil) + end + + sig do + override.returns( + { height: Float, width: Float, x: Float, y_: Float } + ) + end + def to_hash + end + end + + module Format + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdUpdateParams::Creative::Format) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SQUARE = + T.let( + :square, + WhopSDK::AdUpdateParams::Creative::Format::TaggedSymbol + ) + VERTICAL = + T.let( + :vertical, + WhopSDK::AdUpdateParams::Creative::Format::TaggedSymbol + ) + HORIZONTAL = + T.let( + :horizontal, + WhopSDK::AdUpdateParams::Creative::Format::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdUpdateParams::Creative::Format::TaggedSymbol] + ) + end + def self.values + end + end + end + + class LeadForm < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::AdUpdateParams::LeadForm, WhopSDK::Internal::AnyHash) + end + + # Optional completion screen shown after submission; url sets the follow-up + # website button. + sig do + returns(T.nilable(WhopSDK::AdUpdateParams::LeadForm::Completion)) + end + attr_reader :completion + + sig do + params( + completion: WhopSDK::AdUpdateParams::LeadForm::Completion::OrHash + ).void + end + attr_writer :completion + + # Optional custom consent disclaimer with checkboxes. + sig do + returns(T.nilable(WhopSDK::AdUpdateParams::LeadForm::Disclaimer)) + end + attr_reader :disclaimer + + sig do + params( + disclaimer: WhopSDK::AdUpdateParams::LeadForm::Disclaimer::OrHash + ).void + end + attr_writer :disclaimer + + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + sig do + returns( + T.nilable(WhopSDK::AdUpdateParams::LeadForm::FormType::OrSymbol) + ) + end + attr_reader :form_type + + sig do + params( + form_type: WhopSDK::AdUpdateParams::LeadForm::FormType::OrSymbol + ).void + end + attr_writer :form_type + + # Optional intro screen shown before the questions. + sig { returns(T.nilable(WhopSDK::AdUpdateParams::LeadForm::Intro)) } + attr_reader :intro + + sig do + params(intro: WhopSDK::AdUpdateParams::LeadForm::Intro::OrHash).void + end + attr_writer :intro + + # Internal name for the form. Auto-generated if omitted. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # Require SMS verification of the phone number (higher_intent forms). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :phone_verification + + sig { params(phone_verification: T::Boolean).void } + attr_writer :phone_verification + + # Your privacy policy. url is required by Meta. + sig do + returns(T.nilable(WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy)) + end + attr_reader :privacy_policy + + sig do + params( + privacy_policy: + WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy::OrHash + ).void + end + attr_writer :privacy_policy + + # The questions on the form. Standard prefill types need only a type; a custom + # question needs a label and a format (plus options for multiple_choice). Options + # carry an optional key and answer-routing logic. + sig do + returns( + T.nilable(T::Array[WhopSDK::AdUpdateParams::LeadForm::Question]) + ) + end + attr_reader :questions + + sig do + params( + questions: + T::Array[WhopSDK::AdUpdateParams::LeadForm::Question::OrHash] + ).void + end + attr_writer :questions + + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + sig do + params( + completion: WhopSDK::AdUpdateParams::LeadForm::Completion::OrHash, + disclaimer: WhopSDK::AdUpdateParams::LeadForm::Disclaimer::OrHash, + form_type: WhopSDK::AdUpdateParams::LeadForm::FormType::OrSymbol, + intro: WhopSDK::AdUpdateParams::LeadForm::Intro::OrHash, + name: String, + phone_verification: T::Boolean, + privacy_policy: + WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy::OrHash, + questions: + T::Array[WhopSDK::AdUpdateParams::LeadForm::Question::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Optional completion screen shown after submission; url sets the follow-up + # website button. + completion: nil, + # Optional custom consent disclaimer with checkboxes. + disclaimer: nil, + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + form_type: nil, + # Optional intro screen shown before the questions. + intro: nil, + # Internal name for the form. Auto-generated if omitted. + name: nil, + # Require SMS verification of the phone number (higher_intent forms). + phone_verification: nil, + # Your privacy policy. url is required by Meta. + privacy_policy: nil, + # The questions on the form. Standard prefill types need only a type; a custom + # question needs a label and a format (plus options for multiple_choice). Options + # carry an optional key and answer-routing logic. + questions: nil + ) + end + + sig do + override.returns( + { + completion: WhopSDK::AdUpdateParams::LeadForm::Completion, + disclaimer: WhopSDK::AdUpdateParams::LeadForm::Disclaimer, + form_type: WhopSDK::AdUpdateParams::LeadForm::FormType::OrSymbol, + intro: WhopSDK::AdUpdateParams::LeadForm::Intro, + name: String, + phone_verification: T::Boolean, + privacy_policy: WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy, + questions: T::Array[WhopSDK::AdUpdateParams::LeadForm::Question] + } + ) + end + def to_hash + end + + class Completion < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::LeadForm::Completion, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :button_text + + sig { params(button_text: String).void } + attr_writer :button_text + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig { returns(T.nilable(String)) } + attr_reader :headline + + sig { params(headline: String).void } + attr_writer :headline + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Optional completion screen shown after submission; url sets the follow-up + # website button. + sig do + params( + button_text: String, + description: String, + headline: String, + url: String + ).returns(T.attached_class) + end + def self.new( + button_text: nil, + description: nil, + headline: nil, + url: nil + ) + end + + sig do + override.returns( + { + button_text: String, + description: String, + headline: String, + url: String + } + ) + end + def to_hash + end + end + + class Disclaimer < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::LeadForm::Disclaimer, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :body + + sig { params(body: String).void } + attr_writer :body + + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox + ] + ) + ) + end + attr_reader :checkboxes + + sig do + params( + checkboxes: + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox::OrHash + ] + ).void + end + attr_writer :checkboxes + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + # Optional custom consent disclaimer with checkboxes. + sig do + params( + body: String, + checkboxes: + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox::OrHash + ], + title: String + ).returns(T.attached_class) + end + def self.new(body: nil, checkboxes: nil, title: nil) + end + + sig do + override.returns( + { + body: String, + checkboxes: + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox + ], + title: String + } + ) + end + def to_hash + end + + class Checkbox < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :checked_by_default + + sig { params(checked_by_default: T::Boolean).void } + attr_writer :checked_by_default + + sig { returns(T.nilable(String)) } + attr_reader :key + + sig { params(key: String).void } + attr_writer :key + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :required + + sig { params(required: T::Boolean).void } + attr_writer :required + + sig { returns(T.nilable(String)) } + attr_reader :text + + sig { params(text: String).void } + attr_writer :text + + sig do + params( + checked_by_default: T::Boolean, + key: String, + required: T::Boolean, + text: String + ).returns(T.attached_class) + end + def self.new( + checked_by_default: nil, + key: nil, + required: nil, + text: nil + ) + end + + sig do + override.returns( + { + checked_by_default: T::Boolean, + key: String, + required: T::Boolean, + text: String + } + ) + end + def to_hash + end + end + end + + # more_volume (default) is quickest to submit; higher_intent adds a confirmation + # step. + module FormType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdUpdateParams::LeadForm::FormType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MORE_VOLUME = + T.let( + :more_volume, + WhopSDK::AdUpdateParams::LeadForm::FormType::TaggedSymbol + ) + HIGHER_INTENT = + T.let( + :higher_intent, + WhopSDK::AdUpdateParams::LeadForm::FormType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::FormType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Intro < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::LeadForm::Intro, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig { returns(T.nilable(String)) } + attr_reader :headline + + sig { params(headline: String).void } + attr_writer :headline + + # Optional intro screen shown before the questions. + sig do + params(description: String, headline: String).returns( + T.attached_class + ) + end + def self.new(description: nil, headline: nil) + end + + sig { override.returns({ description: String, headline: String }) } + def to_hash + end + end + + class PrivacyPolicy < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :link_text + + sig { params(link_text: String).void } + attr_writer :link_text + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Your privacy policy. url is required by Meta. + sig do + params(link_text: String, url: String).returns(T.attached_class) + end + def self.new(link_text: nil, url: nil) + end + + sig { override.returns({ link_text: String, url: String }) } + def to_hash + end + end + + class Question < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::LeadForm::Question, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + WhopSDK::AdUpdateParams::LeadForm::Question::Format::OrSymbol + ) + ) + end + attr_reader :format_ + + sig do + params( + format_: + WhopSDK::AdUpdateParams::LeadForm::Question::Format::OrSymbol + ).void + end + attr_writer :format_ + + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + sig do + returns( + T.nilable( + T::Array[WhopSDK::AdUpdateParams::LeadForm::Question::Option] + ) + ) + end + attr_reader :options + + sig do + params( + options: + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Question::Option::OrHash + ] + ).void + end + attr_writer :options + + sig do + returns( + T.nilable( + WhopSDK::AdUpdateParams::LeadForm::Question::Type::OrSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: WhopSDK::AdUpdateParams::LeadForm::Question::Type::OrSymbol + ).void + end + attr_writer :type + + sig do + params( + format_: + WhopSDK::AdUpdateParams::LeadForm::Question::Format::OrSymbol, + label: String, + options: + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Question::Option::OrHash + ], + type: WhopSDK::AdUpdateParams::LeadForm::Question::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(format_: nil, label: nil, options: nil, type: nil) + end + + sig do + override.returns( + { + format_: + WhopSDK::AdUpdateParams::LeadForm::Question::Format::OrSymbol, + label: String, + options: + T::Array[WhopSDK::AdUpdateParams::LeadForm::Question::Option], + type: + WhopSDK::AdUpdateParams::LeadForm::Question::Type::OrSymbol + } + ) + end + def to_hash + end + + module Format + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::AdUpdateParams::LeadForm::Question::Format + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SHORT_ANSWER = + T.let( + :short_answer, + WhopSDK::AdUpdateParams::LeadForm::Question::Format::TaggedSymbol + ) + MULTIPLE_CHOICE = + T.let( + :multiple_choice, + WhopSDK::AdUpdateParams::LeadForm::Question::Format::TaggedSymbol + ) + APPOINTMENT = + T.let( + :appointment, + WhopSDK::AdUpdateParams::LeadForm::Question::Format::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Question::Format::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Option < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::LeadForm::Question::Option, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :key + + sig { params(key: String).void } + attr_writer :key + + sig do + returns( + T.nilable( + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic + ) + ) + end + attr_reader :logic + + sig do + params( + logic: + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::OrHash + ).void + end + attr_writer :logic + + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + sig do + params( + key: String, + logic: + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::OrHash, + value: String + ).returns(T.attached_class) + end + def self.new(key: nil, logic: nil, value: nil) + end + + sig do + override.returns( + { + key: String, + logic: + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic, + value: String + } + ) + end + def to_hash + end + + class Logic < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action::OrSymbol + ) + ) + end + attr_reader :action + + sig do + params( + action: + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action::OrSymbol + ).void + end + attr_writer :action + + sig { returns(T.nilable(Integer)) } + attr_reader :target_end_page_index + + sig { params(target_end_page_index: Integer).void } + attr_writer :target_end_page_index + + sig { returns(T.nilable(Integer)) } + attr_reader :target_question_index + + sig { params(target_question_index: Integer).void } + attr_writer :target_question_index + + sig do + params( + action: + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action::OrSymbol, + target_end_page_index: Integer, + target_question_index: Integer + ).returns(T.attached_class) + end + def self.new( + action: nil, + target_end_page_index: nil, + target_question_index: nil + ) + end + + sig do + override.returns( + { + action: + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action::OrSymbol, + target_end_page_index: Integer, + target_question_index: Integer + } + ) + end + def to_hash + end + + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GO_TO_QUESTION = + T.let( + :go_to_question, + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action::TaggedSymbol + ) + SUBMIT_FORM = + T.let( + :submit_form, + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action::TaggedSymbol + ) + CLOSE_FORM = + T.let( + :close_form, + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdUpdateParams::LeadForm::Question::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL = + T.let( + :email, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + PHONE = + T.let( + :phone, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + FULL_NAME = + T.let( + :full_name, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + FIRST_NAME = + T.let( + :first_name, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + LAST_NAME = + T.let( + :last_name, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + CITY = + T.let( + :city, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + STATE = + T.let( + :state, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + ZIP = + T.let( + :zip, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + COUNTRY = + T.let( + :country, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + STREET_ADDRESS = + T.let( + :street_address, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + JOB_TITLE = + T.let( + :job_title, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + COMPANY_NAME = + T.let( + :company_name, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + WORK_EMAIL = + T.let( + :work_email, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + WORK_PHONE_NUMBER = + T.let( + :work_phone_number, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + DOB = + T.let( + :dob, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + GENDER = + T.let( + :gender, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + MARITAL_STATUS = + T.let( + :marital_status, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + RELATIONSHIP_STATUS = + T.let( + :relationship_status, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + MILITARY_STATUS = + T.let( + :military_status, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + DATE_TIME = + T.let( + :date_time, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + CUSTOM = + T.let( + :custom, + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::AdUpdateParams::LeadForm::Question::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class MessagingConfig < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::MessagingConfig, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :keyword + + sig { params(keyword: String).void } + attr_writer :keyword + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + sig do + params(keyword: String, message: String).returns(T.attached_class) + end + def self.new(keyword: nil, message: nil) + end + + sig { override.returns({ keyword: String, message: String }) } + def to_hash + end + end + + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + module PostSource + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdUpdateParams::PostSource) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FACEBOOK = + T.let(:facebook, WhopSDK::AdUpdateParams::PostSource::TaggedSymbol) + INSTAGRAM = + T.let(:instagram, WhopSDK::AdUpdateParams::PostSource::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AdUpdateParams::PostSource::TaggedSymbol] + ) + end + def self.values + end + end + + class SocialAccount < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AdUpdateParams::SocialAccount, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { params(id: String).returns(T.attached_class) } + def self.new(id: nil) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/app.rbi b/rbi/whop_sdk/models/app.rbi index eadc4a65..5ac34635 100644 --- a/rbi/whop_sdk/models/app.rbi +++ b/rbi/whop_sdk/models/app.rbi @@ -69,6 +69,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :experience_path + # The full canonical URL where this app's hosted web build is served. Null if the + # app has not claimed a route. + sig { returns(T.nilable(String)) } + attr_accessor :hosted_url + # The icon image for this app, displayed on the app store, product pages, # checkout, and as the default icon for experiences using this app. sig { returns(T.nilable(WhopSDK::App::Icon)) } @@ -93,6 +98,19 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :origin + # The approved app build currently served to users on web. Null if no production + # build is deployed for web. + sig { returns(T.nilable(WhopSDK::App::ProductionWebBuild)) } + attr_reader :production_web_build + + sig do + params( + production_web_build: + T.nilable(WhopSDK::App::ProductionWebBuild::OrHash) + ).void + end + attr_writer :production_web_build + # The whitelisted OAuth callback URLs that users are redirected to after # authorizing the app. sig { returns(T::Array[String]) } @@ -103,6 +121,17 @@ module WhopSDK sig { returns(T::Array[WhopSDK::App::RequestedPermission]) } attr_accessor :requested_permissions + # The unique subdomain route where this app's hosted web builds are served, such + # as 'myapp' for myapp.whop.app. Null if the app has not claimed a route. + sig { returns(T.nilable(String)) } + attr_accessor :route + + # The app's secrets as an object of string values. Encrypted at rest and injected + # into the app's hosted server runtime as environment bindings. Requires the + # 'developer:update_app' permission. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :secrets + # The URL path template for a specific view of this app, appended to the base # domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is # not configured. @@ -143,13 +172,18 @@ module WhopSDK discover_path: T.nilable(String), domain_id: String, experience_path: T.nilable(String), + hosted_url: T.nilable(String), icon: T.nilable(WhopSDK::App::Icon::OrHash), name: String, openapi_path: T.nilable(String), origin: T.nilable(String), + production_web_build: + T.nilable(WhopSDK::App::ProductionWebBuild::OrHash), redirect_uris: T::Array[String], requested_permissions: T::Array[WhopSDK::App::RequestedPermission::OrHash], + route: T.nilable(String), + secrets: T.nilable(T::Hash[Symbol, T.anything]), skills_path: T.nilable(String), stats: T.nilable(WhopSDK::App::Stats::OrHash), status: WhopSDK::AppStatuses::OrSymbol, @@ -190,6 +224,9 @@ module WhopSDK # domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is # not configured. experience_path:, + # The full canonical URL where this app's hosted web build is served. Null if the + # app has not claimed a route. + hosted_url:, # The icon image for this app, displayed on the app store, product pages, # checkout, and as the default icon for experiences using this app. icon:, @@ -203,12 +240,22 @@ module WhopSDK # The full origin URL for this app's proxied domain (e.g., # 'https://myapp.apps.whop.com'). Null if no proxy domain is configured. origin:, + # The approved app build currently served to users on web. Null if no production + # build is deployed for web. + production_web_build:, # The whitelisted OAuth callback URLs that users are redirected to after # authorizing the app. redirect_uris:, # The list of permissions this app requests when installed, including both # required and optional permissions with justifications. requested_permissions:, + # The unique subdomain route where this app's hosted web builds are served, such + # as 'myapp' for myapp.whop.app. Null if the app has not claimed a route. + route:, + # The app's secrets as an object of string values. Encrypted at rest and injected + # into the app's hosted server runtime as environment bindings. Requires the + # 'developer:update_app' permission. + secrets:, # The URL path template for a specific view of this app, appended to the base # domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is # not configured. @@ -240,12 +287,16 @@ module WhopSDK discover_path: T.nilable(String), domain_id: String, experience_path: T.nilable(String), + hosted_url: T.nilable(String), icon: T.nilable(WhopSDK::App::Icon), name: String, openapi_path: T.nilable(String), origin: T.nilable(String), + production_web_build: T.nilable(WhopSDK::App::ProductionWebBuild), redirect_uris: T::Array[String], requested_permissions: T::Array[WhopSDK::App::RequestedPermission], + route: T.nilable(String), + secrets: T.nilable(T::Hash[Symbol, T.anything]), skills_path: T.nilable(String), stats: T.nilable(WhopSDK::App::Stats), status: WhopSDK::AppStatuses::TaggedSymbol, @@ -394,6 +445,66 @@ module WhopSDK end end + class ProductionWebBuild < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::App::ProductionWebBuild, WhopSDK::Internal::AnyHash) + end + + # The unique identifier for the app build. + sig { returns(String) } + attr_accessor :id + + # A SHA-256 hash of the uploaded build file, generated by the client and used to + # verify file integrity. + sig { returns(String) } + attr_accessor :checksum + + # A URL to download the app build as a .zip archive. + sig { returns(String) } + attr_accessor :file_url + + # The current review status of this build. + sig { returns(WhopSDK::AppBuildStatuses::TaggedSymbol) } + attr_accessor :status + + # The approved app build currently served to users on web. Null if no production + # build is deployed for web. + sig do + params( + id: String, + checksum: String, + file_url: String, + status: WhopSDK::AppBuildStatuses::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the app build. + id:, + # A SHA-256 hash of the uploaded build file, generated by the client and used to + # verify file integrity. + checksum:, + # A URL to download the app build as a .zip archive. + file_url:, + # The current review status of this build. + status: + ) + end + + sig do + override.returns( + { + id: String, + checksum: String, + file_url: String, + status: WhopSDK::AppBuildStatuses::TaggedSymbol + } + ) + end + def to_hash + end + end + class RequestedPermission < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/whop_sdk/models/app_build_create_params.rbi b/rbi/whop_sdk/models/app_build_create_params.rbi index 7bf9fedd..c9812e92 100644 --- a/rbi/whop_sdk/models/app_build_create_params.rbi +++ b/rbi/whop_sdk/models/app_build_create_params.rbi @@ -13,7 +13,7 @@ module WhopSDK # The build file to upload. For iOS and Android, this should be a .zip archive # containing a main_js_bundle.hbc file and an optional assets folder. For web, - # this should be a JavaScript file. + # this should be a JavaScript file or a .zip archive of the hosted site. sig { returns(WhopSDK::AppBuildCreateParams::Attachment) } attr_reader :attachment @@ -62,7 +62,7 @@ module WhopSDK def self.new( # The build file to upload. For iOS and Android, this should be a .zip archive # containing a main_js_bundle.hbc file and an optional assets folder. For web, - # this should be a JavaScript file. + # this should be a JavaScript file or a .zip archive of the hosted site. attachment:, # A client-generated checksum of the build file, used to verify file integrity # when unpacked on a device. @@ -113,7 +113,7 @@ module WhopSDK # The build file to upload. For iOS and Android, this should be a .zip archive # containing a main_js_bundle.hbc file and an optional assets folder. For web, - # this should be a JavaScript file. + # this should be a JavaScript file or a .zip archive of the hosted site. sig { params(id: String).returns(T.attached_class) } def self.new( # The ID of an existing file object. diff --git a/rbi/whop_sdk/models/app_create_params.rbi b/rbi/whop_sdk/models/app_create_params.rbi index 16f2da02..f6a51a01 100644 --- a/rbi/whop_sdk/models/app_create_params.rbi +++ b/rbi/whop_sdk/models/app_create_params.rbi @@ -39,6 +39,11 @@ module WhopSDK sig { returns(T.nilable(T::Array[String])) } attr_accessor :redirect_uris + # The unique subdomain route where the app's hosted web builds are served, such as + # 'myapp' for myapp.whop.app. + sig { returns(T.nilable(String)) } + attr_accessor :route + sig do params( company_id: String, @@ -46,6 +51,7 @@ module WhopSDK base_url: T.nilable(String), icon: T.nilable(WhopSDK::AppCreateParams::Icon::OrHash), redirect_uris: T.nilable(T::Array[String]), + route: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -63,6 +69,9 @@ module WhopSDK # The whitelisted OAuth callback URLs that users are redirected to after # authorizing the app. redirect_uris: nil, + # The unique subdomain route where the app's hosted web builds are served, such as + # 'myapp' for myapp.whop.app. + route: nil, request_options: {} ) end @@ -75,6 +84,7 @@ module WhopSDK base_url: T.nilable(String), icon: T.nilable(WhopSDK::AppCreateParams::Icon), redirect_uris: T.nilable(T::Array[String]), + route: T.nilable(String), request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/app_list_response.rbi b/rbi/whop_sdk/models/app_list_response.rbi index 112a9697..0d0da06c 100644 --- a/rbi/whop_sdk/models/app_list_response.rbi +++ b/rbi/whop_sdk/models/app_list_response.rbi @@ -68,6 +68,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :experience_path + # The full canonical URL where this app's hosted web build is served. Null if the + # app has not claimed a route. + sig { returns(T.nilable(String)) } + attr_accessor :hosted_url + # The icon image for this app, displayed on the app store, product pages, # checkout, and as the default icon for experiences using this app. sig { returns(T.nilable(WhopSDK::Models::AppListResponse::Icon)) } @@ -96,6 +101,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :origin + # The unique subdomain route where this app's hosted web builds are served, such + # as 'myapp' for myapp.whop.app. Null if the app has not claimed a route. + sig { returns(T.nilable(String)) } + attr_accessor :route + # The URL path template for a specific view of this app, appended to the base # domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is # not configured. @@ -127,10 +137,12 @@ module WhopSDK discover_path: T.nilable(String), domain_id: String, experience_path: T.nilable(String), + hosted_url: T.nilable(String), icon: T.nilable(WhopSDK::Models::AppListResponse::Icon::OrHash), name: String, openapi_path: T.nilable(String), origin: T.nilable(String), + route: T.nilable(String), skills_path: T.nilable(String), status: WhopSDK::AppStatuses::OrSymbol, verified: T::Boolean @@ -167,6 +179,9 @@ module WhopSDK # domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is # not configured. experience_path:, + # The full canonical URL where this app's hosted web build is served. Null if the + # app has not claimed a route. + hosted_url:, # The icon image for this app, displayed on the app store, product pages, # checkout, and as the default icon for experiences using this app. icon:, @@ -180,6 +195,9 @@ module WhopSDK # The full origin URL for this app's proxied domain (e.g., # 'https://myapp.apps.whop.com'). Null if no proxy domain is configured. origin:, + # The unique subdomain route where this app's hosted web builds are served, such + # as 'myapp' for myapp.whop.app. Null if the app has not claimed a route. + route:, # The URL path template for a specific view of this app, appended to the base # domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is # not configured. @@ -207,10 +225,12 @@ module WhopSDK discover_path: T.nilable(String), domain_id: String, experience_path: T.nilable(String), + hosted_url: T.nilable(String), icon: T.nilable(WhopSDK::Models::AppListResponse::Icon), name: String, openapi_path: T.nilable(String), origin: T.nilable(String), + route: T.nilable(String), skills_path: T.nilable(String), status: WhopSDK::AppStatuses::TaggedSymbol, verified: T::Boolean diff --git a/rbi/whop_sdk/models/app_logs_params.rbi b/rbi/whop_sdk/models/app_logs_params.rbi new file mode 100644 index 00000000..06ddfd82 --- /dev/null +++ b/rbi/whop_sdk/models/app_logs_params.rbi @@ -0,0 +1,154 @@ +# typed: strong + +module WhopSDK + module Models + class AppLogsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AppLogsParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + # A cursor for fetching logs after a previous page. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Only return logs from this build. + sig { returns(T.nilable(String)) } + attr_reader :app_build_id + + sig { params(app_build_id: String).void } + attr_writer :app_build_id + + # A cursor for fetching logs before a later page. + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Start of the time window as an ISO 8601 timestamp. Defaults to 7 days before + # created_before. + sig { returns(T.nilable(Time)) } + attr_reader :created_after + + sig { params(created_after: Time).void } + attr_writer :created_after + + # End of the time window as an ISO 8601 timestamp. Defaults to now. + sig { returns(T.nilable(Time)) } + attr_reader :created_before + + sig { params(created_before: Time).void } + attr_writer :created_before + + # The number of log lines to return (max 500). + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # Only return console lines of this level. + sig { returns(T.nilable(WhopSDK::AppLogsParams::Level::OrSymbol)) } + attr_reader :level + + sig { params(level: WhopSDK::AppLogsParams::Level::OrSymbol).void } + attr_writer :level + + # Only return logs whose message contains this text (case-insensitive). + sig { returns(T.nilable(String)) } + attr_reader :query + + sig { params(query: String).void } + attr_writer :query + + sig do + params( + id: String, + after: String, + app_build_id: String, + before: String, + created_after: Time, + created_before: Time, + first: Integer, + level: WhopSDK::AppLogsParams::Level::OrSymbol, + query: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # A cursor for fetching logs after a previous page. + after: nil, + # Only return logs from this build. + app_build_id: nil, + # A cursor for fetching logs before a later page. + before: nil, + # Start of the time window as an ISO 8601 timestamp. Defaults to 7 days before + # created_before. + created_after: nil, + # End of the time window as an ISO 8601 timestamp. Defaults to now. + created_before: nil, + # The number of log lines to return (max 500). + first: nil, + # Only return console lines of this level. + level: nil, + # Only return logs whose message contains this text (case-insensitive). + query: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + after: String, + app_build_id: String, + before: String, + created_after: Time, + created_before: Time, + first: Integer, + level: WhopSDK::AppLogsParams::Level::OrSymbol, + query: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Only return console lines of this level. + module Level + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AppLogsParams::Level) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOG = T.let(:log, WhopSDK::AppLogsParams::Level::TaggedSymbol) + DEBUG = T.let(:debug, WhopSDK::AppLogsParams::Level::TaggedSymbol) + INFO = T.let(:info, WhopSDK::AppLogsParams::Level::TaggedSymbol) + WARN = T.let(:warn, WhopSDK::AppLogsParams::Level::TaggedSymbol) + ERROR = T.let(:error, WhopSDK::AppLogsParams::Level::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::AppLogsParams::Level::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/app_logs_response.rbi b/rbi/whop_sdk/models/app_logs_response.rbi new file mode 100644 index 00000000..f1046c69 --- /dev/null +++ b/rbi/whop_sdk/models/app_logs_response.rbi @@ -0,0 +1,261 @@ +# typed: strong + +module WhopSDK + module Models + class AppLogsResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::AppLogsResponse, WhopSDK::Internal::AnyHash) + end + + sig { returns(T::Array[WhopSDK::Models::AppLogsResponse::Data]) } + attr_accessor :data + + sig { returns(WhopSDK::Models::AppLogsResponse::PageInfo) } + attr_reader :page_info + + sig do + params( + page_info: WhopSDK::Models::AppLogsResponse::PageInfo::OrHash + ).void + end + attr_writer :page_info + + sig do + params( + data: T::Array[WhopSDK::Models::AppLogsResponse::Data::OrHash], + page_info: WhopSDK::Models::AppLogsResponse::PageInfo::OrHash + ).returns(T.attached_class) + end + def self.new(data:, page_info:) + end + + sig do + override.returns( + { + data: T::Array[WhopSDK::Models::AppLogsResponse::Data], + page_info: WhopSDK::Models::AppLogsResponse::PageInfo + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::AppLogsResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :app_build_id + + sig { returns(String) } + attr_accessor :app_id + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :level + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :request_id + + sig do + returns(WhopSDK::Models::AppLogsResponse::Data::Source::TaggedSymbol) + end + attr_accessor :source + + sig { returns(T.nilable(Integer)) } + attr_reader :cpu_time_ms + + sig { params(cpu_time_ms: Integer).void } + attr_writer :cpu_time_ms + + sig { returns(T.nilable(String)) } + attr_accessor :outcome + + sig { returns(T.nilable(String)) } + attr_accessor :request_method + + sig { returns(T.nilable(String)) } + attr_accessor :request_path + + sig { returns(T.nilable(Integer)) } + attr_accessor :response_status + + sig { returns(T.nilable(String)) } + attr_accessor :stack + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :truncated + + sig { params(truncated: T::Boolean).void } + attr_writer :truncated + + sig { returns(T.nilable(Integer)) } + attr_reader :wall_time_ms + + sig { params(wall_time_ms: Integer).void } + attr_writer :wall_time_ms + + sig do + params( + app_build_id: String, + app_id: String, + created_at: Time, + level: String, + message: String, + request_id: String, + source: WhopSDK::Models::AppLogsResponse::Data::Source::OrSymbol, + cpu_time_ms: Integer, + outcome: T.nilable(String), + request_method: T.nilable(String), + request_path: T.nilable(String), + response_status: T.nilable(Integer), + stack: T.nilable(String), + truncated: T::Boolean, + wall_time_ms: Integer + ).returns(T.attached_class) + end + def self.new( + app_build_id:, + app_id:, + created_at:, + level:, + message:, + request_id:, + source:, + cpu_time_ms: nil, + outcome: nil, + request_method: nil, + request_path: nil, + response_status: nil, + stack: nil, + truncated: nil, + wall_time_ms: nil + ) + end + + sig do + override.returns( + { + app_build_id: String, + app_id: String, + created_at: Time, + level: String, + message: String, + request_id: String, + source: + WhopSDK::Models::AppLogsResponse::Data::Source::TaggedSymbol, + cpu_time_ms: Integer, + outcome: T.nilable(String), + request_method: T.nilable(String), + request_path: T.nilable(String), + response_status: T.nilable(Integer), + stack: T.nilable(String), + truncated: T::Boolean, + wall_time_ms: Integer + } + ) + end + def to_hash + end + + module Source + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::AppLogsResponse::Data::Source) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONSOLE = + T.let( + :console, + WhopSDK::Models::AppLogsResponse::Data::Source::TaggedSymbol + ) + EXCEPTION = + T.let( + :exception, + WhopSDK::Models::AppLogsResponse::Data::Source::TaggedSymbol + ) + REQUEST = + T.let( + :request, + WhopSDK::Models::AppLogsResponse::Data::Source::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AppLogsResponse::Data::Source::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class PageInfo < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::AppLogsResponse::PageInfo, + WhopSDK::Internal::AnyHash + ) + end + + 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 :end_cursor + + sig { returns(T.nilable(String)) } + attr_accessor :start_cursor + + sig do + params( + has_next_page: T::Boolean, + has_previous_page: T::Boolean, + end_cursor: T.nilable(String), + start_cursor: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + has_next_page:, + has_previous_page:, + end_cursor: nil, + start_cursor: nil + ) + end + + sig do + override.returns( + { + has_next_page: T::Boolean, + has_previous_page: T::Boolean, + end_cursor: T.nilable(String), + start_cursor: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/app_update_params.rbi b/rbi/whop_sdk/models/app_update_params.rbi index 8c4c5d5b..ab829497 100644 --- a/rbi/whop_sdk/models/app_update_params.rbi +++ b/rbi/whop_sdk/models/app_update_params.rbi @@ -81,6 +81,18 @@ module WhopSDK end attr_accessor :required_scopes + # The unique subdomain route where the app's hosted web builds are served, such as + # 'myapp' for myapp.whop.app. + sig { returns(T.nilable(String)) } + attr_accessor :route + + # Secrets to add or overwrite on the app, as an object of string values (e.g. + # {"MAIL_API_KEY": "..."}). Keys not included are left untouched. Pass null or an + # empty string as the value to delete a secret. Secrets are encrypted at rest and + # injected into the app's hosted server runtime as environment bindings. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :secrets + # The URL path to the skills directory of the app, such as '/assets/skills/'. sig { returns(T.nilable(String)) } attr_accessor :skills_path @@ -109,6 +121,8 @@ module WhopSDK T.nilable( T::Array[WhopSDK::AppUpdateParams::RequiredScope::OrSymbol] ), + route: T.nilable(String), + secrets: T.nilable(T::Hash[Symbol, T.anything]), skills_path: T.nilable(String), status: T.nilable(WhopSDK::AppStatuses::OrSymbol), request_options: WhopSDK::RequestOptions::OrHash @@ -146,6 +160,14 @@ module WhopSDK redirect_uris: nil, # The permission scopes the app will request from users when they install it. required_scopes: nil, + # The unique subdomain route where the app's hosted web builds are served, such as + # 'myapp' for myapp.whop.app. + route: nil, + # Secrets to add or overwrite on the app, as an object of string values (e.g. + # {"MAIL_API_KEY": "..."}). Keys not included are left untouched. Pass null or an + # empty string as the value to delete a secret. Secrets are encrypted at rest and + # injected into the app's hosted server runtime as environment bindings. + secrets: nil, # The URL path to the skills directory of the app, such as '/assets/skills/'. skills_path: nil, # The status of an experience interface @@ -175,6 +197,8 @@ module WhopSDK T.nilable( T::Array[WhopSDK::AppUpdateParams::RequiredScope::OrSymbol] ), + route: T.nilable(String), + secrets: T.nilable(T::Hash[Symbol, T.anything]), skills_path: T.nilable(String), status: T.nilable(WhopSDK::AppStatuses::OrSymbol), request_options: WhopSDK::RequestOptions diff --git a/rbi/whop_sdk/models/audience.rbi b/rbi/whop_sdk/models/audience.rbi new file mode 100644 index 00000000..241f6999 --- /dev/null +++ b/rbi/whop_sdk/models/audience.rbi @@ -0,0 +1,140 @@ +# typed: strong + +module WhopSDK + module Models + class Audience < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(WhopSDK::Audience, WhopSDK::Internal::AnyHash) } + + # Audience ID, prefixed `adaud_`. + sig { returns(String) } + attr_accessor :id + + # Unix timestamp when the audience was created. + sig { returns(Float) } + attr_accessor :created_at + + # Processing error message. `null` unless processing is partial or failed. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Rows successfully uploaded to connected ad accounts. + sig { returns(Float) } + attr_accessor :matched_rows + + # Audience display name. + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Array[String]) } + attr_accessor :platform_audience_ids + + # Rows processed from the uploaded CSV. + sig { returns(Float) } + attr_accessor :processed_rows + + # Processing progress from 0 to 100. + sig { returns(Float) } + attr_accessor :progress_percent + + # Current state of the audience import. `syncing` means Whop is sending matched + # rows to connected ad accounts. When status is `partial` or `failed`, + # `error_message` explains what went wrong. + sig { returns(WhopSDK::Audience::Status::TaggedSymbol) } + attr_accessor :status + + # Total rows detected in the uploaded CSV. + sig { returns(Float) } + attr_accessor :total_rows + + # Unix timestamp when the audience was last updated. + sig { returns(Float) } + attr_accessor :updated_at + + sig do + params( + id: String, + created_at: Float, + error_message: T.nilable(String), + matched_rows: Float, + name: String, + platform_audience_ids: T::Array[String], + processed_rows: Float, + progress_percent: Float, + status: WhopSDK::Audience::Status::OrSymbol, + total_rows: Float, + updated_at: Float + ).returns(T.attached_class) + end + def self.new( + # Audience ID, prefixed `adaud_`. + id:, + # Unix timestamp when the audience was created. + created_at:, + # Processing error message. `null` unless processing is partial or failed. + error_message:, + # Rows successfully uploaded to connected ad accounts. + matched_rows:, + # Audience display name. + name:, + platform_audience_ids:, + # Rows processed from the uploaded CSV. + processed_rows:, + # Processing progress from 0 to 100. + progress_percent:, + # Current state of the audience import. `syncing` means Whop is sending matched + # rows to connected ad accounts. When status is `partial` or `failed`, + # `error_message` explains what went wrong. + status:, + # Total rows detected in the uploaded CSV. + total_rows:, + # Unix timestamp when the audience was last updated. + updated_at: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Float, + error_message: T.nilable(String), + matched_rows: Float, + name: String, + platform_audience_ids: T::Array[String], + processed_rows: Float, + progress_percent: Float, + status: WhopSDK::Audience::Status::TaggedSymbol, + total_rows: Float, + updated_at: Float + } + ) + end + def to_hash + end + + # Current state of the audience import. `syncing` means Whop is sending matched + # rows to connected ad accounts. When status is `partial` or `failed`, + # `error_message` explains what went wrong. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Audience::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:pending, WhopSDK::Audience::Status::TaggedSymbol) + PROCESSING = T.let(:processing, WhopSDK::Audience::Status::TaggedSymbol) + SYNCING = T.let(:syncing, WhopSDK::Audience::Status::TaggedSymbol) + READY = T.let(:ready, WhopSDK::Audience::Status::TaggedSymbol) + PARTIAL = T.let(:partial, WhopSDK::Audience::Status::TaggedSymbol) + FAILED = T.let(:failed, WhopSDK::Audience::Status::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::Audience::Status::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/audience_create_params.rbi b/rbi/whop_sdk/models/audience_create_params.rbi new file mode 100644 index 00000000..490cabb5 --- /dev/null +++ b/rbi/whop_sdk/models/audience_create_params.rbi @@ -0,0 +1,160 @@ +# typed: strong + +module WhopSDK + module Models + class AudienceCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AudienceCreateParams, WhopSDK::Internal::AnyHash) + end + + # Account ID, prefixed `biz_`. + sig { returns(String) } + attr_accessor :account_id + + # Maps supported identity fields to CSV column headers. Map at least one of + # `email` or `phone`. + sig { returns(WhopSDK::AudienceCreateParams::ColumnMapping) } + attr_reader :column_mapping + + sig do + params( + column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping::OrHash + ).void + end + attr_writer :column_mapping + + # Direct upload ID from the standard media upload endpoint. + sig { returns(String) } + attr_accessor :file_id + + # Audience display name. + sig { returns(String) } + attr_accessor :name + + sig do + params( + account_id: String, + column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping::OrHash, + file_id: String, + name: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Account ID, prefixed `biz_`. + account_id:, + # Maps supported identity fields to CSV column headers. Map at least one of + # `email` or `phone`. + column_mapping:, + # Direct upload ID from the standard media upload endpoint. + file_id:, + # Audience display name. + name:, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping, + file_id: String, + name: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + class ColumnMapping < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AudienceCreateParams::ColumnMapping, + WhopSDK::Internal::AnyHash + ) + end + + # CSV header for ISO 3166-1 alpha-2 country codes, such as `US`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # CSV header for email addresses. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # CSV header for first names. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # CSV header for last names. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # CSV header for phone numbers. + sig { returns(T.nilable(String)) } + attr_reader :phone + + sig { params(phone: String).void } + attr_writer :phone + + # Maps supported identity fields to CSV column headers. Map at least one of + # `email` or `phone`. + sig do + params( + country: String, + email: String, + first_name: String, + last_name: String, + phone: String + ).returns(T.attached_class) + end + def self.new( + # CSV header for ISO 3166-1 alpha-2 country codes, such as `US`. + country: nil, + # CSV header for email addresses. + email: nil, + # CSV header for first names. + first_name: nil, + # CSV header for last names. + last_name: nil, + # CSV header for phone numbers. + phone: nil + ) + end + + sig do + override.returns( + { + country: String, + email: String, + first_name: String, + last_name: String, + phone: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/audience_delete_params.rbi b/rbi/whop_sdk/models/audience_delete_params.rbi new file mode 100644 index 00000000..100640c7 --- /dev/null +++ b/rbi/whop_sdk/models/audience_delete_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module WhopSDK + module Models + class AudienceDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AudienceDeleteParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :audience_id + + sig do + params( + audience_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(audience_id:, request_options: {}) + end + + sig do + override.returns( + { audience_id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/audience_delete_response.rbi b/rbi/whop_sdk/models/audience_delete_response.rbi new file mode 100644 index 00000000..5cd9c3cd --- /dev/null +++ b/rbi/whop_sdk/models/audience_delete_response.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module WhopSDK + module Models + class AudienceDeleteResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::AudienceDeleteResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :success + + sig { params(success: T::Boolean).returns(T.attached_class) } + def self.new(success:) + end + + sig { override.returns({ success: T::Boolean }) } + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/audience_list_params.rbi b/rbi/whop_sdk/models/audience_list_params.rbi new file mode 100644 index 00000000..0ee21935 --- /dev/null +++ b/rbi/whop_sdk/models/audience_list_params.rbi @@ -0,0 +1,76 @@ +# typed: strong + +module WhopSDK + module Models + class AudienceListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::AudienceListParams, WhopSDK::Internal::AnyHash) + end + + # Account ID, prefixed `biz_`. + sig { returns(String) } + attr_accessor :account_id + + # Cursor for the next page of audiences. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Audience ID, prefixed `adaud_`, used to filter the response to one audience. + sig { returns(T.nilable(String)) } + attr_reader :audience_id + + sig { params(audience_id: String).void } + attr_writer :audience_id + + # Number of audiences to return. Defaults to 20; maximum 100. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + sig do + params( + account_id: String, + after: String, + audience_id: String, + first: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Account ID, prefixed `biz_`. + account_id:, + # Cursor for the next page of audiences. + after: nil, + # Audience ID, prefixed `adaud_`, used to filter the response to one audience. + audience_id: nil, + # Number of audiences to return. Defaults to 20; maximum 100. + first: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + after: String, + audience_id: String, + first: Integer, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/authorized_user_create_params.rbi b/rbi/whop_sdk/models/authorized_user_create_params.rbi index 509826cb..1af8b4a1 100644 --- a/rbi/whop_sdk/models/authorized_user_create_params.rbi +++ b/rbi/whop_sdk/models/authorized_user_create_params.rbi @@ -24,6 +24,18 @@ module WhopSDK sig { returns(String) } attr_accessor :user_id + # Re-authentication proof required to perform this sensitive action. + sig { returns(T.nilable(WhopSDK::AuthorizedUserCreateParams::Elevation)) } + attr_reader :elevation + + sig do + params( + elevation: + T.nilable(WhopSDK::AuthorizedUserCreateParams::Elevation::OrHash) + ).void + end + attr_writer :elevation + # Whether to send notification emails to the user on creation. sig { returns(T.nilable(T::Boolean)) } attr_accessor :send_emails @@ -33,6 +45,8 @@ module WhopSDK company_id: String, role: WhopSDK::AuthorizedUserRoles::OrSymbol, user_id: String, + elevation: + T.nilable(WhopSDK::AuthorizedUserCreateParams::Elevation::OrHash), send_emails: T.nilable(T::Boolean), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) @@ -45,6 +59,8 @@ module WhopSDK role:, # The ID of the user to add as an authorized user. user_id:, + # Re-authentication proof required to perform this sensitive action. + elevation: nil, # Whether to send notification emails to the user on creation. send_emails: nil, request_options: {} @@ -57,6 +73,8 @@ module WhopSDK company_id: String, role: WhopSDK::AuthorizedUserRoles::OrSymbol, user_id: String, + elevation: + T.nilable(WhopSDK::AuthorizedUserCreateParams::Elevation), send_emails: T.nilable(T::Boolean), request_options: WhopSDK::RequestOptions } @@ -64,6 +82,90 @@ module WhopSDK end def to_hash end + + class Elevation < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AuthorizedUserCreateParams::Elevation, + WhopSDK::Internal::AnyHash + ) + end + + # The WebAuthn authenticator data (base64). + sig { returns(T.nilable(String)) } + attr_accessor :authenticator_data + + # The WebAuthn client data JSON (base64). + sig { returns(T.nilable(String)) } + attr_accessor :client_data_json + + # The WebAuthn credential ID (base64). + sig { returns(T.nilable(String)) } + attr_accessor :credential_id + + # The 6-digit code emailed to the user. + sig { returns(T.nilable(String)) } + attr_accessor :email_code + + # The WebAuthn signature (base64). + sig { returns(T.nilable(String)) } + attr_accessor :signature + + # The 6-digit code from the authenticator app or SMS. + sig { returns(T.nilable(String)) } + attr_accessor :totp_code + + # Reuse an existing elevated session (for SMS/email 2FA users). + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :use_finance_session + + # Re-authentication proof required to perform this sensitive action. + sig do + params( + authenticator_data: T.nilable(String), + client_data_json: T.nilable(String), + credential_id: T.nilable(String), + email_code: T.nilable(String), + signature: T.nilable(String), + totp_code: T.nilable(String), + use_finance_session: T.nilable(T::Boolean) + ).returns(T.attached_class) + end + def self.new( + # The WebAuthn authenticator data (base64). + authenticator_data: nil, + # The WebAuthn client data JSON (base64). + client_data_json: nil, + # The WebAuthn credential ID (base64). + credential_id: nil, + # The 6-digit code emailed to the user. + email_code: nil, + # The WebAuthn signature (base64). + signature: nil, + # The 6-digit code from the authenticator app or SMS. + totp_code: nil, + # Reuse an existing elevated session (for SMS/email 2FA users). + use_finance_session: nil + ) + end + + sig do + override.returns( + { + authenticator_data: T.nilable(String), + client_data_json: T.nilable(String), + credential_id: T.nilable(String), + email_code: T.nilable(String), + signature: T.nilable(String), + totp_code: T.nilable(String), + use_finance_session: T.nilable(T::Boolean) + } + ) + end + def to_hash + end + end end end end diff --git a/rbi/whop_sdk/models/bounty_create_params.rbi b/rbi/whop_sdk/models/bounty_create_params.rbi index fdcb480f..46cc9012 100644 --- a/rbi/whop_sdk/models/bounty_create_params.rbi +++ b/rbi/whop_sdk/models/bounty_create_params.rbi @@ -12,7 +12,8 @@ module WhopSDK end # The amount paid to each approved submission. The total bounty pool funded is - # this amount times accepted_submissions_limit. + # this amount times accepted_submissions_limit, and must be at least 5 in the + # bounty's currency. sig { returns(Float) } attr_accessor :base_unit_amount @@ -29,7 +30,8 @@ module WhopSDK attr_accessor :title # The number of submissions that can be approved before the bounty closes. - # Defaults to 1. + # Defaults to 1. The total pool (base_unit_amount times this limit) must be at + # least 5 in the bounty's currency. sig { returns(T.nilable(Integer)) } attr_accessor :accepted_submissions_limit @@ -38,6 +40,15 @@ module WhopSDK sig { returns(T.nilable(T::Array[String])) } attr_accessor :allowed_country_codes + # What the poster is trying to accomplish with a workforce bounty. Used for + # product taxonomy and analytics, separate from the bounty's implementation type. + sig do + returns( + T.nilable(WhopSDK::BountyCreateParams::BusinessGoalType::OrSymbol) + ) + end + attr_accessor :business_goal_type + # An optional experience to scope the bounty to. sig { returns(T.nilable(String)) } attr_accessor :experience_id @@ -58,6 +69,24 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :post_title + # How often a scheduled bounty republishes a new bounty. + sig do + returns( + T.nilable(WhopSDK::BountyCreateParams::ScheduledFrequency::OrSymbol) + ) + end + attr_accessor :scheduled_frequency + + # When to publish the bounty. When provided, the bounty is created as a hidden + # draft and published at this time instead of immediately. Must be in the future. + sig { returns(T.nilable(Time)) } + attr_accessor :scheduled_publish_at + + # The IANA timezone used for recurring occurrences. Required when + # scheduled_publish_at is provided. + sig { returns(T.nilable(String)) } + attr_accessor :scheduled_timezone + sig do params( base_unit_amount: Float, @@ -66,16 +95,25 @@ module WhopSDK title: String, accepted_submissions_limit: T.nilable(Integer), allowed_country_codes: T.nilable(T::Array[String]), + business_goal_type: + T.nilable(WhopSDK::BountyCreateParams::BusinessGoalType::OrSymbol), experience_id: T.nilable(String), origin_account_id: T.nilable(String), post_markdown_content: T.nilable(String), post_title: T.nilable(String), + scheduled_frequency: + T.nilable( + WhopSDK::BountyCreateParams::ScheduledFrequency::OrSymbol + ), + scheduled_publish_at: T.nilable(Time), + scheduled_timezone: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( # The amount paid to each approved submission. The total bounty pool funded is - # this amount times accepted_submissions_limit. + # this amount times accepted_submissions_limit, and must be at least 5 in the + # bounty's currency. base_unit_amount:, # The currency for the bounty pool funding amount. currency:, @@ -84,11 +122,15 @@ module WhopSDK # The title of the bounty. title:, # The number of submissions that can be approved before the bounty closes. - # Defaults to 1. + # Defaults to 1. The total pool (base_unit_amount times this limit) must be at + # least 5 in the bounty's currency. accepted_submissions_limit: nil, # The ISO3166 country codes where this bounty should be visible. Empty means # globally visible. allowed_country_codes: nil, + # What the poster is trying to accomplish with a workforce bounty. Used for + # product taxonomy and analytics, separate from the bounty's implementation type. + business_goal_type: nil, # An optional experience to scope the bounty to. experience_id: nil, # The user (user*\*) or company (biz*\*) tag whose balance funds this bounty pool. @@ -101,6 +143,14 @@ module WhopSDK # Optional title for the anchor forum post. Falls back to the bounty title when # omitted. post_title: nil, + # How often a scheduled bounty republishes a new bounty. + scheduled_frequency: nil, + # When to publish the bounty. When provided, the bounty is created as a hidden + # draft and published at this time instead of immediately. Must be in the future. + scheduled_publish_at: nil, + # The IANA timezone used for recurring occurrences. Required when + # scheduled_publish_at is provided. + scheduled_timezone: nil, request_options: {} ) end @@ -114,16 +164,126 @@ module WhopSDK title: String, accepted_submissions_limit: T.nilable(Integer), allowed_country_codes: T.nilable(T::Array[String]), + business_goal_type: + T.nilable( + WhopSDK::BountyCreateParams::BusinessGoalType::OrSymbol + ), experience_id: T.nilable(String), origin_account_id: T.nilable(String), post_markdown_content: T.nilable(String), post_title: T.nilable(String), + scheduled_frequency: + T.nilable( + WhopSDK::BountyCreateParams::ScheduledFrequency::OrSymbol + ), + scheduled_publish_at: T.nilable(Time), + scheduled_timezone: T.nilable(String), request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # What the poster is trying to accomplish with a workforce bounty. Used for + # product taxonomy and analytics, separate from the bounty's implementation type. + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::BountyCreateParams::BusinessGoalType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLIPPING = + T.let( + :clipping, + WhopSDK::BountyCreateParams::BusinessGoalType::TaggedSymbol + ) + POST_ENGAGEMENT = + T.let( + :post_engagement, + WhopSDK::BountyCreateParams::BusinessGoalType::TaggedSymbol + ) + OWNED_ACCOUNT_GROWTH = + T.let( + :owned_account_growth, + WhopSDK::BountyCreateParams::BusinessGoalType::TaggedSymbol + ) + UGC_CONTENT = + T.let( + :ugc_content, + WhopSDK::BountyCreateParams::BusinessGoalType::TaggedSymbol + ) + LOCAL_ACTIVATION = + T.let( + :local_activation, + WhopSDK::BountyCreateParams::BusinessGoalType::TaggedSymbol + ) + OTHER = + T.let( + :other, + WhopSDK::BountyCreateParams::BusinessGoalType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::BountyCreateParams::BusinessGoalType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # How often a scheduled bounty republishes a new bounty. + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::BountyCreateParams::ScheduledFrequency) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONCE = + T.let( + :once, + WhopSDK::BountyCreateParams::ScheduledFrequency::TaggedSymbol + ) + HOURLY = + T.let( + :hourly, + WhopSDK::BountyCreateParams::ScheduledFrequency::TaggedSymbol + ) + DAILY = + T.let( + :daily, + WhopSDK::BountyCreateParams::ScheduledFrequency::TaggedSymbol + ) + WEEKLY = + T.let( + :weekly, + WhopSDK::BountyCreateParams::ScheduledFrequency::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + WhopSDK::BountyCreateParams::ScheduledFrequency::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::BountyCreateParams::ScheduledFrequency::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/bounty_create_response.rbi b/rbi/whop_sdk/models/bounty_create_response.rbi index f462e89d..80fb6b38 100644 --- a/rbi/whop_sdk/models/bounty_create_response.rbi +++ b/rbi/whop_sdk/models/bounty_create_response.rbi @@ -180,6 +180,11 @@ module WhopSDK :archived, WhopSDK::Models::BountyCreateResponse::Status::TaggedSymbol ) + SCHEDULED = + T.let( + :scheduled, + WhopSDK::Models::BountyCreateResponse::Status::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/whop_sdk/models/bounty_list_params.rbi b/rbi/whop_sdk/models/bounty_list_params.rbi index e739ebdd..89fe9657 100644 --- a/rbi/whop_sdk/models/bounty_list_params.rbi +++ b/rbi/whop_sdk/models/bounty_list_params.rbi @@ -101,6 +101,8 @@ module WhopSDK T.let(:published, WhopSDK::BountyListParams::Status::TaggedSymbol) ARCHIVED = T.let(:archived, WhopSDK::BountyListParams::Status::TaggedSymbol) + SCHEDULED = + T.let(:scheduled, WhopSDK::BountyListParams::Status::TaggedSymbol) sig do override.returns( diff --git a/rbi/whop_sdk/models/bounty_list_response.rbi b/rbi/whop_sdk/models/bounty_list_response.rbi index 5a11198b..6c4dbb76 100644 --- a/rbi/whop_sdk/models/bounty_list_response.rbi +++ b/rbi/whop_sdk/models/bounty_list_response.rbi @@ -175,6 +175,11 @@ module WhopSDK :archived, WhopSDK::Models::BountyListResponse::Status::TaggedSymbol ) + SCHEDULED = + T.let( + :scheduled, + WhopSDK::Models::BountyListResponse::Status::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/whop_sdk/models/bounty_retrieve_response.rbi b/rbi/whop_sdk/models/bounty_retrieve_response.rbi index 6c03f901..a43144ed 100644 --- a/rbi/whop_sdk/models/bounty_retrieve_response.rbi +++ b/rbi/whop_sdk/models/bounty_retrieve_response.rbi @@ -183,6 +183,11 @@ module WhopSDK :archived, WhopSDK::Models::BountyRetrieveResponse::Status::TaggedSymbol ) + SCHEDULED = + T.let( + :scheduled, + WhopSDK::Models::BountyRetrieveResponse::Status::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/whop_sdk/models/card_brands.rbi b/rbi/whop_sdk/models/card_brands.rbi index e535f5a9..012e89bc 100644 --- a/rbi/whop_sdk/models/card_brands.rbi +++ b/rbi/whop_sdk/models/card_brands.rbi @@ -51,6 +51,7 @@ module WhopSDK HIPERCARD = T.let(:hipercard, WhopSDK::CardBrands::TaggedSymbol) JCBLANKAPAY = T.let(:jcblankapay, WhopSDK::CardBrands::TaggedSymbol) CMI = T.let(:cmi, WhopSDK::CardBrands::TaggedSymbol) + AURA = T.let(:aura, WhopSDK::CardBrands::TaggedSymbol) UNKNOWN = T.let(:unknown, WhopSDK::CardBrands::TaggedSymbol) sig { override.returns(T::Array[WhopSDK::CardBrands::TaggedSymbol]) } diff --git a/rbi/whop_sdk/models/card_create_params.rbi b/rbi/whop_sdk/models/card_create_params.rbi new file mode 100644 index 00000000..2c4596a2 --- /dev/null +++ b/rbi/whop_sdk/models/card_create_params.rbi @@ -0,0 +1,167 @@ +# typed: strong + +module WhopSDK + module Models + class CardCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::CardCreateParams, 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 + + # The company member (a user\_ identifier) to assign the card to. Required for + # company (business) card issuing accounts. + sig { returns(T.nilable(String)) } + attr_reader :assigned_user_id + + sig { params(assigned_user_id: String).void } + attr_writer :assigned_user_id + + # A display name for the card. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # Spending limit amount, in dollars. + sig { returns(T.nilable(Float)) } + attr_reader :spend_limit + + sig { params(spend_limit: Float).void } + attr_writer :spend_limit + + # The spending limit window. + sig do + returns( + T.nilable(WhopSDK::CardCreateParams::SpendLimitFrequency::OrSymbol) + ) + end + attr_reader :spend_limit_frequency + + sig do + params( + spend_limit_frequency: + WhopSDK::CardCreateParams::SpendLimitFrequency::OrSymbol + ).void + end + attr_writer :spend_limit_frequency + + # Per-transaction limit amount, in dollars. + sig { returns(T.nilable(Float)) } + attr_reader :transaction_limit + + sig { params(transaction_limit: Float).void } + attr_writer :transaction_limit + + # 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, + assigned_user_id: String, + name: String, + spend_limit: Float, + spend_limit_frequency: + WhopSDK::CardCreateParams::SpendLimitFrequency::OrSymbol, + transaction_limit: Float, + 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, + # The company member (a user\_ identifier) to assign the card to. Required for + # company (business) card issuing accounts. + assigned_user_id: nil, + # A display name for the card. + name: nil, + # Spending limit amount, in dollars. + spend_limit: nil, + # The spending limit window. + spend_limit_frequency: nil, + # Per-transaction limit amount, in dollars. + transaction_limit: 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, + assigned_user_id: String, + name: String, + spend_limit: Float, + spend_limit_frequency: + WhopSDK::CardCreateParams::SpendLimitFrequency::OrSymbol, + transaction_limit: Float, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # The spending limit window. + module SpendLimitFrequency + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::CardCreateParams::SpendLimitFrequency) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAILY = + T.let( + :daily, + WhopSDK::CardCreateParams::SpendLimitFrequency::TaggedSymbol + ) + WEEKLY = + T.let( + :weekly, + WhopSDK::CardCreateParams::SpendLimitFrequency::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + WhopSDK::CardCreateParams::SpendLimitFrequency::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + WhopSDK::CardCreateParams::SpendLimitFrequency::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::CardCreateParams::SpendLimitFrequency::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/card_create_response.rbi b/rbi/whop_sdk/models/card_create_response.rbi new file mode 100644 index 00000000..aaf5196c --- /dev/null +++ b/rbi/whop_sdk/models/card_create_response.rbi @@ -0,0 +1,446 @@ +# typed: strong + +module WhopSDK + module Models + class CardCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::CardCreateResponse, WhopSDK::Internal::AnyHash) + end + + # Card ID, prefixed `icrd_`. + sig { returns(String) } + attr_accessor :id + + # The billing address. + sig { returns(T.nilable(WhopSDK::Models::CardCreateResponse::Billing)) } + attr_reader :billing + + sig do + params( + billing: + T.nilable(WhopSDK::Models::CardCreateResponse::Billing::OrHash) + ).void + end + attr_writer :billing + + # When the card was canceled. + sig { returns(T.nilable(Time)) } + attr_accessor :canceled_at + + # When the card was created. + sig { returns(T.nilable(Time)) } + attr_accessor :created_at + + # Card expiration month. + sig { returns(T.nilable(String)) } + attr_accessor :expiration_month + + # Card expiration year. + sig { returns(T.nilable(String)) } + attr_accessor :expiration_year + + # Last four digits of the card number. `null` for pending invitation cards. + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + # The spending limit configuration. + sig { returns(T.nilable(WhopSDK::Models::CardCreateResponse::Limit)) } + attr_reader :limit + + sig do + params( + limit: T.nilable(WhopSDK::Models::CardCreateResponse::Limit::OrHash) + ).void + end + attr_writer :limit + + # Card display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(WhopSDK::Models::CardCreateResponse::Object::TaggedSymbol) } + attr_accessor :object + + # Total spend in the last 30 days, in cents. + sig { returns(T.nilable(Integer)) } + attr_accessor :spent_last_month + + # The card status. + sig do + returns( + T.nilable(WhopSDK::Models::CardCreateResponse::Status::TaggedSymbol) + ) + end + attr_accessor :status + + # The card type. + sig do + returns( + T.nilable(WhopSDK::Models::CardCreateResponse::Type::TaggedSymbol) + ) + end + attr_accessor :type + + # Cardholder user ID, prefixed `user_`, when assigned. + sig { returns(T.nilable(String)) } + attr_accessor :user_id + + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + sig { returns(T.nilable(WhopSDK::Models::CardCreateResponse::Secrets)) } + attr_reader :secrets + + sig do + params( + secrets: + T.nilable(WhopSDK::Models::CardCreateResponse::Secrets::OrHash) + ).void + end + attr_writer :secrets + + sig do + params( + id: String, + billing: + T.nilable(WhopSDK::Models::CardCreateResponse::Billing::OrHash), + canceled_at: T.nilable(Time), + created_at: T.nilable(Time), + expiration_month: T.nilable(String), + expiration_year: T.nilable(String), + last4: T.nilable(String), + limit: T.nilable(WhopSDK::Models::CardCreateResponse::Limit::OrHash), + name: T.nilable(String), + object: WhopSDK::Models::CardCreateResponse::Object::OrSymbol, + spent_last_month: T.nilable(Integer), + status: + T.nilable(WhopSDK::Models::CardCreateResponse::Status::OrSymbol), + type: T.nilable(WhopSDK::Models::CardCreateResponse::Type::OrSymbol), + user_id: T.nilable(String), + secrets: + T.nilable(WhopSDK::Models::CardCreateResponse::Secrets::OrHash) + ).returns(T.attached_class) + end + def self.new( + # Card ID, prefixed `icrd_`. + id:, + # The billing address. + billing:, + # When the card was canceled. + canceled_at:, + # When the card was created. + created_at:, + # Card expiration month. + expiration_month:, + # Card expiration year. + expiration_year:, + # Last four digits of the card number. `null` for pending invitation cards. + last4:, + # The spending limit configuration. + limit:, + # Card display name. + name:, + object:, + # Total spend in the last 30 days, in cents. + spent_last_month:, + # The card status. + status:, + # The card type. + type:, + # Cardholder user ID, prefixed `user_`, when assigned. + user_id:, + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + secrets: nil + ) + end + + sig do + override.returns( + { + id: String, + billing: T.nilable(WhopSDK::Models::CardCreateResponse::Billing), + canceled_at: T.nilable(Time), + created_at: T.nilable(Time), + expiration_month: T.nilable(String), + expiration_year: T.nilable(String), + last4: T.nilable(String), + limit: T.nilable(WhopSDK::Models::CardCreateResponse::Limit), + name: T.nilable(String), + object: WhopSDK::Models::CardCreateResponse::Object::TaggedSymbol, + spent_last_month: T.nilable(Integer), + status: + T.nilable( + WhopSDK::Models::CardCreateResponse::Status::TaggedSymbol + ), + type: + T.nilable( + WhopSDK::Models::CardCreateResponse::Type::TaggedSymbol + ), + user_id: T.nilable(String), + secrets: T.nilable(WhopSDK::Models::CardCreateResponse::Secrets) + } + ) + end + def to_hash + end + + class Billing < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardCreateResponse::Billing, + WhopSDK::Internal::AnyHash + ) + end + + # Billing city. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Billing country code. + sig { returns(T.nilable(String)) } + attr_accessor :country_code + + # Street address line 1. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # Street address line 2. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Billing postal code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Billing region or state. + sig { returns(T.nilable(String)) } + attr_accessor :region + + # The billing address. + sig do + params( + city: T.nilable(String), + country_code: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + region: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Billing city. + city:, + # Billing country code. + country_code:, + # Street address line 1. + line1:, + # Street address line 2. + line2:, + # Billing postal code. + postal_code:, + # Billing region or state. + region: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country_code: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + region: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Limit < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardCreateResponse::Limit, + WhopSDK::Internal::AnyHash + ) + end + + # The limit amount in dollars. + sig { returns(Float) } + attr_accessor :amount + + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + sig { returns(String) } + attr_accessor :frequency + + # The spending limit configuration. + sig do + params(amount: Float, frequency: String).returns(T.attached_class) + end + def self.new( + # The limit amount in dollars. + amount:, + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + frequency: + ) + end + + sig { override.returns({ amount: Float, frequency: String }) } + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardCreateResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :card, + WhopSDK::Models::CardCreateResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::CardCreateResponse::Object::TaggedSymbol] + ) + end + def self.values + end + end + + # The card status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardCreateResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::CardCreateResponse::Status::TaggedSymbol + ) + FROZEN = + T.let( + :frozen, + WhopSDK::Models::CardCreateResponse::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::CardCreateResponse::Status::TaggedSymbol + ) + INVITED = + T.let( + :invited, + WhopSDK::Models::CardCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::CardCreateResponse::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # The card type. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardCreateResponse::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIRTUAL = + T.let( + :virtual, + WhopSDK::Models::CardCreateResponse::Type::TaggedSymbol + ) + PHYSICAL = + T.let( + :physical, + WhopSDK::Models::CardCreateResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::CardCreateResponse::Type::TaggedSymbol] + ) + end + def self.values + end + end + + class Secrets < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardCreateResponse::Secrets, + WhopSDK::Internal::AnyHash + ) + end + + # Full card number. + sig { returns(String) } + attr_accessor :card_number + + # Card verification code. + sig { returns(String) } + attr_accessor :cvc + + # Cardholder name printed on the card. + sig { returns(T.nilable(String)) } + attr_accessor :name_on_card + + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + sig do + params( + card_number: String, + cvc: String, + name_on_card: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Full card number. + card_number:, + # Card verification code. + cvc:, + # Cardholder name printed on the card. + name_on_card: + ) + end + + sig do + override.returns( + { + card_number: String, + cvc: String, + name_on_card: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/card_list_params.rbi b/rbi/whop_sdk/models/card_list_params.rbi new file mode 100644 index 00000000..6c718ac3 --- /dev/null +++ b/rbi/whop_sdk/models/card_list_params.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module WhopSDK + module Models + class CardListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::CardListParams, 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 + + # 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, + 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, + # 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, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/card_list_response.rbi b/rbi/whop_sdk/models/card_list_response.rbi new file mode 100644 index 00000000..d4cbd734 --- /dev/null +++ b/rbi/whop_sdk/models/card_list_response.rbi @@ -0,0 +1,511 @@ +# typed: strong + +module WhopSDK + module Models + class CardListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::CardListResponse, WhopSDK::Internal::AnyHash) + end + + sig { returns(T::Array[WhopSDK::Models::CardListResponse::Data]) } + attr_accessor :data + + sig do + params( + data: T::Array[WhopSDK::Models::CardListResponse::Data::OrHash] + ).returns(T.attached_class) + end + def self.new(data:) + end + + sig do + override.returns( + { data: T::Array[WhopSDK::Models::CardListResponse::Data] } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardListResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + # Card ID, prefixed `icrd_`. + sig { returns(String) } + attr_accessor :id + + # The billing address. + sig do + returns(T.nilable(WhopSDK::Models::CardListResponse::Data::Billing)) + end + attr_reader :billing + + sig do + params( + billing: + T.nilable( + WhopSDK::Models::CardListResponse::Data::Billing::OrHash + ) + ).void + end + attr_writer :billing + + # When the card was canceled. + sig { returns(T.nilable(Time)) } + attr_accessor :canceled_at + + # When the card was created. + sig { returns(T.nilable(Time)) } + attr_accessor :created_at + + # Card expiration month. + sig { returns(T.nilable(String)) } + attr_accessor :expiration_month + + # Card expiration year. + sig { returns(T.nilable(String)) } + attr_accessor :expiration_year + + # Last four digits of the card number. `null` for pending invitation cards. + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + # The spending limit configuration. + sig do + returns(T.nilable(WhopSDK::Models::CardListResponse::Data::Limit)) + end + attr_reader :limit + + sig do + params( + limit: + T.nilable(WhopSDK::Models::CardListResponse::Data::Limit::OrHash) + ).void + end + attr_writer :limit + + # Card display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + returns(WhopSDK::Models::CardListResponse::Data::Object::TaggedSymbol) + end + attr_accessor :object + + # Total spend in the last 30 days, in cents. + sig { returns(T.nilable(Integer)) } + attr_accessor :spent_last_month + + # The card status. + sig do + returns( + T.nilable( + WhopSDK::Models::CardListResponse::Data::Status::TaggedSymbol + ) + ) + end + attr_accessor :status + + # The card type. + sig do + returns( + T.nilable( + WhopSDK::Models::CardListResponse::Data::Type::TaggedSymbol + ) + ) + end + attr_accessor :type + + # Cardholder user ID, prefixed `user_`, when assigned. + sig { returns(T.nilable(String)) } + attr_accessor :user_id + + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + sig do + returns(T.nilable(WhopSDK::Models::CardListResponse::Data::Secrets)) + end + attr_reader :secrets + + sig do + params( + secrets: + T.nilable( + WhopSDK::Models::CardListResponse::Data::Secrets::OrHash + ) + ).void + end + attr_writer :secrets + + sig do + params( + id: String, + billing: + T.nilable( + WhopSDK::Models::CardListResponse::Data::Billing::OrHash + ), + canceled_at: T.nilable(Time), + created_at: T.nilable(Time), + expiration_month: T.nilable(String), + expiration_year: T.nilable(String), + last4: T.nilable(String), + limit: + T.nilable(WhopSDK::Models::CardListResponse::Data::Limit::OrHash), + name: T.nilable(String), + object: WhopSDK::Models::CardListResponse::Data::Object::OrSymbol, + spent_last_month: T.nilable(Integer), + status: + T.nilable( + WhopSDK::Models::CardListResponse::Data::Status::OrSymbol + ), + type: + T.nilable( + WhopSDK::Models::CardListResponse::Data::Type::OrSymbol + ), + user_id: T.nilable(String), + secrets: + T.nilable( + WhopSDK::Models::CardListResponse::Data::Secrets::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # Card ID, prefixed `icrd_`. + id:, + # The billing address. + billing:, + # When the card was canceled. + canceled_at:, + # When the card was created. + created_at:, + # Card expiration month. + expiration_month:, + # Card expiration year. + expiration_year:, + # Last four digits of the card number. `null` for pending invitation cards. + last4:, + # The spending limit configuration. + limit:, + # Card display name. + name:, + object:, + # Total spend in the last 30 days, in cents. + spent_last_month:, + # The card status. + status:, + # The card type. + type:, + # Cardholder user ID, prefixed `user_`, when assigned. + user_id:, + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + secrets: nil + ) + end + + sig do + override.returns( + { + id: String, + billing: + T.nilable(WhopSDK::Models::CardListResponse::Data::Billing), + canceled_at: T.nilable(Time), + created_at: T.nilable(Time), + expiration_month: T.nilable(String), + expiration_year: T.nilable(String), + last4: T.nilable(String), + limit: T.nilable(WhopSDK::Models::CardListResponse::Data::Limit), + name: T.nilable(String), + object: + WhopSDK::Models::CardListResponse::Data::Object::TaggedSymbol, + spent_last_month: T.nilable(Integer), + status: + T.nilable( + WhopSDK::Models::CardListResponse::Data::Status::TaggedSymbol + ), + type: + T.nilable( + WhopSDK::Models::CardListResponse::Data::Type::TaggedSymbol + ), + user_id: T.nilable(String), + secrets: + T.nilable(WhopSDK::Models::CardListResponse::Data::Secrets) + } + ) + end + def to_hash + end + + class Billing < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardListResponse::Data::Billing, + WhopSDK::Internal::AnyHash + ) + end + + # Billing city. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Billing country code. + sig { returns(T.nilable(String)) } + attr_accessor :country_code + + # Street address line 1. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # Street address line 2. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Billing postal code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Billing region or state. + sig { returns(T.nilable(String)) } + attr_accessor :region + + # The billing address. + sig do + params( + city: T.nilable(String), + country_code: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + region: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Billing city. + city:, + # Billing country code. + country_code:, + # Street address line 1. + line1:, + # Street address line 2. + line2:, + # Billing postal code. + postal_code:, + # Billing region or state. + region: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country_code: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + region: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Limit < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardListResponse::Data::Limit, + WhopSDK::Internal::AnyHash + ) + end + + # The limit amount in dollars. + sig { returns(Float) } + attr_accessor :amount + + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + sig { returns(String) } + attr_accessor :frequency + + # The spending limit configuration. + sig do + params(amount: Float, frequency: String).returns(T.attached_class) + end + def self.new( + # The limit amount in dollars. + amount:, + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + frequency: + ) + end + + sig { override.returns({ amount: Float, frequency: String }) } + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardListResponse::Data::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :card, + WhopSDK::Models::CardListResponse::Data::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::CardListResponse::Data::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The card status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardListResponse::Data::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::CardListResponse::Data::Status::TaggedSymbol + ) + FROZEN = + T.let( + :frozen, + WhopSDK::Models::CardListResponse::Data::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::CardListResponse::Data::Status::TaggedSymbol + ) + INVITED = + T.let( + :invited, + WhopSDK::Models::CardListResponse::Data::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::CardListResponse::Data::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The card type. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardListResponse::Data::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIRTUAL = + T.let( + :virtual, + WhopSDK::Models::CardListResponse::Data::Type::TaggedSymbol + ) + PHYSICAL = + T.let( + :physical, + WhopSDK::Models::CardListResponse::Data::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::CardListResponse::Data::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Secrets < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardListResponse::Data::Secrets, + WhopSDK::Internal::AnyHash + ) + end + + # Full card number. + sig { returns(String) } + attr_accessor :card_number + + # Card verification code. + sig { returns(String) } + attr_accessor :cvc + + # Cardholder name printed on the card. + sig { returns(T.nilable(String)) } + attr_accessor :name_on_card + + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + sig do + params( + card_number: String, + cvc: String, + name_on_card: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Full card number. + card_number:, + # Card verification code. + cvc:, + # Cardholder name printed on the card. + name_on_card: + ) + end + + sig do + override.returns( + { + card_number: String, + cvc: String, + name_on_card: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/card_retrieve_params.rbi b/rbi/whop_sdk/models/card_retrieve_params.rbi new file mode 100644 index 00000000..aac43284 --- /dev/null +++ b/rbi/whop_sdk/models/card_retrieve_params.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module WhopSDK + module Models + class CardRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::CardRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_id + + # 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 + + # 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( + card_id: String, + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_id:, + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_id: String, + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/card_retrieve_response.rbi b/rbi/whop_sdk/models/card_retrieve_response.rbi new file mode 100644 index 00000000..40ae9d06 --- /dev/null +++ b/rbi/whop_sdk/models/card_retrieve_response.rbi @@ -0,0 +1,457 @@ +# typed: strong + +module WhopSDK + module Models + class CardRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Card ID, prefixed `icrd_`. + sig { returns(String) } + attr_accessor :id + + # The billing address. + sig { returns(T.nilable(WhopSDK::Models::CardRetrieveResponse::Billing)) } + attr_reader :billing + + sig do + params( + billing: + T.nilable(WhopSDK::Models::CardRetrieveResponse::Billing::OrHash) + ).void + end + attr_writer :billing + + # When the card was canceled. + sig { returns(T.nilable(Time)) } + attr_accessor :canceled_at + + # When the card was created. + sig { returns(T.nilable(Time)) } + attr_accessor :created_at + + # Card expiration month. + sig { returns(T.nilable(String)) } + attr_accessor :expiration_month + + # Card expiration year. + sig { returns(T.nilable(String)) } + attr_accessor :expiration_year + + # Last four digits of the card number. `null` for pending invitation cards. + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + # The spending limit configuration. + sig { returns(T.nilable(WhopSDK::Models::CardRetrieveResponse::Limit)) } + attr_reader :limit + + sig do + params( + limit: T.nilable(WhopSDK::Models::CardRetrieveResponse::Limit::OrHash) + ).void + end + attr_writer :limit + + # Card display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + returns(WhopSDK::Models::CardRetrieveResponse::Object::TaggedSymbol) + end + attr_accessor :object + + # Total spend in the last 30 days, in cents. + sig { returns(T.nilable(Integer)) } + attr_accessor :spent_last_month + + # The card status. + sig do + returns( + T.nilable(WhopSDK::Models::CardRetrieveResponse::Status::TaggedSymbol) + ) + end + attr_accessor :status + + # The card type. + sig do + returns( + T.nilable(WhopSDK::Models::CardRetrieveResponse::Type::TaggedSymbol) + ) + end + attr_accessor :type + + # Cardholder user ID, prefixed `user_`, when assigned. + sig { returns(T.nilable(String)) } + attr_accessor :user_id + + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + sig { returns(T.nilable(WhopSDK::Models::CardRetrieveResponse::Secrets)) } + attr_reader :secrets + + sig do + params( + secrets: + T.nilable(WhopSDK::Models::CardRetrieveResponse::Secrets::OrHash) + ).void + end + attr_writer :secrets + + sig do + params( + id: String, + billing: + T.nilable(WhopSDK::Models::CardRetrieveResponse::Billing::OrHash), + canceled_at: T.nilable(Time), + created_at: T.nilable(Time), + expiration_month: T.nilable(String), + expiration_year: T.nilable(String), + last4: T.nilable(String), + limit: + T.nilable(WhopSDK::Models::CardRetrieveResponse::Limit::OrHash), + name: T.nilable(String), + object: WhopSDK::Models::CardRetrieveResponse::Object::OrSymbol, + spent_last_month: T.nilable(Integer), + status: + T.nilable(WhopSDK::Models::CardRetrieveResponse::Status::OrSymbol), + type: + T.nilable(WhopSDK::Models::CardRetrieveResponse::Type::OrSymbol), + user_id: T.nilable(String), + secrets: + T.nilable(WhopSDK::Models::CardRetrieveResponse::Secrets::OrHash) + ).returns(T.attached_class) + end + def self.new( + # Card ID, prefixed `icrd_`. + id:, + # The billing address. + billing:, + # When the card was canceled. + canceled_at:, + # When the card was created. + created_at:, + # Card expiration month. + expiration_month:, + # Card expiration year. + expiration_year:, + # Last four digits of the card number. `null` for pending invitation cards. + last4:, + # The spending limit configuration. + limit:, + # Card display name. + name:, + object:, + # Total spend in the last 30 days, in cents. + spent_last_month:, + # The card status. + status:, + # The card type. + type:, + # Cardholder user ID, prefixed `user_`, when assigned. + user_id:, + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + secrets: nil + ) + end + + sig do + override.returns( + { + id: String, + billing: T.nilable(WhopSDK::Models::CardRetrieveResponse::Billing), + canceled_at: T.nilable(Time), + created_at: T.nilable(Time), + expiration_month: T.nilable(String), + expiration_year: T.nilable(String), + last4: T.nilable(String), + limit: T.nilable(WhopSDK::Models::CardRetrieveResponse::Limit), + name: T.nilable(String), + object: WhopSDK::Models::CardRetrieveResponse::Object::TaggedSymbol, + spent_last_month: T.nilable(Integer), + status: + T.nilable( + WhopSDK::Models::CardRetrieveResponse::Status::TaggedSymbol + ), + type: + T.nilable( + WhopSDK::Models::CardRetrieveResponse::Type::TaggedSymbol + ), + user_id: T.nilable(String), + secrets: T.nilable(WhopSDK::Models::CardRetrieveResponse::Secrets) + } + ) + end + def to_hash + end + + class Billing < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardRetrieveResponse::Billing, + WhopSDK::Internal::AnyHash + ) + end + + # Billing city. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Billing country code. + sig { returns(T.nilable(String)) } + attr_accessor :country_code + + # Street address line 1. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # Street address line 2. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Billing postal code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Billing region or state. + sig { returns(T.nilable(String)) } + attr_accessor :region + + # The billing address. + sig do + params( + city: T.nilable(String), + country_code: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + region: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Billing city. + city:, + # Billing country code. + country_code:, + # Street address line 1. + line1:, + # Street address line 2. + line2:, + # Billing postal code. + postal_code:, + # Billing region or state. + region: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country_code: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + region: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Limit < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardRetrieveResponse::Limit, + WhopSDK::Internal::AnyHash + ) + end + + # The limit amount in dollars. + sig { returns(Float) } + attr_accessor :amount + + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + sig { returns(String) } + attr_accessor :frequency + + # The spending limit configuration. + sig do + params(amount: Float, frequency: String).returns(T.attached_class) + end + def self.new( + # The limit amount in dollars. + amount:, + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + frequency: + ) + end + + sig { override.returns({ amount: Float, frequency: String }) } + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardRetrieveResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :card, + WhopSDK::Models::CardRetrieveResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::CardRetrieveResponse::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The card status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardRetrieveResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::CardRetrieveResponse::Status::TaggedSymbol + ) + FROZEN = + T.let( + :frozen, + WhopSDK::Models::CardRetrieveResponse::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::CardRetrieveResponse::Status::TaggedSymbol + ) + INVITED = + T.let( + :invited, + WhopSDK::Models::CardRetrieveResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::CardRetrieveResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The card type. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardRetrieveResponse::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIRTUAL = + T.let( + :virtual, + WhopSDK::Models::CardRetrieveResponse::Type::TaggedSymbol + ) + PHYSICAL = + T.let( + :physical, + WhopSDK::Models::CardRetrieveResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::CardRetrieveResponse::Type::TaggedSymbol] + ) + end + def self.values + end + end + + class Secrets < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardRetrieveResponse::Secrets, + WhopSDK::Internal::AnyHash + ) + end + + # Full card number. + sig { returns(String) } + attr_accessor :card_number + + # Card verification code. + sig { returns(String) } + attr_accessor :cvc + + # Cardholder name printed on the card. + sig { returns(T.nilable(String)) } + attr_accessor :name_on_card + + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + sig do + params( + card_number: String, + cvc: String, + name_on_card: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Full card number. + card_number:, + # Card verification code. + cvc:, + # Cardholder name printed on the card. + name_on_card: + ) + end + + sig do + override.returns( + { + card_number: String, + cvc: String, + name_on_card: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/card_update_params.rbi b/rbi/whop_sdk/models/card_update_params.rbi new file mode 100644 index 00000000..06d84686 --- /dev/null +++ b/rbi/whop_sdk/models/card_update_params.rbi @@ -0,0 +1,299 @@ +# typed: strong + +module WhopSDK + module Models + class CardUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::CardUpdateParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_id + + # 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 + + # New billing address. Requires line1, city, region, postal_code, and + # country_code. + sig { returns(T.nilable(WhopSDK::CardUpdateParams::Billing)) } + attr_reader :billing + + sig { params(billing: WhopSDK::CardUpdateParams::Billing::OrHash).void } + attr_writer :billing + + # Pass `true` to permanently cancel the card. A canceled card cannot be + # uncanceled. Cannot be combined with other fields. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :canceled + + sig { params(canceled: T::Boolean).void } + attr_writer :canceled + + # Pass `true` to freeze the card, `false` to unfreeze it. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :frozen + + sig { params(frozen: T::Boolean).void } + attr_writer :frozen + + # A display name for the card. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # New 4-digit PIN. Can only be set on a card assigned to the acting user. + sig { returns(T.nilable(String)) } + attr_reader :pin + + sig { params(pin: String).void } + attr_writer :pin + + # Pass `true` to remove the spending limit (make the card unlimited). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :remove_limit + + sig { params(remove_limit: T::Boolean).void } + attr_writer :remove_limit + + # Spending limit amount, in dollars. + sig { returns(T.nilable(Float)) } + attr_reader :spend_limit + + sig { params(spend_limit: Float).void } + attr_writer :spend_limit + + # The spending limit window. + sig do + returns( + T.nilable(WhopSDK::CardUpdateParams::SpendLimitFrequency::OrSymbol) + ) + end + attr_reader :spend_limit_frequency + + sig do + params( + spend_limit_frequency: + WhopSDK::CardUpdateParams::SpendLimitFrequency::OrSymbol + ).void + end + attr_writer :spend_limit_frequency + + # Per-transaction limit amount, in dollars. + sig { returns(T.nilable(Float)) } + attr_reader :transaction_limit + + sig { params(transaction_limit: Float).void } + attr_writer :transaction_limit + + # 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( + card_id: String, + account_id: String, + billing: WhopSDK::CardUpdateParams::Billing::OrHash, + canceled: T::Boolean, + frozen: T::Boolean, + name: String, + pin: String, + remove_limit: T::Boolean, + spend_limit: Float, + spend_limit_frequency: + WhopSDK::CardUpdateParams::SpendLimitFrequency::OrSymbol, + transaction_limit: Float, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_id:, + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # New billing address. Requires line1, city, region, postal_code, and + # country_code. + billing: nil, + # Pass `true` to permanently cancel the card. A canceled card cannot be + # uncanceled. Cannot be combined with other fields. + canceled: nil, + # Pass `true` to freeze the card, `false` to unfreeze it. + frozen: nil, + # A display name for the card. + name: nil, + # New 4-digit PIN. Can only be set on a card assigned to the acting user. + pin: nil, + # Pass `true` to remove the spending limit (make the card unlimited). + remove_limit: nil, + # Spending limit amount, in dollars. + spend_limit: nil, + # The spending limit window. + spend_limit_frequency: nil, + # Per-transaction limit amount, in dollars. + transaction_limit: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_id: String, + account_id: String, + billing: WhopSDK::CardUpdateParams::Billing, + canceled: T::Boolean, + frozen: T::Boolean, + name: String, + pin: String, + remove_limit: T::Boolean, + spend_limit: Float, + spend_limit_frequency: + WhopSDK::CardUpdateParams::SpendLimitFrequency::OrSymbol, + transaction_limit: Float, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + class Billing < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::CardUpdateParams::Billing, + WhopSDK::Internal::AnyHash + ) + end + + # Billing city. + sig { returns(String) } + attr_accessor :city + + # Billing country code, ISO 3166-1 alpha-2. + sig { returns(String) } + attr_accessor :country_code + + # Street address line 1. + sig { returns(String) } + attr_accessor :line1 + + # Billing postal code. + sig { returns(String) } + attr_accessor :postal_code + + # Billing region or state. + sig { returns(String) } + attr_accessor :region + + # Street address line 2. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # New billing address. Requires line1, city, region, postal_code, and + # country_code. + sig do + params( + city: String, + country_code: String, + line1: String, + postal_code: String, + region: String, + line2: String + ).returns(T.attached_class) + end + def self.new( + # Billing city. + city:, + # Billing country code, ISO 3166-1 alpha-2. + country_code:, + # Street address line 1. + line1:, + # Billing postal code. + postal_code:, + # Billing region or state. + region:, + # Street address line 2. + line2: nil + ) + end + + sig do + override.returns( + { + city: String, + country_code: String, + line1: String, + postal_code: String, + region: String, + line2: String + } + ) + end + def to_hash + end + end + + # The spending limit window. + module SpendLimitFrequency + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::CardUpdateParams::SpendLimitFrequency) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAILY = + T.let( + :daily, + WhopSDK::CardUpdateParams::SpendLimitFrequency::TaggedSymbol + ) + WEEKLY = + T.let( + :weekly, + WhopSDK::CardUpdateParams::SpendLimitFrequency::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + WhopSDK::CardUpdateParams::SpendLimitFrequency::TaggedSymbol + ) + ONE_TIME = + T.let( + :one_time, + WhopSDK::CardUpdateParams::SpendLimitFrequency::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::CardUpdateParams::SpendLimitFrequency::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/card_update_response.rbi b/rbi/whop_sdk/models/card_update_response.rbi new file mode 100644 index 00000000..da0d7930 --- /dev/null +++ b/rbi/whop_sdk/models/card_update_response.rbi @@ -0,0 +1,446 @@ +# typed: strong + +module WhopSDK + module Models + class CardUpdateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::CardUpdateResponse, WhopSDK::Internal::AnyHash) + end + + # Card ID, prefixed `icrd_`. + sig { returns(String) } + attr_accessor :id + + # The billing address. + sig { returns(T.nilable(WhopSDK::Models::CardUpdateResponse::Billing)) } + attr_reader :billing + + sig do + params( + billing: + T.nilable(WhopSDK::Models::CardUpdateResponse::Billing::OrHash) + ).void + end + attr_writer :billing + + # When the card was canceled. + sig { returns(T.nilable(Time)) } + attr_accessor :canceled_at + + # When the card was created. + sig { returns(T.nilable(Time)) } + attr_accessor :created_at + + # Card expiration month. + sig { returns(T.nilable(String)) } + attr_accessor :expiration_month + + # Card expiration year. + sig { returns(T.nilable(String)) } + attr_accessor :expiration_year + + # Last four digits of the card number. `null` for pending invitation cards. + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + # The spending limit configuration. + sig { returns(T.nilable(WhopSDK::Models::CardUpdateResponse::Limit)) } + attr_reader :limit + + sig do + params( + limit: T.nilable(WhopSDK::Models::CardUpdateResponse::Limit::OrHash) + ).void + end + attr_writer :limit + + # Card display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(WhopSDK::Models::CardUpdateResponse::Object::TaggedSymbol) } + attr_accessor :object + + # Total spend in the last 30 days, in cents. + sig { returns(T.nilable(Integer)) } + attr_accessor :spent_last_month + + # The card status. + sig do + returns( + T.nilable(WhopSDK::Models::CardUpdateResponse::Status::TaggedSymbol) + ) + end + attr_accessor :status + + # The card type. + sig do + returns( + T.nilable(WhopSDK::Models::CardUpdateResponse::Type::TaggedSymbol) + ) + end + attr_accessor :type + + # Cardholder user ID, prefixed `user_`, when assigned. + sig { returns(T.nilable(String)) } + attr_accessor :user_id + + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + sig { returns(T.nilable(WhopSDK::Models::CardUpdateResponse::Secrets)) } + attr_reader :secrets + + sig do + params( + secrets: + T.nilable(WhopSDK::Models::CardUpdateResponse::Secrets::OrHash) + ).void + end + attr_writer :secrets + + sig do + params( + id: String, + billing: + T.nilable(WhopSDK::Models::CardUpdateResponse::Billing::OrHash), + canceled_at: T.nilable(Time), + created_at: T.nilable(Time), + expiration_month: T.nilable(String), + expiration_year: T.nilable(String), + last4: T.nilable(String), + limit: T.nilable(WhopSDK::Models::CardUpdateResponse::Limit::OrHash), + name: T.nilable(String), + object: WhopSDK::Models::CardUpdateResponse::Object::OrSymbol, + spent_last_month: T.nilable(Integer), + status: + T.nilable(WhopSDK::Models::CardUpdateResponse::Status::OrSymbol), + type: T.nilable(WhopSDK::Models::CardUpdateResponse::Type::OrSymbol), + user_id: T.nilable(String), + secrets: + T.nilable(WhopSDK::Models::CardUpdateResponse::Secrets::OrHash) + ).returns(T.attached_class) + end + def self.new( + # Card ID, prefixed `icrd_`. + id:, + # The billing address. + billing:, + # When the card was canceled. + canceled_at:, + # When the card was created. + created_at:, + # Card expiration month. + expiration_month:, + # Card expiration year. + expiration_year:, + # Last four digits of the card number. `null` for pending invitation cards. + last4:, + # The spending limit configuration. + limit:, + # Card display name. + name:, + object:, + # Total spend in the last 30 days, in cents. + spent_last_month:, + # The card status. + status:, + # The card type. + type:, + # Cardholder user ID, prefixed `user_`, when assigned. + user_id:, + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + secrets: nil + ) + end + + sig do + override.returns( + { + id: String, + billing: T.nilable(WhopSDK::Models::CardUpdateResponse::Billing), + canceled_at: T.nilable(Time), + created_at: T.nilable(Time), + expiration_month: T.nilable(String), + expiration_year: T.nilable(String), + last4: T.nilable(String), + limit: T.nilable(WhopSDK::Models::CardUpdateResponse::Limit), + name: T.nilable(String), + object: WhopSDK::Models::CardUpdateResponse::Object::TaggedSymbol, + spent_last_month: T.nilable(Integer), + status: + T.nilable( + WhopSDK::Models::CardUpdateResponse::Status::TaggedSymbol + ), + type: + T.nilable( + WhopSDK::Models::CardUpdateResponse::Type::TaggedSymbol + ), + user_id: T.nilable(String), + secrets: T.nilable(WhopSDK::Models::CardUpdateResponse::Secrets) + } + ) + end + def to_hash + end + + class Billing < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardUpdateResponse::Billing, + WhopSDK::Internal::AnyHash + ) + end + + # Billing city. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Billing country code. + sig { returns(T.nilable(String)) } + attr_accessor :country_code + + # Street address line 1. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # Street address line 2. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Billing postal code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Billing region or state. + sig { returns(T.nilable(String)) } + attr_accessor :region + + # The billing address. + sig do + params( + city: T.nilable(String), + country_code: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + region: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Billing city. + city:, + # Billing country code. + country_code:, + # Street address line 1. + line1:, + # Street address line 2. + line2:, + # Billing postal code. + postal_code:, + # Billing region or state. + region: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country_code: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + region: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Limit < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardUpdateResponse::Limit, + WhopSDK::Internal::AnyHash + ) + end + + # The limit amount in dollars. + sig { returns(Float) } + attr_accessor :amount + + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + sig { returns(String) } + attr_accessor :frequency + + # The spending limit configuration. + sig do + params(amount: Float, frequency: String).returns(T.attached_class) + end + def self.new( + # The limit amount in dollars. + amount:, + # Limit window, for example `per24HourPeriod` or `perAuthorization`. + frequency: + ) + end + + sig { override.returns({ amount: Float, frequency: String }) } + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardUpdateResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :card, + WhopSDK::Models::CardUpdateResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::CardUpdateResponse::Object::TaggedSymbol] + ) + end + def self.values + end + end + + # The card status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardUpdateResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::CardUpdateResponse::Status::TaggedSymbol + ) + FROZEN = + T.let( + :frozen, + WhopSDK::Models::CardUpdateResponse::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::CardUpdateResponse::Status::TaggedSymbol + ) + INVITED = + T.let( + :invited, + WhopSDK::Models::CardUpdateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::CardUpdateResponse::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # The card type. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::CardUpdateResponse::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIRTUAL = + T.let( + :virtual, + WhopSDK::Models::CardUpdateResponse::Type::TaggedSymbol + ) + PHYSICAL = + T.let( + :physical, + WhopSDK::Models::CardUpdateResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::CardUpdateResponse::Type::TaggedSymbol] + ) + end + def self.values + end + end + + class Secrets < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CardUpdateResponse::Secrets, + WhopSDK::Internal::AnyHash + ) + end + + # Full card number. + sig { returns(String) } + attr_accessor :card_number + + # Card verification code. + sig { returns(String) } + attr_accessor :cvc + + # Cardholder name printed on the card. + sig { returns(T.nilable(String)) } + attr_accessor :name_on_card + + # Sensitive card details. Present only on `GET /cards/:card_id` for active cards; + # `null` when the card is inactive or details cannot be retrieved. + sig do + params( + card_number: String, + cvc: String, + name_on_card: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Full card number. + card_number:, + # Card verification code. + cvc:, + # Cardholder name printed on the card. + name_on_card: + ) + end + + sig do + override.returns( + { + card_number: String, + cvc: String, + name_on_card: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/chat_message_created_webhook_event.rbi b/rbi/whop_sdk/models/chat_message_created_webhook_event.rbi new file mode 100644 index 00000000..d708c4a8 --- /dev/null +++ b/rbi/whop_sdk/models/chat_message_created_webhook_event.rbi @@ -0,0 +1,319 @@ +# typed: strong + +module WhopSDK + module Models + class ChatMessageCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ChatMessageCreatedWebhookEvent, + WhopSDK::Internal::AnyHash + ) + end + + # A unique ID for every single webhook request + sig { returns(String) } + attr_accessor :id + + # The API version for this webhook + sig { returns(Symbol) } + attr_accessor :api_version + + sig { returns(WhopSDK::ChatMessageCreatedWebhookEvent::Data) } + attr_reader :data + + sig do + params(data: WhopSDK::ChatMessageCreatedWebhookEvent::Data::OrHash).void + end + attr_writer :data + + # The timestamp in ISO 8601 format that the webhook was sent at on the server + sig { returns(Time) } + attr_accessor :timestamp + + # The webhook event type + sig { returns(Symbol) } + attr_accessor :type + + # The company ID that this webhook event is associated with + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + sig do + params( + id: String, + data: WhopSDK::ChatMessageCreatedWebhookEvent::Data::OrHash, + timestamp: Time, + company_id: T.nilable(String), + api_version: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # A unique ID for every single webhook request + id:, + data:, + # The timestamp in ISO 8601 format that the webhook was sent at on the server + timestamp:, + # The company ID that this webhook event is associated with + company_id: nil, + # The API version for this webhook + api_version: :v1, + # The webhook event type + type: :"chat.message.created" + ) + end + + sig do + override.returns( + { + id: String, + api_version: Symbol, + data: WhopSDK::ChatMessageCreatedWebhookEvent::Data, + timestamp: Time, + type: Symbol, + company_id: T.nilable(String) + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ChatMessageCreatedWebhookEvent::Data, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience) } + attr_reader :audience + + sig do + params( + audience: + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::OrHash + ).void + end + attr_writer :audience + + sig { returns(WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel) } + attr_reader :channel + + sig do + params( + channel: + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::OrHash + ).void + end + attr_writer :channel + + # A message sent within an experience chat, direct message, or group chat. + sig { returns(WhopSDK::Message) } + attr_reader :message + + sig { params(message: WhopSDK::Message::OrHash).void } + attr_writer :message + + sig { returns(String) } + attr_accessor :reason + + sig do + params( + audience: + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::OrHash, + channel: + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::OrHash, + message: WhopSDK::Message::OrHash, + reason: String + ).returns(T.attached_class) + end + def self.new( + audience:, + channel:, + # A message sent within an experience chat, direct message, or group chat. + message:, + reason: + ) + end + + sig do + override.returns( + { + audience: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience, + channel: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel, + message: WhopSDK::Message, + reason: String + } + ) + end + def to_hash + end + + class Audience < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :user_ids + + sig do + params( + type: + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::Type::OrSymbol, + user_ids: T.nilable(T::Array[String]) + ).returns(T.attached_class) + end + def self.new(type:, user_ids: nil) + end + + sig do + override.returns( + { + type: + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol, + user_ids: T.nilable(T::Array[String]) + } + ) + end + def to_hash + end + + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHANNEL = + T.let( + :channel, + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol + ) + USERS = + T.let( + :users, + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Channel < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :experience_id + + sig do + params( + id: String, + type: + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type::OrSymbol, + experience_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, type:, experience_id: nil) + end + + sig do + override.returns( + { + id: String, + type: + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol, + experience_id: T.nilable(String) + } + ) + end + def to_hash + end + + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHAT = + T.let( + :chat, + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ) + SUPPORT = + T.let( + :support, + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/chat_reaction_created_webhook_event.rbi b/rbi/whop_sdk/models/chat_reaction_created_webhook_event.rbi new file mode 100644 index 00000000..37e9bfcc --- /dev/null +++ b/rbi/whop_sdk/models/chat_reaction_created_webhook_event.rbi @@ -0,0 +1,335 @@ +# typed: strong + +module WhopSDK + module Models + class ChatReactionCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ChatReactionCreatedWebhookEvent, + WhopSDK::Internal::AnyHash + ) + end + + # A unique ID for every single webhook request + sig { returns(String) } + attr_accessor :id + + # The API version for this webhook + sig { returns(Symbol) } + attr_accessor :api_version + + sig { returns(WhopSDK::ChatReactionCreatedWebhookEvent::Data) } + attr_reader :data + + sig do + params( + data: WhopSDK::ChatReactionCreatedWebhookEvent::Data::OrHash + ).void + end + attr_writer :data + + # The timestamp in ISO 8601 format that the webhook was sent at on the server + sig { returns(Time) } + attr_accessor :timestamp + + # The webhook event type + sig { returns(Symbol) } + attr_accessor :type + + # The company ID that this webhook event is associated with + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + sig do + params( + id: String, + data: WhopSDK::ChatReactionCreatedWebhookEvent::Data::OrHash, + timestamp: Time, + company_id: T.nilable(String), + api_version: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # A unique ID for every single webhook request + id:, + data:, + # The timestamp in ISO 8601 format that the webhook was sent at on the server + timestamp:, + # The company ID that this webhook event is associated with + company_id: nil, + # The API version for this webhook + api_version: :v1, + # The webhook event type + type: :"chat.reaction.created" + ) + end + + sig do + override.returns( + { + id: String, + api_version: Symbol, + data: WhopSDK::ChatReactionCreatedWebhookEvent::Data, + timestamp: Time, + type: Symbol, + company_id: T.nilable(String) + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ChatReactionCreatedWebhookEvent::Data, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns(WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience) + end + attr_reader :audience + + sig do + params( + audience: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::OrHash + ).void + end + attr_writer :audience + + sig { returns(WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel) } + attr_reader :channel + + sig do + params( + channel: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::OrHash + ).void + end + attr_writer :channel + + # A message sent within an experience chat, direct message, or group chat. + sig { returns(WhopSDK::Message) } + attr_reader :message + + sig { params(message: WhopSDK::Message::OrHash).void } + attr_writer :message + + # A single reaction left by a user on a feed post, such as a like or emoji. + sig { returns(WhopSDK::Reaction) } + attr_reader :reaction + + sig { params(reaction: WhopSDK::Reaction::OrHash).void } + attr_writer :reaction + + sig { returns(String) } + attr_accessor :reason + + sig do + params( + audience: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::OrHash, + channel: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::OrHash, + message: WhopSDK::Message::OrHash, + reaction: WhopSDK::Reaction::OrHash, + reason: String + ).returns(T.attached_class) + end + def self.new( + audience:, + channel:, + # A message sent within an experience chat, direct message, or group chat. + message:, + # A single reaction left by a user on a feed post, such as a like or emoji. + reaction:, + reason: + ) + end + + sig do + override.returns( + { + audience: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience, + channel: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel, + message: WhopSDK::Message, + reaction: WhopSDK::Reaction, + reason: String + } + ) + end + def to_hash + end + + class Audience < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :user_ids + + sig do + params( + type: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::Type::OrSymbol, + user_ids: T.nilable(T::Array[String]) + ).returns(T.attached_class) + end + def self.new(type:, user_ids: nil) + end + + sig do + override.returns( + { + type: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol, + user_ids: T.nilable(T::Array[String]) + } + ) + end + def to_hash + end + + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHANNEL = + T.let( + :channel, + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol + ) + USERS = + T.let( + :users, + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Channel < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :experience_id + + sig do + params( + id: String, + type: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type::OrSymbol, + experience_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, type:, experience_id: nil) + end + + sig do + override.returns( + { + id: String, + type: + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol, + experience_id: T.nilable(String) + } + ) + end + def to_hash + end + + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHAT = + T.let( + :chat, + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ) + SUPPORT = + T.let( + :support, + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/checkout_configuration.rbi b/rbi/whop_sdk/models/checkout_configuration.rbi index fe909d19..e9b2dc05 100644 --- a/rbi/whop_sdk/models/checkout_configuration.rbi +++ b/rbi/whop_sdk/models/checkout_configuration.rbi @@ -16,17 +16,12 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :affiliate_code - # Whether the checkout configuration allows promo codes. When false, the promo - # code input is hidden and promo codes are rejected. - sig { returns(T::Boolean) } - attr_accessor :allow_promo_codes - # The ID of the company to use for the checkout configuration sig { returns(String) } attr_accessor :company_id # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } attr_accessor :currency # The metadata to use for the checkout configuration @@ -34,7 +29,7 @@ module WhopSDK attr_accessor :metadata # The mode of the checkout session. - sig { returns(WhopSDK::CheckoutModes::TaggedSymbol) } + sig { returns(WhopSDK::CheckoutModes::OrSymbol) } attr_accessor :mode # The explicit payment method configuration for the session, if any. This @@ -84,7 +79,6 @@ module WhopSDK params( id: String, affiliate_code: T.nilable(String), - allow_promo_codes: T::Boolean, company_id: String, currency: T.nilable(WhopSDK::Currency::OrSymbol), metadata: T.nilable(T::Hash[Symbol, T.anything]), @@ -103,9 +97,6 @@ module WhopSDK id:, # The affiliate code to use for the checkout configuration affiliate_code:, - # Whether the checkout configuration allows promo codes. When false, the promo - # code input is hidden and promo codes are rejected. - allow_promo_codes:, # The ID of the company to use for the checkout configuration company_id:, # The available currencies on the platform @@ -133,11 +124,10 @@ module WhopSDK { id: String, affiliate_code: T.nilable(String), - allow_promo_codes: T::Boolean, company_id: String, - currency: T.nilable(WhopSDK::Currency::TaggedSymbol), + currency: T.nilable(WhopSDK::Currency::OrSymbol), metadata: T.nilable(T::Hash[Symbol, T.anything]), - mode: WhopSDK::CheckoutModes::TaggedSymbol, + mode: WhopSDK::CheckoutModes::OrSymbol, payment_method_configuration: T.nilable( WhopSDK::CheckoutConfiguration::PaymentMethodConfiguration @@ -162,14 +152,14 @@ module WhopSDK # 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]) } + 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::TaggedSymbol]) } + sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } attr_accessor :enabled # Whether Whop's platform default payment method enablement settings are included @@ -207,8 +197,8 @@ module WhopSDK sig do override.returns( { - disabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol], + disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], + enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], include_platform_defaults: T::Boolean } ) @@ -235,18 +225,18 @@ module WhopSDK 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. + # Number of days between recurring charges, such as 30 for monthly or 365 for + # annual. `null` for one-time plans. sig { returns(T.nilable(Integer)) } attr_accessor :billing_period # 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) } + sig { returns(WhopSDK::Currency::OrSymbol) } attr_accessor :currency - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # Access duration in days for expiration-based plans, such as 365 for a one-year + # pass. sig { returns(T.nilable(Integer)) } attr_accessor :expiration_days @@ -258,12 +248,12 @@ module WhopSDK # The billing model for this plan: 'renewal' for recurring subscriptions or # 'one_time' for single payments. - sig { returns(WhopSDK::PlanType::TaggedSymbol) } + sig { returns(WhopSDK::PlanType::OrSymbol) } attr_accessor :plan_type - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. - sig { returns(WhopSDK::ReleaseMethod::TaggedSymbol) } + # Sales method for this plan: `buy_now` for immediate purchase or `waitlist` for + # waitlist-based access. + sig { returns(WhopSDK::ReleaseMethod::OrSymbol) } attr_accessor :release_method # The recurring price charged every billing_period in the plan's base_currency @@ -275,21 +265,20 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::CheckoutConfiguration::Plan::ThreeDSLevel::TaggedSymbol + WhopSDK::CheckoutConfiguration::Plan::ThreeDSLevel::OrSymbol ) ) end attr_accessor :three_ds_level - # 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. + # Free trial days before first renewal charge. `null` if no trial is configured or + # the user has already used a trial for this plan. sig { returns(T.nilable(Integer)) } attr_accessor :trial_period_days # 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) } + sig { returns(WhopSDK::Visibility::OrSymbol) } attr_accessor :visibility # The plan to use for the checkout configuration @@ -318,14 +307,14 @@ module WhopSDK # Whether the creator has turned on adaptive pricing for this plan. Raw setting — # does not check processor compatibility or feature flags. 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. + # Number of days between recurring charges, such as 30 for monthly or 365 for + # annual. `null` for one-time plans. billing_period:, # The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary # amounts on the plan are denominated in this currency. currency:, - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # Access duration in days for expiration-based plans, such as 365 for a one-year + # pass. 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 @@ -334,17 +323,16 @@ module WhopSDK # The billing model for this plan: 'renewal' for recurring subscriptions or # 'one_time' for single payments. plan_type:, - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. + # Sales method for this plan: `buy_now` for immediate purchase or `waitlist` for + # waitlist-based access. 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. renewal_price:, # The 3D Secure behavior for a plan. three_ds_level:, - # 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. + # Free trial days before first renewal charge. `null` if no trial is configured or + # the user has already used a trial for this plan. trial_period_days:, # Controls whether the plan is visible to customers. When set to 'hidden', the # plan is only accessible via direct link. @@ -358,18 +346,18 @@ module WhopSDK id: String, adaptive_pricing_enabled: T::Boolean, billing_period: T.nilable(Integer), - currency: WhopSDK::Currency::TaggedSymbol, + currency: WhopSDK::Currency::OrSymbol, expiration_days: T.nilable(Integer), initial_price: Float, - plan_type: WhopSDK::PlanType::TaggedSymbol, - release_method: WhopSDK::ReleaseMethod::TaggedSymbol, + plan_type: WhopSDK::PlanType::OrSymbol, + release_method: WhopSDK::ReleaseMethod::OrSymbol, renewal_price: Float, three_ds_level: T.nilable( - WhopSDK::CheckoutConfiguration::Plan::ThreeDSLevel::TaggedSymbol + WhopSDK::CheckoutConfiguration::Plan::ThreeDSLevel::OrSymbol ), trial_period_days: T.nilable(Integer), - visibility: WhopSDK::Visibility::TaggedSymbol + visibility: WhopSDK::Visibility::OrSymbol } ) end diff --git a/rbi/whop_sdk/models/checkout_configuration_create_params.rbi b/rbi/whop_sdk/models/checkout_configuration_create_params.rbi index 65e05440..fa21f831 100644 --- a/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +++ b/rbi/whop_sdk/models/checkout_configuration_create_params.rbi @@ -14,32 +14,132 @@ module WhopSDK ) end - # Parameters for CreateCheckoutSession + # Affiliate code to apply to the checkout. + sig { returns(T.nilable(String)) } + attr_accessor :affiliate_code + + # Account ID, prefixed `biz_`. + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Currency used for setup-mode payment method availability. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # Custom key-value metadata copied to payments and memberships. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # Checkout mode: `payment` collects payment for a plan now; `setup` saves payment + # details without charging. Defaults to `payment`. sig do returns( - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup + T.nilable(WhopSDK::CheckoutConfigurationCreateParams::Mode::OrSymbol) + ) + end + attr_reader :mode + + sig do + params( + mode: WhopSDK::CheckoutConfigurationCreateParams::Mode::OrSymbol + ).void + end + attr_writer :mode + + # Payment method overrides for this checkout. `null` uses the plan or platform + # defaults. + sig do + returns( + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration ) ) end - attr_accessor :body + attr_reader :payment_method_configuration sig do params( - body: - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::OrHash, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::OrHash, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::OrHash + payment_method_configuration: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration::OrHash + ) + ).void + end + attr_writer :payment_method_configuration + + # Plan attributes used to create or find a plan for this checkout configuration. + # Mutually exclusive with `plan_id`. + sig do + returns(T.nilable(WhopSDK::CheckoutConfigurationCreateParams::Plan)) + end + attr_reader :plan + + sig do + params( + plan: + T.nilable(WhopSDK::CheckoutConfigurationCreateParams::Plan::OrHash) + ).void + end + attr_writer :plan + + # Existing plan ID, prefixed `plan_`. Mutually exclusive with `plan`. + sig { returns(T.nilable(String)) } + attr_accessor :plan_id + + # URL customers are sent to after checkout. + sig { returns(T.nilable(String)) } + attr_accessor :redirect_url + + # 3D Secure behavior for this checkout. + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_level + + sig do + params( + affiliate_code: T.nilable(String), + company_id: String, + currency: T.nilable(String), + metadata: T.nilable(T.anything), + mode: WhopSDK::CheckoutConfigurationCreateParams::Mode::OrSymbol, + payment_method_configuration: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration::OrHash ), + plan: + T.nilable(WhopSDK::CheckoutConfigurationCreateParams::Plan::OrHash), + plan_id: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Parameters for CreateCheckoutSession - body:, + # Affiliate code to apply to the checkout. + affiliate_code: nil, + # Account ID, prefixed `biz_`. + company_id: nil, + # Currency used for setup-mode payment method availability. + currency: nil, + # Custom key-value metadata copied to payments and memberships. + metadata: nil, + # Checkout mode: `payment` collects payment for a plan now; `setup` saves payment + # details without charging. Defaults to `payment`. + mode: nil, + # Payment method overrides for this checkout. `null` uses the plan or platform + # defaults. + payment_method_configuration: nil, + # Plan attributes used to create or find a plan for this checkout configuration. + # Mutually exclusive with `plan_id`. + plan: nil, + # Existing plan ID, prefixed `plan_`. Mutually exclusive with `plan`. + plan_id: nil, + # URL customers are sent to after checkout. + redirect_url: nil, + # 3D Secure behavior for this checkout. + three_ds_level: nil, request_options: {} ) end @@ -47,12 +147,19 @@ module WhopSDK sig do override.returns( { - body: - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup + affiliate_code: T.nilable(String), + company_id: String, + currency: T.nilable(String), + metadata: T.nilable(T.anything), + mode: WhopSDK::CheckoutConfigurationCreateParams::Mode::OrSymbol, + payment_method_configuration: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration ), + plan: T.nilable(WhopSDK::CheckoutConfigurationCreateParams::Plan), + plan_id: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String), request_options: WhopSDK::RequestOptions } ) @@ -60,1661 +167,366 @@ module WhopSDK def to_hash end - # Parameters for CreateCheckoutSession - module Body - extend WhopSDK::Internal::Type::Union + # Checkout mode: `payment` collects payment for a plan now; `setup` saves payment + # details without charging. Defaults to `payment`. + module Mode + extend WhopSDK::Internal::Type::Enum - Variants = + TaggedSymbol = T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup - ) - end - - class CreateCheckoutSessionInputModePaymentWithPlan < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan, - WhopSDK::Internal::AnyHash - ) - end - - # The plan attributes to create a new plan inline for this checkout configuration. - sig do - returns( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan - ) + T.all(Symbol, WhopSDK::CheckoutConfigurationCreateParams::Mode) end - attr_reader :plan - - sig do - params( - plan: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::OrHash - ).void - end - attr_writer :plan - - # An affiliate tracking code to attribute the checkout to a specific affiliate. - sig { returns(T.nilable(String)) } - attr_accessor :affiliate_code - - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :allow_promo_codes + OrSymbol = T.type_alias { T.any(Symbol, String) } - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling - ) - ) - end - attr_reader :checkout_styling - - sig do - params( - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling::OrHash - ) - ).void - end - attr_writer :checkout_styling - - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } - attr_accessor :currency - - # Custom key-value metadata to attach to the checkout configuration. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :metadata - - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode::OrSymbol - ) - ) - end - attr_reader :mode - - sig do - params( - mode: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode::OrSymbol - ).void - end - attr_writer :mode - - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration - ) - ) - end - attr_reader :payment_method_configuration - - sig do - params( - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration::OrHash - ) - ).void - end - attr_writer :payment_method_configuration - - # The URL to redirect the user to after checkout is completed. - sig { returns(T.nilable(String)) } - attr_accessor :redirect_url - - # The URL of the page where the checkout is being initiated from. - sig { returns(T.nilable(String)) } - attr_accessor :source_url + PAYMENT = + T.let( + :payment, + WhopSDK::CheckoutConfigurationCreateParams::Mode::TaggedSymbol + ) + SETUP = + T.let( + :setup, + WhopSDK::CheckoutConfigurationCreateParams::Mode::TaggedSymbol + ) - # Autogenerated input type of CreateCheckoutSession - sig do - params( - plan: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::OrHash, - affiliate_code: T.nilable(String), - allow_promo_codes: T.nilable(T::Boolean), - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling::OrHash - ), - currency: T.nilable(WhopSDK::Currency::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - mode: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode::OrSymbol, - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration::OrHash - ), - redirect_url: T.nilable(String), - source_url: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The plan attributes to create a new plan inline for this checkout configuration. - plan:, - # An affiliate tracking code to attribute the checkout to a specific affiliate. - affiliate_code: nil, - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. - allow_promo_codes: nil, - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - checkout_styling: nil, - # The available currencies on the platform - currency: nil, - # Custom key-value metadata to attach to the checkout configuration. - metadata: nil, - mode: nil, - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - payment_method_configuration: nil, - # The URL to redirect the user to after checkout is completed. - redirect_url: nil, - # The URL of the page where the checkout is being initiated from. - source_url: nil + sig do + override.returns( + T::Array[ + WhopSDK::CheckoutConfigurationCreateParams::Mode::TaggedSymbol + ] ) - end + end + def self.values + end + end - sig do - override.returns( - { - plan: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, - affiliate_code: T.nilable(String), - allow_promo_codes: T.nilable(T::Boolean), - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling - ), - currency: T.nilable(WhopSDK::Currency::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - mode: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode::OrSymbol, - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration - ), - redirect_url: T.nilable(String), - source_url: T.nilable(String) - } + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration, + WhopSDK::Internal::AnyHash ) end - def to_hash - end - - class Plan < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, - WhopSDK::Internal::AnyHash - ) - end - - # The company the plan should be created for. - sig { returns(String) } - attr_accessor :company_id - - # The respective currency identifier for the plan. - sig { returns(WhopSDK::Currency::OrSymbol) } - attr_accessor :currency - - # Whether this plan accepts local currency payments via adaptive pricing. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :adaptive_pricing_enabled - - # The application fee amount collected by the platform from this connected - # account. Provided as a number in dollars (e.g., 5.00 for $5.00). Must be less - # than the total payment amount. Only valid for connected accounts with a parent - # company. - sig { returns(T.nilable(Float)) } - attr_accessor :application_fee_amount - - # The interval in days at which the plan charges (renewal plans). For example, 30 - # for monthly billing. - sig { returns(T.nilable(Integer)) } - attr_accessor :billing_period - - # An array of custom field objects. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField - ] - ) - ) - end - attr_accessor :custom_fields - - # The description of the plan. - 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)) } - attr_accessor :expiration_days - - # Whether to force the creation of a new plan even if one with the same attributes - # already exists. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :force_create_new_plan - - # An image for the plan. This will be visible on the product page to customers. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image - ) - ) - end - attr_reader :image - - sig do - params( - image: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image::OrHash - ) - ).void - end - attr_writer :image - - # An additional amount charged upon first purchase. Provided as a number in - # dollars (e.g., 10.00 for $10.00). - sig { returns(T.nilable(Float)) } - attr_accessor :initial_price - - # A personal description or notes section for the business. - sig { returns(T.nilable(String)) } - attr_accessor :internal_notes - - # 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 - - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration - ) - ) - end - attr_reader :payment_method_configuration - - sig do - params( - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration::OrHash - ) - ).void - 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 - # Pass this object to create a new product for this plan. We will use the product - # external identifier to find or create an existing product. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product - ) - ) - end - attr_reader :product + # Payment methods explicitly disabled for checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :disabled - sig do - params( - product: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product::OrHash - ) - ).void - end - attr_writer :product + sig { params(disabled: T::Array[String]).void } + attr_writer :disabled - # The product the plan is related to. Either this or product is required. - sig { returns(T.nilable(String)) } - attr_accessor :product_id + # Payment methods explicitly enabled for checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :enabled - # The methods of how a plan can be released. - sig { returns(T.nilable(WhopSDK::ReleaseMethod::OrSymbol)) } - attr_accessor :release_method + sig { params(enabled: T::Array[String]).void } + attr_writer :enabled - # The amount the customer is charged every billing period. Provided as a number in - # dollars (e.g., 9.99 for $9.99/period). - sig { returns(T.nilable(Float)) } - attr_accessor :renewal_price + # Whether platform default payment methods are included. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_platform_defaults - # The number of payments required before pausing the subscription. - sig { returns(T.nilable(Integer)) } - attr_accessor :split_pay_required_payments + sig { params(include_platform_defaults: T::Boolean).void } + attr_writer :include_platform_defaults - # The number of units available for purchase. If not provided, stock is unlimited. - sig { returns(T.nilable(Integer)) } - attr_accessor :stock - - # The title of the plan. This will be visible on the product page to customers. - sig { returns(T.nilable(String)) } - attr_accessor :title - - # The number of free trial days added before a renewal plan. - sig { returns(T.nilable(Integer)) } - attr_accessor :trial_period_days + # Payment method overrides for this checkout. `null` uses the plan or platform + # defaults. + sig do + params( + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Payment methods explicitly disabled for checkout. + disabled: nil, + # Payment methods explicitly enabled for checkout. + enabled: nil, + # Whether platform default payment methods are included. + include_platform_defaults: nil + ) + end - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility + sig do + override.returns( + { + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean + } + ) + end + def to_hash + end + end - # The plan attributes to create a new plan inline for this checkout configuration. - sig do - params( - company_id: String, - currency: WhopSDK::Currency::OrSymbol, - adaptive_pricing_enabled: T.nilable(T::Boolean), - application_fee_amount: T.nilable(Float), - billing_period: T.nilable(Integer), - custom_fields: - T.nilable( - T::Array[ - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField::OrHash - ] - ), - description: T.nilable(String), - expiration_days: T.nilable(Integer), - force_create_new_plan: T.nilable(T::Boolean), - image: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image::OrHash - ), - initial_price: T.nilable(Float), - internal_notes: T.nilable(String), - override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol), - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration::OrHash - ), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - product: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product::OrHash - ), - product_id: T.nilable(String), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), - renewal_price: T.nilable(Float), - split_pay_required_payments: T.nilable(Integer), - stock: T.nilable(Integer), - title: T.nilable(String), - trial_period_days: T.nilable(Integer), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - ).returns(T.attached_class) - end - def self.new( - # The company the plan should be created for. - company_id:, - # The respective currency identifier for the plan. - currency:, - # Whether this plan accepts local currency payments via adaptive pricing. - adaptive_pricing_enabled: nil, - # The application fee amount collected by the platform from this connected - # account. Provided as a number in dollars (e.g., 5.00 for $5.00). Must be less - # than the total payment amount. Only valid for connected accounts with a parent - # company. - application_fee_amount: nil, - # The interval in days at which the plan charges (renewal plans). For example, 30 - # for monthly billing. - billing_period: nil, - # An array of custom field objects. - custom_fields: nil, - # The description of the plan. - description: nil, - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. - expiration_days: nil, - # Whether to force the creation of a new plan even if one with the same attributes - # already exists. - force_create_new_plan: nil, - # An image for the plan. This will be visible on the product page to customers. - image: nil, - # An additional amount charged upon first purchase. Provided as a number in - # dollars (e.g., 10.00 for $10.00). - initial_price: nil, - # A personal description or notes section for the business. - internal_notes: nil, - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) - override_tax_type: nil, - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - payment_method_configuration: nil, - # The type of plan that can be attached to a product - plan_type: nil, - # Pass this object to create a new product for this plan. We will use the product - # external identifier to find or create an existing product. - product: nil, - # The product the plan is related to. Either this or product is required. - product_id: nil, - # The methods of how a plan can be released. - release_method: nil, - # The amount the customer is charged every billing period. Provided as a number in - # dollars (e.g., 9.99 for $9.99/period). - renewal_price: nil, - # The number of payments required before pausing the subscription. - split_pay_required_payments: nil, - # The number of units available for purchase. If not provided, stock is unlimited. - stock: nil, - # The title of the plan. This will be visible on the product page to customers. - title: nil, - # The number of free trial days added before a renewal plan. - trial_period_days: nil, - # Visibility of a resource - visibility: nil + class Plan < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::CheckoutConfigurationCreateParams::Plan, + WhopSDK::Internal::AnyHash ) - end - - sig do - override.returns( - { - company_id: String, - currency: WhopSDK::Currency::OrSymbol, - adaptive_pricing_enabled: T.nilable(T::Boolean), - application_fee_amount: T.nilable(Float), - billing_period: T.nilable(Integer), - custom_fields: - T.nilable( - T::Array[ - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField - ] - ), - description: T.nilable(String), - expiration_days: T.nilable(Integer), - force_create_new_plan: T.nilable(T::Boolean), - image: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image - ), - initial_price: T.nilable(Float), - internal_notes: T.nilable(String), - override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol), - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration - ), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - product: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product - ), - product_id: T.nilable(String), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), - renewal_price: T.nilable(Float), - split_pay_required_payments: T.nilable(Integer), - stock: T.nilable(Integer), - title: T.nilable(String), - trial_period_days: T.nilable(Integer), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - } - ) - end - def to_hash - end - - class CustomField < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField, - WhopSDK::Internal::AnyHash - ) - end - - # The type of the custom field. - sig { returns(Symbol) } - attr_accessor :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 - - # The order of the field. - sig { returns(T.nilable(Integer)) } - attr_accessor :order - - # The placeholder value of the 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 - - sig do - params( - name: String, - id: T.nilable(String), - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T.nilable(T::Boolean), - field_type: Symbol - ).returns(T.attached_class) - end - def self.new( - # The name of the custom field. - name:, - # The ID of the custom field (if being updated) - id: nil, - # The order of the field. - order: nil, - # The placeholder value of the field. - placeholder: nil, - # Whether or not the field is required. - required: nil, - # The type of the custom field. - field_type: :text - ) - end - - sig do - override.returns( - { - field_type: Symbol, - name: String, - id: T.nilable(String), - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Image < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image, - WhopSDK::Internal::AnyHash - ) - end - - # The ID of an existing file object. - sig { returns(String) } - attr_accessor :id - - # An image for the plan. This will be visible on the product page to customers. - 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 - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::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::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::Boolean)) } - attr_accessor :include_platform_defaults - - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - sig do - params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(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: nil - ) - end - - sig do - override.returns( - { - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Product < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product, - WhopSDK::Internal::AnyHash - ) - end - - # A unique ID used to find or create a product. When provided during creation, we - # will look for an existing product with this external identifier — if found, it - # will be updated; otherwise, a new product will be created. - sig { returns(String) } - attr_accessor :external_identifier - - # The title of the product. - sig { returns(String) } - attr_accessor :title - - # Whether or not to collect shipping information at checkout from the customer. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :collect_shipping_address - - # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be - # between 5 and 22 characters, contain at least one letter, and not contain any of - # the following characters: <, >, \, ', " - sig { returns(T.nilable(String)) } - attr_accessor :custom_statement_descriptor - - # A written description of the product. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # The percentage of the revenue that goes to the global affiliate program. - sig { returns(T.nilable(Float)) } - attr_accessor :global_affiliate_percentage - - # The different statuses of the global affiliate program for a product. - sig do - returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) - end - attr_accessor :global_affiliate_status - - # The headline of the product. - sig { returns(T.nilable(String)) } - attr_accessor :headline - - # The ID of the product tax code to apply to this product. - sig { returns(T.nilable(String)) } - attr_accessor :product_tax_code_id - - # The URL to redirect the customer to after a purchase. - sig { returns(T.nilable(String)) } - attr_accessor :redirect_purchase_url - - # The route of the product. - sig { returns(T.nilable(String)) } - attr_accessor :route - - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility - - # Pass this object to create a new product for this plan. We will use the product - # external identifier to find or create an existing product. - sig do - params( - external_identifier: String, - title: String, - collect_shipping_address: T.nilable(T::Boolean), - custom_statement_descriptor: T.nilable(String), - description: T.nilable(String), - global_affiliate_percentage: T.nilable(Float), - global_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), - headline: T.nilable(String), - product_tax_code_id: T.nilable(String), - redirect_purchase_url: T.nilable(String), - route: T.nilable(String), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - ).returns(T.attached_class) - end - def self.new( - # A unique ID used to find or create a product. When provided during creation, we - # will look for an existing product with this external identifier — if found, it - # will be updated; otherwise, a new product will be created. - external_identifier:, - # The title of the product. - title:, - # Whether or not to collect shipping information at checkout from the customer. - collect_shipping_address: nil, - # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be - # between 5 and 22 characters, contain at least one letter, and not contain any of - # the following characters: <, >, \, ', " - custom_statement_descriptor: nil, - # A written description of the product. - description: nil, - # The percentage of the revenue that goes to the global affiliate program. - global_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. - global_affiliate_status: nil, - # The headline of the product. - headline: nil, - # The ID of the product tax code to apply to this product. - product_tax_code_id: nil, - # The URL to redirect the customer to after a purchase. - redirect_purchase_url: nil, - # The route of the product. - route: nil, - # Visibility of a resource - visibility: nil - ) - end - - sig do - override.returns( - { - external_identifier: String, - title: String, - collect_shipping_address: T.nilable(T::Boolean), - custom_statement_descriptor: T.nilable(String), - description: T.nilable(String), - global_affiliate_percentage: T.nilable(Float), - global_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), - headline: T.nilable(String), - product_tax_code_id: T.nilable(String), - redirect_purchase_url: T.nilable(String), - route: T.nilable(String), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - } - ) - end - def to_hash - end - end end - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling, - WhopSDK::Internal::AnyHash - ) - end + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + sig { returns(T.nilable(Integer)) } + attr_accessor :billing_period - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). - sig { returns(T.nilable(String)) } - attr_accessor :background_color + # Account ID for the inline plan, prefixed `biz_`. Defaults to the account + # resolved from the request. + sig { returns(T.nilable(String)) } + attr_accessor :company_id - # The different border-radius styles available for checkout pages. - sig { returns(T.nilable(WhopSDK::CheckoutShape::OrSymbol)) } - attr_accessor :border_style + # Three-letter ISO currency code for the plan's prices. + sig { returns(T.nilable(String)) } + attr_accessor :currency - # A hex color code for the button color (e.g. #FF5733). - sig { returns(T.nilable(String)) } - attr_accessor :button_color + # Customer-visible plan description. + sig { returns(T.nilable(String)) } + attr_accessor :description - # The different font families available for checkout pages. - sig { returns(T.nilable(WhopSDK::CheckoutFont::OrSymbol)) } - attr_accessor :font_family + # Access duration in days for expiration-based plans. + sig { returns(T.nilable(Integer)) } + attr_accessor :expiration_days - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - 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 - ) - end - - 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 - end - end + # Whether to create a new plan instead of reusing a matching one. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :force_create_new_plan - module Mode - extend WhopSDK::Internal::Type::Enum + # Initial purchase price in the plan currency. + sig { returns(T.nilable(Float)) } + attr_accessor :initial_price - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + # Custom key-value metadata stored on the plan. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata - PAYMENT = - T.let( - :payment, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode::TaggedSymbol - ) + # Tax classification override for this plan. + sig { returns(T.nilable(String)) } + attr_accessor :override_tax_type - sig do - override.returns( - T::Array[ - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Mode::TaggedSymbol - ] - ) - end - def self.values - end - end - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::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::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::Boolean)) } - attr_accessor :include_platform_defaults - - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - sig do - params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(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: nil + # Payment method overrides for the inline plan. `null` uses platform defaults. + sig do + returns( + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration ) - end + ) + end + attr_reader :payment_method_configuration - sig do - override.returns( - { - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(T::Boolean) - } + sig do + params( + payment_method_configuration: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration::OrHash ) - end - def to_hash - end - end + ).void end + attr_writer :payment_method_configuration - class CreateCheckoutSessionInputModePaymentWithPlanID < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID, - WhopSDK::Internal::AnyHash - ) - end + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + sig { returns(T.nilable(String)) } + attr_accessor :plan_type - # The unique identifier of an existing plan to use for this checkout - # configuration. - sig { returns(String) } - attr_accessor :plan_id + # Product ID the inline plan should belong to, prefixed `prod_`. + sig { returns(T.nilable(String)) } + attr_accessor :product_id - # An affiliate tracking code to attribute the checkout to a specific affiliate. - sig { returns(T.nilable(String)) } - attr_accessor :affiliate_code + # Sales method for the plan, such as `buy_now` or `waitlist`. + sig { returns(T.nilable(String)) } + attr_accessor :release_method - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :allow_promo_codes + # Recurring price charged each billing period. + sig { returns(T.nilable(Float)) } + attr_accessor :renewal_price - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling - ) - ) - end - attr_reader :checkout_styling + # Units available for purchase. + sig { returns(T.nilable(Integer)) } + attr_accessor :stock - sig do - params( - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling::OrHash - ) - ).void - end - attr_writer :checkout_styling + # Plan display name shown to customers. + sig { returns(T.nilable(String)) } + attr_accessor :title - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } - attr_accessor :currency + # Free trial days before the first renewal charge. + sig { returns(T.nilable(Integer)) } + attr_accessor :trial_period_days - # Custom key-value metadata to attach to the checkout configuration. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :metadata + # Whether the plan has unlimited stock. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :unlimited_stock - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode::OrSymbol - ) - ) - end - attr_reader :mode + # Whether the plan is visible to customers or hidden from public view. + sig { returns(T.nilable(String)) } + attr_accessor :visibility - sig do - params( - mode: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode::OrSymbol - ).void - end - attr_writer :mode - - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - sig do - returns( + # Plan attributes used to create or find a plan for this checkout configuration. + # Mutually exclusive with `plan_id`. + sig do + params( + billing_period: T.nilable(Integer), + company_id: T.nilable(String), + currency: T.nilable(String), + description: T.nilable(String), + expiration_days: T.nilable(Integer), + force_create_new_plan: T.nilable(T::Boolean), + initial_price: T.nilable(Float), + metadata: T.nilable(T.anything), + override_tax_type: T.nilable(String), + payment_method_configuration: T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration - ) - ) - end - attr_reader :payment_method_configuration - - sig do - params( - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration::OrHash - ) - ).void - end - attr_writer :payment_method_configuration - - # The URL to redirect the user to after checkout is completed. - sig { returns(T.nilable(String)) } - attr_accessor :redirect_url - - # The URL of the page where the checkout is being initiated from. - sig { returns(T.nilable(String)) } - attr_accessor :source_url + WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration::OrHash + ), + plan_type: T.nilable(String), + product_id: T.nilable(String), + release_method: T.nilable(String), + renewal_price: T.nilable(Float), + stock: T.nilable(Integer), + title: T.nilable(String), + trial_period_days: T.nilable(Integer), + unlimited_stock: T.nilable(T::Boolean), + visibility: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + billing_period: nil, + # Account ID for the inline plan, prefixed `biz_`. Defaults to the account + # resolved from the request. + company_id: nil, + # Three-letter ISO currency code for the plan's prices. + currency: nil, + # Customer-visible plan description. + description: nil, + # Access duration in days for expiration-based plans. + expiration_days: nil, + # Whether to create a new plan instead of reusing a matching one. + force_create_new_plan: nil, + # Initial purchase price in the plan currency. + initial_price: nil, + # Custom key-value metadata stored on the plan. + metadata: nil, + # Tax classification override for this plan. + override_tax_type: nil, + # Payment method overrides for the inline plan. `null` uses platform defaults. + payment_method_configuration: nil, + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + plan_type: nil, + # Product ID the inline plan should belong to, prefixed `prod_`. + product_id: nil, + # Sales method for the plan, such as `buy_now` or `waitlist`. + release_method: nil, + # Recurring price charged each billing period. + renewal_price: nil, + # Units available for purchase. + stock: nil, + # Plan display name shown to customers. + title: nil, + # Free trial days before the first renewal charge. + trial_period_days: nil, + # Whether the plan has unlimited stock. + unlimited_stock: nil, + # Whether the plan is visible to customers or hidden from public view. + visibility: nil + ) + end - # Autogenerated input type of CreateCheckoutSession - sig do - params( - plan_id: String, - affiliate_code: T.nilable(String), - allow_promo_codes: T.nilable(T::Boolean), - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling::OrHash - ), - currency: T.nilable(WhopSDK::Currency::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - mode: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode::OrSymbol, + sig do + override.returns( + { + billing_period: T.nilable(Integer), + company_id: T.nilable(String), + currency: T.nilable(String), + description: T.nilable(String), + expiration_days: T.nilable(Integer), + force_create_new_plan: T.nilable(T::Boolean), + initial_price: T.nilable(Float), + metadata: T.nilable(T.anything), + override_tax_type: T.nilable(String), payment_method_configuration: T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration::OrHash + WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration ), - redirect_url: T.nilable(String), - source_url: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The unique identifier of an existing plan to use for this checkout - # configuration. - plan_id:, - # An affiliate tracking code to attribute the checkout to a specific affiliate. - affiliate_code: nil, - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. - allow_promo_codes: nil, - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - checkout_styling: nil, - # The available currencies on the platform - currency: nil, - # Custom key-value metadata to attach to the checkout configuration. - metadata: nil, - mode: nil, - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - payment_method_configuration: nil, - # The URL to redirect the user to after checkout is completed. - redirect_url: nil, - # The URL of the page where the checkout is being initiated from. - source_url: nil + plan_type: T.nilable(String), + product_id: T.nilable(String), + release_method: T.nilable(String), + renewal_price: T.nilable(Float), + stock: T.nilable(Integer), + title: T.nilable(String), + trial_period_days: T.nilable(Integer), + unlimited_stock: T.nilable(T::Boolean), + visibility: T.nilable(String) + } ) - end - - sig do - override.returns( - { - plan_id: String, - affiliate_code: T.nilable(String), - allow_promo_codes: T.nilable(T::Boolean), - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling - ), - currency: T.nilable(WhopSDK::Currency::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - mode: - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode::OrSymbol, - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration - ), - redirect_url: T.nilable(String), - source_url: T.nilable(String) - } - ) - end - def to_hash - end - - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling, - WhopSDK::Internal::AnyHash - ) - end - - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). - 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 - - # 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 session. Overrides plan and company - # defaults. - 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 - ) - end - - 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 - end - end - - module Mode - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PAYMENT = - T.let( - :payment, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::Mode::TaggedSymbol - ] - ) - end - def self.values - end - end - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::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::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::Boolean)) } - attr_accessor :include_platform_defaults - - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - sig do - params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(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: nil - ) - end - - sig do - override.returns( - { - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end + end + def to_hash end - class CreateCheckoutSessionInputModeSetup < WhopSDK::Internal::Type::BaseModel + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup, + WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration, WhopSDK::Internal::AnyHash ) end - # The unique identifier of the company to create the checkout configuration for. - # Only required in setup mode. - sig { returns(String) } - attr_accessor :company_id - - sig { returns(Symbol) } - attr_accessor :mode - - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :allow_promo_codes - - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling - ) - ) - end - attr_reader :checkout_styling + # Payment methods explicitly disabled for this plan. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :disabled - sig do - params( - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling::OrHash - ) - ).void - end - attr_writer :checkout_styling - - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } - attr_accessor :currency - - # Custom key-value metadata to attach to the checkout configuration. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :metadata - - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration - ) - ) - end - attr_reader :payment_method_configuration + sig { params(disabled: T::Array[String]).void } + attr_writer :disabled - sig do - params( - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration::OrHash - ) - ).void - end - attr_writer :payment_method_configuration + # Payment methods explicitly enabled for this plan. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :enabled - # The URL to redirect the user to after checkout is completed. - sig { returns(T.nilable(String)) } - attr_accessor :redirect_url + sig { params(enabled: T::Array[String]).void } + attr_writer :enabled - # The URL of the page where the checkout is being initiated from. - sig { returns(T.nilable(String)) } - attr_accessor :source_url + # Whether platform default payment methods are included. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_platform_defaults - # The 3D Secure behavior for a plan. - sig do - returns( - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel::OrSymbol - ) - ) - end - attr_accessor :three_ds_level + sig { params(include_platform_defaults: T::Boolean).void } + attr_writer :include_platform_defaults - # Autogenerated input type of CreateCheckoutSession + # Payment method overrides for the inline plan. `null` uses platform defaults. sig do params( - company_id: String, - allow_promo_codes: T.nilable(T::Boolean), - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling::OrHash - ), - currency: T.nilable(WhopSDK::Currency::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration::OrHash - ), - redirect_url: T.nilable(String), - source_url: T.nilable(String), - three_ds_level: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel::OrSymbol - ), - mode: Symbol + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean ).returns(T.attached_class) end def self.new( - # The unique identifier of the company to create the checkout configuration for. - # Only required in setup mode. - company_id:, - # Whether the checkout should show the promo code input field and accept promo - # codes. Defaults to true. - allow_promo_codes: nil, - # Checkout styling overrides for this session. Overrides plan and company - # defaults. - checkout_styling: nil, - # The available currencies on the platform - currency: nil, - # Custom key-value metadata to attach to the checkout configuration. - metadata: nil, - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - payment_method_configuration: nil, - # The URL to redirect the user to after checkout is completed. - redirect_url: nil, - # The URL of the page where the checkout is being initiated from. - source_url: nil, - # The 3D Secure behavior for a plan. - three_ds_level: nil, - mode: :setup + # Payment methods explicitly disabled for this plan. + disabled: nil, + # Payment methods explicitly enabled for this plan. + enabled: nil, + # Whether platform default payment methods are included. + include_platform_defaults: nil ) end sig do override.returns( { - company_id: String, - mode: Symbol, - allow_promo_codes: T.nilable(T::Boolean), - checkout_styling: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling - ), - currency: T.nilable(WhopSDK::Currency::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - payment_method_configuration: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration - ), - redirect_url: T.nilable(String), - source_url: T.nilable(String), - three_ds_level: - T.nilable( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel::OrSymbol - ) + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean } ) end def to_hash end - - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling, - WhopSDK::Internal::AnyHash - ) - end - - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). - 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 - - # 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 session. Overrides plan and company - # defaults. - 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 - ) - end - - 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 - end - end - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::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::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::Boolean)) } - attr_accessor :include_platform_defaults - - # The explicit payment method configuration for the checkout session. Only applies - # to setup mode. If not provided, the platform or company defaults will apply. - sig do - params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(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: nil - ) - end - - sig do - override.returns( - { - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(T::Boolean) - } - ) - end - 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::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MANDATE_CHALLENGE = - T.let( - :mandate_challenge, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel::TaggedSymbol - ) - FRICTIONLESS = - T.let( - :frictionless, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::ThreeDSLevel::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - sig do - override.returns( - T::Array[WhopSDK::CheckoutConfigurationCreateParams::Body::Variants] - ) - end - def self.variants end end end diff --git a/rbi/whop_sdk/models/checkout_configuration_create_response.rbi b/rbi/whop_sdk/models/checkout_configuration_create_response.rbi new file mode 100644 index 00000000..21dd9dbe --- /dev/null +++ b/rbi/whop_sdk/models/checkout_configuration_create_response.rbi @@ -0,0 +1,420 @@ +# typed: strong + +module WhopSDK + module Models + class CheckoutConfigurationCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CheckoutConfigurationCreateResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Checkout configuration ID, prefixed `ch_`. + sig { returns(String) } + attr_accessor :id + + # Account ID, prefixed `biz_`. + sig { returns(String) } + attr_accessor :company_id + + # When the checkout configuration was created, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :created_at + + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + sig do + returns( + WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode::TaggedSymbol + ) + end + attr_accessor :mode + + # When the checkout configuration was last updated, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :updated_at + + # Affiliate code applied at checkout, or `null` when none is set. + sig { returns(T.nilable(String)) } + attr_accessor :affiliate_code + + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + sig do + returns( + T.nilable( + WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration + ) + ) + end + attr_reader :payment_method_configuration + + sig do + params( + payment_method_configuration: + T.nilable( + WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration::OrHash + ) + ).void + end + attr_writer :payment_method_configuration + + # Plan used for payment checkout. `null` in setup mode. + sig do + returns( + T.nilable(WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan) + ) + end + attr_reader :plan + + sig do + params( + plan: + T.nilable( + WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan::OrHash + ) + ).void + end + attr_writer :plan + + # Checkout URL you can send to customers. + sig { returns(T.nilable(String)) } + attr_accessor :purchase_url + + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. + sig { returns(T.nilable(String)) } + attr_accessor :redirect_url + + # 3D Secure behavior for this checkout, or `null` to use the account default. + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_level + + sig do + params( + id: String, + company_id: String, + created_at: String, + mode: + WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode::OrSymbol, + updated_at: String, + affiliate_code: T.nilable(String), + currency: T.nilable(String), + metadata: T.nilable(T.anything), + payment_method_configuration: + T.nilable( + WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration::OrHash + ), + plan: + T.nilable( + WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan::OrHash + ), + purchase_url: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Checkout configuration ID, prefixed `ch_`. + id:, + # Account ID, prefixed `biz_`. + company_id:, + # When the checkout configuration was created, as an ISO 8601 timestamp. + created_at:, + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + mode:, + # When the checkout configuration was last updated, as an ISO 8601 timestamp. + updated_at:, + # Affiliate code applied at checkout, or `null` when none is set. + affiliate_code: nil, + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. + currency: nil, + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. + metadata: nil, + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + payment_method_configuration: nil, + # Plan used for payment checkout. `null` in setup mode. + plan: nil, + # Checkout URL you can send to customers. + purchase_url: nil, + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. + redirect_url: nil, + # 3D Secure behavior for this checkout, or `null` to use the account default. + three_ds_level: nil + ) + end + + sig do + override.returns( + { + id: String, + company_id: String, + created_at: String, + mode: + WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode::TaggedSymbol, + updated_at: String, + affiliate_code: T.nilable(String), + currency: T.nilable(String), + metadata: T.nilable(T.anything), + payment_method_configuration: + T.nilable( + WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration + ), + plan: + T.nilable( + WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan + ), + purchase_url: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String) + } + ) + end + def to_hash + end + + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + module Mode + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYMENT = + T.let( + :payment, + WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode::TaggedSymbol + ) + SETUP = + T.let( + :setup, + WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration, + WhopSDK::Internal::AnyHash + ) + end + + # Payment methods explicitly disabled for checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :disabled + + sig { params(disabled: T::Array[String]).void } + attr_writer :disabled + + # Payment methods explicitly enabled for checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :enabled + + sig { params(enabled: T::Array[String]).void } + attr_writer :enabled + + # Whether platform default payment methods are included. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_platform_defaults + + sig { params(include_platform_defaults: T::Boolean).void } + attr_writer :include_platform_defaults + + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + sig do + params( + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Payment methods explicitly disabled for checkout. + disabled: nil, + # Payment methods explicitly enabled for checkout. + enabled: nil, + # Whether platform default payment methods are included. + include_platform_defaults: nil + ) + end + + sig do + override.returns( + { + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean + } + ) + end + def to_hash + end + end + + class Plan < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan, + WhopSDK::Internal::AnyHash + ) + end + + # Plan ID, prefixed `plan_`. + sig { returns(String) } + attr_accessor :id + + # Whether this plan accepts local currency payments via adaptive pricing. + sig { returns(T::Boolean) } + attr_accessor :adaptive_pricing_enabled + + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. + sig { returns(T.nilable(Integer)) } + attr_accessor :billing_period + + # Three-letter ISO currency code for the plan's prices. + sig { returns(String) } + attr_accessor :currency + + # Access duration in days for expiration-based plans. + sig { returns(T.nilable(Integer)) } + attr_accessor :expiration_days + + # Initial purchase price in the plan currency. + sig { returns(Float) } + attr_accessor :initial_price + + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + sig { returns(String) } + attr_accessor :plan_type + + # Sales method for the plan, such as `buy_now` or `waitlist`. + sig { returns(String) } + attr_accessor :release_method + + # Recurring price charged each billing period. + sig { returns(Float) } + attr_accessor :renewal_price + + # 3D Secure behavior for this plan, or `null` to use the account default. + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_level + + # Free trial days before the first renewal charge. + sig { returns(T.nilable(Integer)) } + attr_accessor :trial_period_days + + # Whether the plan is visible to customers or hidden from public view. + sig { returns(String) } + attr_accessor :visibility + + # Plan used for payment checkout. `null` in setup mode. + sig do + params( + id: String, + adaptive_pricing_enabled: T::Boolean, + billing_period: T.nilable(Integer), + currency: String, + expiration_days: T.nilable(Integer), + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: T.nilable(String), + trial_period_days: T.nilable(Integer), + visibility: String + ).returns(T.attached_class) + end + def self.new( + # Plan ID, prefixed `plan_`. + id:, + # Whether this plan accepts local currency payments via adaptive pricing. + adaptive_pricing_enabled:, + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. + billing_period:, + # Three-letter ISO currency code for the plan's prices. + currency:, + # Access duration in days for expiration-based plans. + expiration_days:, + # Initial purchase price in the plan currency. + initial_price:, + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + plan_type:, + # Sales method for the plan, such as `buy_now` or `waitlist`. + release_method:, + # Recurring price charged each billing period. + renewal_price:, + # 3D Secure behavior for this plan, or `null` to use the account default. + three_ds_level:, + # Free trial days before the first renewal charge. + trial_period_days:, + # Whether the plan is visible to customers or hidden from public view. + visibility: + ) + end + + sig do + override.returns( + { + id: String, + adaptive_pricing_enabled: T::Boolean, + billing_period: T.nilable(Integer), + currency: String, + expiration_days: T.nilable(Integer), + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: T.nilable(String), + trial_period_days: T.nilable(Integer), + visibility: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/checkout_configuration_delete_params.rbi b/rbi/whop_sdk/models/checkout_configuration_delete_params.rbi new file mode 100644 index 00000000..6e658017 --- /dev/null +++ b/rbi/whop_sdk/models/checkout_configuration_delete_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module WhopSDK + module Models + class CheckoutConfigurationDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::CheckoutConfigurationDeleteParams, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/checkout_configuration_list_params.rbi b/rbi/whop_sdk/models/checkout_configuration_list_params.rbi index 58d2f5b6..94cc16ad 100644 --- a/rbi/whop_sdk/models/checkout_configuration_list_params.rbi +++ b/rbi/whop_sdk/models/checkout_configuration_list_params.rbi @@ -14,76 +14,108 @@ module WhopSDK ) end - # The unique identifier of the company to list checkout configurations for. + # Account ID, prefixed `biz_`. sig { returns(String) } attr_accessor :company_id - # Returns the elements in the list that come after the specified cursor. + # Cursor for the next page of results. sig { returns(T.nilable(String)) } - attr_accessor :after + attr_reader :after - # Returns the elements in the list that come before the specified cursor. - sig { returns(T.nilable(String)) } - attr_accessor :before - - # Only return checkout configurations created after this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_after + sig { params(after: String).void } + attr_writer :after - # Only return checkout configurations created before this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_before + # Only return checkout configurations created after this Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :created_after - # The direction of the sort. - sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) } - attr_accessor :direction + sig { params(created_after: Integer).void } + attr_writer :created_after - # Returns the first _n_ elements from the list. + # Only return checkout configurations created before this Unix timestamp. sig { returns(T.nilable(Integer)) } - attr_accessor :first + attr_reader :created_before - # Returns the last _n_ elements from the list. + sig { params(created_before: Integer).void } + attr_writer :created_before + + # Sort direction. Defaults to `desc`. + sig do + returns( + T.nilable( + WhopSDK::CheckoutConfigurationListParams::Direction::OrSymbol + ) + ) + end + attr_reader :direction + + sig do + params( + direction: + WhopSDK::CheckoutConfigurationListParams::Direction::OrSymbol + ).void + end + attr_writer :direction + + # Number of checkout configurations to return. sig { returns(T.nilable(Integer)) } - attr_accessor :last + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # Field used to sort checkout configurations. + sig do + returns( + T.nilable(WhopSDK::CheckoutConfigurationListParams::Order::OrSymbol) + ) + end + attr_reader :order + + sig do + params( + order: WhopSDK::CheckoutConfigurationListParams::Order::OrSymbol + ).void + end + attr_writer :order - # Filter checkout configurations to only those associated with this plan - # identifier. + # Only return checkout configurations for this plan ID, prefixed `plan_`. sig { returns(T.nilable(String)) } - attr_accessor :plan_id + attr_reader :plan_id + + sig { params(plan_id: String).void } + attr_writer :plan_id 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), - plan_id: T.nilable(String), + after: String, + created_after: Integer, + created_before: Integer, + direction: + WhopSDK::CheckoutConfigurationListParams::Direction::OrSymbol, + first: Integer, + order: WhopSDK::CheckoutConfigurationListParams::Order::OrSymbol, + plan_id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The unique identifier of the company to list checkout configurations for. + # Account ID, prefixed `biz_`. company_id:, - # Returns the elements in the list that come after the specified cursor. + # Cursor for the next page of results. after: nil, - # Returns the elements in the list that come before the specified cursor. - before: nil, - # Only return checkout configurations created after this timestamp. + # Only return checkout configurations created after this Unix timestamp. created_after: nil, - # Only return checkout configurations created before this timestamp. + # Only return checkout configurations created before this Unix timestamp. created_before: nil, - # The direction of the sort. + # Sort direction. Defaults to `desc`. direction: nil, - # Returns the first _n_ elements from the list. + # Number of checkout configurations to return. first: nil, - # Returns the last _n_ elements from the list. - last: nil, - # Filter checkout configurations to only those associated with this plan - # identifier. + # Field used to sort checkout configurations. + order: nil, + # Only return checkout configurations for this plan ID, prefixed `plan_`. plan_id: nil, request_options: {} ) @@ -93,20 +125,79 @@ 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), - plan_id: T.nilable(String), + after: String, + created_after: Integer, + created_before: Integer, + direction: + WhopSDK::CheckoutConfigurationListParams::Direction::OrSymbol, + first: Integer, + order: WhopSDK::CheckoutConfigurationListParams::Order::OrSymbol, + plan_id: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # Sort direction. Defaults to `desc`. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::CheckoutConfigurationListParams::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let( + :asc, + WhopSDK::CheckoutConfigurationListParams::Direction::TaggedSymbol + ) + DESC = + T.let( + :desc, + WhopSDK::CheckoutConfigurationListParams::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::CheckoutConfigurationListParams::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Field used to sort checkout configurations. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::CheckoutConfigurationListParams::Order) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT = + T.let( + :created_at, + WhopSDK::CheckoutConfigurationListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::CheckoutConfigurationListParams::Order::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/checkout_configuration_list_response.rbi b/rbi/whop_sdk/models/checkout_configuration_list_response.rbi index 9fbe9b89..d337835c 100644 --- a/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +++ b/rbi/whop_sdk/models/checkout_configuration_list_response.rbi @@ -11,38 +11,47 @@ module WhopSDK ) end - # The unique identifier for the checkout session. + # Checkout configuration ID, prefixed `ch_`. sig { returns(String) } attr_accessor :id - # The affiliate code to use for the checkout configuration - sig { returns(T.nilable(String)) } - attr_accessor :affiliate_code + # Account ID, prefixed `biz_`. + sig { returns(String) } + attr_accessor :company_id - # Whether the checkout configuration allows promo codes. When false, the promo - # code input is hidden and promo codes are rejected. - sig { returns(T::Boolean) } - attr_accessor :allow_promo_codes + # When the checkout configuration was created, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :created_at - # The ID of the company to use for the checkout configuration + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + sig do + returns( + WhopSDK::Models::CheckoutConfigurationListResponse::Mode::TaggedSymbol + ) + end + attr_accessor :mode + + # When the checkout configuration was last updated, as an ISO 8601 timestamp. sig { returns(String) } - attr_accessor :company_id + attr_accessor :updated_at + + # Affiliate code applied at checkout, or `null` when none is set. + sig { returns(T.nilable(String)) } + attr_accessor :affiliate_code - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. + sig { returns(T.nilable(String)) } attr_accessor :currency - # The metadata to use for the checkout configuration - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. + sig { returns(T.nilable(T.anything)) } attr_accessor :metadata - # The mode of the checkout session. - sig { returns(WhopSDK::CheckoutModes::TaggedSymbol) } - attr_accessor :mode - - # The explicit payment method configuration for the session, if any. This - # currently only works in 'setup' mode. Use the plan's - # payment_method_configuration for payment method. + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. sig do returns( T.nilable( @@ -62,7 +71,7 @@ module WhopSDK end attr_writer :payment_method_configuration - # The plan to use for the checkout configuration + # Plan used for payment checkout. `null` in setup mode. sig do returns( T.nilable(WhopSDK::Models::CheckoutConfigurationListResponse::Plan) @@ -80,27 +89,30 @@ module WhopSDK end attr_writer :plan - # A URL you can send to customers to complete a checkout. It looks like - # `/checkout/plan_xxxx?session={id}` - sig { returns(String) } + # Checkout URL you can send to customers. + sig { returns(T.nilable(String)) } attr_accessor :purchase_url - # The URL to redirect the user to after the checkout configuration is created + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. sig { returns(T.nilable(String)) } attr_accessor :redirect_url - # A checkout configuration is a reusable configuration for a checkout, including - # the plan, affiliate, and custom metadata. Payments and memberships created from - # a checkout session inherit its metadata. + # 3D Secure behavior for this checkout, or `null` to use the account default. + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_level + sig do params( id: String, - affiliate_code: T.nilable(String), - allow_promo_codes: T::Boolean, company_id: String, - currency: T.nilable(WhopSDK::Currency::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - mode: WhopSDK::CheckoutModes::OrSymbol, + created_at: String, + mode: + WhopSDK::Models::CheckoutConfigurationListResponse::Mode::OrSymbol, + updated_at: String, + affiliate_code: T.nilable(String), + currency: T.nilable(String), + metadata: T.nilable(T.anything), payment_method_configuration: T.nilable( WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration::OrHash @@ -109,37 +121,43 @@ module WhopSDK T.nilable( WhopSDK::Models::CheckoutConfigurationListResponse::Plan::OrHash ), - purchase_url: String, - redirect_url: T.nilable(String) + purchase_url: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String) ).returns(T.attached_class) end def self.new( - # The unique identifier for the checkout session. + # Checkout configuration ID, prefixed `ch_`. id:, - # The affiliate code to use for the checkout configuration - affiliate_code:, - # Whether the checkout configuration allows promo codes. When false, the promo - # code input is hidden and promo codes are rejected. - allow_promo_codes:, - # The ID of the company to use for the checkout configuration + # Account ID, prefixed `biz_`. company_id:, - # The available currencies on the platform - currency:, - # The metadata to use for the checkout configuration - metadata:, - # The mode of the checkout session. + # When the checkout configuration was created, as an ISO 8601 timestamp. + created_at:, + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. mode:, - # The explicit payment method configuration for the session, if any. This - # currently only works in 'setup' mode. Use the plan's - # payment_method_configuration for payment method. - payment_method_configuration:, - # The plan to use for the checkout configuration - plan:, - # A URL you can send to customers to complete a checkout. It looks like - # `/checkout/plan_xxxx?session={id}` - purchase_url:, - # The URL to redirect the user to after the checkout configuration is created - redirect_url: + # When the checkout configuration was last updated, as an ISO 8601 timestamp. + updated_at:, + # Affiliate code applied at checkout, or `null` when none is set. + affiliate_code: nil, + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. + currency: nil, + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. + metadata: nil, + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + payment_method_configuration: nil, + # Plan used for payment checkout. `null` in setup mode. + plan: nil, + # Checkout URL you can send to customers. + purchase_url: nil, + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. + redirect_url: nil, + # 3D Secure behavior for this checkout, or `null` to use the account default. + three_ds_level: nil ) end @@ -147,12 +165,14 @@ module WhopSDK override.returns( { id: String, - affiliate_code: T.nilable(String), - allow_promo_codes: T::Boolean, company_id: String, - currency: T.nilable(WhopSDK::Currency::TaggedSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - mode: WhopSDK::CheckoutModes::TaggedSymbol, + created_at: String, + mode: + WhopSDK::Models::CheckoutConfigurationListResponse::Mode::TaggedSymbol, + updated_at: String, + affiliate_code: T.nilable(String), + currency: T.nilable(String), + metadata: T.nilable(T.anything), payment_method_configuration: T.nilable( WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration @@ -161,14 +181,51 @@ module WhopSDK T.nilable( WhopSDK::Models::CheckoutConfigurationListResponse::Plan ), - purchase_url: String, - redirect_url: T.nilable(String) + purchase_url: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String) } ) end def to_hash end + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + module Mode + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::CheckoutConfigurationListResponse::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYMENT = + T.let( + :payment, + WhopSDK::Models::CheckoutConfigurationListResponse::Mode::TaggedSymbol + ) + SETUP = + T.let( + :setup, + WhopSDK::Models::CheckoutConfigurationListResponse::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::CheckoutConfigurationListResponse::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do @@ -178,55 +235,51 @@ 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::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 + # Payment methods explicitly disabled for checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :disabled - # The explicit payment method configuration for the session, if any. This - # currently only works in 'setup' mode. Use the plan's - # payment_method_configuration for payment method. + sig { params(disabled: T::Array[String]).void } + attr_writer :disabled + + # Payment methods explicitly enabled for checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :enabled + + sig { params(enabled: T::Array[String]).void } + attr_writer :enabled + + # Whether platform default payment methods are included. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_platform_defaults + + sig { params(include_platform_defaults: T::Boolean).void } + attr_writer :include_platform_defaults + + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. sig do params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], + 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. - include_platform_defaults: + # Payment methods explicitly disabled for checkout. + disabled: nil, + # Payment methods explicitly enabled for checkout. + enabled: nil, + # Whether platform default payment methods are included. + include_platform_defaults: nil ) end sig do override.returns( { - disabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol], + disabled: T::Array[String], + enabled: T::Array[String], include_platform_defaults: T::Boolean } ) @@ -244,128 +297,99 @@ module WhopSDK ) end - # The unique identifier for the plan. + # Plan ID, prefixed `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. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. sig { returns(T.nilable(Integer)) } attr_accessor :billing_period - # 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) } + # Three-letter ISO currency code for the plan's prices. + sig { returns(String) } attr_accessor :currency - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # Access duration in days for expiration-based plans. sig { returns(T.nilable(Integer)) } 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. + # Initial purchase price in the plan currency. sig { returns(Float) } attr_accessor :initial_price - # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. - sig { returns(WhopSDK::PlanType::TaggedSymbol) } + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + sig { returns(String) } attr_accessor :plan_type - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. - sig { returns(WhopSDK::ReleaseMethod::TaggedSymbol) } + # Sales method for the plan, such as `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. + # Recurring price charged each billing period. sig { returns(Float) } attr_accessor :renewal_price - # The 3D Secure behavior for a plan. - sig do - returns( - T.nilable( - WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel::TaggedSymbol - ) - ) - end + # 3D Secure behavior for this plan, or `null` to use the account default. + sig { returns(T.nilable(String)) } attr_accessor :three_ds_level - # 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. + # Free trial days before the first renewal charge. sig { returns(T.nilable(Integer)) } attr_accessor :trial_period_days - # 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 - # The plan to use for the checkout configuration + # Plan used for payment checkout. `null` in setup mode. sig do params( id: String, adaptive_pricing_enabled: T::Boolean, billing_period: T.nilable(Integer), - currency: WhopSDK::Currency::OrSymbol, + currency: String, expiration_days: T.nilable(Integer), initial_price: Float, - plan_type: WhopSDK::PlanType::OrSymbol, - release_method: WhopSDK::ReleaseMethod::OrSymbol, + plan_type: String, + release_method: String, renewal_price: Float, - three_ds_level: - T.nilable( - WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel::OrSymbol - ), + three_ds_level: T.nilable(String), trial_period_days: T.nilable(Integer), - visibility: WhopSDK::Visibility::OrSymbol + visibility: String ).returns(T.attached_class) end def self.new( - # The unique identifier for the plan. + # Plan ID, prefixed `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. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. billing_period:, - # The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary - # amounts on the plan are denominated in this currency. + # Three-letter ISO currency code for the plan's prices. currency:, - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # Access duration in days 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. + # Initial purchase price in the plan currency. initial_price:, - # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). plan_type:, - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. + # Sales method for the plan, such as `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. + # Recurring price charged each billing period. renewal_price:, - # The 3D Secure behavior for a plan. + # 3D Secure behavior for this plan, or `null` to use the account default. three_ds_level:, - # 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. + # Free trial days before the first renewal charge. trial_period_days:, - # 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 @@ -376,58 +400,20 @@ module WhopSDK id: String, adaptive_pricing_enabled: T::Boolean, billing_period: T.nilable(Integer), - currency: WhopSDK::Currency::TaggedSymbol, + currency: String, expiration_days: T.nilable(Integer), initial_price: Float, - plan_type: WhopSDK::PlanType::TaggedSymbol, - release_method: WhopSDK::ReleaseMethod::TaggedSymbol, + plan_type: String, + release_method: String, renewal_price: Float, - three_ds_level: - T.nilable( - WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel::TaggedSymbol - ), + three_ds_level: T.nilable(String), trial_period_days: T.nilable(Integer), - visibility: WhopSDK::Visibility::TaggedSymbol + visibility: String } ) end def to_hash 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::CheckoutConfigurationListResponse::Plan::ThreeDSLevel - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MANDATE_CHALLENGE = - T.let( - :mandate_challenge, - WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel::TaggedSymbol - ) - FRICTIONLESS = - T.let( - :frictionless, - WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::Models::CheckoutConfigurationListResponse::Plan::ThreeDSLevel::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/whop_sdk/models/checkout_configuration_retrieve_response.rbi b/rbi/whop_sdk/models/checkout_configuration_retrieve_response.rbi new file mode 100644 index 00000000..47ccf6e8 --- /dev/null +++ b/rbi/whop_sdk/models/checkout_configuration_retrieve_response.rbi @@ -0,0 +1,422 @@ +# typed: strong + +module WhopSDK + module Models + class CheckoutConfigurationRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Checkout configuration ID, prefixed `ch_`. + sig { returns(String) } + attr_accessor :id + + # Account ID, prefixed `biz_`. + sig { returns(String) } + attr_accessor :company_id + + # When the checkout configuration was created, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :created_at + + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + sig do + returns( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode::TaggedSymbol + ) + end + attr_accessor :mode + + # When the checkout configuration was last updated, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :updated_at + + # Affiliate code applied at checkout, or `null` when none is set. + sig { returns(T.nilable(String)) } + attr_accessor :affiliate_code + + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + sig do + returns( + T.nilable( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration + ) + ) + end + attr_reader :payment_method_configuration + + sig do + params( + payment_method_configuration: + T.nilable( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration::OrHash + ) + ).void + end + attr_writer :payment_method_configuration + + # Plan used for payment checkout. `null` in setup mode. + sig do + returns( + T.nilable( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan + ) + ) + end + attr_reader :plan + + sig do + params( + plan: + T.nilable( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan::OrHash + ) + ).void + end + attr_writer :plan + + # Checkout URL you can send to customers. + sig { returns(T.nilable(String)) } + attr_accessor :purchase_url + + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. + sig { returns(T.nilable(String)) } + attr_accessor :redirect_url + + # 3D Secure behavior for this checkout, or `null` to use the account default. + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_level + + sig do + params( + id: String, + company_id: String, + created_at: String, + mode: + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode::OrSymbol, + updated_at: String, + affiliate_code: T.nilable(String), + currency: T.nilable(String), + metadata: T.nilable(T.anything), + payment_method_configuration: + T.nilable( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration::OrHash + ), + plan: + T.nilable( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan::OrHash + ), + purchase_url: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Checkout configuration ID, prefixed `ch_`. + id:, + # Account ID, prefixed `biz_`. + company_id:, + # When the checkout configuration was created, as an ISO 8601 timestamp. + created_at:, + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + mode:, + # When the checkout configuration was last updated, as an ISO 8601 timestamp. + updated_at:, + # Affiliate code applied at checkout, or `null` when none is set. + affiliate_code: nil, + # Currency used for setup-mode payment method availability; defaults to `usd` when + # omitted. + currency: nil, + # Custom key-value metadata copied to payments and memberships. `null` without the + # `checkout_configuration:basic:read` scope. + metadata: nil, + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + payment_method_configuration: nil, + # Plan used for payment checkout. `null` in setup mode. + plan: nil, + # Checkout URL you can send to customers. + purchase_url: nil, + # URL customers are sent to after checkout, or `null` when no redirect is + # configured. + redirect_url: nil, + # 3D Secure behavior for this checkout, or `null` to use the account default. + three_ds_level: nil + ) + end + + sig do + override.returns( + { + id: String, + company_id: String, + created_at: String, + mode: + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode::TaggedSymbol, + updated_at: String, + affiliate_code: T.nilable(String), + currency: T.nilable(String), + metadata: T.nilable(T.anything), + payment_method_configuration: + T.nilable( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration + ), + plan: + T.nilable( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan + ), + purchase_url: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String) + } + ) + end + def to_hash + end + + # Checkout mode: `payment` collects payment now; `setup` saves payment details for + # later. + module Mode + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYMENT = + T.let( + :payment, + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode::TaggedSymbol + ) + SETUP = + T.let( + :setup, + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration, + WhopSDK::Internal::AnyHash + ) + end + + # Payment methods explicitly disabled for checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :disabled + + sig { params(disabled: T::Array[String]).void } + attr_writer :disabled + + # Payment methods explicitly enabled for checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :enabled + + sig { params(enabled: T::Array[String]).void } + attr_writer :enabled + + # Whether platform default payment methods are included. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_platform_defaults + + sig { params(include_platform_defaults: T::Boolean).void } + attr_writer :include_platform_defaults + + # Payment method overrides for this checkout. `null` when it uses the plan or + # platform defaults. + sig do + params( + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Payment methods explicitly disabled for checkout. + disabled: nil, + # Payment methods explicitly enabled for checkout. + enabled: nil, + # Whether platform default payment methods are included. + include_platform_defaults: nil + ) + end + + sig do + override.returns( + { + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean + } + ) + end + def to_hash + end + end + + class Plan < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan, + WhopSDK::Internal::AnyHash + ) + end + + # Plan ID, prefixed `plan_`. + sig { returns(String) } + attr_accessor :id + + # Whether this plan accepts local currency payments via adaptive pricing. + sig { returns(T::Boolean) } + attr_accessor :adaptive_pricing_enabled + + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. + sig { returns(T.nilable(Integer)) } + attr_accessor :billing_period + + # Three-letter ISO currency code for the plan's prices. + sig { returns(String) } + attr_accessor :currency + + # Access duration in days for expiration-based plans. + sig { returns(T.nilable(Integer)) } + attr_accessor :expiration_days + + # Initial purchase price in the plan currency. + sig { returns(Float) } + attr_accessor :initial_price + + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + sig { returns(String) } + attr_accessor :plan_type + + # Sales method for the plan, such as `buy_now` or `waitlist`. + sig { returns(String) } + attr_accessor :release_method + + # Recurring price charged each billing period. + sig { returns(Float) } + attr_accessor :renewal_price + + # 3D Secure behavior for this plan, or `null` to use the account default. + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_level + + # Free trial days before the first renewal charge. + sig { returns(T.nilable(Integer)) } + attr_accessor :trial_period_days + + # Whether the plan is visible to customers or hidden from public view. + sig { returns(String) } + attr_accessor :visibility + + # Plan used for payment checkout. `null` in setup mode. + sig do + params( + id: String, + adaptive_pricing_enabled: T::Boolean, + billing_period: T.nilable(Integer), + currency: String, + expiration_days: T.nilable(Integer), + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: T.nilable(String), + trial_period_days: T.nilable(Integer), + visibility: String + ).returns(T.attached_class) + end + def self.new( + # Plan ID, prefixed `plan_`. + id:, + # Whether this plan accepts local currency payments via adaptive pricing. + adaptive_pricing_enabled:, + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. + billing_period:, + # Three-letter ISO currency code for the plan's prices. + currency:, + # Access duration in days for expiration-based plans. + expiration_days:, + # Initial purchase price in the plan currency. + initial_price:, + # Billing model for the plan: `renewal` (recurring) or `one_time` (single + # payment). + plan_type:, + # Sales method for the plan, such as `buy_now` or `waitlist`. + release_method:, + # Recurring price charged each billing period. + renewal_price:, + # 3D Secure behavior for this plan, or `null` to use the account default. + three_ds_level:, + # Free trial days before the first renewal charge. + trial_period_days:, + # Whether the plan is visible to customers or hidden from public view. + visibility: + ) + end + + sig do + override.returns( + { + id: String, + adaptive_pricing_enabled: T::Boolean, + billing_period: T.nilable(Integer), + currency: String, + expiration_days: T.nilable(Integer), + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: T.nilable(String), + trial_period_days: T.nilable(Integer), + visibility: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/company.rbi b/rbi/whop_sdk/models/company.rbi index 92a86fbb..ce59733a 100644 --- a/rbi/whop_sdk/models/company.rbi +++ b/rbi/whop_sdk/models/company.rbi @@ -66,7 +66,7 @@ module WhopSDK sig { returns(Integer) } attr_accessor :published_reviews_count - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. sig { returns(String) } attr_accessor :route @@ -147,7 +147,7 @@ module WhopSDK # The total number of published customer reviews across all products for this # company. published_reviews_count:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. route:, # Whether Whop sends transactional emails (receipts, updates) to customers on # behalf of this company. diff --git a/rbi/whop_sdk/models/company_list_response.rbi b/rbi/whop_sdk/models/company_list_response.rbi index 91bc4272..81fbf208 100644 --- a/rbi/whop_sdk/models/company_list_response.rbi +++ b/rbi/whop_sdk/models/company_list_response.rbi @@ -61,7 +61,7 @@ module WhopSDK sig { returns(Integer) } attr_accessor :published_reviews_count - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. sig { returns(String) } attr_accessor :route @@ -127,7 +127,7 @@ module WhopSDK # The total number of published customer reviews across all products for this # company. published_reviews_count:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. route:, # Whether Whop sends transactional emails (receipts, updates) to customers on # behalf of this company. diff --git a/rbi/whop_sdk/models/course.rbi b/rbi/whop_sdk/models/course.rbi index ac3c7d09..dde98ae2 100644 --- a/rbi/whop_sdk/models/course.rbi +++ b/rbi/whop_sdk/models/course.rbi @@ -427,7 +427,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -464,7 +464,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, diff --git a/rbi/whop_sdk/models/course_list_response.rbi b/rbi/whop_sdk/models/course_list_response.rbi index 61f00493..dd25c9dd 100644 --- a/rbi/whop_sdk/models/course_list_response.rbi +++ b/rbi/whop_sdk/models/course_list_response.rbi @@ -178,7 +178,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -215,7 +215,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, diff --git a/rbi/whop_sdk/models/deposit_create_params.rbi b/rbi/whop_sdk/models/deposit_create_params.rbi index 0af697e0..9e9e3af0 100644 --- a/rbi/whop_sdk/models/deposit_create_params.rbi +++ b/rbi/whop_sdk/models/deposit_create_params.rbi @@ -11,10 +11,6 @@ module WhopSDK T.any(WhopSDK::DepositCreateParams, WhopSDK::Internal::AnyHash) end - # Amount to deposit. - sig { returns(Float) } - attr_accessor :amount - # Destination account ID or wallet address. Object form is supported for # compatibility. sig do @@ -24,39 +20,46 @@ module WhopSDK end attr_accessor :destination - # Arbitrary metadata echoed in the response. + # Amount to prefill on hosted deposit page. + sig { returns(T.nilable(Float)) } + attr_reader :amount + + sig { params(amount: Float).void } + attr_writer :amount + + # Metadata to include with the deposit response. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } attr_writer :metadata - # Optional destination network override. + # Destination network override. sig { returns(T.nilable(String)) } attr_accessor :network sig do params( - amount: Float, destination: T.any( String, WhopSDK::DepositCreateParams::Destination::UnionMember1::OrHash ), + amount: Float, metadata: T::Hash[Symbol, T.anything], network: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Amount to deposit. - amount:, # Destination account ID or wallet address. Object form is supported for # compatibility. destination:, - # Arbitrary metadata echoed in the response. + # Amount to prefill on hosted deposit page. + amount: nil, + # Metadata to include with the deposit response. metadata: nil, - # Optional destination network override. + # Destination network override. network: nil, request_options: {} ) @@ -65,12 +68,12 @@ module WhopSDK sig do override.returns( { - amount: Float, destination: T.any( String, WhopSDK::DepositCreateParams::Destination::UnionMember1 ), + amount: Float, metadata: T::Hash[Symbol, T.anything], network: T.nilable(String), request_options: WhopSDK::RequestOptions @@ -102,18 +105,21 @@ module WhopSDK ) end + # Destination account ID. sig { returns(T.nilable(String)) } attr_reader :account_id sig { params(account_id: String).void } attr_writer :account_id + # Destination wallet address. sig { returns(T.nilable(String)) } attr_reader :address sig { params(address: String).void } attr_writer :address + # Destination wallet network. sig { returns(T.nilable(String)) } attr_reader :network @@ -127,7 +133,14 @@ module WhopSDK network: String ).returns(T.attached_class) end - def self.new(account_id: nil, address: nil, network: nil) + def self.new( + # Destination account ID. + account_id: nil, + # Destination wallet address. + address: nil, + # Destination wallet network. + network: nil + ) end sig do diff --git a/rbi/whop_sdk/models/deposit_create_response.rbi b/rbi/whop_sdk/models/deposit_create_response.rbi index 1b4bbdc4..b7027ab0 100644 --- a/rbi/whop_sdk/models/deposit_create_response.rbi +++ b/rbi/whop_sdk/models/deposit_create_response.rbi @@ -11,148 +11,400 @@ module WhopSDK ) end - sig { returns(String) } - attr_accessor :amount + # Account ID of the destination owner. Null for raw wallet address destinations. + sig { returns(T.nilable(String)) } + attr_accessor :account_id - sig { returns(WhopSDK::Models::DepositCreateResponse::DepositAddress) } - attr_reader :deposit_address + # URL of the hosted deposit page. Only present for business destinations. + sig { returns(T.nilable(String)) } + attr_accessor :hosted_url - sig do - params( - deposit_address: - WhopSDK::Models::DepositCreateResponse::DepositAddress::OrHash - ).void - end - attr_writer :deposit_address + # Metadata from the request. + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :metadata - sig { returns(WhopSDK::Models::DepositCreateResponse::Destination) } - attr_reader :destination + # Available deposit methods for destination. + sig { returns(WhopSDK::Models::DepositCreateResponse::Methods) } + attr_reader :methods_ sig do params( - destination: - WhopSDK::Models::DepositCreateResponse::Destination::OrHash + methods_: WhopSDK::Models::DepositCreateResponse::Methods::OrHash ).void end - attr_writer :destination - - sig { returns(T.nilable(String)) } - attr_accessor :hosted_url - - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :metadata + attr_writer :methods_ sig do returns(WhopSDK::Models::DepositCreateResponse::Object::TaggedSymbol) end attr_accessor :object + # Requested deposit amount. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + sig do params( - amount: String, - deposit_address: - WhopSDK::Models::DepositCreateResponse::DepositAddress::OrHash, - destination: - WhopSDK::Models::DepositCreateResponse::Destination::OrHash, + account_id: T.nilable(String), hosted_url: T.nilable(String), metadata: T::Hash[Symbol, T.anything], - object: WhopSDK::Models::DepositCreateResponse::Object::OrSymbol + methods_: WhopSDK::Models::DepositCreateResponse::Methods::OrHash, + object: WhopSDK::Models::DepositCreateResponse::Object::OrSymbol, + amount: String ).returns(T.attached_class) end def self.new( - amount:, - deposit_address:, - destination:, + # Account ID of the destination owner. Null for raw wallet address destinations. + account_id:, + # URL of the hosted deposit page. Only present for business destinations. hosted_url:, + # Metadata from the request. metadata:, - object: + # Available deposit methods for destination. + methods_:, + object:, + # Requested deposit amount. + amount: nil ) end sig do override.returns( { - amount: String, - deposit_address: - WhopSDK::Models::DepositCreateResponse::DepositAddress, - destination: WhopSDK::Models::DepositCreateResponse::Destination, + account_id: T.nilable(String), hosted_url: T.nilable(String), metadata: T::Hash[Symbol, T.anything], - object: WhopSDK::Models::DepositCreateResponse::Object::TaggedSymbol + methods_: WhopSDK::Models::DepositCreateResponse::Methods, + object: + WhopSDK::Models::DepositCreateResponse::Object::TaggedSymbol, + amount: String } ) end def to_hash end - class DepositAddress < WhopSDK::Internal::Type::BaseModel + class Methods < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::Models::DepositCreateResponse::DepositAddress, + WhopSDK::Models::DepositCreateResponse::Methods, WhopSDK::Internal::AnyHash ) end - sig { returns(String) } - attr_accessor :evm - - sig { returns(String) } - attr_accessor :solana - - sig { params(evm: String, solana: String).returns(T.attached_class) } - def self.new(evm:, solana:) + # Bank deposit details. Only present when bank deposits are active for the + # destination account. + sig do + returns( + T.nilable(WhopSDK::Models::DepositCreateResponse::Methods::Bank) + ) end + attr_reader :bank - sig { override.returns({ evm: String, solana: String }) } - def to_hash + sig do + params( + bank: + T.nilable( + WhopSDK::Models::DepositCreateResponse::Methods::Bank::OrHash + ) + ).void end - end - - class Destination < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::DepositCreateResponse::Destination, - WhopSDK::Internal::AnyHash - ) - end + attr_writer :bank - sig { returns(String) } - attr_accessor :address - - sig { returns(String) } - attr_accessor :currency - - sig { returns(String) } - attr_accessor :network - - sig { returns(T.nilable(String)) } - attr_accessor :account_id + # Crypto networks available for this deposit, each with its on-chain deposit + # address and the tokens accepted on that network. + sig do + returns( + T::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto] + ) + end + attr_accessor :crypto + # Available deposit methods for destination. sig do params( - address: String, - currency: String, - network: String, - account_id: T.nilable(String) + bank: + T.nilable( + WhopSDK::Models::DepositCreateResponse::Methods::Bank::OrHash + ), + crypto: + T::Array[ + WhopSDK::Models::DepositCreateResponse::Methods::Crypto::OrHash + ] ).returns(T.attached_class) end - def self.new(address:, currency:, network:, account_id: nil) + def self.new( + # Bank deposit details. Only present when bank deposits are active for the + # destination account. + bank:, + # Crypto networks available for this deposit, each with its on-chain deposit + # address and the tokens accepted on that network. + crypto: + ) end sig do override.returns( { - address: String, - currency: String, - network: String, - account_id: T.nilable(String) + bank: + T.nilable( + WhopSDK::Models::DepositCreateResponse::Methods::Bank + ), + crypto: + T::Array[ + WhopSDK::Models::DepositCreateResponse::Methods::Crypto + ] } ) end def to_hash end + + class Bank < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::DepositCreateResponse::Methods::Bank, + WhopSDK::Internal::AnyHash + ) + end + + # Bank transfer currencies available for this deposit. + sig do + returns( + T::Array[ + WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency + ] + ) + end + attr_accessor :currencies + + # Bank deposit details. Only present when bank deposits are active for the + # destination account. + sig do + params( + currencies: + T::Array[ + WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Bank transfer currencies available for this deposit. + currencies: + ) + end + + sig do + override.returns( + { + currencies: + T::Array[ + WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency + ] + } + ) + end + def to_hash + end + + class Currency < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency, + WhopSDK::Internal::AnyHash + ) + end + + # Bank account number for deposits in this currency. + sig { returns(T.nilable(String)) } + attr_accessor :account_number + + # Currency supported by these bank instructions. + sig { returns(String) } + attr_accessor :currency + + # Receiving bank name. + sig { returns(T.nilable(String)) } + attr_accessor :deposit_bank_name + + # Beneficiary name to use for transfer. + sig { returns(T.nilable(String)) } + attr_accessor :deposit_beneficiary_name + + # Reference to include with bank transfer. + sig { returns(T.nilable(String)) } + attr_accessor :deposit_reference + + # Active deposit rails for this currency, such as `ach`, `wire`, or `sepa`. + sig { returns(T::Array[String]) } + attr_accessor :rails + + # Bank routing number for deposits in this currency. + sig { returns(T.nilable(String)) } + attr_accessor :routing_number + + sig do + params( + account_number: T.nilable(String), + currency: String, + deposit_bank_name: T.nilable(String), + deposit_beneficiary_name: T.nilable(String), + deposit_reference: T.nilable(String), + rails: T::Array[String], + routing_number: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Bank account number for deposits in this currency. + account_number:, + # Currency supported by these bank instructions. + currency:, + # Receiving bank name. + deposit_bank_name:, + # Beneficiary name to use for transfer. + deposit_beneficiary_name:, + # Reference to include with bank transfer. + deposit_reference:, + # Active deposit rails for this currency, such as `ach`, `wire`, or `sepa`. + rails:, + # Bank routing number for deposits in this currency. + routing_number: + ) + end + + sig do + override.returns( + { + account_number: T.nilable(String), + currency: String, + deposit_bank_name: T.nilable(String), + deposit_beneficiary_name: T.nilable(String), + deposit_reference: T.nilable(String), + rails: T::Array[String], + routing_number: T.nilable(String) + } + ) + end + def to_hash + end + end + end + + class Crypto < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::DepositCreateResponse::Methods::Crypto, + WhopSDK::Internal::AnyHash + ) + end + + # Address to send funds to on this network. Null when the provider has not issued + # one yet. + sig { returns(T.nilable(String)) } + attr_accessor :deposit_address + + # Network icon URL. + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Network display name, such as `Ethereum` or `Solana`. + sig { returns(String) } + attr_accessor :name + + # Tokens accepted for deposit on this network. + sig do + returns( + T::Array[ + WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency + ] + ) + end + attr_accessor :supported_currencies + + sig do + params( + deposit_address: T.nilable(String), + icon_url: T.nilable(String), + name: String, + supported_currencies: + T::Array[ + WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Address to send funds to on this network. Null when the provider has not issued + # one yet. + deposit_address:, + # Network icon URL. + icon_url:, + # Network display name, such as `Ethereum` or `Solana`. + name:, + # Tokens accepted for deposit on this network. + supported_currencies: + ) + end + + sig do + override.returns( + { + deposit_address: T.nilable(String), + icon_url: T.nilable(String), + name: String, + supported_currencies: + T::Array[ + WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency + ] + } + ) + end + def to_hash + end + + class SupportedCurrency < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency, + WhopSDK::Internal::AnyHash + ) + end + + # Token icon URL. Null when no icon is available. + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Token symbol, such as `USDC`. + sig { returns(String) } + attr_accessor :name + + sig do + params(icon_url: T.nilable(String), name: String).returns( + T.attached_class + ) + end + def self.new( + # Token icon URL. Null when no icon is available. + icon_url:, + # Token symbol, such as `USDC`. + name: + ) + end + + sig do + override.returns({ icon_url: T.nilable(String), name: String }) + end + def to_hash + end + end + end end module Object diff --git a/rbi/whop_sdk/models/wallet_balance_params.rbi b/rbi/whop_sdk/models/deposit_list_params.rbi similarity index 70% rename from rbi/whop_sdk/models/wallet_balance_params.rbi rename to rbi/whop_sdk/models/deposit_list_params.rbi index d373f7d9..5411c1ef 100644 --- a/rbi/whop_sdk/models/wallet_balance_params.rbi +++ b/rbi/whop_sdk/models/deposit_list_params.rbi @@ -2,16 +2,16 @@ module WhopSDK module Models - class WalletBalanceParams < WhopSDK::Internal::Type::BaseModel + class DepositListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters OrHash = T.type_alias do - T.any(WhopSDK::WalletBalanceParams, WhopSDK::Internal::AnyHash) + T.any(WhopSDK::DepositListParams, WhopSDK::Internal::AnyHash) end - # The business or user account ID whose wallet balance should be returned. + # Business account ID (biz\_\*). sig { returns(String) } attr_accessor :account_id @@ -22,7 +22,7 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # The business or user account ID whose wallet balance should be returned. + # Business account ID (biz\_\*). account_id:, request_options: {} ) diff --git a/rbi/whop_sdk/models/deposit_list_response.rbi b/rbi/whop_sdk/models/deposit_list_response.rbi new file mode 100644 index 00000000..008d88d6 --- /dev/null +++ b/rbi/whop_sdk/models/deposit_list_response.rbi @@ -0,0 +1,163 @@ +# typed: strong + +module WhopSDK + module Models + class DepositListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::DepositListResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Account ID that owns these deposit transactions. + sig { returns(String) } + attr_accessor :account_id + + # Bank deposit transactions for this account. + sig { returns(T::Array[WhopSDK::Models::DepositListResponse::Bank]) } + attr_accessor :bank + + sig do + returns(WhopSDK::Models::DepositListResponse::Object::TaggedSymbol) + end + attr_accessor :object + + sig do + params( + account_id: String, + bank: T::Array[WhopSDK::Models::DepositListResponse::Bank::OrHash], + object: WhopSDK::Models::DepositListResponse::Object::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Account ID that owns these deposit transactions. + account_id:, + # Bank deposit transactions for this account. + bank:, + object: + ) + end + + sig do + override.returns( + { + account_id: String, + bank: T::Array[WhopSDK::Models::DepositListResponse::Bank], + object: WhopSDK::Models::DepositListResponse::Object::TaggedSymbol + } + ) + end + def to_hash + end + + class Bank < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::DepositListResponse::Bank, + WhopSDK::Internal::AnyHash + ) + end + + # Bank deposit transaction ID. + sig { returns(String) } + attr_accessor :id + + # When the bank deposit transaction was created. + sig { returns(Time) } + attr_accessor :created_at + + # Amount credited to the account balance. + sig { returns(T.nilable(String)) } + attr_accessor :destination_amount + + # Currency credited to the account balance. + sig { returns(T.nilable(String)) } + attr_accessor :destination_currency + + # Amount sent by the depositor. + sig { returns(String) } + attr_accessor :source_amount + + # Currency sent by the depositor. + sig { returns(String) } + attr_accessor :source_currency + + # Current bank deposit status. + sig { returns(String) } + attr_accessor :status + + sig do + params( + id: String, + created_at: Time, + destination_amount: T.nilable(String), + destination_currency: T.nilable(String), + source_amount: String, + source_currency: String, + status: String + ).returns(T.attached_class) + end + def self.new( + # Bank deposit transaction ID. + id:, + # When the bank deposit transaction was created. + created_at:, + # Amount credited to the account balance. + destination_amount:, + # Currency credited to the account balance. + destination_currency:, + # Amount sent by the depositor. + source_amount:, + # Currency sent by the depositor. + source_currency:, + # Current bank deposit status. + status: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + destination_amount: T.nilable(String), + destination_currency: T.nilable(String), + source_amount: String, + source_currency: String, + status: String + } + ) + end + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::DepositListResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPOSITS = + T.let( + :deposits, + WhopSDK::Models::DepositListResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::DepositListResponse::Object::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/dispute.rbi b/rbi/whop_sdk/models/dispute.rbi index d032c193..aab22e3e 100644 --- a/rbi/whop_sdk/models/dispute.rbi +++ b/rbi/whop_sdk/models/dispute.rbi @@ -350,7 +350,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -380,7 +380,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, @@ -450,7 +450,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -480,7 +480,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, @@ -884,7 +884,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -914,7 +914,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, @@ -955,7 +955,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -985,7 +985,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, diff --git a/rbi/whop_sdk/models/conversion_create_params.rbi b/rbi/whop_sdk/models/event_create_params.rbi similarity index 64% rename from rbi/whop_sdk/models/conversion_create_params.rbi rename to rbi/whop_sdk/models/event_create_params.rbi index 8d50c14b..8972ebe6 100644 --- a/rbi/whop_sdk/models/conversion_create_params.rbi +++ b/rbi/whop_sdk/models/event_create_params.rbi @@ -2,44 +2,42 @@ module WhopSDK module Models - class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel + class EventCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters OrHash = T.type_alias do - T.any(WhopSDK::ConversionCreateParams, WhopSDK::Internal::AnyHash) + T.any(WhopSDK::EventCreateParams, WhopSDK::Internal::AnyHash) end - # The company to associate with this event. + # The account to associate with this event. sig { returns(String) } - attr_accessor :company_id + attr_accessor :account_id - # The type of event. - sig { returns(WhopSDK::ConversionCreateParams::EventName::OrSymbol) } + # The type of conversion or engagement event + sig { returns(WhopSDK::EventCreateParams::EventName::OrSymbol) } attr_accessor :event_name # The channel where an event originated sig do - returns( - T.nilable(WhopSDK::ConversionCreateParams::ActionSource::OrSymbol) - ) + returns(T.nilable(WhopSDK::EventCreateParams::ActionSource::OrSymbol)) end attr_accessor :action_source # Tracking and attribution context. - sig { returns(T.nilable(WhopSDK::ConversionCreateParams::Context)) } + sig { returns(T.nilable(WhopSDK::EventCreateParams::Context)) } attr_reader :context sig do params( - context: T.nilable(WhopSDK::ConversionCreateParams::Context::OrHash) + context: T.nilable(WhopSDK::EventCreateParams::Context::OrHash) ).void end attr_writer :context # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } + sig { returns(T.nilable(WhopSDK::EventCreateParams::Currency::OrSymbol)) } attr_accessor :currency # Custom event name when event_name is 'custom'. Maximum 35 chars for this value. @@ -88,13 +86,11 @@ module WhopSDK attr_accessor :url # User identity and profile data. - sig { returns(T.nilable(WhopSDK::ConversionCreateParams::User)) } + sig { returns(T.nilable(WhopSDK::EventCreateParams::User)) } attr_reader :user sig do - params( - user: T.nilable(WhopSDK::ConversionCreateParams::User::OrHash) - ).void + params(user: T.nilable(WhopSDK::EventCreateParams::User::OrHash)).void end attr_writer :user @@ -104,12 +100,12 @@ module WhopSDK sig do params( - company_id: String, - event_name: WhopSDK::ConversionCreateParams::EventName::OrSymbol, + account_id: String, + event_name: WhopSDK::EventCreateParams::EventName::OrSymbol, action_source: - T.nilable(WhopSDK::ConversionCreateParams::ActionSource::OrSymbol), - context: T.nilable(WhopSDK::ConversionCreateParams::Context::OrHash), - currency: T.nilable(WhopSDK::Currency::OrSymbol), + T.nilable(WhopSDK::EventCreateParams::ActionSource::OrSymbol), + context: T.nilable(WhopSDK::EventCreateParams::Context::OrHash), + currency: T.nilable(WhopSDK::EventCreateParams::Currency::OrSymbol), custom_name: T.nilable(String), duration: T.nilable(Integer), event_id: T.nilable(String), @@ -121,15 +117,15 @@ module WhopSDK source: T.nilable(String), title: T.nilable(String), url: T.nilable(String), - user: T.nilable(WhopSDK::ConversionCreateParams::User::OrHash), + user: T.nilable(WhopSDK::EventCreateParams::User::OrHash), value: T.nilable(Float), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The company to associate with this event. - company_id:, - # The type of event. + # The account to associate with this event. + account_id:, + # The type of conversion or engagement event event_name:, # The channel where an event originated action_source: nil, @@ -171,14 +167,12 @@ module WhopSDK sig do override.returns( { - company_id: String, - event_name: WhopSDK::ConversionCreateParams::EventName::OrSymbol, + account_id: String, + event_name: WhopSDK::EventCreateParams::EventName::OrSymbol, action_source: - T.nilable( - WhopSDK::ConversionCreateParams::ActionSource::OrSymbol - ), - context: T.nilable(WhopSDK::ConversionCreateParams::Context), - currency: T.nilable(WhopSDK::Currency::OrSymbol), + T.nilable(WhopSDK::EventCreateParams::ActionSource::OrSymbol), + context: T.nilable(WhopSDK::EventCreateParams::Context), + currency: T.nilable(WhopSDK::EventCreateParams::Currency::OrSymbol), custom_name: T.nilable(String), duration: T.nilable(Integer), event_id: T.nilable(String), @@ -190,7 +184,7 @@ module WhopSDK source: T.nilable(String), title: T.nilable(String), url: T.nilable(String), - user: T.nilable(WhopSDK::ConversionCreateParams::User), + user: T.nilable(WhopSDK::EventCreateParams::User), value: T.nilable(Float), request_options: WhopSDK::RequestOptions } @@ -199,59 +193,46 @@ module WhopSDK def to_hash end - # The type of event. + # The type of conversion or engagement event module EventName extend WhopSDK::Internal::Type::Enum TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::ConversionCreateParams::EventName) - end + T.type_alias { T.all(Symbol, WhopSDK::EventCreateParams::EventName) } OrSymbol = T.type_alias { T.any(Symbol, String) } - LEAD = - T.let(:lead, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol) + LEAD = T.let(:lead, WhopSDK::EventCreateParams::EventName::TaggedSymbol) SUBMIT_APPLICATION = T.let( :submit_application, - WhopSDK::ConversionCreateParams::EventName::TaggedSymbol + WhopSDK::EventCreateParams::EventName::TaggedSymbol ) CONTACT = - T.let( - :contact, - WhopSDK::ConversionCreateParams::EventName::TaggedSymbol - ) + T.let(:contact, WhopSDK::EventCreateParams::EventName::TaggedSymbol) COMPLETE_REGISTRATION = T.let( :complete_registration, - WhopSDK::ConversionCreateParams::EventName::TaggedSymbol + WhopSDK::EventCreateParams::EventName::TaggedSymbol ) SCHEDULE = - T.let( - :schedule, - WhopSDK::ConversionCreateParams::EventName::TaggedSymbol - ) + T.let(:schedule, WhopSDK::EventCreateParams::EventName::TaggedSymbol) VIEW_CONTENT = T.let( :view_content, - WhopSDK::ConversionCreateParams::EventName::TaggedSymbol + WhopSDK::EventCreateParams::EventName::TaggedSymbol ) ADD_TO_CART = T.let( :add_to_cart, - WhopSDK::ConversionCreateParams::EventName::TaggedSymbol + WhopSDK::EventCreateParams::EventName::TaggedSymbol ) CUSTOM = - T.let( - :custom, - WhopSDK::ConversionCreateParams::EventName::TaggedSymbol - ) - PAGE = - T.let(:page, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol) + T.let(:custom, WhopSDK::EventCreateParams::EventName::TaggedSymbol) + PAGE = T.let(:page, WhopSDK::EventCreateParams::EventName::TaggedSymbol) sig do override.returns( - T::Array[WhopSDK::ConversionCreateParams::EventName::TaggedSymbol] + T::Array[WhopSDK::EventCreateParams::EventName::TaggedSymbol] ) end def self.values @@ -264,61 +245,47 @@ module WhopSDK TaggedSymbol = T.type_alias do - T.all(Symbol, WhopSDK::ConversionCreateParams::ActionSource) + T.all(Symbol, WhopSDK::EventCreateParams::ActionSource) end OrSymbol = T.type_alias { T.any(Symbol, String) } EMAIL = - T.let( - :email, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol - ) + T.let(:email, WhopSDK::EventCreateParams::ActionSource::TaggedSymbol) WEBSITE = T.let( :website, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol + WhopSDK::EventCreateParams::ActionSource::TaggedSymbol ) APP = - T.let( - :app, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol - ) + T.let(:app, WhopSDK::EventCreateParams::ActionSource::TaggedSymbol) PHONE_CALL = T.let( :phone_call, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol + WhopSDK::EventCreateParams::ActionSource::TaggedSymbol ) CHAT = - T.let( - :chat, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol - ) + T.let(:chat, WhopSDK::EventCreateParams::ActionSource::TaggedSymbol) PHYSICAL_STORE = T.let( :physical_store, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol + WhopSDK::EventCreateParams::ActionSource::TaggedSymbol ) SYSTEM_GENERATED = T.let( :system_generated, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol + WhopSDK::EventCreateParams::ActionSource::TaggedSymbol ) BUSINESS_MESSAGING = T.let( :business_messaging, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol + WhopSDK::EventCreateParams::ActionSource::TaggedSymbol ) OTHER = - T.let( - :other, - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol - ) + T.let(:other, WhopSDK::EventCreateParams::ActionSource::TaggedSymbol) sig do override.returns( - T::Array[ - WhopSDK::ConversionCreateParams::ActionSource::TaggedSymbol - ] + T::Array[WhopSDK::EventCreateParams::ActionSource::TaggedSymbol] ) end def self.values @@ -329,7 +296,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::ConversionCreateParams::Context, + WhopSDK::EventCreateParams::Context, WhopSDK::Internal::AnyHash ) end @@ -601,13 +568,119 @@ module WhopSDK end end + # The available currencies on the platform + module Currency + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::EventCreateParams::Currency) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USD = T.let(:usd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + SGD = T.let(:sgd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + INR = T.let(:inr, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + AUD = T.let(:aud, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + BRL = T.let(:brl, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + CAD = T.let(:cad, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + DKK = T.let(:dkk, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + EUR = T.let(:eur, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + NOK = T.let(:nok, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + GBP = T.let(:gbp, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + SEK = T.let(:sek, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + CHF = T.let(:chf, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + HKD = T.let(:hkd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + HUF = T.let(:huf, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + JPY = T.let(:jpy, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MXN = T.let(:mxn, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MYR = T.let(:myr, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + PLN = T.let(:pln, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + CZK = T.let(:czk, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + NZD = T.let(:nzd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + AED = T.let(:aed, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + ETH = T.let(:eth, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + APE = T.let(:ape, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + COP = T.let(:cop, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + RON = T.let(:ron, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + THB = T.let(:thb, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + BGN = T.let(:bgn, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + IDR = T.let(:idr, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + DOP = T.let(:dop, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + PHP = T.let(:php, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + TRY = T.let(:try, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + KRW = T.let(:krw, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + TWD = T.let(:twd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + VND = T.let(:vnd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + PKR = T.let(:pkr, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + CLP = T.let(:clp, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + UYU = T.let(:uyu, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + ARS = T.let(:ars, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + ZAR = T.let(:zar, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + DZD = T.let(:dzd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + TND = T.let(:tnd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MAD = T.let(:mad, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + KES = T.let(:kes, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + KWD = T.let(:kwd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + JOD = T.let(:jod, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + ALL = T.let(:all, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + XCD = T.let(:xcd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + AMD = T.let(:amd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + BSD = T.let(:bsd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + BHD = T.let(:bhd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + BOB = T.let(:bob, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + BAM = T.let(:bam, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + KHR = T.let(:khr, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + CRC = T.let(:crc, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + XOF = T.let(:xof, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + EGP = T.let(:egp, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + ETB = T.let(:etb, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + GMD = T.let(:gmd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + GHS = T.let(:ghs, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + GTQ = T.let(:gtq, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + GYD = T.let(:gyd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + ILS = T.let(:ils, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + JMD = T.let(:jmd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MOP = T.let(:mop, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MGA = T.let(:mga, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MUR = T.let(:mur, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MDL = T.let(:mdl, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MNT = T.let(:mnt, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + NAD = T.let(:nad, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + NGN = T.let(:ngn, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + MKD = T.let(:mkd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + OMR = T.let(:omr, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + PYG = T.let(:pyg, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + PEN = T.let(:pen, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + QAR = T.let(:qar, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + RWF = T.let(:rwf, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + SAR = T.let(:sar, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + RSD = T.let(:rsd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + LKR = T.let(:lkr, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + TZS = T.let(:tzs, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + TTD = T.let(:ttd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + UZS = T.let(:uzs, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + RUB = T.let(:rub, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + BTC = T.let(:btc, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + CNY = T.let(:cny, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + USDT = T.let(:usdt, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + KZT = T.let(:kzt, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + AWG = T.let(:awg, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + WHOP_USD = + T.let(:whop_usd, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + XAU = T.let(:xau, WhopSDK::EventCreateParams::Currency::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::EventCreateParams::Currency::TaggedSymbol] + ) + end + def self.values + end + end + class User < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do - T.any( - WhopSDK::ConversionCreateParams::User, - WhopSDK::Internal::AnyHash - ) + T.any(WhopSDK::EventCreateParams::User, WhopSDK::Internal::AnyHash) end # An anonymous identifier for the user. @@ -640,9 +713,7 @@ module WhopSDK # Gender sig do - returns( - T.nilable(WhopSDK::ConversionCreateParams::User::Gender::OrSymbol) - ) + returns(T.nilable(WhopSDK::EventCreateParams::User::Gender::OrSymbol)) end attr_accessor :gender @@ -702,9 +773,7 @@ module WhopSDK external_id: T.nilable(String), first_name: T.nilable(String), gender: - T.nilable( - WhopSDK::ConversionCreateParams::User::Gender::OrSymbol - ), + T.nilable(WhopSDK::EventCreateParams::User::Gender::OrSymbol), last_name: T.nilable(String), linked_anonymous_id: T.nilable(String), linked_wuid: T.nilable(String), @@ -772,9 +841,7 @@ module WhopSDK external_id: T.nilable(String), first_name: T.nilable(String), gender: - T.nilable( - WhopSDK::ConversionCreateParams::User::Gender::OrSymbol - ), + T.nilable(WhopSDK::EventCreateParams::User::Gender::OrSymbol), last_name: T.nilable(String), linked_anonymous_id: T.nilable(String), linked_wuid: T.nilable(String), @@ -798,26 +865,21 @@ module WhopSDK TaggedSymbol = T.type_alias do - T.all(Symbol, WhopSDK::ConversionCreateParams::User::Gender) + T.all(Symbol, WhopSDK::EventCreateParams::User::Gender) end OrSymbol = T.type_alias { T.any(Symbol, String) } MALE = - T.let( - :male, - WhopSDK::ConversionCreateParams::User::Gender::TaggedSymbol - ) + T.let(:male, WhopSDK::EventCreateParams::User::Gender::TaggedSymbol) FEMALE = T.let( :female, - WhopSDK::ConversionCreateParams::User::Gender::TaggedSymbol + WhopSDK::EventCreateParams::User::Gender::TaggedSymbol ) sig do override.returns( - T::Array[ - WhopSDK::ConversionCreateParams::User::Gender::TaggedSymbol - ] + T::Array[WhopSDK::EventCreateParams::User::Gender::TaggedSymbol] ) end def self.values diff --git a/rbi/whop_sdk/models/conversion_create_response.rbi b/rbi/whop_sdk/models/event_create_response.rbi similarity index 56% rename from rbi/whop_sdk/models/conversion_create_response.rbi rename to rbi/whop_sdk/models/event_create_response.rbi index 5a7624bb..d06ce992 100644 --- a/rbi/whop_sdk/models/conversion_create_response.rbi +++ b/rbi/whop_sdk/models/event_create_response.rbi @@ -2,25 +2,20 @@ module WhopSDK module Models - class ConversionCreateResponse < WhopSDK::Internal::Type::BaseModel + class EventCreateResponse < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::Models::ConversionCreateResponse, + WhopSDK::Models::EventCreateResponse, WhopSDK::Internal::AnyHash ) end - # The unique identifier for the conversion sig { returns(String) } attr_accessor :id - # A tracked conversion event sig { params(id: String).returns(T.attached_class) } - def self.new( - # The unique identifier for the conversion - id: - ) + def self.new(id:) end sig { override.returns({ id: String }) } diff --git a/rbi/whop_sdk/models/event_list_params.rbi b/rbi/whop_sdk/models/event_list_params.rbi new file mode 100644 index 00000000..b7f0acd2 --- /dev/null +++ b/rbi/whop_sdk/models/event_list_params.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module WhopSDK + module Models + class EventListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::EventListParams, WhopSDK::Internal::AnyHash) + end + + # The ID of the person. + sig { returns(String) } + attr_accessor :person_id + + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # A cursor for fetching events after a previous page. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # A cursor for fetching events before a later page. + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # The number of events to return. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # Start of the time range as a Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :from + + sig { params(from: Integer).void } + attr_writer :from + + # End of the time range as a Unix timestamp. Defaults to now. + sig { returns(T.nilable(Integer)) } + attr_reader :to + + sig { params(to: Integer).void } + attr_writer :to + + sig do + params( + person_id: String, + account_id: String, + after: String, + before: String, + first: Integer, + from: Integer, + to: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the person. + person_id:, + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + account_id: nil, + # A cursor for fetching events after a previous page. + after: nil, + # A cursor for fetching events before a later page. + before: nil, + # The number of events to return. + first: nil, + # Start of the time range as a Unix timestamp. + from: nil, + # End of the time range as a Unix timestamp. Defaults to now. + to: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + person_id: String, + account_id: String, + after: String, + before: String, + first: Integer, + from: Integer, + to: Integer, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/event_list_response.rbi b/rbi/whop_sdk/models/event_list_response.rbi new file mode 100644 index 00000000..d6e99540 --- /dev/null +++ b/rbi/whop_sdk/models/event_list_response.rbi @@ -0,0 +1,350 @@ +# typed: strong + +module WhopSDK + module Models + class EventListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::EventListResponse, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :event_id + + sig { returns(String) } + attr_accessor :event_name + + sig { returns(Integer) } + attr_accessor :event_time + + sig { returns(T.nilable(WhopSDK::Models::EventListResponse::Context)) } + attr_reader :context + + sig do + params( + context: + T.nilable(WhopSDK::Models::EventListResponse::Context::OrHash) + ).void + end + attr_writer :context + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :custom_name + + sig { returns(T.nilable(String)) } + attr_accessor :path + + sig do + returns( + T.nilable(T::Array[WhopSDK::Models::EventListResponse::Question]) + ) + end + attr_accessor :questions + + sig { returns(T.nilable(String)) } + attr_accessor :referrer_url + + sig { returns(T.nilable(Float)) } + attr_accessor :total_usd_amount + + sig { returns(T.nilable(String)) } + attr_accessor :url + + sig { returns(T.nilable(WhopSDK::Models::EventListResponse::User)) } + attr_reader :user + + sig do + params( + user: T.nilable(WhopSDK::Models::EventListResponse::User::OrHash) + ).void + end + attr_writer :user + + sig { returns(T.nilable(Float)) } + attr_accessor :value + + sig do + params( + id: String, + event_id: String, + event_name: String, + event_time: Integer, + context: + T.nilable(WhopSDK::Models::EventListResponse::Context::OrHash), + currency: T.nilable(String), + custom_name: T.nilable(String), + path: T.nilable(String), + questions: + T.nilable( + T::Array[WhopSDK::Models::EventListResponse::Question::OrHash] + ), + referrer_url: T.nilable(String), + total_usd_amount: T.nilable(Float), + url: T.nilable(String), + user: T.nilable(WhopSDK::Models::EventListResponse::User::OrHash), + value: T.nilable(Float) + ).returns(T.attached_class) + end + def self.new( + id:, + event_id:, + event_name:, + event_time:, + context: nil, + currency: nil, + custom_name: nil, + path: nil, + questions: nil, + referrer_url: nil, + total_usd_amount: nil, + url: nil, + user: nil, + value: nil + ) + end + + sig do + override.returns( + { + id: String, + event_id: String, + event_name: String, + event_time: Integer, + context: T.nilable(WhopSDK::Models::EventListResponse::Context), + currency: T.nilable(String), + custom_name: T.nilable(String), + path: T.nilable(String), + questions: + T.nilable(T::Array[WhopSDK::Models::EventListResponse::Question]), + referrer_url: T.nilable(String), + total_usd_amount: T.nilable(Float), + url: T.nilable(String), + user: T.nilable(WhopSDK::Models::EventListResponse::User), + value: T.nilable(Float) + } + ) + end + def to_hash + end + + class Context < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::EventListResponse::Context, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :ad_campaign_id + + sig { returns(T.nilable(String)) } + attr_accessor :ad_id + + sig { returns(T.nilable(String)) } + attr_accessor :ad_set_id + + sig { returns(T.nilable(String)) } + attr_accessor :utm_campaign + + sig { returns(T.nilable(String)) } + attr_accessor :utm_content + + sig { returns(T.nilable(String)) } + attr_accessor :utm_medium + + sig { returns(T.nilable(String)) } + attr_accessor :utm_source + + sig { returns(T.nilable(String)) } + attr_accessor :utm_term + + sig do + params( + ad_campaign_id: T.nilable(String), + ad_id: T.nilable(String), + ad_set_id: T.nilable(String), + utm_campaign: T.nilable(String), + utm_content: T.nilable(String), + utm_medium: T.nilable(String), + utm_source: T.nilable(String), + utm_term: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + ad_campaign_id: nil, + ad_id: nil, + ad_set_id: nil, + utm_campaign: nil, + utm_content: nil, + utm_medium: nil, + utm_source: nil, + utm_term: nil + ) + end + + sig do + override.returns( + { + ad_campaign_id: T.nilable(String), + ad_id: T.nilable(String), + ad_set_id: T.nilable(String), + utm_campaign: T.nilable(String), + utm_content: T.nilable(String), + utm_medium: T.nilable(String), + utm_source: T.nilable(String), + utm_term: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Question < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::EventListResponse::Question, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :answer + + sig { returns(T.nilable(String)) } + attr_accessor :key + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :options + + sig { returns(T.nilable(String)) } + attr_accessor :question + + sig { returns(T.nilable(String)) } + attr_accessor :type + + sig do + params( + id: T.nilable(String), + answer: T.nilable(String), + key: T.nilable(String), + options: T.nilable(T::Array[String]), + question: T.nilable(String), + type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id: nil, + answer: nil, + key: nil, + options: nil, + question: nil, + type: nil + ) + end + + sig do + override.returns( + { + id: T.nilable(String), + answer: T.nilable(String), + key: T.nilable(String), + options: T.nilable(T::Array[String]), + question: T.nilable(String), + type: T.nilable(String) + } + ) + end + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::EventListResponse::User, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :phone + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + email: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + name: T.nilable(String), + phone: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + city: nil, + country: nil, + email: nil, + first_name: nil, + last_name: nil, + name: nil, + phone: nil, + state: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + email: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + name: T.nilable(String), + phone: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/experience.rbi b/rbi/whop_sdk/models/experience.rbi index 81c12a83..28d9c2c8 100644 --- a/rbi/whop_sdk/models/experience.rbi +++ b/rbi/whop_sdk/models/experience.rbi @@ -212,7 +212,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. sig { returns(String) } attr_accessor :route @@ -229,7 +229,7 @@ module WhopSDK def self.new( # The unique identifier for the company. id:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. route:, # The display name of the company shown to customers. title: @@ -277,8 +277,8 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. sig { returns(String) } attr_accessor :route @@ -297,8 +297,8 @@ module WhopSDK def self.new( # The unique identifier for the product. id:, - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. route:, # The display name of the product shown to customers on the product page and in # search results. diff --git a/rbi/whop_sdk/models/experience_list_response.rbi b/rbi/whop_sdk/models/experience_list_response.rbi index 75184c3d..31f54c5a 100644 --- a/rbi/whop_sdk/models/experience_list_response.rbi +++ b/rbi/whop_sdk/models/experience_list_response.rbi @@ -237,7 +237,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. sig { returns(String) } attr_accessor :route @@ -254,7 +254,7 @@ module WhopSDK def self.new( # The unique identifier for the company. id:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. route:, # The display name of the company shown to customers. title: diff --git a/rbi/whop_sdk/models/external_ad_status.rbi b/rbi/whop_sdk/models/external_ad_status.rbi deleted file mode 100644 index d45dd5ae..00000000 --- a/rbi/whop_sdk/models/external_ad_status.rbi +++ /dev/null @@ -1,26 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - # The status of an external ad. - module ExternalAdStatus - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::ExternalAdStatus) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ACTIVE = T.let(:active, WhopSDK::ExternalAdStatus::TaggedSymbol) - PAUSED = T.let(:paused, WhopSDK::ExternalAdStatus::TaggedSymbol) - INACTIVE = T.let(:inactive, WhopSDK::ExternalAdStatus::TaggedSymbol) - IN_REVIEW = T.let(:in_review, WhopSDK::ExternalAdStatus::TaggedSymbol) - REJECTED = T.let(:rejected, WhopSDK::ExternalAdStatus::TaggedSymbol) - FLAGGED = T.let(:flagged, WhopSDK::ExternalAdStatus::TaggedSymbol) - - sig do - override.returns(T::Array[WhopSDK::ExternalAdStatus::TaggedSymbol]) - end - def self.values - end - end - end -end diff --git a/rbi/whop_sdk/models/financial_activity_list_params.rbi b/rbi/whop_sdk/models/financial_activity_list_params.rbi index de9de9f2..5257b8fa 100644 --- a/rbi/whop_sdk/models/financial_activity_list_params.rbi +++ b/rbi/whop_sdk/models/financial_activity_list_params.rbi @@ -21,7 +21,24 @@ module WhopSDK sig { params(account_id: String).void } attr_writer :account_id - # Optional currency code filter, for example usd. + # Only include rows whose funds became withdrawable on or after this `YYYY-MM-DD` + # settlement date (UTC), distinct from posted_at. Requires currency. + sig { returns(T.nilable(Date)) } + attr_reader :available_after + + sig { params(available_after: Date).void } + attr_writer :available_after + + # Only include rows whose funds became withdrawable on or before this `YYYY-MM-DD` + # settlement date (UTC). Set equal to available_after for a single day. Requires + # currency. + sig { returns(T.nilable(Date)) } + attr_reader :available_before + + sig { params(available_before: Date).void } + attr_writer :available_before + + # Optional currency code filter, for example `usd`. sig { returns(T.nilable(String)) } attr_reader :currency @@ -35,6 +52,16 @@ module WhopSDK sig { params(cursor: String).void } attr_writer :cursor + # When true, aggregates the authenticated user's personal ledger with the + # businesses they own (owner role with balance read) into one feed. Requires + # user_id to be the authenticated user; cannot be combined with account_id or the + # settlement-date filters. Each returned row includes the owning `account`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_owned_accounts + + sig { params(include_owned_accounts: T::Boolean).void } + attr_writer :include_owned_accounts + # Maximum number of rows to return. sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -42,7 +69,9 @@ module WhopSDK sig { params(limit: Integer).void } attr_writer :limit - # Optional ledger line categories to include. + # Optional ledger line categories to include. Some categories (for example + # `onchain_deposit`, which covers inbound crypto deposits such as MoonPay onramps) + # are only returned when explicitly requested here. sig { returns(T.nilable(T::Array[String])) } attr_reader :line_types @@ -73,8 +102,11 @@ module WhopSDK sig do params( account_id: String, + available_after: Date, + available_before: Date, currency: String, cursor: String, + include_owned_accounts: T::Boolean, limit: Integer, line_types: T::Array[String], posted_after: Time, @@ -86,13 +118,27 @@ module WhopSDK 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. + # Only include rows whose funds became withdrawable on or after this `YYYY-MM-DD` + # settlement date (UTC), distinct from posted_at. Requires currency. + available_after: nil, + # Only include rows whose funds became withdrawable on or before this `YYYY-MM-DD` + # settlement date (UTC). Set equal to available_after for a single day. Requires + # currency. + available_before: nil, + # Optional currency code filter, for example `usd`. currency: nil, # Cursor returned by the previous page. cursor: nil, + # When true, aggregates the authenticated user's personal ledger with the + # businesses they own (owner role with balance read) into one feed. Requires + # user_id to be the authenticated user; cannot be combined with account_id or the + # settlement-date filters. Each returned row includes the owning `account`. + include_owned_accounts: nil, # Maximum number of rows to return. limit: nil, - # Optional ledger line categories to include. + # Optional ledger line categories to include. Some categories (for example + # `onchain_deposit`, which covers inbound crypto deposits such as MoonPay onramps) + # are only returned when explicitly requested here. line_types: nil, # Only include rows posted after this ISO 8601 timestamp. posted_after: nil, @@ -108,8 +154,11 @@ module WhopSDK override.returns( { account_id: String, + available_after: Date, + available_before: Date, currency: String, cursor: String, + include_owned_accounts: T::Boolean, limit: Integer, line_types: T::Array[String], posted_after: Time, diff --git a/rbi/whop_sdk/models/financial_activity_list_response.rbi b/rbi/whop_sdk/models/financial_activity_list_response.rbi index fbc9af7d..59018fc8 100644 --- a/rbi/whop_sdk/models/financial_activity_list_response.rbi +++ b/rbi/whop_sdk/models/financial_activity_list_response.rbi @@ -61,6 +61,7 @@ module WhopSDK ) end + # Ledger activity ID. sig { returns(String) } attr_accessor :id @@ -68,9 +69,20 @@ module WhopSDK sig { returns(String) } attr_accessor :amount + # ISO 8601 timestamp these funds became (or are scheduled to become) withdrawable: + # the posted time for already-settled funds, or 00:00:00 UTC on the scheduled + # release date for pending funds. Present only on inflows entering the balance + # (payments, top-ups, incoming transfers/affiliate); null on withdrawals, refunds, + # disputes and on-chain rows. The available_after/before filters window on its UTC + # settlement date. + sig { returns(T.nilable(Time)) } + attr_accessor :available_at + + # When the activity record was created. sig { returns(T.nilable(Time)) } attr_accessor :created_at + # Currency for this ledger activity. sig do returns( WhopSDK::Models::FinancialActivityListResponse::Data::Currency @@ -86,6 +98,7 @@ module WhopSDK end attr_writer :currency + # Type of ledger activity. sig { returns(String) } attr_accessor :line_type @@ -96,9 +109,11 @@ module WhopSDK end attr_accessor :object + # When the activity posted to the ledger. sig { returns(Time) } attr_accessor :posted_at + # Resource associated with this ledger activity. sig do returns( T.nilable( @@ -108,6 +123,7 @@ module WhopSDK end attr_accessor :resource + # Source of this ledger activity. sig do returns( T.nilable( @@ -127,10 +143,40 @@ module WhopSDK end attr_writer :source + # The viewer account that owns this row's ledger. Present only when the response + # aggregates owned accounts (include_owned_accounts=true); omitted otherwise. + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Account::Variants + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::OrHash + ) + ).void + end + attr_writer :account + + # The ledger account (a ldgr\_ identifier) this row belongs to. Present only when + # the response aggregates owned accounts (include_owned_accounts=true); omitted + # otherwise. Pair it with `account` to scope drawers and dashboard links to the + # owning business. + sig { returns(T.nilable(String)) } + attr_accessor :ledger_account_id + sig do params( id: String, amount: String, + available_at: T.nilable(Time), created_at: T.nilable(Time), currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency::OrHash, @@ -145,26 +191,56 @@ module WhopSDK 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 + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::OrHash ) ), source: T.nilable( WhopSDK::Models::FinancialActivityListResponse::Data::Source::OrHash - ) + ), + account: + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::OrHash + ), + ledger_account_id: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Ledger activity ID. id:, # Signed amount in the currency's smallest precision units. amount:, + # ISO 8601 timestamp these funds became (or are scheduled to become) withdrawable: + # the posted time for already-settled funds, or 00:00:00 UTC on the scheduled + # release date for pending funds. Present only on inflows entering the balance + # (payments, top-ups, incoming transfers/affiliate); null on withdrawals, refunds, + # disputes and on-chain rows. The available_after/before filters window on its UTC + # settlement date. + available_at:, + # When the activity record was created. created_at:, + # Currency for this ledger activity. currency:, + # Type of ledger activity. line_type:, object:, + # When the activity posted to the ledger. posted_at:, + # Resource associated with this ledger activity. resource:, - source: + # Source of this ledger activity. + source:, + # The viewer account that owns this row's ledger. Present only when the response + # aggregates owned accounts (include_owned_accounts=true); omitted otherwise. + account: nil, + # The ledger account (a ldgr\_ identifier) this row belongs to. Present only when + # the response aggregates owned accounts (include_owned_accounts=true); omitted + # otherwise. Pair it with `account` to scope drawers and dashboard links to the + # owning business. + ledger_account_id: nil ) end @@ -173,6 +249,7 @@ module WhopSDK { id: String, amount: String, + available_at: T.nilable(Time), created_at: T.nilable(Time), currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, @@ -187,7 +264,10 @@ module WhopSDK source: T.nilable( WhopSDK::Models::FinancialActivityListResponse::Data::Source - ) + ), + account: + WhopSDK::Models::FinancialActivityListResponse::Data::Account::Variants, + ledger_account_id: T.nilable(String) } ) end @@ -203,19 +283,22 @@ module WhopSDK ) end + # Currency code. sig { returns(String) } attr_accessor :code - # Precision factor for the currency, for example 100000000 for USD. + # Precision factor for the currency, for example `100000000` for USD. sig { returns(String) } attr_accessor :precision + # Currency for this ledger activity. sig do params(code: String, precision: String).returns(T.attached_class) end def self.new( + # Currency code. code:, - # Precision factor for the currency, for example 100000000 for USD. + # Precision factor for the currency, for example `100000000` for USD. precision: ) end @@ -254,6 +337,7 @@ module WhopSDK end end + # Resource associated with this ledger activity. module Resource extend WhopSDK::Internal::Type::Union @@ -264,7 +348,9 @@ module WhopSDK WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6 ) end @@ -277,9 +363,11 @@ module WhopSDK ) end + # Account ID. sig { returns(String) } attr_accessor :id + # Account logo URL. sig { returns(T.nilable(String)) } attr_accessor :logo_url @@ -290,9 +378,11 @@ module WhopSDK end attr_accessor :object + # Account route. sig { returns(T.nilable(String)) } attr_accessor :route + # Account display name. sig { returns(T.nilable(String)) } attr_accessor :title @@ -306,7 +396,17 @@ module WhopSDK title: T.nilable(String) ).returns(T.attached_class) end - def self.new(id:, logo_url:, object:, route:, title:) + def self.new( + # Account ID. + id:, + # Account logo URL. + logo_url:, + object:, + # Account route. + route:, + # Account display name. + title: + ) end sig do @@ -363,9 +463,11 @@ module WhopSDK ) end + # User ID. sig { returns(String) } attr_accessor :id + # User display name. sig { returns(T.nilable(String)) } attr_accessor :name @@ -376,9 +478,11 @@ module WhopSDK end attr_accessor :object + # User profile image URL. sig { returns(T.nilable(String)) } attr_accessor :profile_picture_url + # User's username. sig { returns(T.nilable(String)) } attr_accessor :username @@ -392,7 +496,17 @@ module WhopSDK username: T.nilable(String) ).returns(T.attached_class) end - def self.new(id:, name:, object:, profile_picture_url:, username:) + def self.new( + # User ID. + id:, + # User display name. + name:, + object:, + # User profile image URL. + profile_picture_url:, + # User's username. + username: + ) end sig do @@ -449,6 +563,7 @@ module WhopSDK ) end + # Bounty ID. sig { returns(String) } attr_accessor :id @@ -459,10 +574,102 @@ module WhopSDK end attr_accessor :object + # Bounty lifecycle status. + sig { returns(String) } + attr_accessor :status + + # Bounty title. + sig { returns(String) } + attr_accessor :title + + sig do + params( + id: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::OrSymbol, + status: String, + title: String + ).returns(T.attached_class) + end + def self.new( + # Bounty ID. + id:, + object:, + # Bounty lifecycle status. + status:, + # Bounty title. + title: + ) + end + + sig do + override.returns( + { + id: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol, + status: String, + title: 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::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BOUNTY = + T.let( + :bounty, + 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 + end + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, + WhopSDK::Internal::AnyHash + ) + end + + # Ledger account ID. + sig { returns(String) } + attr_accessor :id + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + ) + end + attr_accessor :object + sig do returns( T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::Variants ) ) end @@ -472,17 +679,22 @@ module WhopSDK params( id: String, object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::OrSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::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 + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::OrHash ) ) ).returns(T.attached_class) end - def self.new(id:, object:, owner:) + def self.new( + # Ledger account ID. + id:, + object:, + owner: + ) end sig do @@ -490,10 +702,10 @@ module WhopSDK { id: String, object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol, owner: T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::Variants ) } ) @@ -508,7 +720,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -516,13 +728,13 @@ module WhopSDK LEDGER_ACCOUNT = T.let( :ledger_account, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol ] ) end @@ -536,8 +748,8 @@ module WhopSDK Variants = T.type_alias do T.any( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1 ) end @@ -545,27 +757,31 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0, WhopSDK::Internal::AnyHash ) end + # Account ID. sig { returns(String) } attr_accessor :id + # Account logo URL. sig { returns(T.nilable(String)) } attr_accessor :logo_url sig do returns( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::Object::TaggedSymbol ) end attr_accessor :object + # Account route. sig { returns(T.nilable(String)) } attr_accessor :route + # Account display name. sig { returns(T.nilable(String)) } attr_accessor :title @@ -574,12 +790,22 @@ module WhopSDK id: String, logo_url: T.nilable(String), object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::OrSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::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:) + def self.new( + # Account ID. + id:, + # Account logo URL. + logo_url:, + object:, + # Account route. + route:, + # Account display name. + title: + ) end sig do @@ -588,7 +814,7 @@ module WhopSDK id: String, logo_url: T.nilable(String), object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::Object::TaggedSymbol, route: T.nilable(String), title: T.nilable(String) } @@ -604,7 +830,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -612,13 +838,13 @@ module WhopSDK ACCOUNT = T.let( :account, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::Object::TaggedSymbol ] ) end @@ -631,27 +857,31 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1, WhopSDK::Internal::AnyHash ) end + # User ID. sig { returns(String) } attr_accessor :id + # User display name. sig { returns(T.nilable(String)) } attr_accessor :name sig do returns( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object::TaggedSymbol ) end attr_accessor :object + # User profile image URL. sig { returns(T.nilable(String)) } attr_accessor :profile_picture_url + # User's username. sig { returns(T.nilable(String)) } attr_accessor :username @@ -660,16 +890,20 @@ module WhopSDK id: String, name: T.nilable(String), object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::OrSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object::OrSymbol, profile_picture_url: T.nilable(String), username: T.nilable(String) ).returns(T.attached_class) end def self.new( + # User ID. id:, + # User display name. name:, object:, + # User profile image URL. profile_picture_url:, + # User's username. username: ) end @@ -680,7 +914,7 @@ module WhopSDK id: String, name: T.nilable(String), object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object::TaggedSymbol, profile_picture_url: T.nilable(String), username: T.nilable(String) } @@ -696,7 +930,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -704,13 +938,13 @@ module WhopSDK USER = T.let( :user, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::Object::TaggedSymbol ] ) end @@ -722,7 +956,7 @@ module WhopSDK sig do override.returns( T::Array[ - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::Variants ] ) end @@ -731,22 +965,23 @@ module WhopSDK end end - class UnionMember3 < WhopSDK::Internal::Type::BaseModel + class UnionMember4 < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, WhopSDK::Internal::AnyHash ) end + # Payment method ID. sig { returns(String) } attr_accessor :id sig do returns( T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank ) ) end @@ -756,7 +991,7 @@ module WhopSDK params( bank: T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank::OrHash + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank::OrHash ) ).void end @@ -765,7 +1000,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card ) ) end @@ -775,25 +1010,28 @@ module WhopSDK params( card: T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card::OrHash + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card::OrHash ) ).void end attr_writer :card + # Email identifier for email-based payment methods. sig { returns(T.nilable(String)) } attr_accessor :email_identifier + # Payment gateway type. sig { returns(T.nilable(String)) } attr_accessor :gateway_type sig do returns( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol ) end attr_accessor :object + # Payment method type. sig { returns(T.nilable(String)) } attr_accessor :payment_method_type @@ -802,26 +1040,30 @@ module WhopSDK id: String, bank: T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank::OrHash + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank::OrHash ), card: T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card::OrHash + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card::OrHash ), email_identifier: T.nilable(String), gateway_type: T.nilable(String), object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::OrSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::OrSymbol, payment_method_type: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Payment method ID. id:, bank:, card:, + # Email identifier for email-based payment methods. email_identifier:, + # Payment gateway type. gateway_type:, object:, + # Payment method type. payment_method_type: ) end @@ -832,16 +1074,16 @@ module WhopSDK id: String, bank: T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank ), card: T.nilable( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card ), email_identifier: T.nilable(String), gateway_type: T.nilable(String), object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol, payment_method_type: T.nilable(String) } ) @@ -853,20 +1095,24 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank, WhopSDK::Internal::AnyHash ) end + # Bank account holder name. sig { returns(T.nilable(String)) } attr_accessor :account_name + # Bank account type. sig { returns(T.nilable(String)) } attr_accessor :account_type + # Bank name. sig { returns(T.nilable(String)) } attr_accessor :bank_name + # Last four digits of the bank account. sig { returns(T.nilable(String)) } attr_accessor :last4 @@ -878,7 +1124,16 @@ module WhopSDK last4: T.nilable(String) ).returns(T.attached_class) end - def self.new(account_name:, account_type:, bank_name:, last4:) + def self.new( + # Bank account holder name. + account_name:, + # Bank account type. + account_type:, + # Bank name. + bank_name:, + # Last four digits of the bank account. + last4: + ) end sig do @@ -899,20 +1154,24 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card, WhopSDK::Internal::AnyHash ) end + # Card brand. sig { returns(T.nilable(String)) } attr_accessor :brand + # Card expiration month. sig { returns(T.nilable(Integer)) } attr_accessor :exp_month + # Card expiration year. sig { returns(T.nilable(Integer)) } attr_accessor :exp_year + # Last four digits of the card. sig { returns(T.nilable(String)) } attr_accessor :last4 @@ -924,7 +1183,16 @@ module WhopSDK last4: T.nilable(String) ).returns(T.attached_class) end - def self.new(brand:, exp_month:, exp_year:, last4:) + def self.new( + # Card brand. + brand:, + # Card expiration month. + exp_month:, + # Card expiration year. + exp_year:, + # Last four digits of the card. + last4: + ) end sig do @@ -948,7 +1216,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -956,13 +1224,13 @@ module WhopSDK PAYMENT_METHOD = T.let( :payment_method, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol ] ) end @@ -971,37 +1239,43 @@ module WhopSDK end end - class UnionMember4 < WhopSDK::Internal::Type::BaseModel + class UnionMember5 < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5, WhopSDK::Internal::AnyHash ) end + # Payout method ID. sig { returns(String) } attr_accessor :id + # Masked account reference. sig { returns(T.nilable(String)) } attr_accessor :account_reference + # Destination currency code. sig { returns(T.nilable(String)) } attr_accessor :destination_currency_code + # Payout institution name. sig { returns(T.nilable(String)) } attr_accessor :institution_name + # Payout method nickname. sig { returns(T.nilable(String)) } attr_accessor :nickname sig do returns( - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object::TaggedSymbol ) end attr_accessor :object + # Payout provider. sig { returns(T.nilable(String)) } attr_accessor :provider @@ -1013,17 +1287,23 @@ module WhopSDK institution_name: T.nilable(String), nickname: T.nilable(String), object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::OrSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object::OrSymbol, provider: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Payout method ID. id:, + # Masked account reference. account_reference:, + # Destination currency code. destination_currency_code:, + # Payout institution name. institution_name:, + # Payout method nickname. nickname:, object:, + # Payout provider. provider: ) end @@ -1037,7 +1317,7 @@ module WhopSDK institution_name: T.nilable(String), nickname: T.nilable(String), object: - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object::TaggedSymbol, provider: T.nilable(String) } ) @@ -1052,7 +1332,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -1060,13 +1340,191 @@ module WhopSDK PAYOUT_METHOD = T.let( :payout_method, - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember6 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6, + WhopSDK::Internal::AnyHash + ) + end + + # Card transaction ID. + sig { returns(String) } + attr_accessor :id + + # ISO 8601 timestamp the transaction was authorized. + sig { returns(T.nilable(Time)) } + attr_accessor :authorized_at + + # Identifier of the card that the transaction was charged to. + sig { returns(T.nilable(String)) } + attr_accessor :card_id + + # Cashback earned on this transaction as a USD decimal string. Zero for declined + # or ineligible transactions; null when cashback has not been computed yet. + sig { returns(T.nilable(String)) } + attr_accessor :cashback_usd + + # Reason the transaction was declined (when status is declined). + sig { returns(T.nilable(String)) } + attr_accessor :declined_reason + + # Amount the merchant charged in their local currency, as a decimal string. Pair + # with local_currency. + sig { returns(T.nilable(String)) } + attr_accessor :local_amount + + # ISO 4217 currency code of the merchant-charged amount in local_amount. + sig { returns(T.nilable(String)) } + attr_accessor :local_currency + + # Merchant category. + sig { returns(T.nilable(String)) } + attr_accessor :merchant_category + + # Merchant icon URL. + sig { returns(T.nilable(String)) } + attr_accessor :merchant_icon_url + + # Merchant display name. + sig { returns(T.nilable(String)) } + attr_accessor :merchant_name + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::Object::TaggedSymbol + ) + end + attr_accessor :object + + # ISO 8601 timestamp the transaction was settled by the card network. + sig { returns(T.nilable(Time)) } + attr_accessor :posted_at + + # Current card transaction status. + sig { returns(T.nilable(String)) } + attr_accessor :status + + # The processor-settled USD amount as a decimal string. The ledger's USDT leg is + # posted 1:1 from this value. + sig { returns(T.nilable(String)) } + attr_accessor :usd_amount + + sig do + params( + id: String, + authorized_at: T.nilable(Time), + card_id: T.nilable(String), + cashback_usd: T.nilable(String), + declined_reason: T.nilable(String), + local_amount: T.nilable(String), + local_currency: T.nilable(String), + merchant_category: T.nilable(String), + merchant_icon_url: T.nilable(String), + merchant_name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::Object::OrSymbol, + posted_at: T.nilable(Time), + status: T.nilable(String), + usd_amount: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Card transaction ID. + id:, + # ISO 8601 timestamp the transaction was authorized. + authorized_at:, + # Identifier of the card that the transaction was charged to. + card_id:, + # Cashback earned on this transaction as a USD decimal string. Zero for declined + # or ineligible transactions; null when cashback has not been computed yet. + cashback_usd:, + # Reason the transaction was declined (when status is declined). + declined_reason:, + # Amount the merchant charged in their local currency, as a decimal string. Pair + # with local_currency. + local_amount:, + # ISO 4217 currency code of the merchant-charged amount in local_amount. + local_currency:, + # Merchant category. + merchant_category:, + # Merchant icon URL. + merchant_icon_url:, + # Merchant display name. + merchant_name:, + object:, + # ISO 8601 timestamp the transaction was settled by the card network. + posted_at:, + # Current card transaction status. + status:, + # The processor-settled USD amount as a decimal string. The ledger's USDT leg is + # posted 1:1 from this value. + usd_amount: + ) + end + + sig do + override.returns( + { + id: String, + authorized_at: T.nilable(Time), + card_id: T.nilable(String), + cashback_usd: T.nilable(String), + declined_reason: T.nilable(String), + local_amount: T.nilable(String), + local_currency: T.nilable(String), + merchant_category: T.nilable(String), + merchant_icon_url: T.nilable(String), + merchant_name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::Object::TaggedSymbol, + posted_at: T.nilable(Time), + status: T.nilable(String), + usd_amount: 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::UnionMember6::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD_TRANSACTION = + T.let( + :card_transaction, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::Object::TaggedSymbol ] ) end @@ -1101,6 +1559,20 @@ module WhopSDK sig { returns(String) } attr_accessor :object + # Withdrawal amount as a decimal number in the destination currency (withdrawal + # sources only; requires payout:withdrawal:read). + sig { returns(T.nilable(Float)) } + attr_accessor :amount_float + + # Chain the deposit landed on, for example plasma (onchain_transaction sources + # only). + sig { returns(T.nilable(String)) } + attr_accessor :chain + + # Public claim URL for the airdrop link (airdrop_link sources only). + sig { returns(T.nilable(String)) } + attr_accessor :claim_url + # Withdrawal creation time as an ISO 8601 timestamp (withdrawal sources only; # requires payout:withdrawal:read). sig { returns(T.nilable(Time)) } @@ -1111,6 +1583,14 @@ module WhopSDK sig { returns(T.nilable(Time)) } attr_accessor :estimated_arrival + # Amount converted out of from_currency as a decimal string (swap sources only). + sig { returns(T.nilable(String)) } + attr_accessor :from_amount + + # Lowercase currency code converted from (swap sources only). + sig { returns(T.nilable(String)) } + attr_accessor :from_currency + # Name of the entity processing the payout (withdrawal sources only; requires # payout:withdrawal:read). sig { returns(T.nilable(String)) } @@ -1140,35 +1620,81 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :payout_token_nickname - # Withdrawal lifecycle status (withdrawal sources only; requires - # payout:withdrawal:read). + # Transfer reason on transfer sources, for example pool_top_up or bounty_return. + sig { returns(T.nilable(String)) } + attr_accessor :reason + + # Sender wallet address or onramp provider identifier (onchain_transaction sources + # only). + sig { returns(T.nilable(String)) } + attr_accessor :sender_address + + # Lifecycle status. On withdrawal sources this is the withdrawal status (requires + # payout:withdrawal:read); on airdrop_link sources it is the claim-link status + # (ungated); on payment and top-up sources it is the friendly payment status such + # as succeeded/pending/failed (ungated). sig { returns(T.nilable(String)) } attr_accessor :status + # Amount received in to_currency as a decimal string (swap sources only). + sig { returns(T.nilable(String)) } + attr_accessor :to_amount + + # Lowercase currency code converted to (swap sources only). + sig { returns(T.nilable(String)) } + attr_accessor :to_currency + + # On-chain transaction hash (onchain_transaction and swap sources only). + sig { returns(T.nilable(String)) } + attr_accessor :tx_hash + + # Source of this ledger activity. sig do params( id: String, object: String, + amount_float: T.nilable(Float), + chain: T.nilable(String), + claim_url: T.nilable(String), created_at: T.nilable(Time), estimated_arrival: T.nilable(Time), + from_amount: T.nilable(String), + from_currency: T.nilable(String), 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) + reason: T.nilable(String), + sender_address: T.nilable(String), + status: T.nilable(String), + to_amount: T.nilable(String), + to_currency: T.nilable(String), + tx_hash: T.nilable(String) ).returns(T.attached_class) end def self.new( id:, object:, + # Withdrawal amount as a decimal number in the destination currency (withdrawal + # sources only; requires payout:withdrawal:read). + amount_float: nil, + # Chain the deposit landed on, for example plasma (onchain_transaction sources + # only). + chain: nil, + # Public claim URL for the airdrop link (airdrop_link sources only). + claim_url: nil, # 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, + # Amount converted out of from_currency as a decimal string (swap sources only). + from_amount: nil, + # Lowercase currency code converted from (swap sources only). + from_currency: nil, # Name of the entity processing the payout (withdrawal sources only; requires # payout:withdrawal:read). payer_name: nil, @@ -1176,9 +1702,22 @@ module WhopSDK 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 + # Transfer reason on transfer sources, for example pool_top_up or bounty_return. + reason: nil, + # Sender wallet address or onramp provider identifier (onchain_transaction sources + # only). + sender_address: nil, + # Lifecycle status. On withdrawal sources this is the withdrawal status (requires + # payout:withdrawal:read); on airdrop_link sources it is the claim-link status + # (ungated); on payment and top-up sources it is the friendly payment status such + # as succeeded/pending/failed (ungated). + status: nil, + # Amount received in to_currency as a decimal string (swap sources only). + to_amount: nil, + # Lowercase currency code converted to (swap sources only). + to_currency: nil, + # On-chain transaction hash (onchain_transaction and swap sources only). + tx_hash: nil ) end @@ -1187,15 +1726,25 @@ module WhopSDK { id: String, object: String, + amount_float: T.nilable(Float), + chain: T.nilable(String), + claim_url: T.nilable(String), created_at: T.nilable(Time), estimated_arrival: T.nilable(Time), + from_amount: T.nilable(String), + from_currency: T.nilable(String), 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) + reason: T.nilable(String), + sender_address: T.nilable(String), + status: T.nilable(String), + to_amount: T.nilable(String), + to_currency: T.nilable(String), + tx_hash: T.nilable(String) } ) end @@ -1236,6 +1785,230 @@ module WhopSDK end end end + + # The viewer account that owns this row's ledger. Present only when the response + # aggregates owned accounts (include_owned_accounts=true); omitted otherwise. + module Account + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0, + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1 + ) + end + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0, + WhopSDK::Internal::AnyHash + ) + end + + # Account ID. + sig { returns(String) } + attr_accessor :id + + # Account logo URL. + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::Object::TaggedSymbol + ) + end + attr_accessor :object + + # Account route. + sig { returns(T.nilable(String)) } + attr_accessor :route + + # Account display name. + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::Object::OrSymbol, + route: T.nilable(String), + title: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Account ID. + id:, + # Account logo URL. + logo_url:, + object:, + # Account route. + route:, + # Account display name. + title: + ) + end + + sig do + override.returns( + { + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Account::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::Account::UnionMember0::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT = + T.let( + :account, + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Account::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::Account::UnionMember1, + WhopSDK::Internal::AnyHash + ) + end + + # User ID. + sig { returns(String) } + attr_accessor :id + + # User display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::Object::TaggedSymbol + ) + end + attr_accessor :object + + # User profile image URL. + sig { returns(T.nilable(String)) } + attr_accessor :profile_picture_url + + # User's username. + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig do + params( + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::Object::OrSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # User ID. + id:, + # User display name. + name:, + object:, + # User profile image URL. + profile_picture_url:, + # User's username. + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Account::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::Account::UnionMember1::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Account::Variants + ] + ) + end + def self.variants + end + end end class PageInfo < WhopSDK::Internal::Type::BaseModel diff --git a/rbi/whop_sdk/models/forum_post.rbi b/rbi/whop_sdk/models/forum_post.rbi index 299ffb9b..7b1c9181 100644 --- a/rbi/whop_sdk/models/forum_post.rbi +++ b/rbi/whop_sdk/models/forum_post.rbi @@ -164,7 +164,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -193,7 +193,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, diff --git a/rbi/whop_sdk/models/forum_post_list_response.rbi b/rbi/whop_sdk/models/forum_post_list_response.rbi index c9a0e4fd..ecfd4e6b 100644 --- a/rbi/whop_sdk/models/forum_post_list_response.rbi +++ b/rbi/whop_sdk/models/forum_post_list_response.rbi @@ -180,7 +180,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -209,7 +209,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, diff --git a/rbi/whop_sdk/models/identity_profile_approved_webhook_event.rbi b/rbi/whop_sdk/models/identity_profile_approved_webhook_event.rbi index 18192ce4..72401f79 100644 --- a/rbi/whop_sdk/models/identity_profile_approved_webhook_event.rbi +++ b/rbi/whop_sdk/models/identity_profile_approved_webhook_event.rbi @@ -128,9 +128,9 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :business_structure - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. sig { returns(T.nilable(String)) } attr_accessor :country @@ -269,9 +269,9 @@ module WhopSDK # Reported legal structure of a business profile (e.g. `corp`, `llc`). # Provider-specific values; present on `business` profiles. business_structure:, - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. country:, # When the identity profile was first created. created_at:, diff --git a/rbi/whop_sdk/models/identity_profile_needs_action_webhook_event.rbi b/rbi/whop_sdk/models/identity_profile_needs_action_webhook_event.rbi index 9a0b8214..64be1580 100644 --- a/rbi/whop_sdk/models/identity_profile_needs_action_webhook_event.rbi +++ b/rbi/whop_sdk/models/identity_profile_needs_action_webhook_event.rbi @@ -128,9 +128,9 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :business_structure - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. sig { returns(T.nilable(String)) } attr_accessor :country @@ -269,9 +269,9 @@ module WhopSDK # Reported legal structure of a business profile (e.g. `corp`, `llc`). # Provider-specific values; present on `business` profiles. business_structure:, - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. country:, # When the identity profile was first created. created_at:, diff --git a/rbi/whop_sdk/models/identity_profile_rejected_webhook_event.rbi b/rbi/whop_sdk/models/identity_profile_rejected_webhook_event.rbi index 28ba8764..923861c4 100644 --- a/rbi/whop_sdk/models/identity_profile_rejected_webhook_event.rbi +++ b/rbi/whop_sdk/models/identity_profile_rejected_webhook_event.rbi @@ -128,9 +128,9 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :business_structure - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. sig { returns(T.nilable(String)) } attr_accessor :country @@ -269,9 +269,9 @@ module WhopSDK # Reported legal structure of a business profile (e.g. `corp`, `llc`). # Provider-specific values; present on `business` profiles. business_structure:, - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. country:, # When the identity profile was first created. created_at:, diff --git a/rbi/whop_sdk/models/identity_profile_updated_webhook_event.rbi b/rbi/whop_sdk/models/identity_profile_updated_webhook_event.rbi index f2cc9ca8..05998fba 100644 --- a/rbi/whop_sdk/models/identity_profile_updated_webhook_event.rbi +++ b/rbi/whop_sdk/models/identity_profile_updated_webhook_event.rbi @@ -128,9 +128,9 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :business_structure - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. sig { returns(T.nilable(String)) } attr_accessor :country @@ -269,9 +269,9 @@ module WhopSDK # Reported legal structure of a business profile (e.g. `corp`, `llc`). # Provider-specific values; present on `business` profiles. business_structure:, - # ISO 3166-1 alpha-3 country code (e.g. `USA`, `GBR`). For individuals this is the - # country of citizenship or residence reported by the identity provider; for - # businesses this is the country of incorporation. + # ISO 3166-1 alpha-2 country code reported by the identity provider, such as `US` + # or `GB`. For individuals this is the country of citizenship or residence; for + # businesses, the country of incorporation. country:, # When the identity profile was first created. created_at:, diff --git a/rbi/whop_sdk/models/invoice_create_params.rbi b/rbi/whop_sdk/models/invoice_create_params.rbi index 516f0051..f700b353 100644 --- a/rbi/whop_sdk/models/invoice_create_params.rbi +++ b/rbi/whop_sdk/models/invoice_create_params.rbi @@ -338,6 +338,10 @@ module WhopSDK ) end + # Whether this plan accepts local currency payments via adaptive pricing. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :adaptive_pricing_enabled + # The interval in days at which the plan charges (renewal plans). sig { returns(T.nilable(Integer)) } attr_accessor :billing_period @@ -436,6 +440,7 @@ module WhopSDK # invoice. sig do params( + adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: @@ -463,6 +468,8 @@ module WhopSDK ).returns(T.attached_class) end def self.new( + # Whether this plan accepts local currency payments via adaptive pricing. + adaptive_pricing_enabled: nil, # The interval in days at which the plan charges (renewal plans). billing_period: nil, # The available currencies on the platform @@ -507,6 +514,7 @@ module WhopSDK sig do override.returns( { + adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: @@ -1137,6 +1145,10 @@ module WhopSDK ) end + # Whether this plan accepts local currency payments via adaptive pricing. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :adaptive_pricing_enabled + # The interval in days at which the plan charges (renewal plans). sig { returns(T.nilable(Integer)) } attr_accessor :billing_period @@ -1235,6 +1247,7 @@ module WhopSDK # invoice. sig do params( + adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: @@ -1262,6 +1275,8 @@ module WhopSDK ).returns(T.attached_class) end def self.new( + # Whether this plan accepts local currency payments via adaptive pricing. + adaptive_pricing_enabled: nil, # The interval in days at which the plan charges (renewal plans). billing_period: nil, # The available currencies on the platform @@ -1306,6 +1321,7 @@ module WhopSDK sig do override.returns( { + adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: diff --git a/rbi/whop_sdk/models/invoice_update_params.rbi b/rbi/whop_sdk/models/invoice_update_params.rbi index 7af5ffef..d4a4e629 100644 --- a/rbi/whop_sdk/models/invoice_update_params.rbi +++ b/rbi/whop_sdk/models/invoice_update_params.rbi @@ -342,6 +342,10 @@ module WhopSDK ) end + # Whether this plan accepts local currency payments via adaptive pricing. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :adaptive_pricing_enabled + # The interval in days at which the plan charges (renewal plans). sig { returns(T.nilable(Integer)) } attr_accessor :billing_period @@ -435,6 +439,7 @@ module WhopSDK # Updated plan attributes. sig do params( + adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: @@ -462,6 +467,8 @@ module WhopSDK ).returns(T.attached_class) end def self.new( + # Whether this plan accepts local currency payments via adaptive pricing. + adaptive_pricing_enabled: nil, # The interval in days at which the plan charges (renewal plans). billing_period: nil, # The available currencies on the platform @@ -506,6 +513,7 @@ module WhopSDK sig do override.returns( { + adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: diff --git a/rbi/whop_sdk/models/ledger_account_funds_available_webhook_event.rbi b/rbi/whop_sdk/models/ledger_account_funds_available_webhook_event.rbi new file mode 100644 index 00000000..11a0845b --- /dev/null +++ b/rbi/whop_sdk/models/ledger_account_funds_available_webhook_event.rbi @@ -0,0 +1,1001 @@ +# typed: strong + +module WhopSDK + module Models + class LedgerAccountFundsAvailableWebhookEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent, + WhopSDK::Internal::AnyHash + ) + end + + # A unique ID for every single webhook request + sig { returns(String) } + attr_accessor :id + + # The API version for this webhook + sig { returns(Symbol) } + attr_accessor :api_version + + # A ledger account represents a financial account on Whop that can hold many + # balances. + sig { returns(WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data) } + attr_reader :data + + sig do + params( + data: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::OrHash + ).void + end + attr_writer :data + + # The timestamp in ISO 8601 format that the webhook was sent at on the server + sig { returns(Time) } + attr_accessor :timestamp + + # The webhook event type + sig { returns(Symbol) } + attr_accessor :type + + # The company ID that this webhook event is associated with + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + sig do + params( + id: String, + data: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::OrHash, + timestamp: Time, + company_id: T.nilable(String), + api_version: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # A unique ID for every single webhook request + id:, + # A ledger account represents a financial account on Whop that can hold many + # balances. + data:, + # The timestamp in ISO 8601 format that the webhook was sent at on the server + timestamp:, + # The company ID that this webhook event is associated with + company_id: nil, + # The API version for this webhook + api_version: :v1, + # The webhook event type + type: :"ledger_account.funds_available" + ) + end + + sig do + override.returns( + { + id: String, + api_version: Symbol, + data: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data, + timestamp: Time, + type: Symbol, + company_id: T.nilable(String) + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the ledger account. + sig { returns(String) } + attr_accessor :id + + # The balances associated with the account. + sig do + returns( + T::Array[ + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance + ] + ) + end + attr_accessor :balances + + # The type of ledger account. + sig do + returns( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType::TaggedSymbol + ) + end + attr_accessor :ledger_type + + # The owner of the ledger account. + sig do + returns( + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Variants + ) + ) + end + attr_accessor :owner + + # The different approval statuses an account can have. + sig do + returns( + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus::TaggedSymbol + ) + ) + end + attr_accessor :payments_approval_status + + # The payout account associated with the LedgerAccount, if any. + sig do + returns( + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails + ) + ) + end + attr_reader :payout_account_details + + sig do + params( + payout_account_details: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::OrHash + ) + ).void + end + attr_writer :payout_account_details + + # The fee for transfers, if applicable. + sig { returns(T.nilable(Float)) } + attr_accessor :transfer_fee + + # The balance cache associated with the account by currency. + sig do + returns( + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance + ) + ) + end + attr_reader :treasury_balance + + sig do + params( + treasury_balance: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance::OrHash + ) + ).void + end + attr_writer :treasury_balance + + # A ledger account represents a financial account on Whop that can hold many + # balances. + sig do + params( + id: String, + balances: + T::Array[ + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance::OrHash + ], + ledger_type: + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType::OrSymbol, + owner: + T.nilable( + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::User::OrHash, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Company::OrHash + ) + ), + payments_approval_status: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus::OrSymbol + ), + payout_account_details: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::OrHash + ), + transfer_fee: T.nilable(Float), + treasury_balance: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the ledger account. + id:, + # The balances associated with the account. + balances:, + # The type of ledger account. + ledger_type:, + # The owner of the ledger account. + owner:, + # The different approval statuses an account can have. + payments_approval_status:, + # The payout account associated with the LedgerAccount, if any. + payout_account_details:, + # The fee for transfers, if applicable. + transfer_fee:, + # The balance cache associated with the account by currency. + treasury_balance: + ) + end + + sig do + override.returns( + { + id: String, + balances: + T::Array[ + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance + ], + ledger_type: + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType::TaggedSymbol, + owner: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Variants + ), + payments_approval_status: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus::TaggedSymbol + ), + payout_account_details: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails + ), + transfer_fee: T.nilable(Float), + treasury_balance: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance + ) + } + ) + end + def to_hash + end + + class Balance < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance, + WhopSDK::Internal::AnyHash + ) + end + + # The amount of the balance. + sig { returns(Float) } + attr_accessor :balance + + # The currency of the balance. + sig { returns(WhopSDK::Currency::TaggedSymbol) } + attr_accessor :currency + + # The amount of the balance that is pending. + sig { returns(Float) } + attr_accessor :pending_balance + + # The amount of the balance that is reserved. + sig { returns(Float) } + attr_accessor :reserve_balance + + # A cached balance for a LedgerAccount in respect to a currency. + sig do + params( + balance: Float, + currency: WhopSDK::Currency::OrSymbol, + pending_balance: Float, + reserve_balance: Float + ).returns(T.attached_class) + end + def self.new( + # The amount of the balance. + balance:, + # The currency of the balance. + currency:, + # The amount of the balance that is pending. + pending_balance:, + # The amount of the balance that is reserved. + reserve_balance: + ) + end + + sig do + override.returns( + { + balance: Float, + currency: WhopSDK::Currency::TaggedSymbol, + pending_balance: Float, + reserve_balance: Float + } + ) + end + def to_hash + end + end + + # The type of ledger account. + module LedgerType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIMARY = + T.let( + :primary, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType::TaggedSymbol + ) + POOL = + T.let( + :pool, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::LedgerType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The owner of the ledger account. + module Owner + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.nilable( + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::User, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Company + ) + ) + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::User, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the user. + sig { returns(String) } + attr_accessor :id + + # The user's display name shown on their public profile. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The typename of this object + sig { returns(Symbol) } + attr_accessor :typename + + # 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, + name: T.nilable(String), + username: String, + typename: Symbol + ).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:, + # The typename of this object + typename: :User + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + typename: Symbol, + username: String + } + ) + end + def to_hash + end + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Company, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the company. + sig { returns(String) } + attr_accessor :id + + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. + sig { returns(String) } + attr_accessor :route + + # The display name of the company shown to customers. + sig { returns(String) } + attr_accessor :title + + # The typename of this object + sig { returns(Symbol) } + attr_accessor :typename + + # A company is a seller on Whop. Companies own products, manage members, and + # receive payouts. + sig do + params( + id: String, + route: String, + title: String, + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the company. + id:, + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. + route:, + # The display name of the company shown to customers. + title:, + # The typename of this object + typename: :Company + ) + end + + sig do + override.returns( + { id: String, route: String, title: String, typename: Symbol } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Variants + ] + ) + end + def self.variants + end + end + + # The different approval statuses an account can have. + module PaymentsApprovalStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus::TaggedSymbol + ) + APPROVED = + T.let( + :approved, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus::TaggedSymbol + ) + MONITORING = + T.let( + :monitoring, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PaymentsApprovalStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the payout account. + sig { returns(String) } + attr_accessor :id + + # The physical address associated with this payout account + sig do + returns( + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address::OrHash + ) + ).void + end + attr_writer :address + + # The company's legal name + sig { returns(T.nilable(String)) } + attr_accessor :business_name + + # The business representative for this payout account + sig do + returns( + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative + ) + ) + end + attr_reader :business_representative + + sig do + params( + business_representative: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative::OrHash + ) + ).void + end + attr_writer :business_representative + + # The email address of the representative + sig { returns(T.nilable(String)) } + attr_accessor :email + + # The latest verification for the connected account. + sig do + returns( + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification + ) + ) + end + attr_reader :latest_verification + + sig do + params( + latest_verification: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification::OrHash + ) + ).void + end + attr_writer :latest_verification + + # The business representative's phone + sig { returns(T.nilable(String)) } + attr_accessor :phone + + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + sig do + returns( + T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol) + ) + end + attr_accessor :status + + # The payout account associated with the LedgerAccount, if any. + sig do + params( + id: String, + address: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address::OrHash + ), + business_name: T.nilable(String), + business_representative: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative::OrHash + ), + email: T.nilable(String), + latest_verification: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification::OrHash + ), + phone: T.nilable(String), + status: + T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the payout account. + id:, + # The physical address associated with this payout account + address:, + # The company's legal name + business_name:, + # The business representative for this payout account + business_representative:, + # The email address of the representative + email:, + # The latest verification for the connected account. + latest_verification:, + # The business representative's phone + phone:, + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + status: + ) + end + + sig do + override.returns( + { + id: String, + address: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address + ), + business_name: T.nilable(String), + business_representative: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative + ), + email: T.nilable(String), + latest_verification: + T.nilable( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification + ), + phone: T.nilable(String), + status: + T.nilable( + WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol + ) + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address, + WhopSDK::Internal::AnyHash + ) + end + + # The city of the address. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The country of the address. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # The line 1 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # The line 2 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # The postal code of the address. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # The state of the address. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # The physical address associated with this payout account + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The city of the address. + city:, + # The country of the address. + country:, + # The line 1 of the address. + line1:, + # The line 2 of the address. + line2:, + # The postal code of the address. + postal_code:, + # The state of the address. + state: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative, + WhopSDK::Internal::AnyHash + ) + end + + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + sig { returns(T.nilable(String)) } + attr_accessor :date_of_birth + + # The first name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + # The last name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + # The middle name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :middle_name + + # The business representative for this payout account + sig do + params( + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + middle_name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + date_of_birth:, + # The first name of the business representative. + first_name:, + # The last name of the business representative. + last_name:, + # The middle name of the business representative. + middle_name: + ) + end + + sig do + override.returns( + { + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + middle_name: T.nilable(String) + } + ) + end + def to_hash + end + end + + class LatestVerification < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification, + WhopSDK::Internal::AnyHash + ) + end + + # The numeric id of the verification record. + sig { returns(String) } + attr_accessor :id + + # An error code for a verification attempt. + sig do + returns(T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol)) + end + attr_accessor :last_error_code + + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + sig { returns(T.nilable(String)) } + attr_accessor :last_error_reason + + # The current status of this verification session. + sig { returns(WhopSDK::VerificationStatus::TaggedSymbol) } + attr_accessor :status + + # The latest verification for the connected account. + sig do + params( + id: String, + last_error_code: + T.nilable(WhopSDK::VerificationErrorCode::OrSymbol), + last_error_reason: T.nilable(String), + status: WhopSDK::VerificationStatus::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The numeric id of the verification record. + id:, + # An error code for a verification attempt. + last_error_code:, + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + last_error_reason:, + # The current status of this verification session. + status: + ) + end + + sig do + override.returns( + { + id: String, + last_error_code: + T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol), + last_error_reason: T.nilable(String), + status: WhopSDK::VerificationStatus::TaggedSymbol + } + ) + end + def to_hash + end + end + end + + class TreasuryBalance < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance, + WhopSDK::Internal::AnyHash + ) + end + + # The amount of the balance. + sig { returns(Float) } + attr_accessor :balance + + # The balance converted to USD. + sig { returns(Float) } + attr_accessor :balance_usd + + # The currency of the balance. + sig { returns(WhopSDK::Currency::TaggedSymbol) } + attr_accessor :currency + + # The amount of the balance that is pending. + sig { returns(Float) } + attr_accessor :pending_balance + + # The amount of the balance that is reserved. + sig { returns(Float) } + attr_accessor :reserve_balance + + # The amount of the balance that is withdrawable. + sig { returns(Float) } + attr_accessor :total_withdrawable_balance + + # The balance cache associated with the account by currency. + sig do + params( + balance: Float, + balance_usd: Float, + currency: WhopSDK::Currency::OrSymbol, + pending_balance: Float, + reserve_balance: Float, + total_withdrawable_balance: Float + ).returns(T.attached_class) + end + def self.new( + # The amount of the balance. + balance:, + # The balance converted to USD. + balance_usd:, + # The currency of the balance. + currency:, + # The amount of the balance that is pending. + pending_balance:, + # The amount of the balance that is reserved. + reserve_balance:, + # The amount of the balance that is withdrawable. + total_withdrawable_balance: + ) + end + + sig do + override.returns( + { + balance: Float, + balance_usd: Float, + currency: WhopSDK::Currency::TaggedSymbol, + pending_balance: Float, + reserve_balance: Float, + total_withdrawable_balance: Float + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi b/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi index 0e42de39..0eeb2e1f 100644 --- a/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +++ b/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi @@ -362,7 +362,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. sig { returns(String) } attr_accessor :route @@ -387,7 +387,7 @@ module WhopSDK def self.new( # The unique identifier for the company. id:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. route:, # The display name of the company shown to customers. title:, diff --git a/rbi/whop_sdk/models/lesson.rbi b/rbi/whop_sdk/models/lesson.rbi index 4eb21588..957695f7 100644 --- a/rbi/whop_sdk/models/lesson.rbi +++ b/rbi/whop_sdk/models/lesson.rbi @@ -296,7 +296,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -325,7 +325,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, @@ -426,7 +426,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -455,7 +455,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, @@ -493,7 +493,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -523,7 +523,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, diff --git a/rbi/whop_sdk/models/media_asset.rbi b/rbi/whop_sdk/models/media_asset.rbi new file mode 100644 index 00000000..37ed4ceb --- /dev/null +++ b/rbi/whop_sdk/models/media_asset.rbi @@ -0,0 +1,325 @@ +# typed: strong + +module WhopSDK + module Models + class MediaAsset < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(WhopSDK::MediaAsset, WhopSDK::Internal::AnyHash) } + + # Media asset ID, prefixed `media_`. + sig { returns(String) } + attr_accessor :id + + # USD amount charged to the account's balance for this generation. `null` if the + # generation wasn't billed. + sig { returns(T.nilable(Float)) } + attr_accessor :amount_charged + + # ISO 8601 timestamp when the asset reached a terminal state. `null` while + # `processing`. + sig { returns(T.nilable(String)) } + attr_accessor :completed_at + + # ISO 8601 timestamp when the generation was requested. + sig { returns(String) } + attr_accessor :created_at + + # Currency of `amount_charged`. Always `usd`. + sig { returns(String) } + attr_accessor :currency + + # Why generation failed. `null` unless status is `failed`. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # The produced file, usable anywhere attachments are accepted. `null` until the + # asset is `ready`. + sig { returns(T.nilable(WhopSDK::MediaAsset::File)) } + attr_reader :file + + sig { params(file: T.nilable(WhopSDK::MediaAsset::File::OrHash)).void } + attr_writer :file + + # The inputs the asset was generated from. + sig { returns(WhopSDK::MediaAsset::Generation) } + attr_reader :generation + + sig { params(generation: WhopSDK::MediaAsset::Generation::OrHash).void } + attr_writer :generation + + # The kind of media this asset holds. + sig { returns(WhopSDK::MediaAsset::MediaType::TaggedSymbol) } + attr_accessor :media_type + + # How the asset was created. Always `generated`. + sig { returns(WhopSDK::MediaAsset::Source::TaggedSymbol) } + attr_accessor :source + + # Lifecycle state: `processing` while generation runs, `ready` when the file is + # available, `failed` when generation failed and the charge was refunded. + sig { returns(WhopSDK::MediaAsset::Status::TaggedSymbol) } + attr_accessor :status + + sig do + params( + id: String, + amount_charged: T.nilable(Float), + completed_at: T.nilable(String), + created_at: String, + currency: String, + error_message: T.nilable(String), + file: T.nilable(WhopSDK::MediaAsset::File::OrHash), + generation: WhopSDK::MediaAsset::Generation::OrHash, + media_type: WhopSDK::MediaAsset::MediaType::OrSymbol, + source: WhopSDK::MediaAsset::Source::OrSymbol, + status: WhopSDK::MediaAsset::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Media asset ID, prefixed `media_`. + id:, + # USD amount charged to the account's balance for this generation. `null` if the + # generation wasn't billed. + amount_charged:, + # ISO 8601 timestamp when the asset reached a terminal state. `null` while + # `processing`. + completed_at:, + # ISO 8601 timestamp when the generation was requested. + created_at:, + # Currency of `amount_charged`. Always `usd`. + currency:, + # Why generation failed. `null` unless status is `failed`. + error_message:, + # The produced file, usable anywhere attachments are accepted. `null` until the + # asset is `ready`. + file:, + # The inputs the asset was generated from. + generation:, + # The kind of media this asset holds. + media_type:, + # How the asset was created. Always `generated`. + source:, + # Lifecycle state: `processing` while generation runs, `ready` when the file is + # available, `failed` when generation failed and the charge was refunded. + status: + ) + end + + sig do + override.returns( + { + id: String, + amount_charged: T.nilable(Float), + completed_at: T.nilable(String), + created_at: String, + currency: String, + error_message: T.nilable(String), + file: T.nilable(WhopSDK::MediaAsset::File), + generation: WhopSDK::MediaAsset::Generation, + media_type: WhopSDK::MediaAsset::MediaType::TaggedSymbol, + source: WhopSDK::MediaAsset::Source::TaggedSymbol, + status: WhopSDK::MediaAsset::Status::TaggedSymbol + } + ) + end + def to_hash + end + + class File < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::MediaAsset::File, WhopSDK::Internal::AnyHash) + end + + # File ID, prefixed `file_`. + sig { returns(String) } + attr_accessor :id + + # CDN URL for downloading the file. + sig { returns(String) } + attr_accessor :url + + # The produced file, usable anywhere attachments are accepted. `null` until the + # asset is `ready`. + sig { params(id: String, url: String).returns(T.attached_class) } + def self.new( + # File ID, prefixed `file_`. + id:, + # CDN URL for downloading the file. + url: + ) + end + + sig { override.returns({ id: String, url: String }) } + def to_hash + end + end + + class Generation < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::MediaAsset::Generation, WhopSDK::Internal::AnyHash) + end + + # Requested video length in seconds. `null` for images. + sig { returns(T.nilable(Float)) } + attr_accessor :duration_seconds + + # What the asset was generated from. + sig { returns(String) } + attr_accessor :prompt + + sig { returns(T::Array[String]) } + attr_accessor :reference_media + + # Requested video resolution. `null` for images. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + sig do + returns( + T.nilable(WhopSDK::MediaAsset::Generation::Resolution::TaggedSymbol) + ) + end + attr_accessor :resolution + + # The inputs the asset was generated from. + sig do + params( + duration_seconds: T.nilable(Float), + prompt: String, + reference_media: T::Array[String], + resolution: + T.nilable(WhopSDK::MediaAsset::Generation::Resolution::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # Requested video length in seconds. `null` for images. + duration_seconds:, + # What the asset was generated from. + prompt:, + reference_media:, + # Requested video resolution. `null` for images. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + resolution: + ) + end + + sig do + override.returns( + { + duration_seconds: T.nilable(Float), + prompt: String, + reference_media: T::Array[String], + resolution: + T.nilable( + WhopSDK::MediaAsset::Generation::Resolution::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # Requested video resolution. `null` for images. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + module Resolution + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::MediaAsset::Generation::Resolution) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RESOLUTION_480P = + T.let( + :"480p", + WhopSDK::MediaAsset::Generation::Resolution::TaggedSymbol + ) + RESOLUTION_720P = + T.let( + :"720p", + WhopSDK::MediaAsset::Generation::Resolution::TaggedSymbol + ) + RESOLUTION_1080P = + T.let( + :"1080p", + WhopSDK::MediaAsset::Generation::Resolution::TaggedSymbol + ) + RESOLUTION_4K = + T.let( + :"4k", + WhopSDK::MediaAsset::Generation::Resolution::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::MediaAsset::Generation::Resolution::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The kind of media this asset holds. + module MediaType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::MediaAsset::MediaType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIDEO = T.let(:video, WhopSDK::MediaAsset::MediaType::TaggedSymbol) + IMAGE = T.let(:image, WhopSDK::MediaAsset::MediaType::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::MediaAsset::MediaType::TaggedSymbol] + ) + end + def self.values + end + end + + # How the asset was created. Always `generated`. + module Source + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::MediaAsset::Source) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GENERATED = T.let(:generated, WhopSDK::MediaAsset::Source::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::MediaAsset::Source::TaggedSymbol]) + end + def self.values + end + end + + # Lifecycle state: `processing` while generation runs, `ready` when the file is + # available, `failed` when generation failed and the charge was refunded. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::MediaAsset::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PROCESSING = + T.let(:processing, WhopSDK::MediaAsset::Status::TaggedSymbol) + READY = T.let(:ready, WhopSDK::MediaAsset::Status::TaggedSymbol) + FAILED = T.let(:failed, WhopSDK::MediaAsset::Status::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::MediaAsset::Status::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/media_generate_params.rbi b/rbi/whop_sdk/models/media_generate_params.rbi new file mode 100644 index 00000000..80ebb935 --- /dev/null +++ b/rbi/whop_sdk/models/media_generate_params.rbi @@ -0,0 +1,204 @@ +# typed: strong + +module WhopSDK + module Models + class MediaGenerateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::MediaGenerateParams, WhopSDK::Internal::AnyHash) + end + + # What to generate. Up to 2,000 characters. + sig { returns(String) } + attr_accessor :prompt + + # The kind of media to generate. + sig { returns(WhopSDK::MediaGenerateParams::Type::OrSymbol) } + attr_accessor :type + + # Account ID, prefixed `biz_`. Defaults to the account the API key belongs to. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # Video length in seconds. Video only; defaults to 5. + sig do + returns( + T.nilable(WhopSDK::MediaGenerateParams::DurationSeconds::OrInteger) + ) + end + attr_reader :duration_seconds + + sig do + params( + duration_seconds: + WhopSDK::MediaGenerateParams::DurationSeconds::OrInteger + ).void + end + attr_writer :duration_seconds + + # Optional reference image file IDs (`file_` prefixed), up to 4. For video, a + # single reference seeds the opening frame; multiple references guide subject and + # style instead. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :reference_media + + sig { params(reference_media: T::Array[String]).void } + attr_writer :reference_media + + # Video resolution. Video only; defaults to `1080p`. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + sig do + returns(T.nilable(WhopSDK::MediaGenerateParams::Resolution::OrSymbol)) + end + attr_reader :resolution + + sig do + params( + resolution: WhopSDK::MediaGenerateParams::Resolution::OrSymbol + ).void + end + attr_writer :resolution + + sig do + params( + prompt: String, + type: WhopSDK::MediaGenerateParams::Type::OrSymbol, + account_id: String, + duration_seconds: + WhopSDK::MediaGenerateParams::DurationSeconds::OrInteger, + reference_media: T::Array[String], + resolution: WhopSDK::MediaGenerateParams::Resolution::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # What to generate. Up to 2,000 characters. + prompt:, + # The kind of media to generate. + type:, + # Account ID, prefixed `biz_`. Defaults to the account the API key belongs to. + account_id: nil, + # Video length in seconds. Video only; defaults to 5. + duration_seconds: nil, + # Optional reference image file IDs (`file_` prefixed), up to 4. For video, a + # single reference seeds the opening frame; multiple references guide subject and + # style instead. + reference_media: nil, + # Video resolution. Video only; defaults to `1080p`. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + resolution: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + prompt: String, + type: WhopSDK::MediaGenerateParams::Type::OrSymbol, + account_id: String, + duration_seconds: + WhopSDK::MediaGenerateParams::DurationSeconds::OrInteger, + reference_media: T::Array[String], + resolution: WhopSDK::MediaGenerateParams::Resolution::OrSymbol, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # The kind of media to generate. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::MediaGenerateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIDEO = T.let(:video, WhopSDK::MediaGenerateParams::Type::TaggedSymbol) + IMAGE = T.let(:image, WhopSDK::MediaGenerateParams::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::MediaGenerateParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + + # Video length in seconds. Video only; defaults to 5. + module DurationSeconds + extend WhopSDK::Internal::Type::Enum + + TaggedInteger = + T.type_alias do + T.all(Integer, WhopSDK::MediaGenerateParams::DurationSeconds) + end + OrInteger = T.type_alias { Integer } + + DURATION_SECONDS_5 = + T.let(5, WhopSDK::MediaGenerateParams::DurationSeconds::TaggedInteger) + DURATION_SECONDS_10 = + T.let( + 10, + WhopSDK::MediaGenerateParams::DurationSeconds::TaggedInteger + ) + DURATION_SECONDS_15 = + T.let( + 15, + WhopSDK::MediaGenerateParams::DurationSeconds::TaggedInteger + ) + + sig do + override.returns( + T::Array[ + WhopSDK::MediaGenerateParams::DurationSeconds::TaggedInteger + ] + ) + end + def self.values + end + end + + # Video resolution. Video only; defaults to `1080p`. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + module Resolution + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::MediaGenerateParams::Resolution) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RESOLUTION_480P = + T.let(:"480p", WhopSDK::MediaGenerateParams::Resolution::TaggedSymbol) + RESOLUTION_720P = + T.let(:"720p", WhopSDK::MediaGenerateParams::Resolution::TaggedSymbol) + RESOLUTION_1080P = + T.let( + :"1080p", + WhopSDK::MediaGenerateParams::Resolution::TaggedSymbol + ) + RESOLUTION_4K = + T.let(:"4k", WhopSDK::MediaGenerateParams::Resolution::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::MediaGenerateParams::Resolution::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/media_retrieve_params.rbi b/rbi/whop_sdk/models/media_retrieve_params.rbi new file mode 100644 index 00000000..162e4664 --- /dev/null +++ b/rbi/whop_sdk/models/media_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module WhopSDK + module Models + class MediaRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::MediaRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/membership.rbi b/rbi/whop_sdk/models/membership.rbi index 2b7abc52..4963df4c 100644 --- a/rbi/whop_sdk/models/membership.rbi +++ b/rbi/whop_sdk/models/membership.rbi @@ -82,7 +82,7 @@ module WhopSDK attr_writer :member # Custom key-value pairs for the membership (commonly used for software licensing, - # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. + # e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -215,7 +215,7 @@ module WhopSDK # the member record has not been created yet. member:, # Custom key-value pairs for the membership (commonly used for software licensing, - # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. + # e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value. metadata:, # Whether recurring payment collection for this membership is temporarily paused # by the company. @@ -385,7 +385,8 @@ module WhopSDK attr_accessor :id # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -400,7 +401,8 @@ module WhopSDK # The unique identifier for the plan. id:, # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: ) end @@ -424,8 +426,9 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -445,8 +448,9 @@ module WhopSDK def self.new( # The unique identifier for the product. id:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata:, # The display name of the product shown to customers on the product page and in # search results. diff --git a/rbi/whop_sdk/models/membership_list_response.rbi b/rbi/whop_sdk/models/membership_list_response.rbi index f8bab58b..8f6868ae 100644 --- a/rbi/whop_sdk/models/membership_list_response.rbi +++ b/rbi/whop_sdk/models/membership_list_response.rbi @@ -91,7 +91,7 @@ module WhopSDK attr_writer :member # Custom key-value pairs for the membership (commonly used for software licensing, - # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. + # e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -238,7 +238,7 @@ module WhopSDK # the member record has not been created yet. member:, # Custom key-value pairs for the membership (commonly used for software licensing, - # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. + # e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value. metadata:, # Whether recurring payment collection for this membership is temporarily paused # by the company. @@ -372,7 +372,8 @@ module WhopSDK attr_accessor :id # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -387,7 +388,8 @@ module WhopSDK # The unique identifier for the plan. id:, # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: ) end @@ -414,8 +416,9 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -435,8 +438,9 @@ module WhopSDK def self.new( # The unique identifier for the product. id:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata:, # The display name of the product shown to customers on the product page and in # search results. diff --git a/rbi/whop_sdk/models/membership_trial_ending_soon_webhook_event.rbi b/rbi/whop_sdk/models/membership_trial_ending_soon_webhook_event.rbi new file mode 100644 index 00000000..7c10b049 --- /dev/null +++ b/rbi/whop_sdk/models/membership_trial_ending_soon_webhook_event.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module WhopSDK + module Models + class MembershipTrialEndingSoonWebhookEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::MembershipTrialEndingSoonWebhookEvent, + WhopSDK::Internal::AnyHash + ) + end + + # A unique ID for every single webhook request + sig { returns(String) } + attr_accessor :id + + # The API version for this webhook + sig { returns(Symbol) } + attr_accessor :api_version + + # A membership represents an active relationship between a user and a product. It + # tracks the user's access, billing status, and renewal schedule. + sig { returns(WhopSDK::Membership) } + attr_reader :data + + sig { params(data: WhopSDK::Membership::OrHash).void } + attr_writer :data + + # The timestamp in ISO 8601 format that the webhook was sent at on the server + sig { returns(Time) } + attr_accessor :timestamp + + # The webhook event type + sig { returns(Symbol) } + attr_accessor :type + + # The company ID that this webhook event is associated with + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + sig do + params( + id: String, + data: WhopSDK::Membership::OrHash, + timestamp: Time, + company_id: T.nilable(String), + api_version: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # A unique ID for every single webhook request + id:, + # A membership represents an active relationship between a user and a product. It + # tracks the user's access, billing status, and renewal schedule. + data:, + # The timestamp in ISO 8601 format that the webhook was sent at on the server + timestamp:, + # The company ID that this webhook event is associated with + company_id: nil, + # The API version for this webhook + api_version: :v1, + # The webhook event type + type: :"membership.trial_ending_soon" + ) + end + + sig do + override.returns( + { + id: String, + api_version: Symbol, + data: WhopSDK::Membership, + timestamp: Time, + type: Symbol, + company_id: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/payment.rbi b/rbi/whop_sdk/models/payment.rbi index 760d1144..31ed2c52 100644 --- a/rbi/whop_sdk/models/payment.rbi +++ b/rbi/whop_sdk/models/payment.rbi @@ -186,6 +186,11 @@ module WhopSDK sig { returns(T.nilable(Time)) } attr_accessor :refunded_at + # The refunds issued against this payment, newest first, including failed and + # canceled refund attempts. Limited to the 100 most recent. + sig { returns(T::Array[WhopSDK::Payment::Refund]) } + attr_accessor :refunds + # The resolution center cases opened by the customer on this payment. Null if the # actor in context does not have the payment:resolution_center_case:read # permission. @@ -198,6 +203,18 @@ module WhopSDK sig { returns(T::Boolean) } attr_accessor :retryable + # Whop's in-house fraud risk score for this payment, from 0 (lowest risk) to 100 + # (highest risk). Null when the payment has not been scored or scoring has not yet + # completed. + sig { returns(T.nilable(Integer)) } + attr_accessor :risk_score + + # A curated set of factors behind the risk score, grouped by category (business + # transaction history, buyer, device). Each entry has a key, human-readable label, + # category, and value. Null when there is no risk assessment for this payment. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :risk_signals + # The total amount charged to the customer for this payment, including taxes and # after any discounts. In the currency specified by the currency field. sig { returns(Float) } @@ -211,6 +228,18 @@ module WhopSDK sig { returns(T.nilable(Float)) } attr_accessor :settlement_exchange_rate + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + sig { returns(T.nilable(WhopSDK::Payment::ShippingAddress)) } + attr_reader :shipping_address + + sig do + params( + shipping_address: T.nilable(WhopSDK::Payment::ShippingAddress::OrHash) + ).void + end + attr_writer :shipping_address + # The status of a receipt sig { returns(T.nilable(WhopSDK::ReceiptStatus::TaggedSymbol)) } attr_accessor :status @@ -236,6 +265,10 @@ module WhopSDK sig { returns(T.nilable(Float)) } attr_accessor :tax_refunded_amount + # Whether 3D Secure authentication was completed for this payment. + sig { returns(T::Boolean) } + attr_accessor :three_ds_verified + # The total to show to the creator (excluding buyer fees). sig { returns(T.nilable(Float)) } attr_accessor :total @@ -297,18 +330,24 @@ module WhopSDK refundable: T::Boolean, refunded_amount: T.nilable(Float), refunded_at: T.nilable(Time), + refunds: T::Array[WhopSDK::Payment::Refund::OrHash], resolutions: T.nilable(T::Array[WhopSDK::Payment::Resolution::OrHash]), retryable: T::Boolean, + risk_score: T.nilable(Integer), + risk_signals: T.nilable(T::Hash[Symbol, T.anything]), settlement_amount: Float, settlement_currency: WhopSDK::Currency::OrSymbol, settlement_exchange_rate: T.nilable(Float), + shipping_address: + T.nilable(WhopSDK::Payment::ShippingAddress::OrHash), status: T.nilable(WhopSDK::ReceiptStatus::OrSymbol), substatus: WhopSDK::FriendlyReceiptStatus::OrSymbol, subtotal: T.nilable(Float), tax_amount: T.nilable(Float), tax_behavior: T.nilable(WhopSDK::ReceiptTaxBehavior::OrSymbol), tax_refunded_amount: T.nilable(Float), + three_ds_verified: T::Boolean, total: T.nilable(Float), updated_at: Time, usd_total: T.nilable(Float), @@ -390,6 +429,9 @@ module WhopSDK refunded_amount:, # When the payment was refunded (if applicable). refunded_at:, + # The refunds issued against this payment, newest first, including failed and + # canceled refund attempts. Limited to the 100 most recent. + refunds:, # The resolution center cases opened by the customer on this payment. Null if the # actor in context does not have the payment:resolution_center_case:read # permission. @@ -398,6 +440,14 @@ module WhopSDK # retry-eligible states (`active`, `trialing`, `completed`, or `past_due`); # otherwise false. Used to decide if Whop can attempt the charge again. retryable:, + # Whop's in-house fraud risk score for this payment, from 0 (lowest risk) to 100 + # (highest risk). Null when the payment has not been scored or scoring has not yet + # completed. + risk_score:, + # A curated set of factors behind the risk score, grouped by category (business + # transaction history, buyer, device). Each entry has a key, human-readable label, + # category, and value. Null when there is no risk assessment for this payment. + risk_signals:, # The total amount charged to the customer for this payment, including taxes and # after any discounts. In the currency specified by the currency field. settlement_amount:, @@ -405,6 +455,9 @@ module WhopSDK settlement_currency:, # Deprecated. Always returns null. settlement_exchange_rate:, + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + shipping_address:, # The status of a receipt status:, # The friendly status of the payment. @@ -418,6 +471,8 @@ module WhopSDK tax_behavior:, # The amount of tax that has been refunded (if applicable). tax_refunded_amount:, + # Whether 3D Secure authentication was completed for this payment. + three_ds_verified:, # The total to show to the creator (excluding buyer fees). total:, # The datetime the payment was last updated. @@ -469,17 +524,22 @@ module WhopSDK refundable: T::Boolean, refunded_amount: T.nilable(Float), refunded_at: T.nilable(Time), + refunds: T::Array[WhopSDK::Payment::Refund], resolutions: T.nilable(T::Array[WhopSDK::Payment::Resolution]), retryable: T::Boolean, + risk_score: T.nilable(Integer), + risk_signals: T.nilable(T::Hash[Symbol, T.anything]), settlement_amount: Float, settlement_currency: WhopSDK::Currency::TaggedSymbol, settlement_exchange_rate: T.nilable(Float), + shipping_address: T.nilable(WhopSDK::Payment::ShippingAddress), status: T.nilable(WhopSDK::ReceiptStatus::TaggedSymbol), substatus: WhopSDK::FriendlyReceiptStatus::TaggedSymbol, subtotal: T.nilable(Float), tax_amount: T.nilable(Float), tax_behavior: T.nilable(WhopSDK::ReceiptTaxBehavior::TaggedSymbol), tax_refunded_amount: T.nilable(Float), + three_ds_verified: T::Boolean, total: T.nilable(Float), updated_at: Time, usd_total: T.nilable(Float), @@ -1241,7 +1301,8 @@ module WhopSDK attr_accessor :internal_notes # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -1259,7 +1320,8 @@ module WhopSDK # A personal description or notes section for the business. internal_notes:, # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: ) end @@ -1287,13 +1349,14 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. sig { returns(String) } attr_accessor :route @@ -1314,11 +1377,12 @@ module WhopSDK def self.new( # The unique identifier for the product. id:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata:, - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. route:, # The display name of the product shown to customers on the product page and in # search results. @@ -1417,6 +1481,76 @@ module WhopSDK end end + class Refund < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Payment::Refund, WhopSDK::Internal::AnyHash) + end + + # The unique identifier for the refund. + sig { returns(String) } + attr_accessor :id + + # The refunded amount as a decimal in the specified currency, such as 10.43 for + # $10.43 USD. + sig { returns(Float) } + attr_accessor :amount + + # The datetime the refund was created. + sig { returns(Time) } + attr_accessor :created_at + + # The three-letter ISO currency code for the refunded amount. + sig { returns(WhopSDK::Currency::TaggedSymbol) } + attr_accessor :currency + + # The current processing status of the refund, such as pending, succeeded, or + # failed. + sig { returns(WhopSDK::RefundStatus::TaggedSymbol) } + attr_accessor :status + + # A refund represents a full or partial reversal of a payment, including the + # amount, status, and payment provider. + sig do + params( + id: String, + amount: Float, + created_at: Time, + currency: WhopSDK::Currency::OrSymbol, + status: WhopSDK::RefundStatus::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the refund. + id:, + # The refunded amount as a decimal in the specified currency, such as 10.43 for + # $10.43 USD. + amount:, + # The datetime the refund was created. + created_at:, + # The three-letter ISO currency code for the refunded amount. + currency:, + # The current processing status of the refund, such as pending, succeeded, or + # failed. + status: + ) + end + + sig do + override.returns( + { + id: String, + amount: Float, + created_at: Time, + currency: WhopSDK::Currency::TaggedSymbol, + status: WhopSDK::RefundStatus::TaggedSymbol + } + ) + end + def to_hash + end + end + class Resolution < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do @@ -1551,6 +1685,88 @@ module WhopSDK end end + class ShippingAddress < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Payment::ShippingAddress, WhopSDK::Internal::AnyHash) + end + + # The city of the address. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The country of the address. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # The line 1 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # The line 2 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # The name of the customer. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The postal code of the address. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # The state of the address. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + name: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The city of the address. + city:, + # The country of the address. + country:, + # The line 1 of the address. + line1:, + # The line 2 of the address. + line2:, + # The name of the customer. + name:, + # The postal code of the address. + postal_code:, + # The state of the address. + state: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + name: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + class User < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/whop_sdk/models/payment_create_params.rbi b/rbi/whop_sdk/models/payment_create_params.rbi index 20256787..e1d5de5c 100644 --- a/rbi/whop_sdk/models/payment_create_params.rbi +++ b/rbi/whop_sdk/models/payment_create_params.rbi @@ -108,6 +108,12 @@ module WhopSDK sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata + # The ID of an active promo code to apply to this payment. The promo code must + # belong to the company and be valid for the plan being purchased. The plan must + # be attached to a product — promo codes are not eligible for one-off purchases. + sig { returns(T.nilable(String)) } + attr_accessor :promo_code_id + # Autogenerated input type of CreatePayment sig do params( @@ -116,7 +122,8 @@ module WhopSDK payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Body::CreatePaymentInputWithPlan::Plan::OrHash, - metadata: T.nilable(T::Hash[Symbol, T.anything]) + metadata: T.nilable(T::Hash[Symbol, T.anything]), + promo_code_id: T.nilable(String) ).returns(T.attached_class) end def self.new( @@ -130,7 +137,11 @@ module WhopSDK # Pass this object to create a new plan for this payment plan:, # Custom metadata to attach to the payment. - metadata: nil + metadata: nil, + # The ID of an active promo code to apply to this payment. The promo code must + # belong to the company and be valid for the plan being purchased. The plan must + # be attached to a product — promo codes are not eligible for one-off purchases. + promo_code_id: nil ) end @@ -142,7 +153,8 @@ module WhopSDK payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Body::CreatePaymentInputWithPlan::Plan, - metadata: T.nilable(T::Hash[Symbol, T.anything]) + metadata: T.nilable(T::Hash[Symbol, T.anything]), + promo_code_id: T.nilable(String) } ) end @@ -505,6 +517,12 @@ module WhopSDK sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata + # The ID of an active promo code to apply to this payment. The promo code must + # belong to the company and be valid for the plan being purchased. The plan must + # be attached to a product — promo codes are not eligible for one-off purchases. + sig { returns(T.nilable(String)) } + attr_accessor :promo_code_id + # Autogenerated input type of CreatePayment sig do params( @@ -512,7 +530,8 @@ module WhopSDK member_id: String, payment_method_id: String, plan_id: String, - metadata: T.nilable(T::Hash[Symbol, T.anything]) + metadata: T.nilable(T::Hash[Symbol, T.anything]), + promo_code_id: T.nilable(String) ).returns(T.attached_class) end def self.new( @@ -526,7 +545,11 @@ module WhopSDK # An ID of an existing plan to use for the payment. plan_id:, # Custom metadata to attach to the payment. - metadata: nil + metadata: nil, + # The ID of an active promo code to apply to this payment. The promo code must + # belong to the company and be valid for the plan being purchased. The plan must + # be attached to a product — promo codes are not eligible for one-off purchases. + promo_code_id: nil ) end @@ -537,7 +560,8 @@ module WhopSDK member_id: String, payment_method_id: String, plan_id: String, - metadata: T.nilable(T::Hash[Symbol, T.anything]) + metadata: T.nilable(T::Hash[Symbol, T.anything]), + promo_code_id: T.nilable(String) } ) end diff --git a/rbi/whop_sdk/models/payment_list_response.rbi b/rbi/whop_sdk/models/payment_list_response.rbi index 60990107..2d0ee9d3 100644 --- a/rbi/whop_sdk/models/payment_list_response.rbi +++ b/rbi/whop_sdk/models/payment_list_response.rbi @@ -230,6 +230,25 @@ module WhopSDK sig { returns(WhopSDK::Currency::TaggedSymbol) } attr_accessor :settlement_currency + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + sig do + returns( + T.nilable(WhopSDK::Models::PaymentListResponse::ShippingAddress) + ) + end + attr_reader :shipping_address + + sig do + params( + shipping_address: + T.nilable( + WhopSDK::Models::PaymentListResponse::ShippingAddress::OrHash + ) + ).void + end + attr_writer :shipping_address + # The status of a receipt sig { returns(T.nilable(WhopSDK::ReceiptStatus::TaggedSymbol)) } attr_accessor :status @@ -328,6 +347,10 @@ module WhopSDK refunded_at: T.nilable(Time), retryable: T::Boolean, settlement_currency: WhopSDK::Currency::OrSymbol, + shipping_address: + T.nilable( + WhopSDK::Models::PaymentListResponse::ShippingAddress::OrHash + ), status: T.nilable(WhopSDK::ReceiptStatus::OrSymbol), substatus: WhopSDK::FriendlyReceiptStatus::OrSymbol, subtotal: T.nilable(Float), @@ -411,6 +434,9 @@ module WhopSDK retryable:, # The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). settlement_currency:, + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + shipping_address:, # The status of a receipt status:, # The friendly status of the payment. @@ -476,6 +502,8 @@ module WhopSDK refunded_at: T.nilable(Time), retryable: T::Boolean, settlement_currency: WhopSDK::Currency::TaggedSymbol, + shipping_address: + T.nilable(WhopSDK::Models::PaymentListResponse::ShippingAddress), status: T.nilable(WhopSDK::ReceiptStatus::TaggedSymbol), substatus: WhopSDK::FriendlyReceiptStatus::TaggedSymbol, subtotal: T.nilable(Float), @@ -941,7 +969,8 @@ module WhopSDK attr_accessor :internal_notes # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -959,7 +988,8 @@ module WhopSDK # A personal description or notes section for the business. internal_notes:, # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: ) end @@ -990,13 +1020,14 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. sig { returns(String) } attr_accessor :route @@ -1017,11 +1048,12 @@ module WhopSDK def self.new( # The unique identifier for the product. id:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata:, - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. route:, # The display name of the product shown to customers on the product page and in # search results. @@ -1123,6 +1155,91 @@ module WhopSDK end end + class ShippingAddress < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PaymentListResponse::ShippingAddress, + WhopSDK::Internal::AnyHash + ) + end + + # The city of the address. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The country of the address. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # The line 1 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # The line 2 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # The name of the customer. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The postal code of the address. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # The state of the address. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # The shipping address provided by the customer for physical goods. Null if no + # shipping address was collected. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + name: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The city of the address. + city:, + # The country of the address. + country:, + # The line 1 of the address. + line1:, + # The line 2 of the address. + line2:, + # The name of the customer. + name:, + # The postal code of the address. + postal_code:, + # The state of the address. + state: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + name: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + class User < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/whop_sdk/models/payout_create_params.rbi b/rbi/whop_sdk/models/payout_create_params.rbi new file mode 100644 index 00000000..c87c9267 --- /dev/null +++ b/rbi/whop_sdk/models/payout_create_params.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::PayoutCreateParams, WhopSDK::Internal::AnyHash) + end + + # The account to pay out from (a biz\_ identifier). + sig { returns(String) } + attr_accessor :account_id + + # The amount to pay out in the specified currency. + sig { returns(Float) } + attr_accessor :amount + + # The saved payout method to deliver to (a potk\_ identifier). + sig { returns(String) } + attr_accessor :payout_method_id + + # The payout currency. Defaults to usd. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # A client-generated key that makes retries safe. Retrying with the same key + # returns the original payout instead of creating a second one. + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + + sig do + params( + account_id: String, + amount: Float, + payout_method_id: String, + currency: String, + idempotency_key: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The account to pay out from (a biz\_ identifier). + account_id:, + # The amount to pay out in the specified currency. + amount:, + # The saved payout method to deliver to (a potk\_ identifier). + payout_method_id:, + # The payout currency. Defaults to usd. + currency: nil, + # A client-generated key that makes retries safe. Retrying with the same key + # returns the original payout instead of creating a second one. + idempotency_key: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + amount: Float, + payout_method_id: String, + currency: String, + idempotency_key: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_create_response.rbi b/rbi/whop_sdk/models/payout_create_response.rbi new file mode 100644 index 00000000..a62cf134 --- /dev/null +++ b/rbi/whop_sdk/models/payout_create_response.rbi @@ -0,0 +1,352 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutCreateResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Payout ID. + sig { returns(String) } + attr_accessor :id + + # The payout amount in whole currency units. + sig { returns(Float) } + attr_accessor :amount + + # When the payout was created. + sig { returns(Time) } + attr_accessor :created_at + + # Payout currency. + sig { returns(String) } + attr_accessor :currency + + # Estimated time the funds become available in the destination account. Null until + # the payout settles. + sig { returns(T.nilable(Time)) } + attr_accessor :estimated_arrival + + # The fee charged for the payout, in the payout currency. + sig { returns(Float) } + attr_accessor :fee_amount + + sig do + returns(WhopSDK::Models::PayoutCreateResponse::Object::TaggedSymbol) + end + attr_accessor :object + + # Name of the entity processing the payout. Null until the payout settles. + sig { returns(T.nilable(String)) } + attr_accessor :payer_name + + # The saved payout method used. Requires payout:destination:read; null without it. + sig do + returns(T.nilable(WhopSDK::Models::PayoutCreateResponse::PayoutToken)) + end + attr_reader :payout_token + + sig do + params( + payout_token: + T.nilable( + WhopSDK::Models::PayoutCreateResponse::PayoutToken::OrHash + ) + ).void + end + attr_writer :payout_token + + # Payout delivery speed. + sig do + returns(WhopSDK::Models::PayoutCreateResponse::Speed::TaggedSymbol) + end + attr_accessor :speed + + # Current payout status, in the same vocabulary as GET /payouts. + sig do + returns(WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol) + end + attr_accessor :status + + sig do + params( + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: T.nilable(Time), + fee_amount: Float, + object: WhopSDK::Models::PayoutCreateResponse::Object::OrSymbol, + payer_name: T.nilable(String), + payout_token: + T.nilable( + WhopSDK::Models::PayoutCreateResponse::PayoutToken::OrHash + ), + speed: WhopSDK::Models::PayoutCreateResponse::Speed::OrSymbol, + status: WhopSDK::Models::PayoutCreateResponse::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Payout ID. + id:, + # The payout amount in whole currency units. + amount:, + # When the payout was created. + created_at:, + # Payout currency. + currency:, + # Estimated time the funds become available in the destination account. Null until + # the payout settles. + estimated_arrival:, + # The fee charged for the payout, in the payout currency. + fee_amount:, + object:, + # Name of the entity processing the payout. Null until the payout settles. + payer_name:, + # The saved payout method used. Requires payout:destination:read; null without it. + payout_token:, + # Payout delivery speed. + speed:, + # Current payout status, in the same vocabulary as GET /payouts. + status: + ) + end + + sig do + override.returns( + { + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: T.nilable(Time), + fee_amount: Float, + object: WhopSDK::Models::PayoutCreateResponse::Object::TaggedSymbol, + payer_name: T.nilable(String), + payout_token: + T.nilable(WhopSDK::Models::PayoutCreateResponse::PayoutToken), + speed: WhopSDK::Models::PayoutCreateResponse::Speed::TaggedSymbol, + status: WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::PayoutCreateResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYOUT = + T.let( + :payout, + WhopSDK::Models::PayoutCreateResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::PayoutCreateResponse::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PayoutToken < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutCreateResponse::PayoutToken, + WhopSDK::Internal::AnyHash + ) + end + + # Saved payout method nickname. + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + # Payout destination display details. + sig do + returns( + T.nilable( + WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination + ) + ) + end + attr_reader :payout_destination + + sig do + params( + payout_destination: + T.nilable( + WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination::OrHash + ) + ).void + end + attr_writer :payout_destination + + # The saved payout method used. Requires payout:destination:read; null without it. + sig do + params( + nickname: T.nilable(String), + payout_destination: + T.nilable( + WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # Saved payout method nickname. + nickname:, + # Payout destination display details. + payout_destination: + ) + end + + sig do + override.returns( + { + nickname: T.nilable(String), + payout_destination: + T.nilable( + WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination + ) + } + ) + end + def to_hash + end + + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination, + WhopSDK::Internal::AnyHash + ) + end + + # Payout destination icon URL. + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Payout destination display name. + sig { returns(T.nilable(String)) } + attr_accessor :payer_name + + # Payout destination display details. + sig do + params( + icon_url: T.nilable(String), + payer_name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Payout destination icon URL. + icon_url:, + # Payout destination display name. + payer_name: + ) + end + + sig do + override.returns( + { icon_url: T.nilable(String), payer_name: T.nilable(String) } + ) + end + def to_hash + end + end + end + + # Payout delivery speed. + module Speed + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::PayoutCreateResponse::Speed) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STANDARD = + T.let( + :standard, + WhopSDK::Models::PayoutCreateResponse::Speed::TaggedSymbol + ) + INSTANT = + T.let( + :instant, + WhopSDK::Models::PayoutCreateResponse::Speed::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::PayoutCreateResponse::Speed::TaggedSymbol] + ) + end + def self.values + end + end + + # Current payout status, in the same vocabulary as GET /payouts. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::PayoutCreateResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUESTED = + T.let( + :requested, + WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol + ) + IN_TRANSIT = + T.let( + :in_transit, + WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_destination_category.rbi b/rbi/whop_sdk/models/payout_destination_category.rbi deleted file mode 100644 index eeae2185..00000000 --- a/rbi/whop_sdk/models/payout_destination_category.rbi +++ /dev/null @@ -1,33 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - # The category of a payout destination. - module PayoutDestinationCategory - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::PayoutDestinationCategory) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CRYPTO = T.let(:crypto, WhopSDK::PayoutDestinationCategory::TaggedSymbol) - RTP = T.let(:rtp, WhopSDK::PayoutDestinationCategory::TaggedSymbol) - NEXT_DAY_BANK = - T.let(:next_day_bank, WhopSDK::PayoutDestinationCategory::TaggedSymbol) - BANK_WIRE = - T.let(:bank_wire, WhopSDK::PayoutDestinationCategory::TaggedSymbol) - DIGITAL_WALLET = - T.let(:digital_wallet, WhopSDK::PayoutDestinationCategory::TaggedSymbol) - UNKNOWN = - T.let(:unknown, WhopSDK::PayoutDestinationCategory::TaggedSymbol) - - sig do - override.returns( - T::Array[WhopSDK::PayoutDestinationCategory::TaggedSymbol] - ) - end - def self.values - end - end - end -end diff --git a/rbi/whop_sdk/models/payout_list_params.rbi b/rbi/whop_sdk/models/payout_list_params.rbi new file mode 100644 index 00000000..4d9c6f3d --- /dev/null +++ b/rbi/whop_sdk/models/payout_list_params.rbi @@ -0,0 +1,112 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::PayoutListParams, 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 + + # Cursor to fetch the page after (from page_info.end_cursor). + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Cursor to fetch the page before (from page_info.start_cursor). + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Optional currency code filter, for example `usd`. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # Number of payouts to return from the start of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # Number of payouts to return from the end of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :last + + sig { params(last: Integer).void } + attr_writer :last + + # 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, + after: String, + before: String, + currency: String, + first: Integer, + last: Integer, + 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, + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Optional currency code filter, for example `usd`. + currency: nil, + # Number of payouts to return from the start of the window. + first: nil, + # Number of payouts to return from the end of the window. + last: 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, + after: String, + before: String, + currency: String, + first: Integer, + last: Integer, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_list_response.rbi b/rbi/whop_sdk/models/payout_list_response.rbi new file mode 100644 index 00000000..371b9949 --- /dev/null +++ b/rbi/whop_sdk/models/payout_list_response.rbi @@ -0,0 +1,353 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::PayoutListResponse, WhopSDK::Internal::AnyHash) + end + + # Payout ID. + sig { returns(String) } + attr_accessor :id + + # The payout amount in whole currency units. + sig { returns(Float) } + attr_accessor :amount + + # When the payout was created. + sig { returns(Time) } + attr_accessor :created_at + + # Payout currency. + sig { returns(String) } + attr_accessor :currency + + # Estimated time the funds become available in the destination account. + sig { returns(T.nilable(Time)) } + attr_accessor :estimated_arrival + + # The fee charged for the payout, in the payout currency. + sig { returns(Float) } + attr_accessor :fee_amount + + sig { returns(WhopSDK::Models::PayoutListResponse::Object::TaggedSymbol) } + attr_accessor :object + + # Name of the entity processing the payout. + sig { returns(T.nilable(String)) } + attr_accessor :payer_name + + # The ID returned by POST /payouts when this payout was requested. Match it to the + # settled payout in GET /payouts. Null for payouts not created by POST /payouts. + sig { returns(T.nilable(String)) } + attr_accessor :payout_request_id + + # The saved payout method used. Requires payout:destination:read; null without it. + sig do + returns(T.nilable(WhopSDK::Models::PayoutListResponse::PayoutToken)) + end + attr_reader :payout_token + + sig do + params( + payout_token: + T.nilable(WhopSDK::Models::PayoutListResponse::PayoutToken::OrHash) + ).void + end + attr_writer :payout_token + + # Payout delivery speed. + sig { returns(WhopSDK::Models::PayoutListResponse::Speed::TaggedSymbol) } + attr_accessor :speed + + # Current payout status. + sig { returns(WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol) } + attr_accessor :status + + sig do + params( + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: T.nilable(Time), + fee_amount: Float, + object: WhopSDK::Models::PayoutListResponse::Object::OrSymbol, + payer_name: T.nilable(String), + payout_request_id: T.nilable(String), + payout_token: + T.nilable(WhopSDK::Models::PayoutListResponse::PayoutToken::OrHash), + speed: WhopSDK::Models::PayoutListResponse::Speed::OrSymbol, + status: WhopSDK::Models::PayoutListResponse::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Payout ID. + id:, + # The payout amount in whole currency units. + amount:, + # When the payout was created. + created_at:, + # Payout currency. + currency:, + # Estimated time the funds become available in the destination account. + estimated_arrival:, + # The fee charged for the payout, in the payout currency. + fee_amount:, + object:, + # Name of the entity processing the payout. + payer_name:, + # The ID returned by POST /payouts when this payout was requested. Match it to the + # settled payout in GET /payouts. Null for payouts not created by POST /payouts. + payout_request_id:, + # The saved payout method used. Requires payout:destination:read; null without it. + payout_token:, + # Payout delivery speed. + speed:, + # Current payout status. + status: + ) + end + + sig do + override.returns( + { + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: T.nilable(Time), + fee_amount: Float, + object: WhopSDK::Models::PayoutListResponse::Object::TaggedSymbol, + payer_name: T.nilable(String), + payout_request_id: T.nilable(String), + payout_token: + T.nilable(WhopSDK::Models::PayoutListResponse::PayoutToken), + speed: WhopSDK::Models::PayoutListResponse::Speed::TaggedSymbol, + status: WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::PayoutListResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYOUT = + T.let( + :payout, + WhopSDK::Models::PayoutListResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::PayoutListResponse::Object::TaggedSymbol] + ) + end + def self.values + end + end + + class PayoutToken < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutListResponse::PayoutToken, + WhopSDK::Internal::AnyHash + ) + end + + # Saved payout method nickname. + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + # Payout destination display details. + sig do + returns( + T.nilable( + WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination + ) + ) + end + attr_reader :payout_destination + + sig do + params( + payout_destination: + T.nilable( + WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination::OrHash + ) + ).void + end + attr_writer :payout_destination + + # The saved payout method used. Requires payout:destination:read; null without it. + sig do + params( + nickname: T.nilable(String), + payout_destination: + T.nilable( + WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # Saved payout method nickname. + nickname:, + # Payout destination display details. + payout_destination: + ) + end + + sig do + override.returns( + { + nickname: T.nilable(String), + payout_destination: + T.nilable( + WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination + ) + } + ) + end + def to_hash + end + + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination, + WhopSDK::Internal::AnyHash + ) + end + + # Payout destination icon URL. + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Payout destination display name. + sig { returns(T.nilable(String)) } + attr_accessor :payer_name + + # Payout destination display details. + sig do + params( + icon_url: T.nilable(String), + payer_name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Payout destination icon URL. + icon_url:, + # Payout destination display name. + payer_name: + ) + end + + sig do + override.returns( + { icon_url: T.nilable(String), payer_name: T.nilable(String) } + ) + end + def to_hash + end + end + end + + # Payout delivery speed. + module Speed + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::PayoutListResponse::Speed) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STANDARD = + T.let( + :standard, + WhopSDK::Models::PayoutListResponse::Speed::TaggedSymbol + ) + INSTANT = + T.let( + :instant, + WhopSDK::Models::PayoutListResponse::Speed::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::PayoutListResponse::Speed::TaggedSymbol] + ) + end + def self.values + end + end + + # Current payout status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::PayoutListResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUESTED = + T.let( + :requested, + WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol + ) + AWAITING_PAYMENT = + T.let( + :awaiting_payment, + WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol + ) + IN_TRANSIT = + T.let( + :in_transit, + WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol + ) + DENIED = + T.let( + :denied, + WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::PayoutListResponse::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi b/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi index 70a34f13..cf1a7dd9 100644 --- a/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi +++ b/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi @@ -278,7 +278,11 @@ module WhopSDK end # The category of the payout destination - sig { returns(WhopSDK::PayoutDestinationCategory::TaggedSymbol) } + sig do + returns( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + end attr_accessor :category # The country code of the payout destination @@ -293,7 +297,8 @@ module WhopSDK # configured. sig do params( - category: WhopSDK::PayoutDestinationCategory::OrSymbol, + category: + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::OrSymbol, country_code: String, name: String ).returns(T.attached_class) @@ -311,7 +316,8 @@ module WhopSDK sig do override.returns( { - category: WhopSDK::PayoutDestinationCategory::TaggedSymbol, + category: + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol, country_code: String, name: String } @@ -319,6 +325,61 @@ module WhopSDK end def to_hash end + + # The category of the payout destination + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CRYPTO = + T.let( + :crypto, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + RTP = + T.let( + :rtp, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + NEXT_DAY_BANK = + T.let( + :next_day_bank, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + BANK_WIRE = + T.let( + :bank_wire, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + DIGITAL_WALLET = + T.let( + :digital_wallet, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + UNKNOWN = + T.let( + :unknown, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/payout_method_list_params.rbi b/rbi/whop_sdk/models/payout_method_list_params.rbi deleted file mode 100644 index 6a55970f..00000000 --- a/rbi/whop_sdk/models/payout_method_list_params.rbi +++ /dev/null @@ -1,75 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class PayoutMethodListParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any(WhopSDK::PayoutMethodListParams, WhopSDK::Internal::AnyHash) - end - - # The unique identifier of the company to list payout methods for. - sig { returns(String) } - attr_accessor :company_id - - # Returns the elements in the list that come after the specified cursor. - sig { returns(T.nilable(String)) } - attr_accessor :after - - # Returns the elements in the list that come before the specified cursor. - sig { returns(T.nilable(String)) } - attr_accessor :before - - # Returns the first _n_ elements from the list. - sig { returns(T.nilable(Integer)) } - attr_accessor :first - - # Returns the last _n_ elements from the list. - sig { returns(T.nilable(Integer)) } - attr_accessor :last - - sig do - params( - company_id: String, - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), - request_options: WhopSDK::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The unique identifier of the company to list payout methods for. - company_id:, - # Returns the elements in the list that come after the specified cursor. - after: nil, - # Returns the elements in the list that come before the specified cursor. - before: nil, - # Returns the first _n_ elements from the list. - first: nil, - # Returns the last _n_ elements from the list. - last: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - company_id: String, - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), - request_options: WhopSDK::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/whop_sdk/models/payout_method_list_response.rbi b/rbi/whop_sdk/models/payout_method_list_response.rbi deleted file mode 100644 index 3c7d8f3b..00000000 --- a/rbi/whop_sdk/models/payout_method_list_response.rbi +++ /dev/null @@ -1,234 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PayoutMethodListResponse, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the payout token. - sig { returns(String) } - attr_accessor :id - - # A masked identifier for the payout destination, such as the last four digits of - # a bank account or an email address. Null if no reference is available. - sig { returns(T.nilable(String)) } - attr_accessor :account_reference - - # The company associated with this payout destination. Null if not linked to a - # specific company. - sig do - returns(T.nilable(WhopSDK::Models::PayoutMethodListResponse::Company)) - end - attr_reader :company - - sig do - params( - company: - T.nilable( - WhopSDK::Models::PayoutMethodListResponse::Company::OrHash - ) - ).void - end - attr_writer :company - - # The datetime the payout token was created. - sig { returns(Time) } - attr_accessor :created_at - - # The three-letter ISO currency code that payouts are delivered in for this - # destination. - sig { returns(String) } - attr_accessor :currency - - # The payout destination configuration linked to this token. Null if not yet - # configured. - sig do - returns( - T.nilable(WhopSDK::Models::PayoutMethodListResponse::Destination) - ) - end - attr_reader :destination - - sig do - params( - destination: - T.nilable( - WhopSDK::Models::PayoutMethodListResponse::Destination::OrHash - ) - ).void - end - attr_writer :destination - - # The name of the bank or financial institution receiving payouts. Null if not - # applicable or not provided. - sig { returns(T.nilable(String)) } - attr_accessor :institution_name - - # Whether this is the default payout destination for the associated payout - # account. - sig { returns(T::Boolean) } - attr_accessor :is_default - - # A user-defined label to help identify this payout destination. Not sent to the - # provider. Null if no nickname has been set. - sig { returns(T.nilable(String)) } - attr_accessor :nickname - - # A configured payout destination where a user receives earned funds, such as a - # bank account or digital wallet. - sig do - params( - id: String, - account_reference: T.nilable(String), - company: - T.nilable( - WhopSDK::Models::PayoutMethodListResponse::Company::OrHash - ), - created_at: Time, - currency: String, - destination: - T.nilable( - WhopSDK::Models::PayoutMethodListResponse::Destination::OrHash - ), - institution_name: T.nilable(String), - is_default: T::Boolean, - nickname: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the payout token. - id:, - # A masked identifier for the payout destination, such as the last four digits of - # a bank account or an email address. Null if no reference is available. - account_reference:, - # The company associated with this payout destination. Null if not linked to a - # specific company. - company:, - # The datetime the payout token was created. - created_at:, - # The three-letter ISO currency code that payouts are delivered in for this - # destination. - currency:, - # The payout destination configuration linked to this token. Null if not yet - # configured. - destination:, - # The name of the bank or financial institution receiving payouts. Null if not - # applicable or not provided. - institution_name:, - # Whether this is the default payout destination for the associated payout - # account. - is_default:, - # A user-defined label to help identify this payout destination. Not sent to the - # provider. Null if no nickname has been set. - nickname: - ) - end - - sig do - override.returns( - { - id: String, - account_reference: T.nilable(String), - company: - T.nilable(WhopSDK::Models::PayoutMethodListResponse::Company), - created_at: Time, - currency: String, - destination: - T.nilable(WhopSDK::Models::PayoutMethodListResponse::Destination), - institution_name: T.nilable(String), - is_default: T::Boolean, - nickname: T.nilable(String) - } - ) - end - def to_hash - end - - class Company < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PayoutMethodListResponse::Company, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the company. - sig { returns(String) } - attr_accessor :id - - # The company associated with this payout destination. Null if not linked to a - # specific company. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The unique identifier for the company. - id: - ) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - - class Destination < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PayoutMethodListResponse::Destination, - WhopSDK::Internal::AnyHash - ) - end - - # The category of the payout destination - sig { returns(WhopSDK::PayoutDestinationCategory::TaggedSymbol) } - attr_accessor :category - - # The country code of the payout destination - sig { returns(String) } - attr_accessor :country_code - - # The name of the payer associated with the payout destination - sig { returns(String) } - attr_accessor :name - - # The payout destination configuration linked to this token. Null if not yet - # configured. - sig do - params( - category: WhopSDK::PayoutDestinationCategory::OrSymbol, - country_code: String, - name: String - ).returns(T.attached_class) - end - def self.new( - # The category of the payout destination - category:, - # The country code of the payout destination - country_code:, - # The name of the payer associated with the payout destination - name: - ) - end - - sig do - override.returns( - { - category: WhopSDK::PayoutDestinationCategory::TaggedSymbol, - country_code: String, - name: String - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/models/payout_method_retrieve_response.rbi b/rbi/whop_sdk/models/payout_method_retrieve_response.rbi deleted file mode 100644 index 44557ab9..00000000 --- a/rbi/whop_sdk/models/payout_method_retrieve_response.rbi +++ /dev/null @@ -1,238 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class PayoutMethodRetrieveResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PayoutMethodRetrieveResponse, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the payout token. - sig { returns(String) } - attr_accessor :id - - # A masked identifier for the payout destination, such as the last four digits of - # a bank account or an email address. Null if no reference is available. - sig { returns(T.nilable(String)) } - attr_accessor :account_reference - - # The company associated with this payout destination. Null if not linked to a - # specific company. - sig do - returns( - T.nilable(WhopSDK::Models::PayoutMethodRetrieveResponse::Company) - ) - end - attr_reader :company - - sig do - params( - company: - T.nilable( - WhopSDK::Models::PayoutMethodRetrieveResponse::Company::OrHash - ) - ).void - end - attr_writer :company - - # The datetime the payout token was created. - sig { returns(Time) } - attr_accessor :created_at - - # The three-letter ISO currency code that payouts are delivered in for this - # destination. - sig { returns(String) } - attr_accessor :currency - - # The payout destination configuration linked to this token. Null if not yet - # configured. - sig do - returns( - T.nilable(WhopSDK::Models::PayoutMethodRetrieveResponse::Destination) - ) - end - attr_reader :destination - - sig do - params( - destination: - T.nilable( - WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::OrHash - ) - ).void - end - attr_writer :destination - - # The name of the bank or financial institution receiving payouts. Null if not - # applicable or not provided. - sig { returns(T.nilable(String)) } - attr_accessor :institution_name - - # Whether this is the default payout destination for the associated payout - # account. - sig { returns(T::Boolean) } - attr_accessor :is_default - - # A user-defined label to help identify this payout destination. Not sent to the - # provider. Null if no nickname has been set. - sig { returns(T.nilable(String)) } - attr_accessor :nickname - - # A configured payout destination where a user receives earned funds, such as a - # bank account or digital wallet. - sig do - params( - id: String, - account_reference: T.nilable(String), - company: - T.nilable( - WhopSDK::Models::PayoutMethodRetrieveResponse::Company::OrHash - ), - created_at: Time, - currency: String, - destination: - T.nilable( - WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::OrHash - ), - institution_name: T.nilable(String), - is_default: T::Boolean, - nickname: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the payout token. - id:, - # A masked identifier for the payout destination, such as the last four digits of - # a bank account or an email address. Null if no reference is available. - account_reference:, - # The company associated with this payout destination. Null if not linked to a - # specific company. - company:, - # The datetime the payout token was created. - created_at:, - # The three-letter ISO currency code that payouts are delivered in for this - # destination. - currency:, - # The payout destination configuration linked to this token. Null if not yet - # configured. - destination:, - # The name of the bank or financial institution receiving payouts. Null if not - # applicable or not provided. - institution_name:, - # Whether this is the default payout destination for the associated payout - # account. - is_default:, - # A user-defined label to help identify this payout destination. Not sent to the - # provider. Null if no nickname has been set. - nickname: - ) - end - - sig do - override.returns( - { - id: String, - account_reference: T.nilable(String), - company: - T.nilable(WhopSDK::Models::PayoutMethodRetrieveResponse::Company), - created_at: Time, - currency: String, - destination: - T.nilable( - WhopSDK::Models::PayoutMethodRetrieveResponse::Destination - ), - institution_name: T.nilable(String), - is_default: T::Boolean, - nickname: T.nilable(String) - } - ) - end - def to_hash - end - - class Company < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PayoutMethodRetrieveResponse::Company, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the company. - sig { returns(String) } - attr_accessor :id - - # The company associated with this payout destination. Null if not linked to a - # specific company. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The unique identifier for the company. - id: - ) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - - class Destination < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PayoutMethodRetrieveResponse::Destination, - WhopSDK::Internal::AnyHash - ) - end - - # The category of the payout destination - sig { returns(WhopSDK::PayoutDestinationCategory::TaggedSymbol) } - attr_accessor :category - - # The country code of the payout destination - sig { returns(String) } - attr_accessor :country_code - - # The name of the payer associated with the payout destination - sig { returns(String) } - attr_accessor :name - - # The payout destination configuration linked to this token. Null if not yet - # configured. - sig do - params( - category: WhopSDK::PayoutDestinationCategory::OrSymbol, - country_code: String, - name: String - ).returns(T.attached_class) - end - def self.new( - # The category of the payout destination - category:, - # The country code of the payout destination - country_code:, - # The name of the payer associated with the payout destination - name: - ) - end - - sig do - override.returns( - { - category: WhopSDK::PayoutDestinationCategory::TaggedSymbol, - country_code: String, - name: String - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/models/payouts/method_list_params.rbi b/rbi/whop_sdk/models/payouts/method_list_params.rbi new file mode 100644 index 00000000..4aa05098 --- /dev/null +++ b/rbi/whop_sdk/models/payouts/method_list_params.rbi @@ -0,0 +1,209 @@ +# typed: strong + +module WhopSDK + module Models + module Payouts + class MethodListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Payouts::MethodListParams, + 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 + + # Cursor to fetch the page after (from page_info.end_cursor). + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Optional withdrawal amount in whole currency units, for example `250.00`. When + # provided, each method includes a quote with the estimated fee, amount received, + # and delivery date for that amount. + sig { returns(T.nilable(Float)) } + attr_reader :amount + + sig { params(amount: Float).void } + attr_writer :amount + + # Cursor to fetch the page before (from page_info.start_cursor). + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Currency code of the amount, for example `usd`. Only meaningful with amount. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # Number of payout methods to return from the start of the window. Capped at 25 + # when an amount is provided. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # When true, the response also carries available_destinations — payout rails the + # account could add as a new payout method, with per-currency quotes when an + # amount is provided. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_available + + sig { params(include_available: T::Boolean).void } + attr_writer :include_available + + # Number of payout methods to return from the end of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :last + + sig { params(last: Integer).void } + attr_writer :last + + # Optional status filter. `created` means saved but unused, `active` means a + # payout through it succeeded, `broken` means the last payout failed and the + # method needs fixing. + sig do + returns( + T.nilable(WhopSDK::Payouts::MethodListParams::Status::OrSymbol) + ) + end + attr_reader :status + + sig do + params( + status: WhopSDK::Payouts::MethodListParams::Status::OrSymbol + ).void + end + attr_writer :status + + # 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, + after: String, + amount: Float, + before: String, + currency: String, + first: Integer, + include_available: T::Boolean, + last: Integer, + status: WhopSDK::Payouts::MethodListParams::Status::OrSymbol, + 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, + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Optional withdrawal amount in whole currency units, for example `250.00`. When + # provided, each method includes a quote with the estimated fee, amount received, + # and delivery date for that amount. + amount: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Currency code of the amount, for example `usd`. Only meaningful with amount. + currency: nil, + # Number of payout methods to return from the start of the window. Capped at 25 + # when an amount is provided. + first: nil, + # When true, the response also carries available_destinations — payout rails the + # account could add as a new payout method, with per-currency quotes when an + # amount is provided. + include_available: nil, + # Number of payout methods to return from the end of the window. + last: nil, + # Optional status filter. `created` means saved but unused, `active` means a + # payout through it succeeded, `broken` means the last payout failed and the + # method needs fixing. + status: 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, + after: String, + amount: Float, + before: String, + currency: String, + first: Integer, + include_available: T::Boolean, + last: Integer, + status: WhopSDK::Payouts::MethodListParams::Status::OrSymbol, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Optional status filter. `created` means saved but unused, `active` means a + # payout through it succeeded, `broken` means the last payout failed and the + # method needs fixing. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Payouts::MethodListParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED = + T.let( + :created, + WhopSDK::Payouts::MethodListParams::Status::TaggedSymbol + ) + ACTIVE = + T.let( + :active, + WhopSDK::Payouts::MethodListParams::Status::TaggedSymbol + ) + BROKEN = + T.let( + :broken, + WhopSDK::Payouts::MethodListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Payouts::MethodListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/payouts/method_list_response.rbi b/rbi/whop_sdk/models/payouts/method_list_response.rbi new file mode 100644 index 00000000..8dbf4b26 --- /dev/null +++ b/rbi/whop_sdk/models/payouts/method_list_response.rbi @@ -0,0 +1,554 @@ +# typed: strong + +module WhopSDK + module Models + module Payouts + class MethodListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Payouts::MethodListResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Payout method ID. + sig { returns(String) } + attr_accessor :id + + # Masked identifier for the destination, such as the last four digits of a bank + # account. + sig { returns(T.nilable(String)) } + attr_accessor :account_reference + + # When the payout method was added. + sig { returns(Time) } + attr_accessor :created_at + + # Currency payouts are delivered in for this method. + sig { returns(String) } + attr_accessor :destination_currency + + # Name of the bank or institution receiving payouts. + sig { returns(T.nilable(String)) } + attr_accessor :institution_name + + # Whether this is the default payout method for the account. + sig { returns(T::Boolean) } + attr_accessor :is_default + + # User-defined label for the payout method. + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + sig do + returns( + WhopSDK::Models::Payouts::MethodListResponse::Object::TaggedSymbol + ) + end + attr_accessor :object + + # Display name of the payout rail, such as `ACH Bank Deposit`. + sig { returns(T.nilable(String)) } + attr_accessor :payer_name + + # The payout rail this method delivers through. + sig do + returns( + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination + ) + ) + end + attr_reader :payout_destination + + sig do + params( + payout_destination: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination::OrHash + ) + ).void + end + attr_writer :payout_destination + + # Fee and delivery estimate for withdrawing the requested amount through this + # method. Null unless an amount was provided, or when the estimate is unavailable. + sig do + returns( + T.nilable(WhopSDK::Models::Payouts::MethodListResponse::Quote) + ) + end + attr_reader :quote + + sig do + params( + quote: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::OrHash + ) + ).void + end + attr_writer :quote + + # Lifecycle status: `created` means saved but unused, `active` means a payout + # succeeded through it, `broken` means the last payout failed. + sig do + returns( + WhopSDK::Models::Payouts::MethodListResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig do + params( + id: String, + account_reference: T.nilable(String), + created_at: Time, + destination_currency: String, + institution_name: T.nilable(String), + is_default: T::Boolean, + nickname: T.nilable(String), + object: + WhopSDK::Models::Payouts::MethodListResponse::Object::OrSymbol, + payer_name: T.nilable(String), + payout_destination: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination::OrHash + ), + quote: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::OrHash + ), + status: + WhopSDK::Models::Payouts::MethodListResponse::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Payout method ID. + id:, + # Masked identifier for the destination, such as the last four digits of a bank + # account. + account_reference:, + # When the payout method was added. + created_at:, + # Currency payouts are delivered in for this method. + destination_currency:, + # Name of the bank or institution receiving payouts. + institution_name:, + # Whether this is the default payout method for the account. + is_default:, + # User-defined label for the payout method. + nickname:, + object:, + # Display name of the payout rail, such as `ACH Bank Deposit`. + payer_name:, + # The payout rail this method delivers through. + payout_destination:, + # Fee and delivery estimate for withdrawing the requested amount through this + # method. Null unless an amount was provided, or when the estimate is unavailable. + quote:, + # Lifecycle status: `created` means saved but unused, `active` means a payout + # succeeded through it, `broken` means the last payout failed. + status: + ) + end + + sig do + override.returns( + { + id: String, + account_reference: T.nilable(String), + created_at: Time, + destination_currency: String, + institution_name: T.nilable(String), + is_default: T::Boolean, + nickname: T.nilable(String), + object: + WhopSDK::Models::Payouts::MethodListResponse::Object::TaggedSymbol, + payer_name: T.nilable(String), + payout_destination: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination + ), + quote: + T.nilable(WhopSDK::Models::Payouts::MethodListResponse::Quote), + status: + WhopSDK::Models::Payouts::MethodListResponse::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Payouts::MethodListResponse::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYOUT_METHOD = + T.let( + :payout_method, + WhopSDK::Models::Payouts::MethodListResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Payouts::MethodListResponse::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination, + WhopSDK::Internal::AnyHash + ) + end + + # How funds are delivered, for example `bank_deposit`. + sig { returns(String) } + attr_accessor :delivery_type + + # Payout destination icon URL. + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Payout destination display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T::Boolean) } + attr_accessor :supports_instant_delivery + + sig { returns(T::Boolean) } + attr_accessor :supports_standard_delivery + + # The payout rail this method delivers through. + sig do + params( + delivery_type: String, + icon_url: T.nilable(String), + name: T.nilable(String), + supports_instant_delivery: T::Boolean, + supports_standard_delivery: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # How funds are delivered, for example `bank_deposit`. + delivery_type:, + # Payout destination icon URL. + icon_url:, + # Payout destination display name. + name:, + supports_instant_delivery:, + supports_standard_delivery: + ) + end + + sig do + override.returns( + { + delivery_type: String, + icon_url: T.nilable(String), + name: T.nilable(String), + supports_instant_delivery: T::Boolean, + supports_standard_delivery: T::Boolean + } + ) + end + def to_hash + end + end + + class Quote < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Payouts::MethodListResponse::Quote, + WhopSDK::Internal::AnyHash + ) + end + + # The withdrawal amount the quote is for. + sig { returns(Float) } + attr_accessor :amount + + # Currency of the quoted amount. + sig { returns(String) } + attr_accessor :currency + + # Exchange rate from the withdrawal currency to the destination currency. + sig { returns(Float) } + attr_accessor :exchange_rate + + # Instant-delivery estimate. Null if the method does not support instant delivery, + # instant delivery is unavailable for the account, or the amount does not cover + # the fee. + sig do + returns( + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant + ) + ) + end + attr_reader :instant + + sig do + params( + instant: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant::OrHash + ) + ).void + end + attr_writer :instant + + # Maximum withdrawal amount for this method, in the withdrawal currency. + sig { returns(T.nilable(Float)) } + attr_accessor :max_limit + + # Minimum withdrawal amount for this method, in the withdrawal currency. + sig { returns(Float) } + attr_accessor :min_limit + + # Standard-delivery estimate. Null if the method does not support standard + # delivery, or the amount does not cover the fee. + sig do + returns( + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard + ) + ) + end + attr_reader :standard + + sig do + params( + standard: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard::OrHash + ) + ).void + end + attr_writer :standard + + # Fee and delivery estimate for withdrawing the requested amount through this + # method. Null unless an amount was provided, or when the estimate is unavailable. + sig do + params( + amount: Float, + currency: String, + exchange_rate: Float, + instant: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant::OrHash + ), + max_limit: T.nilable(Float), + min_limit: Float, + standard: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # The withdrawal amount the quote is for. + amount:, + # Currency of the quoted amount. + currency:, + # Exchange rate from the withdrawal currency to the destination currency. + exchange_rate:, + # Instant-delivery estimate. Null if the method does not support instant delivery, + # instant delivery is unavailable for the account, or the amount does not cover + # the fee. + instant:, + # Maximum withdrawal amount for this method, in the withdrawal currency. + max_limit:, + # Minimum withdrawal amount for this method, in the withdrawal currency. + min_limit:, + # Standard-delivery estimate. Null if the method does not support standard + # delivery, or the amount does not cover the fee. + standard: + ) + end + + sig do + override.returns( + { + amount: Float, + currency: String, + exchange_rate: Float, + instant: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant + ), + max_limit: T.nilable(Float), + min_limit: Float, + standard: + T.nilable( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard + ) + } + ) + end + def to_hash + end + + class Instant < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant, + WhopSDK::Internal::AnyHash + ) + end + + # Estimated time the funds become available. + sig { returns(Time) } + attr_accessor :estimated_arrival + + # Total fee charged, in the withdrawal currency. + sig { returns(Float) } + attr_accessor :fee + + # Amount delivered after fees, in the withdrawal currency. + sig { returns(Float) } + attr_accessor :total_received + + # Instant-delivery estimate. Null if the method does not support instant delivery, + # instant delivery is unavailable for the account, or the amount does not cover + # the fee. + sig do + params( + estimated_arrival: Time, + fee: Float, + total_received: Float + ).returns(T.attached_class) + end + def self.new( + # Estimated time the funds become available. + estimated_arrival:, + # Total fee charged, in the withdrawal currency. + fee:, + # Amount delivered after fees, in the withdrawal currency. + total_received: + ) + end + + sig do + override.returns( + { estimated_arrival: Time, fee: Float, total_received: Float } + ) + end + def to_hash + end + end + + class Standard < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard, + WhopSDK::Internal::AnyHash + ) + end + + # Estimated time the funds become available. + sig { returns(Time) } + attr_accessor :estimated_arrival + + # Total fee charged, in the withdrawal currency. + sig { returns(Float) } + attr_accessor :fee + + # Amount delivered after fees, in the withdrawal currency. + sig { returns(Float) } + attr_accessor :total_received + + # Standard-delivery estimate. Null if the method does not support standard + # delivery, or the amount does not cover the fee. + sig do + params( + estimated_arrival: Time, + fee: Float, + total_received: Float + ).returns(T.attached_class) + end + def self.new( + # Estimated time the funds become available. + estimated_arrival:, + # Total fee charged, in the withdrawal currency. + fee:, + # Amount delivered after fees, in the withdrawal currency. + total_received: + ) + end + + sig do + override.returns( + { estimated_arrival: Time, fee: Float, total_received: Float } + ) + end + def to_hash + end + end + end + + # Lifecycle status: `created` means saved but unused, `active` means a payout + # succeeded through it, `broken` means the last payout failed. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Payouts::MethodListResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED = + T.let( + :created, + WhopSDK::Models::Payouts::MethodListResponse::Status::TaggedSymbol + ) + ACTIVE = + T.let( + :active, + WhopSDK::Models::Payouts::MethodListResponse::Status::TaggedSymbol + ) + BROKEN = + T.let( + :broken, + WhopSDK::Models::Payouts::MethodListResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Payouts::MethodListResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/person_list_params.rbi b/rbi/whop_sdk/models/person_list_params.rbi new file mode 100644 index 00000000..9adc0806 --- /dev/null +++ b/rbi/whop_sdk/models/person_list_params.rbi @@ -0,0 +1,160 @@ +# typed: strong + +module WhopSDK + module Models + class PersonListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::PersonListParams, WhopSDK::Internal::AnyHash) + end + + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # A cursor for fetching people after a previous page. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # A cursor for fetching people before a later page. + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Sort direction. Defaults to desc. + sig { returns(T.nilable(WhopSDK::PersonListParams::Direction::OrSymbol)) } + attr_reader :direction + + sig do + params(direction: WhopSDK::PersonListParams::Direction::OrSymbol).void + end + attr_writer :direction + + # A JSON-encoded array of filters, each with field, operator, and value keys. + sig { returns(T.nilable(String)) } + attr_reader :filters + + sig { params(filters: String).void } + attr_writer :filters + + # The number of people to return (default 100, max 100). + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # Start of the time range as a Unix timestamp. Defaults to 366 days before `to`. + sig { returns(T.nilable(Integer)) } + attr_reader :from + + sig { params(from: Integer).void } + attr_writer :from + + # Column to sort by (e.g. last_seen_at, ltv, purchase_count). Defaults to + # last_seen_at. + sig { returns(T.nilable(String)) } + attr_reader :sort + + sig { params(sort: String).void } + attr_writer :sort + + # End of the time range as a Unix timestamp. Defaults to now. + sig { returns(T.nilable(Integer)) } + attr_reader :to + + sig { params(to: Integer).void } + attr_writer :to + + sig do + params( + account_id: String, + after: String, + before: String, + direction: WhopSDK::PersonListParams::Direction::OrSymbol, + filters: String, + first: Integer, + from: Integer, + sort: String, + to: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + account_id: nil, + # A cursor for fetching people after a previous page. + after: nil, + # A cursor for fetching people before a later page. + before: nil, + # Sort direction. Defaults to desc. + direction: nil, + # A JSON-encoded array of filters, each with field, operator, and value keys. + filters: nil, + # The number of people to return (default 100, max 100). + first: nil, + # Start of the time range as a Unix timestamp. Defaults to 366 days before `to`. + from: nil, + # Column to sort by (e.g. last_seen_at, ltv, purchase_count). Defaults to + # last_seen_at. + sort: nil, + # End of the time range as a Unix timestamp. Defaults to now. + to: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + after: String, + before: String, + direction: WhopSDK::PersonListParams::Direction::OrSymbol, + filters: String, + first: Integer, + from: Integer, + sort: String, + to: Integer, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::PersonListParams::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = T.let(:asc, WhopSDK::PersonListParams::Direction::TaggedSymbol) + DESC = T.let(:desc, WhopSDK::PersonListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::PersonListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/person_list_response.rbi b/rbi/whop_sdk/models/person_list_response.rbi new file mode 100644 index 00000000..885f5a7d --- /dev/null +++ b/rbi/whop_sdk/models/person_list_response.rbi @@ -0,0 +1,282 @@ +# typed: strong + +module WhopSDK + module Models + class PersonListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::PersonListResponse, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :account_id + + sig { returns(Integer) } + attr_accessor :first_seen_at + + sig { returns(Integer) } + attr_accessor :last_seen_at + + sig { returns(String) } + attr_accessor :person_id + + sig { returns(Integer) } + attr_accessor :purchase_count + + sig do + returns(T.nilable(T::Array[WhopSDK::Models::PersonListResponse::AdSet])) + end + attr_reader :ad_sets + + sig do + params( + ad_sets: T::Array[WhopSDK::Models::PersonListResponse::AdSet::OrHash] + ).void + end + attr_writer :ad_sets + + sig do + returns(T.nilable(T::Array[WhopSDK::Models::PersonListResponse::Ad])) + end + attr_reader :ads + + sig do + params( + ads: T::Array[WhopSDK::Models::PersonListResponse::Ad::OrHash] + ).void + end + attr_writer :ads + + sig { returns(T.nilable(Float)) } + attr_reader :aov + + sig { params(aov: Float).void } + attr_writer :aov + + sig do + returns( + T.nilable(T::Array[WhopSDK::Models::PersonListResponse::Campaign]) + ) + end + attr_reader :campaigns + + sig do + params( + campaigns: + T::Array[WhopSDK::Models::PersonListResponse::Campaign::OrHash] + ).void + end + attr_writer :campaigns + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_failed_payment + + sig { params(has_failed_payment: T::Boolean).void } + attr_writer :has_failed_payment + + sig { returns(T.nilable(Float)) } + attr_reader :ltv + + sig { params(ltv: Float).void } + attr_writer :ltv + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :phone + + sig do + params( + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: T::Array[WhopSDK::Models::PersonListResponse::AdSet::OrHash], + ads: T::Array[WhopSDK::Models::PersonListResponse::Ad::OrHash], + aov: Float, + campaigns: + T::Array[WhopSDK::Models::PersonListResponse::Campaign::OrHash], + email: T.nilable(String), + has_failed_payment: T::Boolean, + ltv: Float, + name: T.nilable(String), + phone: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + account_id:, + first_seen_at:, + last_seen_at:, + person_id:, + purchase_count:, + ad_sets: nil, + ads: nil, + aov: nil, + campaigns: nil, + email: nil, + has_failed_payment: nil, + ltv: nil, + name: nil, + phone: nil + ) + end + + sig do + override.returns( + { + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: T::Array[WhopSDK::Models::PersonListResponse::AdSet], + ads: T::Array[WhopSDK::Models::PersonListResponse::Ad], + aov: Float, + campaigns: T::Array[WhopSDK::Models::PersonListResponse::Campaign], + email: T.nilable(String), + has_failed_payment: T::Boolean, + ltv: Float, + name: T.nilable(String), + phone: T.nilable(String) + } + ) + end + def to_hash + end + + class AdSet < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PersonListResponse::AdSet, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :thumbnail_url + + sig do + params( + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, name: nil, thumbnail_url: nil) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Ad < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PersonListResponse::Ad, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :thumbnail_url + + sig do + params( + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, name: nil, thumbnail_url: nil) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Campaign < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PersonListResponse::Campaign, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :thumbnail_url + + sig do + params( + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, name: nil, thumbnail_url: nil) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/person_retrieve_params.rbi b/rbi/whop_sdk/models/person_retrieve_params.rbi new file mode 100644 index 00000000..d8a2a6ef --- /dev/null +++ b/rbi/whop_sdk/models/person_retrieve_params.rbi @@ -0,0 +1,76 @@ +# typed: strong + +module WhopSDK + module Models + class PersonRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::PersonRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :person_id + + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # Start of the time range as a Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :from + + sig { params(from: Integer).void } + attr_writer :from + + # End of the time range as a Unix timestamp. Defaults to now. + sig { returns(T.nilable(Integer)) } + attr_reader :to + + sig { params(to: Integer).void } + attr_writer :to + + sig do + params( + person_id: String, + account_id: String, + from: Integer, + to: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + person_id:, + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + account_id: nil, + # Start of the time range as a Unix timestamp. + from: nil, + # End of the time range as a Unix timestamp. Defaults to now. + to: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + person_id: String, + account_id: String, + from: Integer, + to: Integer, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/person_retrieve_response.rbi b/rbi/whop_sdk/models/person_retrieve_response.rbi new file mode 100644 index 00000000..9a3755ba --- /dev/null +++ b/rbi/whop_sdk/models/person_retrieve_response.rbi @@ -0,0 +1,349 @@ +# typed: strong + +module WhopSDK + module Models + class PersonRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PersonRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(WhopSDK::Models::PersonRetrieveResponse::Data) } + attr_reader :data + + sig do + params(data: WhopSDK::Models::PersonRetrieveResponse::Data::OrHash).void + end + attr_writer :data + + sig do + params( + data: WhopSDK::Models::PersonRetrieveResponse::Data::OrHash + ).returns(T.attached_class) + end + def self.new(data:) + end + + sig do + override.returns( + { data: WhopSDK::Models::PersonRetrieveResponse::Data } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PersonRetrieveResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :account_id + + sig { returns(Integer) } + attr_accessor :first_seen_at + + sig { returns(Integer) } + attr_accessor :last_seen_at + + sig { returns(String) } + attr_accessor :person_id + + sig { returns(Integer) } + attr_accessor :purchase_count + + sig do + returns( + T.nilable( + T::Array[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet] + ) + ) + end + attr_reader :ad_sets + + sig do + params( + ad_sets: + T::Array[ + WhopSDK::Models::PersonRetrieveResponse::Data::AdSet::OrHash + ] + ).void + end + attr_writer :ad_sets + + sig do + returns( + T.nilable( + T::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Ad] + ) + ) + end + attr_reader :ads + + sig do + params( + ads: + T::Array[ + WhopSDK::Models::PersonRetrieveResponse::Data::Ad::OrHash + ] + ).void + end + attr_writer :ads + + sig { returns(T.nilable(Float)) } + attr_reader :aov + + sig { params(aov: Float).void } + attr_writer :aov + + sig do + returns( + T.nilable( + T::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Campaign] + ) + ) + end + attr_reader :campaigns + + sig do + params( + campaigns: + T::Array[ + WhopSDK::Models::PersonRetrieveResponse::Data::Campaign::OrHash + ] + ).void + end + attr_writer :campaigns + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_failed_payment + + sig { params(has_failed_payment: T::Boolean).void } + attr_writer :has_failed_payment + + sig { returns(T.nilable(Float)) } + attr_reader :ltv + + sig { params(ltv: Float).void } + attr_writer :ltv + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :phone + + sig do + params( + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: + T::Array[ + WhopSDK::Models::PersonRetrieveResponse::Data::AdSet::OrHash + ], + ads: + T::Array[ + WhopSDK::Models::PersonRetrieveResponse::Data::Ad::OrHash + ], + aov: Float, + campaigns: + T::Array[ + WhopSDK::Models::PersonRetrieveResponse::Data::Campaign::OrHash + ], + email: T.nilable(String), + has_failed_payment: T::Boolean, + ltv: Float, + name: T.nilable(String), + phone: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + account_id:, + first_seen_at:, + last_seen_at:, + person_id:, + purchase_count:, + ad_sets: nil, + ads: nil, + aov: nil, + campaigns: nil, + email: nil, + has_failed_payment: nil, + ltv: nil, + name: nil, + phone: nil + ) + end + + sig do + override.returns( + { + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: + T::Array[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet], + ads: T::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Ad], + aov: Float, + campaigns: + T::Array[ + WhopSDK::Models::PersonRetrieveResponse::Data::Campaign + ], + email: T.nilable(String), + has_failed_payment: T::Boolean, + ltv: Float, + name: T.nilable(String), + phone: T.nilable(String) + } + ) + end + def to_hash + end + + class AdSet < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PersonRetrieveResponse::Data::AdSet, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :thumbnail_url + + sig do + params( + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, name: nil, thumbnail_url: nil) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Ad < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PersonRetrieveResponse::Data::Ad, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :thumbnail_url + + sig do + params( + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, name: nil, thumbnail_url: nil) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Campaign < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PersonRetrieveResponse::Data::Campaign, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :thumbnail_url + + sig do + params( + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, name: nil, thumbnail_url: nil) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + thumbnail_url: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/plan.rbi b/rbi/whop_sdk/models/plan.rbi index 7dd01cdc..1d532bfd 100644 --- a/rbi/whop_sdk/models/plan.rbi +++ b/rbi/whop_sdk/models/plan.rbi @@ -5,145 +5,139 @@ module WhopSDK class Plan < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias { T.any(WhopSDK::Plan, WhopSDK::Internal::AnyHash) } - # The ID of the plan, which will look like plan\_******\******* + # Plan ID, prefixed `plan_`. sig { returns(String) } attr_accessor :id - # Whether this plan accepts local currency payments via adaptive pricing + # Account that sells this plan; `null` for standalone invoice plans. + sig { returns(T.nilable(T.anything)) } + attr_accessor :account + + # Whether this plan accepts local currency payments via adaptive pricing. sig { returns(T::Boolean) } attr_accessor :adaptive_pricing_enabled - # The number of days between recurring charges. Null for one-time plans + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. sig { returns(T.nilable(Float)) } attr_accessor :billing_period - # Whether tax is collected on purchases of this plan + # Whether tax is collected on purchases of this plan. sig { returns(T::Boolean) } attr_accessor :collect_tax - # 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 - - # When the plan was created, as an ISO 8601 timestamp + # When the plan was created, as an ISO 8601 timestamp. sig { returns(String) } attr_accessor :created_at - # The three-letter ISO currency code all prices on this plan are denominated in + # Three-letter ISO currency code for this plan's prices. sig { returns(WhopSDK::Plan::Currency::TaggedSymbol) } attr_accessor :currency - # Custom input fields displayed on the checkout form, objects with id, field_type, - # name, order, placeholder and required - sig { returns(T::Array[T.anything]) } + sig { returns(T::Array[WhopSDK::Plan::CustomField]) } attr_accessor :custom_fields - # A text description of the plan visible to customers + # Customer-visible plan description. sig { returns(T.nilable(String)) } attr_accessor :description - # The number of days until the membership expires, for expiration-based plans + # Access duration in days for expiration-based plans. sig { returns(T.nilable(Float)) } attr_accessor :expiration_days - # The initial purchase price in the plan's currency + # Initial purchase price in plan currency. sig { returns(Float) } attr_accessor :initial_price - # Private notes visible only to authorized team members + # Private notes visible only to authorized team members. sig { returns(T.nilable(String)) } attr_accessor :internal_notes - # The invoice this plan was generated for, an object with an id. Null unless the - # plan was created for an invoice + # Invoice this plan was generated for; `null` unless created for an invoice. sig { returns(T.nilable(T.anything)) } attr_accessor :invoice - # The number of active memberships on this plan. Only visible to authorized team - # members + # Active memberships through this plan, when visible to the requester. sig { returns(T.nilable(Float)) } attr_accessor :member_count - # Custom key-value pairs stored on the plan + # Custom key-value pairs stored on the plan. sig { returns(T.nilable(T.anything)) } attr_accessor :metadata - # 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 (`enabled`, `disabled`, + # `include_platform_defaults`); `null` when 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 + # Billing model for this plan: `renewal` (recurring) or `one_time` (single + # payment). sig { returns(WhopSDK::Plan::PlanType::TaggedSymbol) } attr_accessor :plan_type - # The product this plan belongs to, an object with an id and title. Null for - # standalone plans + # Product this plan belongs to; `null` for standalone plans. sig { returns(T.nilable(T.anything)) } attr_accessor :product - # The full URL where customers can purchase this plan directly + # URL where customers can purchase this plan directly. sig { returns(String) } attr_accessor :purchase_url - # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # Sales method for this plan, such as `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 currency + # Recurring price charged every billing period. sig { returns(Float) } attr_accessor :renewal_price - # The number of installment payments required before the subscription pauses + # 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 + # Units available for purchase, when visible to the requester. sig { returns(T.nilable(Float)) } attr_accessor :stock - # How tax is handled for this plan: 'inclusive', 'exclusive', or 'unspecified' - sig { returns(String) } + # How tax is handled for this plan. + sig { returns(WhopSDK::Plan::TaxType::TaggedSymbol) } attr_accessor :tax_type - # The 3D Secure behavior for this plan. Null means the plan inherits the account - # default + # 3D Secure behavior for this plan; `null` inherits account default. sig { returns(T.nilable(WhopSDK::Plan::ThreeDSLevel::TaggedSymbol)) } attr_accessor :three_ds_level - # The display name of the plan shown to customers + # Plan display name shown to customers. sig { returns(T.nilable(String)) } attr_accessor :title - # The number of free trial days before the first charge on a recurring plan + # Free trial days before the first renewal charge. `null` if no trial is + # configured or the user has already used a trial for this plan. sig { returns(T.nilable(Float)) } attr_accessor :trial_period_days - # Whether the plan has unlimited stock + # Whether the plan has unlimited stock. sig { returns(T::Boolean) } attr_accessor :unlimited_stock - # When the plan was last updated, as an ISO 8601 timestamp + # When the plan was last updated, as an ISO 8601 timestamp. sig { returns(String) } attr_accessor :updated_at - # Whether the plan is visible to customers or hidden from public view + # Whether the plan is visible to customers or hidden from public view. sig { returns(WhopSDK::Plan::Visibility::TaggedSymbol) } attr_accessor :visibility sig do params( id: String, + account: T.nilable(T.anything), adaptive_pricing_enabled: T::Boolean, billing_period: T.nilable(Float), collect_tax: T::Boolean, - company: T.nilable(T.anything), created_at: String, currency: WhopSDK::Plan::Currency::OrSymbol, - custom_fields: T::Array[T.anything], + custom_fields: T::Array[WhopSDK::Plan::CustomField::OrHash], description: T.nilable(String), expiration_days: T.nilable(Float), initial_price: Float, @@ -159,7 +153,7 @@ module WhopSDK renewal_price: Float, split_pay_required_payments: T.nilable(Float), stock: T.nilable(Float), - tax_type: String, + tax_type: WhopSDK::Plan::TaxType::OrSymbol, three_ds_level: T.nilable(WhopSDK::Plan::ThreeDSLevel::OrSymbol), title: T.nilable(String), trial_period_days: T.nilable(Float), @@ -169,74 +163,68 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # The ID of the plan, which will look like plan\_******\******* + # Plan ID, prefixed `plan_`. id:, - # Whether this plan accepts local currency payments via adaptive pricing + # Account that sells this plan; `null` for standalone invoice plans. + account:, + # Whether this plan accepts local currency payments via adaptive pricing. adaptive_pricing_enabled:, - # The number of days between recurring charges. Null for one-time plans + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. billing_period:, - # Whether tax is collected on purchases of this plan + # Whether tax is collected on purchases of this plan. collect_tax:, - # The company that sells this plan, an object with an id and title. Null for - # standalone invoice plans - company:, - # When the plan was created, as an ISO 8601 timestamp + # When the plan was created, as an ISO 8601 timestamp. created_at:, - # The three-letter ISO currency code all prices on this plan are denominated in + # Three-letter ISO currency code for this plan's prices. currency:, - # 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 + # Customer-visible plan description. description:, - # The number of days until the membership expires, for expiration-based plans + # Access duration in days for expiration-based plans. expiration_days:, - # The initial purchase price in the plan's currency + # Initial purchase price in plan currency. initial_price:, - # Private notes visible only to authorized team members + # Private notes visible only to authorized team members. internal_notes:, - # The invoice this plan was generated for, an object with an id. Null unless the - # plan was created for an invoice + # Invoice this plan was generated for; `null` unless created for an invoice. invoice:, - # The number of active memberships on this plan. Only visible to authorized team - # members + # Active memberships through this plan, when visible to the requester. member_count:, - # Custom key-value pairs stored on the plan + # Custom key-value pairs stored on the plan. metadata:, - # 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 (`enabled`, `disabled`, + # `include_platform_defaults`); `null` when plan uses default settings. payment_method_configuration:, - # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments + # Billing model for this plan: `renewal` (recurring) or `one_time` (single + # payment). plan_type:, - # The product this plan belongs to, an object with an id and title. Null for - # standalone plans + # Product this plan belongs to; `null` for standalone plans. product:, - # The full URL where customers can purchase this plan directly + # URL where customers can purchase this plan directly. purchase_url:, - # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # Sales method for this plan, such as `buy_now` or `waitlist`. release_method:, - # The recurring price charged every billing period in the plan's currency + # Recurring price charged every billing period. renewal_price:, - # The number of installment payments required before the subscription pauses + # Installment payments required before the subscription pauses. split_pay_required_payments:, - # The number of units available for purchase. Only visible to authorized team - # members + # Units available for purchase, when visible to the requester. stock:, - # How tax is handled for this plan: 'inclusive', 'exclusive', or 'unspecified' + # How tax is handled for this plan. tax_type:, - # The 3D Secure behavior for this plan. Null means the plan inherits the account - # default + # 3D Secure behavior for this plan; `null` inherits account default. three_ds_level:, - # The display name of the plan shown to customers + # Plan display name shown to customers. title:, - # The number of free trial days before the first charge on a recurring plan + # Free trial days before the first renewal charge. `null` if no trial is + # configured or the user has already used a trial for this plan. trial_period_days:, - # Whether the plan has unlimited stock + # Whether the plan has unlimited stock. unlimited_stock:, - # When the plan was last updated, as an ISO 8601 timestamp + # When the plan was last updated, as an ISO 8601 timestamp. updated_at:, - # Whether the plan is visible to customers or hidden from public view + # Whether the plan is visible to customers or hidden from public view. visibility: ) end @@ -245,13 +233,13 @@ module WhopSDK override.returns( { id: String, + account: T.nilable(T.anything), adaptive_pricing_enabled: T::Boolean, billing_period: T.nilable(Float), collect_tax: T::Boolean, - company: T.nilable(T.anything), created_at: String, currency: WhopSDK::Plan::Currency::TaggedSymbol, - custom_fields: T::Array[T.anything], + custom_fields: T::Array[WhopSDK::Plan::CustomField], description: T.nilable(String), expiration_days: T.nilable(Float), initial_price: Float, @@ -267,7 +255,7 @@ module WhopSDK renewal_price: Float, split_pay_required_payments: T.nilable(Float), stock: T.nilable(Float), - tax_type: String, + tax_type: WhopSDK::Plan::TaxType::TaggedSymbol, three_ds_level: T.nilable(WhopSDK::Plan::ThreeDSLevel::TaggedSymbol), title: T.nilable(String), @@ -281,7 +269,7 @@ module WhopSDK def to_hash end - # The three-letter ISO currency code all prices on this plan are denominated in + # Three-letter ISO currency code for this plan's prices. module Currency extend WhopSDK::Internal::Type::Enum @@ -386,8 +374,103 @@ module WhopSDK end end - # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments + class CustomField < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Plan::CustomField, WhopSDK::Internal::AnyHash) + end + + # Custom field ID. + sig { returns(String) } + attr_accessor :id + + # Custom field input type. + sig { returns(WhopSDK::Plan::CustomField::FieldType::TaggedSymbol) } + attr_accessor :field_type + + # Field label shown to customer at checkout. + sig { returns(String) } + attr_accessor :name + + # Field position on checkout form. + sig { returns(Float) } + attr_accessor :order + + # Placeholder text shown in empty field. + sig { returns(T.nilable(String)) } + attr_accessor :placeholder + + # Whether the customer must complete this field to check out. + sig { returns(T::Boolean) } + attr_accessor :required + + # Custom input fields collected on the checkout form. + sig do + params( + id: String, + field_type: WhopSDK::Plan::CustomField::FieldType::OrSymbol, + name: String, + order: Float, + placeholder: T.nilable(String), + required: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Custom field ID. + id:, + # Custom field input type. + field_type:, + # Field label shown to customer at checkout. + name:, + # Field position on checkout form. + order:, + # Placeholder text shown in empty field. + placeholder:, + # Whether the customer must complete this field to check out. + required: + ) + end + + sig do + override.returns( + { + id: String, + field_type: WhopSDK::Plan::CustomField::FieldType::TaggedSymbol, + name: String, + order: Float, + placeholder: T.nilable(String), + required: T::Boolean + } + ) + end + def to_hash + end + + # Custom field input type. + module FieldType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Plan::CustomField::FieldType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TEXT = + T.let(:text, WhopSDK::Plan::CustomField::FieldType::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::Plan::CustomField::FieldType::TaggedSymbol] + ) + end + def self.values + end + end + end + + # Billing model for this plan: `renewal` (recurring) or `one_time` (single + # payment). module PlanType extend WhopSDK::Internal::Type::Enum @@ -404,7 +487,7 @@ module WhopSDK end end - # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # Sales method for this plan, such as `buy_now` or `waitlist`. module ReleaseMethod extend WhopSDK::Internal::Type::Enum @@ -422,8 +505,23 @@ module WhopSDK end end - # The 3D Secure behavior for this plan. Null means the plan inherits the account - # default + # How tax is handled for this plan. + module TaxType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Plan::TaxType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUSIVE = T.let(:inclusive, WhopSDK::Plan::TaxType::TaggedSymbol) + EXCLUSIVE = T.let(:exclusive, WhopSDK::Plan::TaxType::TaggedSymbol) + UNSPECIFIED = T.let(:unspecified, WhopSDK::Plan::TaxType::TaggedSymbol) + + sig { override.returns(T::Array[WhopSDK::Plan::TaxType::TaggedSymbol]) } + def self.values + end + end + + # 3D Secure behavior for this plan; `null` inherits account default. module ThreeDSLevel extend WhopSDK::Internal::Type::Enum @@ -443,7 +541,7 @@ module WhopSDK end end - # Whether the plan is visible to customers or hidden from public view + # Whether the plan is visible to customers or hidden from public view. module Visibility extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/plan_calculate_tax_params.rbi b/rbi/whop_sdk/models/plan_calculate_tax_params.rbi new file mode 100644 index 00000000..c6fc7cc3 --- /dev/null +++ b/rbi/whop_sdk/models/plan_calculate_tax_params.rbi @@ -0,0 +1,795 @@ +# typed: strong + +module WhopSDK + module Models + class PlanCalculateTaxParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::PlanCalculateTaxParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + # Buyer billing address used for tax calculation. Provide either `address.country` + # or `ip_address`; include state and postal code when available for more accurate + # results. + sig { returns(T.nilable(WhopSDK::PlanCalculateTaxParams::Address)) } + attr_reader :address + + sig do + params( + address: T.nilable(WhopSDK::PlanCalculateTaxParams::Address::OrHash) + ).void + end + attr_writer :address + + # Buyer IP address used to infer location when no billing address is provided. + sig { returns(T.nilable(String)) } + attr_reader :ip_address + + sig { params(ip_address: String).void } + attr_writer :ip_address + + # Optional buyer tax ID for B2B exemptions. At most one entry is supported. + sig do + returns(T.nilable(T::Array[WhopSDK::PlanCalculateTaxParams::TaxID])) + end + attr_accessor :tax_ids + + sig do + params( + id: String, + address: T.nilable(WhopSDK::PlanCalculateTaxParams::Address::OrHash), + ip_address: String, + tax_ids: + T.nilable(T::Array[WhopSDK::PlanCalculateTaxParams::TaxID::OrHash]), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # Buyer billing address used for tax calculation. Provide either `address.country` + # or `ip_address`; include state and postal code when available for more accurate + # results. + address: nil, + # Buyer IP address used to infer location when no billing address is provided. + ip_address: nil, + # Optional buyer tax ID for B2B exemptions. At most one entry is supported. + tax_ids: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + address: T.nilable(WhopSDK::PlanCalculateTaxParams::Address), + ip_address: String, + tax_ids: + T.nilable(T::Array[WhopSDK::PlanCalculateTaxParams::TaxID]), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PlanCalculateTaxParams::Address, + WhopSDK::Internal::AnyHash + ) + end + + # ISO 3166-1 alpha-2 country code, such as `US`, `DE`, or `GB`. + sig { returns(String) } + attr_accessor :country + + # City name. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State, province, or region code, such as `CA`. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Buyer billing address used for tax calculation. Provide either `address.country` + # or `ip_address`; include state and postal code when available for more accurate + # results. + sig do + params( + country: String, + city: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # ISO 3166-1 alpha-2 country code, such as `US`, `DE`, or `GB`. + country:, + # City name. + city: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, such as `CA`. + state: nil + ) + end + + sig do + override.returns( + { + country: String, + city: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + class TaxID < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PlanCalculateTaxParams::TaxID, + WhopSDK::Internal::AnyHash + ) + end + + # Tax ID type, such as `eu_vat` for an EU VAT number. + sig do + returns( + T.nilable(WhopSDK::PlanCalculateTaxParams::TaxID::Type::OrSymbol) + ) + end + attr_reader :type + + sig do + params( + type: WhopSDK::PlanCalculateTaxParams::TaxID::Type::OrSymbol + ).void + end + attr_writer :type + + # Tax ID value, for example `DE123456789`. + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + sig do + params( + type: WhopSDK::PlanCalculateTaxParams::TaxID::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # Tax ID type, such as `eu_vat` for an EU VAT number. + type: nil, + # Tax ID value, for example `DE123456789`. + value: nil + ) + end + + sig do + override.returns( + { + type: WhopSDK::PlanCalculateTaxParams::TaxID::Type::OrSymbol, + value: String + } + ) + end + def to_hash + end + + # Tax ID type, such as `eu_vat` for an EU VAT number. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::PlanCalculateTaxParams::TaxID::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD_NRT = + T.let( + :ad_nrt, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AO_TIN = + T.let( + :ao_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AR_CUIT = + T.let( + :ar_cuit, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AL_TIN = + T.let( + :al_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AM_TIN = + T.let( + :am_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AW_TIN = + T.let( + :aw_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AU_ABN = + T.let( + :au_abn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AU_ARN = + T.let( + :au_arn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + EU_VAT = + T.let( + :eu_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AZ_TIN = + T.let( + :az_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BS_TIN = + T.let( + :bs_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BH_VAT = + T.let( + :bh_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BD_BIN = + T.let( + :bd_bin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BB_TIN = + T.let( + :bb_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BY_TIN = + T.let( + :by_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BJ_IFU = + T.let( + :bj_ifu, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BO_TIN = + T.let( + :bo_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BA_TIN = + T.let( + :ba_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BR_CNPJ = + T.let( + :br_cnpj, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BR_CPF = + T.let( + :br_cpf, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BG_UIC = + T.let( + :bg_uic, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + BF_IFU = + T.let( + :bf_ifu, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + KH_TIN = + T.let( + :kh_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CM_NIU = + T.let( + :cm_niu, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CA_BN = + T.let( + :ca_bn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CA_GST_HST = + T.let( + :ca_gst_hst, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CA_PST_BC = + T.let( + :ca_pst_bc, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CA_PST_MB = + T.let( + :ca_pst_mb, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CA_PST_SK = + T.let( + :ca_pst_sk, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CA_QST = + T.let( + :ca_qst, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CV_NIF = + T.let( + :cv_nif, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CL_TIN = + T.let( + :cl_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CN_TIN = + T.let( + :cn_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CO_NIT = + T.let( + :co_nit, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CD_NIF = + T.let( + :cd_nif, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CR_TIN = + T.let( + :cr_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + HR_OIB = + T.let( + :hr_oib, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + DO_RCN = + T.let( + :do_rcn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + EC_RUC = + T.let( + :ec_ruc, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + EG_TIN = + T.let( + :eg_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + SV_NIT = + T.let( + :sv_nit, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + ET_TIN = + T.let( + :et_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + EU_OSS_VAT = + T.let( + :eu_oss_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + GE_VAT = + T.let( + :ge_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + GH_TIN = + T.let( + :gh_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + DE_STN = + T.let( + :de_stn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + GB_VAT = + T.let( + :gb_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + GN_NIF = + T.let( + :gn_nif, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + HK_BR = + T.let( + :hk_br, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + HU_TIN = + T.let( + :hu_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + IS_VAT = + T.let( + :is_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + IN_GST = + T.let( + :in_gst, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + ID_NPWP = + T.let( + :id_npwp, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + IL_VAT = + T.let( + :il_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + JP_CN = + T.let( + :jp_cn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + JP_RN = + T.let( + :jp_rn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + JP_TRN = + T.let( + :jp_trn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + KZ_BIN = + T.let( + :kz_bin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + KE_PIN = + T.let( + :ke_pin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + KG_TIN = + T.let( + :kg_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + LA_TIN = + T.let( + :la_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + LI_UID = + T.let( + :li_uid, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + LI_VAT = + T.let( + :li_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + MY_FRP = + T.let( + :my_frp, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + MY_ITN = + T.let( + :my_itn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + MY_SST = + T.let( + :my_sst, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + MR_NIF = + T.let( + :mr_nif, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + MX_RFC = + T.let( + :mx_rfc, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + MD_VAT = + T.let( + :md_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + ME_PIB = + T.let( + :me_pib, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + MA_VAT = + T.let( + :ma_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + NP_PAN = + T.let( + :np_pan, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + NZ_GST = + T.let( + :nz_gst, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + NG_TIN = + T.let( + :ng_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + MK_VAT = + T.let( + :mk_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + NO_VAT = + T.let( + :no_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + NO_VOEC = + T.let( + :no_voec, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + OM_VAT = + T.let( + :om_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + PE_RUC = + T.let( + :pe_ruc, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + PH_TIN = + T.let( + :ph_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + RO_TIN = + T.let( + :ro_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + RU_INN = + T.let( + :ru_inn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + RU_KPP = + T.let( + :ru_kpp, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + SA_VAT = + T.let( + :sa_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + SN_NINEA = + T.let( + :sn_ninea, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + RS_PIB = + T.let( + :rs_pib, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + SG_GST = + T.let( + :sg_gst, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + SG_UEN = + T.let( + :sg_uen, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + SI_TIN = + T.let( + :si_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + ZA_VAT = + T.let( + :za_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + KR_BRN = + T.let( + :kr_brn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + ES_CIF = + T.let( + :es_cif, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CH_UID = + T.let( + :ch_uid, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + CH_VAT = + T.let( + :ch_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + TW_VAT = + T.let( + :tw_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + TJ_TIN = + T.let( + :tj_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + TZ_VAT = + T.let( + :tz_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + TH_VAT = + T.let( + :th_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + TR_TIN = + T.let( + :tr_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + UG_TIN = + T.let( + :ug_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + UA_VAT = + T.let( + :ua_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + AE_TRN = + T.let( + :ae_trn, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + US_EIN = + T.let( + :us_ein, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + UY_RUC = + T.let( + :uy_ruc, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + UZ_TIN = + T.let( + :uz_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + UZ_VAT = + T.let( + :uz_vat, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + VE_RIF = + T.let( + :ve_rif, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + VN_TIN = + T.let( + :vn_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + ZM_TIN = + T.let( + :zm_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + ZW_TIN = + T.let( + :zw_tin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + SR_FIN = + T.let( + :sr_fin, + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::PlanCalculateTaxParams::TaxID::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/plan_calculate_tax_response.rbi b/rbi/whop_sdk/models/plan_calculate_tax_response.rbi new file mode 100644 index 00000000..63f829f6 --- /dev/null +++ b/rbi/whop_sdk/models/plan_calculate_tax_response.rbi @@ -0,0 +1,170 @@ +# typed: strong + +module WhopSDK + module Models + class PlanCalculateTaxResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PlanCalculateTaxResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Three-letter ISO 4217 currency code for the returned amounts. + sig { returns(String) } + attr_accessor :currency + + # Whether Whop calculated tax for this preview. `not_calculated` means no tax + # could be determined, so `tax_amount` is 0 and `total` equals `subtotal`. + sig do + returns(WhopSDK::Models::PlanCalculateTaxResponse::Status::TaggedSymbol) + end + attr_accessor :status + + # Plan price in the currency's smallest unit, for example cents. For exclusive + # tax, this is the pre-tax amount; for inclusive tax, it already includes tax and + # equals the total. + sig { returns(Integer) } + attr_accessor :subtotal + + # Calculated tax amount in the currency's smallest unit. For exclusive tax, this + # is added on top of the subtotal; for inclusive tax, it is the portion of the + # subtotal that is tax. + sig { returns(Integer) } + attr_accessor :tax_amount + + # Whether tax is added on top of the plan price or already included in it for this + # buyer's location. + sig do + returns( + WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior::TaggedSymbol + ) + end + attr_accessor :tax_behavior + + # Amount the buyer would pay in the currency's smallest unit. + sig { returns(Integer) } + attr_accessor :total + + sig do + params( + currency: String, + status: WhopSDK::Models::PlanCalculateTaxResponse::Status::OrSymbol, + subtotal: Integer, + tax_amount: Integer, + tax_behavior: + WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior::OrSymbol, + total: Integer + ).returns(T.attached_class) + end + def self.new( + # Three-letter ISO 4217 currency code for the returned amounts. + currency:, + # Whether Whop calculated tax for this preview. `not_calculated` means no tax + # could be determined, so `tax_amount` is 0 and `total` equals `subtotal`. + status:, + # Plan price in the currency's smallest unit, for example cents. For exclusive + # tax, this is the pre-tax amount; for inclusive tax, it already includes tax and + # equals the total. + subtotal:, + # Calculated tax amount in the currency's smallest unit. For exclusive tax, this + # is added on top of the subtotal; for inclusive tax, it is the portion of the + # subtotal that is tax. + tax_amount:, + # Whether tax is added on top of the plan price or already included in it for this + # buyer's location. + tax_behavior:, + # Amount the buyer would pay in the currency's smallest unit. + total: + ) + end + + sig do + override.returns( + { + currency: String, + status: + WhopSDK::Models::PlanCalculateTaxResponse::Status::TaggedSymbol, + subtotal: Integer, + tax_amount: Integer, + tax_behavior: + WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior::TaggedSymbol, + total: Integer + } + ) + end + def to_hash + end + + # Whether Whop calculated tax for this preview. `not_calculated` means no tax + # could be determined, so `tax_amount` is 0 and `total` equals `subtotal`. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::PlanCalculateTaxResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CALCULATED = + T.let( + :calculated, + WhopSDK::Models::PlanCalculateTaxResponse::Status::TaggedSymbol + ) + NOT_CALCULATED = + T.let( + :not_calculated, + WhopSDK::Models::PlanCalculateTaxResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::PlanCalculateTaxResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Whether tax is added on top of the plan price or already included in it for this + # buyer's location. + module TaxBehavior + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXCLUSIVE = + T.let( + :exclusive, + WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior::TaggedSymbol + ) + INCLUSIVE = + T.let( + :inclusive, + WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior::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 759896b6..e355be3b 100644 --- a/rbi/whop_sdk/models/plan_create_params.rbi +++ b/rbi/whop_sdk/models/plan_create_params.rbi @@ -11,16 +11,19 @@ module WhopSDK T.any(WhopSDK::PlanCreateParams, WhopSDK::Internal::AnyHash) end - # The unique identifier of the product to attach this plan to. - sig { returns(String) } - attr_accessor :product_id + # The unique identifier of the account to create this plan for. Defaults to the + # caller's account. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id # Whether this plan accepts local currency payments via adaptive pricing. sig { returns(T.nilable(T::Boolean)) } attr_accessor :adaptive_pricing_enabled - # The number of days between recurring charges. For example, 30 for monthly or 365 - # for yearly. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. sig { returns(T.nilable(Integer)) } attr_accessor :billing_period @@ -28,14 +31,6 @@ module WhopSDK sig { returns(T.nilable(T.anything)) } attr_accessor :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 @@ -54,7 +49,7 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :description - # The number of days until the membership expires and access is revoked. + # Access duration in days before the membership expires. sig { returns(T.nilable(Integer)) } attr_accessor :expiration_days @@ -67,12 +62,11 @@ module WhopSDK end attr_writer :image - # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 - # for $10.43). + # Initial amount charged in the plan's currency, e.g. 10.43 for $10.43. sig { returns(T.nilable(Float)) } attr_accessor :initial_price - # Private notes visible only to the business owner. Not shown to customers. + # Private notes visible only to the account owner. Not shown to customers. sig { returns(T.nilable(String)) } attr_accessor :internal_notes @@ -81,7 +75,8 @@ 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. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T.anything)) } attr_accessor :metadata @@ -93,7 +88,7 @@ module WhopSDK attr_writer :override_tax_type # Explicit payment method configuration for the plan. When not provided, the - # company's defaults apply. + # account's defaults apply. sig do returns( T.nilable(WhopSDK::PlanCreateParams::PaymentMethodConfiguration) @@ -111,14 +106,21 @@ module WhopSDK end attr_writer :payment_method_configuration - # The billing type of the plan, such as one_time or renewal. + # Plan billing type, 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). + # The unique identifier of the product to attach this plan to. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # Sales method for this plan, such as `buy_now` or `waitlist`. sig { returns(T.nilable(String)) } attr_reader :release_method @@ -130,7 +132,7 @@ module WhopSDK sig { returns(T.nilable(Float)) } attr_accessor :renewal_price - # The number of installment payments required before the subscription pauses. + # Installment payments required before the subscription pauses. sig { returns(T.nilable(Integer)) } attr_accessor :split_pay_required_payments @@ -139,7 +141,7 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :stock - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 3D Secure behavior for this plan. Send `null` to inherit the account default. sig do returns(T.nilable(WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol)) end @@ -156,7 +158,7 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :title - # The number of free trial days before the first charge on a recurring plan. + # Free trial duration before the first recurring charge. sig { returns(T.nilable(Integer)) } attr_accessor :trial_period_days @@ -173,11 +175,10 @@ module WhopSDK sig do params( - product_id: String, + account_id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), checkout_styling: T.nilable(T.anything), - company_id: String, currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField::OrHash]), @@ -194,6 +195,7 @@ module WhopSDK WhopSDK::PlanCreateParams::PaymentMethodConfiguration::OrHash ), plan_type: String, + product_id: String, release_method: String, renewal_price: T.nilable(Float), split_pay_required_payments: T.nilable(Integer), @@ -207,18 +209,15 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # The unique identifier of the product to attach this plan to. - product_id:, + # The unique identifier of the account to create this plan for. Defaults to the + # caller's account. + account_id: nil, # 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. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. billing_period: nil, # Checkout styling overrides for this plan. checkout_styling: nil, - # 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. @@ -226,42 +225,44 @@ module WhopSDK 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. + # Access duration in days before the membership expires. expiration_days: nil, # An image displayed on the product page to represent this plan. image: nil, - # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 - # for $10.43). + # Initial amount charged 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. + # Private notes visible only to the account 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. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: nil, # 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. + # account's defaults apply. payment_method_configuration: nil, - # The billing type of the plan, such as one_time or renewal. + # Plan billing type, such as `one_time` or `renewal`. plan_type: nil, - # The method used to sell this plan (e.g., buy_now, waitlist). + # The unique identifier of the product to attach this plan to. + product_id: nil, + # Sales method for this plan, such as `buy_now` or `waitlist`. release_method: nil, # 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. + # 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 this plan. Send null to inherit the account default. + # 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. + # Free trial duration before the first recurring charge. trial_period_days: nil, # Whether the plan has unlimited stock. When true, the stock field is ignored. unlimited_stock: nil, @@ -274,11 +275,10 @@ module WhopSDK sig do override.returns( { - product_id: String, + account_id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), checkout_styling: T.nilable(T.anything), - company_id: String, currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField]), @@ -293,6 +293,7 @@ module WhopSDK payment_method_configuration: T.nilable(WhopSDK::PlanCreateParams::PaymentMethodConfiguration), plan_type: String, + product_id: String, release_method: String, renewal_price: T.nilable(Float), split_pay_required_payments: T.nilable(Integer), @@ -497,7 +498,7 @@ module WhopSDK attr_writer :include_platform_defaults # Explicit payment method configuration for the plan. When not provided, the - # company's defaults apply. + # account's defaults apply. sig do params( disabled: T::Array[String], @@ -525,7 +526,7 @@ module WhopSDK end end - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 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 b95ef213..aa512d69 100644 --- a/rbi/whop_sdk/models/plan_list_params.rbi +++ b/rbi/whop_sdk/models/plan_list_params.rbi @@ -11,9 +11,9 @@ module WhopSDK T.any(WhopSDK::PlanListParams, WhopSDK::Internal::AnyHash) end - # The unique identifier of the company to list plans for. + # The unique identifier of the account to list plans for. sig { returns(String) } - attr_accessor :company_id + attr_accessor :account_id # A cursor; returns plans after this position. sig { returns(T.nilable(String)) } @@ -103,7 +103,7 @@ module WhopSDK sig do params( - company_id: String, + account_id: String, after: String, before: String, created_after: String, @@ -120,8 +120,8 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # The unique identifier of the company to list plans for. - company_id:, + # The unique identifier of the account to list plans for. + account_id:, # A cursor; returns plans after this position. after: nil, # A cursor; returns plans before this position. @@ -153,7 +153,7 @@ module WhopSDK sig do override.returns( { - company_id: String, + account_id: String, after: String, before: String, created_after: String, @@ -211,8 +211,8 @@ module WhopSDK T.let(:created_at, WhopSDK::PlanListParams::Order::TaggedSymbol) INTERNAL_NOTES = T.let(:internal_notes, WhopSDK::PlanListParams::Order::TaggedSymbol) - EXPIRES_AT = - T.let(:expires_at, WhopSDK::PlanListParams::Order::TaggedSymbol) + EXPIRATION_DAYS = + T.let(:expiration_days, WhopSDK::PlanListParams::Order::TaggedSymbol) sig do override.returns( diff --git a/rbi/whop_sdk/models/plan_list_response.rbi b/rbi/whop_sdk/models/plan_list_response.rbi index 31f2ae03..3d790972 100644 --- a/rbi/whop_sdk/models/plan_list_response.rbi +++ b/rbi/whop_sdk/models/plan_list_response.rbi @@ -8,128 +8,124 @@ module WhopSDK T.any(WhopSDK::Models::PlanListResponse, WhopSDK::Internal::AnyHash) end - # The ID of the plan, which will look like plan\_******\******* + # Plan ID, prefixed `plan_`. sig { returns(String) } attr_accessor :id - # Whether this plan accepts local currency payments via adaptive pricing + # Account that sells this plan; `null` for standalone invoice plans. + sig { returns(T.nilable(T.anything)) } + attr_accessor :account + + # Whether this plan accepts local currency payments via adaptive pricing. sig { returns(T::Boolean) } attr_accessor :adaptive_pricing_enabled - # The number of days between recurring charges. Null for one-time plans + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. sig { returns(T.nilable(Float)) } attr_accessor :billing_period - # 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 - - # When the plan was created, as an ISO 8601 timestamp + # When the plan was created, as an ISO 8601 timestamp. sig { returns(String) } attr_accessor :created_at - # The three-letter ISO currency code all prices on this plan are denominated in + # Three-letter ISO currency code for this plan's prices. sig { returns(String) } attr_accessor :currency - # A text description of the plan visible to customers + # Customer-visible plan description. sig { returns(T.nilable(String)) } attr_accessor :description - # The number of days until the membership expires, for expiration-based plans + # Access duration in days for expiration-based plans. sig { returns(T.nilable(Float)) } attr_accessor :expiration_days - # The initial purchase price in the plan's currency + # Initial purchase price in plan currency. sig { returns(Float) } attr_accessor :initial_price - # Private notes visible only to authorized team members + # Private notes visible only to authorized team members. sig { returns(T.nilable(String)) } attr_accessor :internal_notes - # The invoice this plan was generated for, an object with an id. Null unless the - # plan was created for an invoice + # Invoice this plan was generated for; `null` unless created for an invoice. sig { returns(T.nilable(T.anything)) } attr_accessor :invoice - # The number of active memberships on this plan. Only visible to authorized team - # members + # Active memberships through this plan, when visible to the requester. sig { returns(T.nilable(Float)) } attr_accessor :member_count - # Custom key-value pairs stored on the plan + # Custom key-value pairs stored on the plan. sig { returns(T.nilable(T.anything)) } attr_accessor :metadata - # 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 (`enabled`, `disabled`, + # `include_platform_defaults`); `null` when 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 + # Billing model for this plan: `renewal` (recurring) or `one_time` (single + # payment). sig { returns(String) } attr_accessor :plan_type - # The product this plan belongs to, an object with an id and title. Null for - # standalone plans + # Product this plan belongs to; `null` for standalone plans. sig { returns(T.nilable(T.anything)) } attr_accessor :product - # The full URL where customers can purchase this plan directly + # URL where customers can purchase this plan directly. sig { returns(String) } attr_accessor :purchase_url - # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # Sales method for this plan, such as `buy_now` or `waitlist`. sig { returns(String) } attr_accessor :release_method - # The recurring price charged every billing period in the plan's currency + # Recurring price charged every billing period. sig { returns(Float) } attr_accessor :renewal_price - # The number of installment payments required before the subscription pauses + # 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 + # Units available for purchase, when visible to the requester. sig { returns(T.nilable(Float)) } attr_accessor :stock - # The 3D Secure behavior for this plan. Null means the plan inherits the account - # default + # 3D Secure behavior for this plan; `null` inherits account default. sig { returns(T.nilable(String)) } attr_accessor :three_ds_level - # The display name of the plan shown to customers + # Plan display name shown to customers. sig { returns(T.nilable(String)) } attr_accessor :title - # The number of free trial days before the first charge on a recurring plan + # Free trial days before the first renewal charge. `null` if no trial is + # configured or the user has already used a trial for this plan. sig { returns(T.nilable(Float)) } attr_accessor :trial_period_days - # Whether the plan has unlimited stock + # Whether the plan has unlimited stock. sig { returns(T::Boolean) } attr_accessor :unlimited_stock - # When the plan was last updated, as an ISO 8601 timestamp + # When the plan was last updated, as an ISO 8601 timestamp. sig { returns(String) } attr_accessor :updated_at - # Whether the plan is visible to customers or hidden from public view + # Whether the plan is visible to customers or hidden from public view. sig { returns(String) } attr_accessor :visibility sig do params( id: String, + account: T.nilable(T.anything), adaptive_pricing_enabled: T::Boolean, billing_period: T.nilable(Float), - company: T.nilable(T.anything), created_at: String, currency: String, description: T.nilable(String), @@ -156,67 +152,63 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # The ID of the plan, which will look like plan\_******\******* + # Plan ID, prefixed `plan_`. id:, - # Whether this plan accepts local currency payments via adaptive pricing + # Account that sells this plan; `null` for standalone invoice plans. + account:, + # Whether this plan accepts local currency payments via adaptive pricing. adaptive_pricing_enabled:, - # The number of days between recurring charges. Null for one-time plans + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. + # `null` for one-time plans. billing_period:, - # The company that sells this plan, an object with an id and title. Null for - # standalone invoice plans - company:, - # When the plan was created, as an ISO 8601 timestamp + # When the plan was created, as an ISO 8601 timestamp. created_at:, - # The three-letter ISO currency code all prices on this plan are denominated in + # Three-letter ISO currency code for this plan's prices. currency:, - # A text description of the plan visible to customers + # Customer-visible plan description. description:, - # The number of days until the membership expires, for expiration-based plans + # Access duration in days for expiration-based plans. expiration_days:, - # The initial purchase price in the plan's currency + # Initial purchase price in plan currency. initial_price:, - # Private notes visible only to authorized team members + # Private notes visible only to authorized team members. internal_notes:, - # The invoice this plan was generated for, an object with an id. Null unless the - # plan was created for an invoice + # Invoice this plan was generated for; `null` unless created for an invoice. invoice:, - # The number of active memberships on this plan. Only visible to authorized team - # members + # Active memberships through this plan, when visible to the requester. member_count:, - # Custom key-value pairs stored on the plan + # Custom key-value pairs stored on the plan. metadata:, - # 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 (`enabled`, `disabled`, + # `include_platform_defaults`); `null` when plan uses default settings. payment_method_configuration:, - # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments + # Billing model for this plan: `renewal` (recurring) or `one_time` (single + # payment). plan_type:, - # The product this plan belongs to, an object with an id and title. Null for - # standalone plans + # Product this plan belongs to; `null` for standalone plans. product:, - # The full URL where customers can purchase this plan directly + # URL where customers can purchase this plan directly. purchase_url:, - # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # Sales method for this plan, such as `buy_now` or `waitlist`. release_method:, - # The recurring price charged every billing period in the plan's currency + # Recurring price charged every billing period. renewal_price:, - # The number of installment payments required before the subscription pauses + # Installment payments required before the subscription pauses. split_pay_required_payments:, - # The number of units available for purchase. Only visible to authorized team - # members + # Units available for purchase, when visible to the requester. stock:, - # The 3D Secure behavior for this plan. Null means the plan inherits the account - # default + # 3D Secure behavior for this plan; `null` inherits account default. three_ds_level:, - # The display name of the plan shown to customers + # Plan display name shown to customers. title:, - # The number of free trial days before the first charge on a recurring plan + # Free trial days before the first renewal charge. `null` if no trial is + # configured or the user has already used a trial for this plan. trial_period_days:, - # Whether the plan has unlimited stock + # Whether the plan has unlimited stock. unlimited_stock:, - # When the plan was last updated, as an ISO 8601 timestamp + # When the plan was last updated, as an ISO 8601 timestamp. updated_at:, - # Whether the plan is visible to customers or hidden from public view + # Whether the plan is visible to customers or hidden from public view. visibility: ) end @@ -225,9 +217,9 @@ module WhopSDK override.returns( { id: String, + account: T.nilable(T.anything), adaptive_pricing_enabled: T::Boolean, billing_period: T.nilable(Float), - company: T.nilable(T.anything), created_at: String, currency: String, description: T.nilable(String), diff --git a/rbi/whop_sdk/models/plan_update_params.rbi b/rbi/whop_sdk/models/plan_update_params.rbi index 12d9c8d7..f767ef78 100644 --- a/rbi/whop_sdk/models/plan_update_params.rbi +++ b/rbi/whop_sdk/models/plan_update_params.rbi @@ -18,8 +18,7 @@ module WhopSDK sig { returns(T.nilable(T::Boolean)) } attr_accessor :adaptive_pricing_enabled - # The number of days between recurring charges. For example, 30 for monthly or 365 - # for yearly. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. sig { returns(T.nilable(Integer)) } attr_accessor :billing_period @@ -45,7 +44,7 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :description - # The number of days until the membership expires and access is revoked. + # Access duration in days before the membership expires. sig { returns(T.nilable(Integer)) } attr_accessor :expiration_days @@ -58,12 +57,11 @@ module WhopSDK end attr_writer :image - # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 - # for $10.43). + # Initial amount charged in the plan's currency, e.g. 10.43 for $10.43. sig { returns(T.nilable(Float)) } attr_accessor :initial_price - # Private notes visible only to the business owner. Not shown to customers. + # Private notes visible only to the account owner. Not shown to customers. sig { returns(T.nilable(String)) } attr_accessor :internal_notes @@ -72,7 +70,8 @@ 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. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T.anything)) } attr_accessor :metadata @@ -88,7 +87,7 @@ module WhopSDK attr_writer :override_tax_type # Explicit payment method configuration for the plan. When not provided, the - # company's defaults apply. + # account's defaults apply. sig do returns( T.nilable(WhopSDK::PlanUpdateParams::PaymentMethodConfiguration) @@ -124,7 +123,7 @@ module WhopSDK sig { returns(T.nilable(Float)) } attr_accessor :strike_through_renewal_price - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 3D Secure behavior for this plan. Send `null` to inherit the account default. sig do returns(T.nilable(WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol)) end @@ -141,7 +140,7 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :title - # The number of free trial days before the first charge on a recurring plan. + # Free trial duration before the first recurring charge. sig { returns(T.nilable(Integer)) } attr_accessor :trial_period_days @@ -194,8 +193,7 @@ module WhopSDK 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. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. billing_period: nil, # Checkout styling overrides for this plan. checkout_styling: nil, @@ -206,26 +204,26 @@ module WhopSDK 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. + # Access duration in days before the membership expires. expiration_days: nil, # An image displayed on the product page to represent this plan. image: nil, - # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 - # for $10.43). + # Initial amount charged 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. + # Private notes visible only to the account 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. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: nil, # Whether to offer a retention discount when a customer attempts to cancel. offer_cancel_discount: nil, # 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. + # account's defaults apply. payment_method_configuration: nil, # The amount charged each billing period for recurring plans, in the plan's # currency. @@ -237,11 +235,11 @@ module WhopSDK strike_through_initial_price: nil, # A comparison price displayed with a strikethrough for the renewal price. strike_through_renewal_price: nil, - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 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. + # Free trial duration before the first recurring charge. trial_period_days: nil, # Whether the plan has unlimited stock. When true, the stock field is ignored. unlimited_stock: nil, @@ -476,7 +474,7 @@ module WhopSDK attr_writer :include_platform_defaults # Explicit payment method configuration for the plan. When not provided, the - # company's defaults apply. + # account's defaults apply. sig do params( disabled: T::Array[String], @@ -504,7 +502,7 @@ module WhopSDK end end - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 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/product.rbi b/rbi/whop_sdk/models/product.rbi index d6d4759a..d47a0087 100644 --- a/rbi/whop_sdk/models/product.rbi +++ b/rbi/whop_sdk/models/product.rbi @@ -21,8 +21,7 @@ module WhopSDK sig { returns(Time) } attr_accessor :created_at - # The call-to-action button label displayed on the product's purchase page (e.g., - # 'join', 'buy', 'subscribe'). + # Call-to-action button label shown on the product purchase page. sig { returns(WhopSDK::CustomCta::TaggedSymbol) } attr_accessor :custom_cta @@ -31,9 +30,8 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :custom_cta_url - # A custom text label that appears on the customer's bank or credit card statement - # for purchases of this product. Maximum 22 characters, including the required - # prefix WHOP\*. + # Custom bank statement descriptor for product purchases. Maximum 22 characters, + # including required `WHOP*` prefix. sig { returns(T.nilable(String)) } attr_accessor :custom_statement_descriptor @@ -42,9 +40,8 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :description - # A unique identifier used to create or update products via the API. When provided - # on product creation endpoints, an existing product with this identifier will be - # updated instead of creating a new one. + # External identifier for the product. Providing it on a product creation endpoint + # updates the existing product with this identifier instead of creating a new one. sig { returns(T.nilable(String)) } attr_accessor :external_identifier @@ -52,8 +49,8 @@ module WhopSDK sig { returns(T::Array[WhopSDK::Product::GalleryImage]) } attr_accessor :gallery_images - # The commission rate (as a percentage) that affiliates earn on sales through the - # Whop marketplace global affiliate program. Null if the program is not active. + # Marketplace affiliate commission percentage for this product, or `null` if + # program is inactive. sig { returns(T.nilable(Float)) } attr_accessor :global_affiliate_percentage @@ -66,9 +63,8 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :headline - # The commission rate (as a percentage) that existing members earn when referring - # new customers through the member affiliate program. Null if the program is not - # active. + # Member referral commission percentage for this product, or `null` if program is + # inactive. sig { returns(T.nilable(Float)) } attr_accessor :member_affiliate_percentage @@ -76,13 +72,14 @@ module WhopSDK sig { returns(WhopSDK::GlobalAffiliateStatus::TaggedSymbol) } attr_accessor :member_affiliate_status - # The number of users who currently hold an active membership to this product. - # Returns 0 if the company has disabled public member counts. + # Active memberships for this product. Returns `0` if the account has disabled + # public member counts. sig { returns(Integer) } attr_accessor :member_count - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -109,8 +106,8 @@ module WhopSDK sig { returns(Integer) } attr_accessor :published_reviews_count - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. sig { returns(String) } attr_accessor :route @@ -169,44 +166,41 @@ module WhopSDK company:, # The datetime the product was created. created_at:, - # The call-to-action button label displayed on the product's purchase page (e.g., - # 'join', 'buy', 'subscribe'). + # Call-to-action button label shown on the product purchase page. custom_cta:, # An optional URL that the call-to-action button links to instead of the default # checkout flow. Null if no custom URL is set. custom_cta_url:, - # A custom text label that appears on the customer's bank or credit card statement - # for purchases of this product. Maximum 22 characters, including the required - # prefix WHOP\*. + # Custom bank statement descriptor for product purchases. Maximum 22 characters, + # including required `WHOP*` prefix. custom_statement_descriptor:, # A brief summary of what the product offers, displayed on product pages and # search results. description:, - # A unique identifier used to create or update products via the API. When provided - # on product creation endpoints, an existing product with this identifier will be - # updated instead of creating a new one. + # External identifier for the product. Providing it on a product creation endpoint + # updates the existing product with this identifier instead of creating a new one. external_identifier:, # The gallery images for this product, ordered by position. gallery_images:, - # The commission rate (as a percentage) that affiliates earn on sales through the - # Whop marketplace global affiliate program. Null if the program is not active. + # Marketplace affiliate commission percentage for this product, or `null` if + # program is inactive. global_affiliate_percentage:, # The enrollment status of this product in the Whop marketplace global affiliate # program. global_affiliate_status:, # A short marketing headline displayed prominently on the product's product page. headline:, - # The commission rate (as a percentage) that existing members earn when referring - # new customers through the member affiliate program. Null if the program is not - # active. + # Member referral commission percentage for this product, or `null` if program is + # inactive. member_affiliate_percentage:, # The enrollment status of this product in the member affiliate program. member_affiliate_status:, - # The number of users who currently hold an active membership to this product. - # Returns 0 if the company has disabled public member counts. + # Active memberships for this product. Returns `0` if the account has disabled + # public member counts. member_count:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata:, # The user who owns the company that sells this product. owner_user:, @@ -215,8 +209,8 @@ module WhopSDK product_tax_code:, # The total number of published customer reviews for this product's company. published_reviews_count:, - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. route:, # The display name of the product shown to customers on the product page and in # search results. @@ -276,7 +270,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. sig { returns(String) } attr_accessor :route @@ -293,7 +287,7 @@ module WhopSDK def self.new( # The unique identifier for the company. id:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. route:, # The display name of the company shown to customers. title: @@ -399,12 +393,12 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The human-readable name of this tax classification (e.g., 'Digital - SaaS'). + # Human-readable name of this tax classification, such as 'Digital - SaaS'. sig { returns(String) } attr_accessor :name - # The broad product category this tax code covers (e.g., physical goods, digital - # services). + # Broad product category this tax code covers, such as physical goods or digital + # services. sig do returns(WhopSDK::Product::ProductTaxCode::ProductType::TaggedSymbol) end @@ -423,10 +417,10 @@ module WhopSDK def self.new( # The unique identifier for the product tax code. id:, - # The human-readable name of this tax classification (e.g., 'Digital - SaaS'). + # Human-readable name of this tax classification, such as 'Digital - SaaS'. name:, - # The broad product category this tax code covers (e.g., physical goods, digital - # services). + # Broad product category this tax code covers, such as physical goods or digital + # services. product_type: ) end @@ -444,8 +438,8 @@ module WhopSDK def to_hash end - # The broad product category this tax code covers (e.g., physical goods, digital - # services). + # Broad product category this tax code covers, such as physical goods or digital + # services. module ProductType extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/product_create_params.rbi b/rbi/whop_sdk/models/product_create_params.rbi index 5ff1885b..5c37e3db 100644 --- a/rbi/whop_sdk/models/product_create_params.rbi +++ b/rbi/whop_sdk/models/product_create_params.rbi @@ -11,86 +11,73 @@ module WhopSDK T.any(WhopSDK::ProductCreateParams, WhopSDK::Internal::AnyHash) end - # The unique identifier of the company to create this product for. - sig { returns(String) } - attr_accessor :company_id - # The display name of the product. Maximum 80 characters. sig { returns(String) } attr_accessor :title - # Whether the checkout flow collects a shipping address from the customer. + # Whether to collect a shipping address at checkout. sig { returns(T.nilable(T::Boolean)) } attr_accessor :collect_shipping_address - # The different types of custom CTAs that can be selected. - sig { returns(T.nilable(WhopSDK::CustomCta::OrSymbol)) } + # The unique identifier of the company to create this product for. + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # The call-to-action button label. + sig { returns(T.nilable(String)) } attr_accessor :custom_cta - # A URL that the call-to-action button links to instead of the default checkout - # flow. + # A URL the call-to-action button links to. sig { returns(T.nilable(String)) } attr_accessor :custom_cta_url - # A custom text label that appears on the customer's bank statement. Must be 5-22 - # characters, contain at least one letter, and not contain <, >, \, ', or " - # characters. + # Custom bank statement descriptor. Must start with WHOP\*. sig { returns(T.nilable(String)) } attr_accessor :custom_statement_descriptor - # A written description of the product displayed on its product page. + # A written description displayed on the product page. sig { returns(T.nilable(String)) } attr_accessor :description - # The unique identifiers of experiences to connect to this product. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :experience_ids - - # The commission rate as a percentage that affiliates earn through the global - # affiliate program. + # The commission rate affiliates earn. sig { returns(T.nilable(Float)) } attr_accessor :global_affiliate_percentage - # The different statuses of the global affiliate program for a product. - sig { returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) } - attr_accessor :global_affiliate_status + # The enrollment status in the global affiliate program. + sig { returns(T.nilable(String)) } + attr_reader :global_affiliate_status + + sig { params(global_affiliate_status: String).void } + attr_writer :global_affiliate_status - # A short marketing headline displayed prominently on the product page. + # A short marketing headline for the product page. sig { returns(T.nilable(String)) } attr_accessor :headline - # The commission rate as a percentage that members earn through the member - # affiliate program. + # The commission rate members earn. sig { returns(T.nilable(Float)) } attr_accessor :member_affiliate_percentage - # The different statuses of the global affiliate program for a product. - sig { returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) } - attr_accessor :member_affiliate_status - - # Custom key-value pairs to store on the product. 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])) } - attr_accessor :metadata + # The enrollment status in the member affiliate program. + sig { returns(T.nilable(String)) } + attr_reader :member_affiliate_status - # Configuration for an automatically generated plan to attach to this product. - sig { returns(T.nilable(WhopSDK::ProductCreateParams::PlanOptions)) } - attr_reader :plan_options + sig { params(member_affiliate_status: String).void } + attr_writer :member_affiliate_status - sig do - params( - plan_options: - T.nilable(WhopSDK::ProductCreateParams::PlanOptions::OrHash) - ).void - end - attr_writer :plan_options + # Custom key-value pairs to store on the product. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata - # The unique identifier of the tax classification code to apply to this product. + # The unique identifier of the tax classification code. See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). sig { returns(T.nilable(String)) } attr_accessor :product_tax_code_id - # A URL to redirect the customer to after completing a purchase. + # A URL to redirect the customer to after purchase. sig { returns(T.nilable(String)) } attr_accessor :redirect_purchase_url @@ -103,86 +90,74 @@ module WhopSDK sig { returns(T.nilable(T::Boolean)) } attr_accessor :send_welcome_message - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility + # Whether the product is visible to customers. + sig { returns(T.nilable(String)) } + attr_reader :visibility + + sig { params(visibility: String).void } + attr_writer :visibility sig do params( - company_id: String, title: String, collect_shipping_address: T.nilable(T::Boolean), - custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol), + company_id: String, + custom_cta: T.nilable(String), custom_cta_url: T.nilable(String), custom_statement_descriptor: T.nilable(String), description: T.nilable(String), - experience_ids: T.nilable(T::Array[String]), global_affiliate_percentage: T.nilable(Float), - global_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), + global_affiliate_status: String, headline: T.nilable(String), member_affiliate_percentage: T.nilable(Float), - member_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - plan_options: - T.nilable(WhopSDK::ProductCreateParams::PlanOptions::OrHash), + member_affiliate_status: String, + metadata: T.nilable(T.anything), product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), send_welcome_message: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The unique identifier of the company to create this product for. - company_id:, # The display name of the product. Maximum 80 characters. title:, - # Whether the checkout flow collects a shipping address from the customer. + # Whether to collect a shipping address at checkout. collect_shipping_address: nil, - # The different types of custom CTAs that can be selected. + # The unique identifier of the company to create this product for. + company_id: nil, + # The call-to-action button label. custom_cta: nil, - # A URL that the call-to-action button links to instead of the default checkout - # flow. + # A URL the call-to-action button links to. custom_cta_url: nil, - # A custom text label that appears on the customer's bank statement. Must be 5-22 - # characters, contain at least one letter, and not contain <, >, \, ', or " - # characters. + # Custom bank statement descriptor. Must start with WHOP\*. custom_statement_descriptor: nil, - # A written description of the product displayed on its product page. + # A written description displayed on the product page. description: nil, - # The unique identifiers of experiences to connect to this product. - experience_ids: nil, - # The commission rate as a percentage that affiliates earn through the global - # affiliate program. + # The commission rate affiliates earn. global_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. + # The enrollment status in the global affiliate program. global_affiliate_status: nil, - # A short marketing headline displayed prominently on the product page. + # A short marketing headline for the product page. headline: nil, - # The commission rate as a percentage that members earn through the member - # affiliate program. + # The commission rate members earn. member_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. + # The enrollment status in the member affiliate program. member_affiliate_status: nil, - # Custom key-value pairs to store on the product. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # Custom key-value pairs to store on the product. metadata: nil, - # Configuration for an automatically generated plan to attach to this product. - plan_options: nil, - # The unique identifier of the tax classification code to apply to this product. + # The unique identifier of the tax classification code. See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). product_tax_code_id: nil, - # A URL to redirect the customer to after completing a purchase. + # A URL to redirect the customer to after purchase. redirect_purchase_url: nil, # The URL slug for the product's public link. route: nil, # Whether to send an automated welcome message via support chat when a user joins # this product. Defaults to true. send_welcome_message: nil, - # Visibility of a resource + # Whether the product is visible to customers. visibility: nil, request_options: {} ) @@ -191,221 +166,30 @@ module WhopSDK sig do override.returns( { - company_id: String, title: String, collect_shipping_address: T.nilable(T::Boolean), - custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol), + company_id: String, + custom_cta: T.nilable(String), custom_cta_url: T.nilable(String), custom_statement_descriptor: T.nilable(String), description: T.nilable(String), - experience_ids: T.nilable(T::Array[String]), global_affiliate_percentage: T.nilable(Float), - global_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), + global_affiliate_status: String, headline: T.nilable(String), member_affiliate_percentage: T.nilable(Float), - member_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - plan_options: T.nilable(WhopSDK::ProductCreateParams::PlanOptions), + member_affiliate_status: String, + metadata: T.nilable(T.anything), product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), send_welcome_message: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end - - class PlanOptions < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::ProductCreateParams::PlanOptions, - WhopSDK::Internal::AnyHash - ) - end - - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } - attr_accessor :base_currency - - # The interval at which the plan charges (renewal plans). - sig { returns(T.nilable(Integer)) } - attr_accessor :billing_period - - # An array of custom field objects. - sig do - returns( - T.nilable( - T::Array[WhopSDK::ProductCreateParams::PlanOptions::CustomField] - ) - ) - end - attr_accessor :custom_fields - - # An additional amount charged upon first purchase. Provided as a number in the - # specified currency. Eg: 10.43 for $10.43 USD. - sig { returns(T.nilable(Float)) } - attr_accessor :initial_price - - # The type of plan that can be attached to a product - sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) } - attr_accessor :plan_type - - # The methods of how a plan can be released. - sig { returns(T.nilable(WhopSDK::ReleaseMethod::OrSymbol)) } - attr_accessor :release_method - - # The amount the customer is charged every billing period. Provided as a number in - # the specified currency. Eg: 10.43 for $10.43 USD. - sig { returns(T.nilable(Float)) } - attr_accessor :renewal_price - - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility - - # Configuration for an automatically generated plan to attach to this product. - sig do - params( - base_currency: T.nilable(WhopSDK::Currency::OrSymbol), - billing_period: T.nilable(Integer), - custom_fields: - T.nilable( - T::Array[ - WhopSDK::ProductCreateParams::PlanOptions::CustomField::OrHash - ] - ), - initial_price: T.nilable(Float), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), - renewal_price: T.nilable(Float), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - ).returns(T.attached_class) - end - def self.new( - # The available currencies on the platform - base_currency: nil, - # The interval at which the plan charges (renewal plans). - billing_period: nil, - # An array of custom field objects. - custom_fields: nil, - # An additional amount charged upon first purchase. Provided as a number in the - # specified currency. Eg: 10.43 for $10.43 USD. - initial_price: nil, - # The type of plan that can be attached to a product - plan_type: nil, - # The methods of how a plan can be released. - release_method: nil, - # The amount the customer is charged every billing period. Provided as a number in - # the specified currency. Eg: 10.43 for $10.43 USD. - renewal_price: nil, - # Visibility of a resource - visibility: nil - ) - end - - sig do - override.returns( - { - base_currency: T.nilable(WhopSDK::Currency::OrSymbol), - billing_period: T.nilable(Integer), - custom_fields: - T.nilable( - T::Array[ - WhopSDK::ProductCreateParams::PlanOptions::CustomField - ] - ), - initial_price: T.nilable(Float), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), - renewal_price: T.nilable(Float), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - } - ) - end - def to_hash - end - - class CustomField < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::ProductCreateParams::PlanOptions::CustomField, - WhopSDK::Internal::AnyHash - ) - end - - # The type of the custom field. - sig { returns(Symbol) } - attr_accessor :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 - - # The order of the field. - sig { returns(T.nilable(Integer)) } - attr_accessor :order - - # The placeholder value of the 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 - - sig do - params( - name: String, - id: T.nilable(String), - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T.nilable(T::Boolean), - field_type: Symbol - ).returns(T.attached_class) - end - def self.new( - # The name of the custom field. - name:, - # The ID of the custom field (if being updated) - id: nil, - # The order of the field. - order: nil, - # The placeholder value of the field. - placeholder: nil, - # Whether or not the field is required. - required: nil, - # The type of the custom field. - field_type: :text - ) - end - - sig do - override.returns( - { - field_type: Symbol, - name: String, - id: T.nilable(String), - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - end end end end diff --git a/rbi/whop_sdk/models/product_list_item.rbi b/rbi/whop_sdk/models/product_list_item.rbi index 56823acd..9c27cd44 100644 --- a/rbi/whop_sdk/models/product_list_item.rbi +++ b/rbi/whop_sdk/models/product_list_item.rbi @@ -16,9 +16,8 @@ module WhopSDK sig { returns(Time) } attr_accessor :created_at - # A unique identifier used to create or update products via the API. When provided - # on product creation endpoints, an existing product with this identifier will be - # updated instead of creating a new one. + # External identifier for the product. Providing it on a product creation endpoint + # updates the existing product with this identifier instead of creating a new one. sig { returns(T.nilable(String)) } attr_accessor :external_identifier @@ -26,13 +25,14 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :headline - # The number of users who currently hold an active membership to this product. - # Returns 0 if the company has disabled public member counts. + # Active memberships for this product. Returns `0` if the account has disabled + # public member counts. sig { returns(Integer) } attr_accessor :member_count - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -40,8 +40,8 @@ module WhopSDK sig { returns(Integer) } attr_accessor :published_reviews_count - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. sig { returns(String) } attr_accessor :route @@ -86,22 +86,22 @@ module WhopSDK id:, # The datetime the product was created. created_at:, - # A unique identifier used to create or update products via the API. When provided - # on product creation endpoints, an existing product with this identifier will be - # updated instead of creating a new one. + # External identifier for the product. Providing it on a product creation endpoint + # updates the existing product with this identifier instead of creating a new one. external_identifier:, # A short marketing headline displayed prominently on the product's product page. headline:, - # The number of users who currently hold an active membership to this product. - # Returns 0 if the company has disabled public member counts. + # Active memberships for this product. Returns `0` if the account has disabled + # public member counts. member_count:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata:, # The total number of published customer reviews for this product's company. published_reviews_count:, - # The URL slug used in the product's public link (e.g., 'my-product' in - # whop.com/company/my-product). + # URL slug in the product's public link, e.g. `pickaxe-analytics` in + # whop.com/company/pickaxe-analytics. route:, # The display name of the product shown to customers on the product page and in # search results. diff --git a/rbi/whop_sdk/models/product_list_params.rbi b/rbi/whop_sdk/models/product_list_params.rbi index eaebf33d..4a91a4e7 100644 --- a/rbi/whop_sdk/models/product_list_params.rbi +++ b/rbi/whop_sdk/models/product_list_params.rbi @@ -15,84 +15,97 @@ module WhopSDK sig { returns(String) } attr_accessor :company_id - # Returns the elements in the list that come after the specified cursor. + # Filter to only products matching these types. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :access_pass_types + + sig { params(access_pass_types: T::Array[String]).void } + attr_writer :access_pass_types + + # A cursor; returns products 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 products before this position. sig { returns(T.nilable(String)) } - attr_accessor :before + attr_reader :before - # Only return products created after this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_after + sig { params(before: String).void } + attr_writer :before - # Only return products created before this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_before + # The sort direction for results. Defaults to descending. + sig do + returns(T.nilable(WhopSDK::ProductListParams::Direction::OrSymbol)) + end + attr_reader :direction - # The direction of the sort. - sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) } - attr_accessor :direction + sig do + params(direction: WhopSDK::ProductListParams::Direction::OrSymbol).void + end + attr_writer :direction - # Returns the first _n_ elements from the list. + # The number of products 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 products 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 AccessPasses can be ordered - sig { returns(T.nilable(WhopSDK::ProductListParams::Order::OrSymbol)) } - attr_accessor :order + # The field to sort results by. Defaults to created_at. + sig { returns(T.nilable(String)) } + attr_reader :order - # Filter to only products matching these type classifications. - sig { returns(T.nilable(T::Array[WhopSDK::AccessPassType::OrSymbol])) } - attr_accessor :product_types + sig { params(order: String).void } + attr_writer :order # Filter to only products 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::ProductListParams::Order::OrSymbol), - product_types: T.nilable(T::Array[WhopSDK::AccessPassType::OrSymbol]), - visibilities: - T.nilable(T::Array[WhopSDK::VisibilityFilter::OrSymbol]), + access_pass_types: T::Array[String], + after: String, + before: String, + direction: WhopSDK::ProductListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: 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 products for. company_id:, - # Returns the elements in the list that come after the specified cursor. + # Filter to only products matching these types. + access_pass_types: nil, + # A cursor; returns products after this position. after: nil, - # Returns the elements in the list that come before the specified cursor. + # A cursor; returns products before this position. before: nil, - # Only return products created after this timestamp. - created_after: nil, - # Only return products 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 products to return (default and max 100). first: nil, - # Returns the last _n_ elements from the list. + # The number of products to return from the end of the range. last: nil, - # The ways a relation of AccessPasses can be ordered + # The field to sort results by. Defaults to created_at. order: nil, - # Filter to only products matching these type classifications. - product_types: nil, # Filter to only products matching these visibility states. visibilities: nil, request_options: {} @@ -103,18 +116,14 @@ 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::ProductListParams::Order::OrSymbol), - product_types: - T.nilable(T::Array[WhopSDK::AccessPassType::OrSymbol]), - visibilities: - T.nilable(T::Array[WhopSDK::VisibilityFilter::OrSymbol]), + access_pass_types: T::Array[String], + after: String, + before: String, + direction: WhopSDK::ProductListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: String, + visibilities: T::Array[String], request_options: WhopSDK::RequestOptions } ) @@ -122,32 +131,20 @@ module WhopSDK def to_hash end - # The ways a relation of AccessPasses can be ordered - module Order + # The sort direction for results. Defaults to descending. + module Direction extend WhopSDK::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::ProductListParams::Order) } + T.type_alias { T.all(Symbol, WhopSDK::ProductListParams::Direction) } OrSymbol = T.type_alias { T.any(Symbol, String) } - ACTIVE_MEMBERSHIPS_COUNT = - T.let( - :active_memberships_count, - WhopSDK::ProductListParams::Order::TaggedSymbol - ) - CREATED_AT = - T.let(:created_at, WhopSDK::ProductListParams::Order::TaggedSymbol) - USD_GMV = - T.let(:usd_gmv, WhopSDK::ProductListParams::Order::TaggedSymbol) - USD_GMV_30_DAYS = - T.let( - :usd_gmv_30_days, - WhopSDK::ProductListParams::Order::TaggedSymbol - ) + ASC = T.let(:asc, WhopSDK::ProductListParams::Direction::TaggedSymbol) + DESC = T.let(:desc, WhopSDK::ProductListParams::Direction::TaggedSymbol) sig do override.returns( - T::Array[WhopSDK::ProductListParams::Order::TaggedSymbol] + T::Array[WhopSDK::ProductListParams::Direction::TaggedSymbol] ) end def self.values diff --git a/rbi/whop_sdk/models/product_update_params.rbi b/rbi/whop_sdk/models/product_update_params.rbi index c51bce50..15d3f9bc 100644 --- a/rbi/whop_sdk/models/product_update_params.rbi +++ b/rbi/whop_sdk/models/product_update_params.rbi @@ -14,178 +14,72 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Whether the checkout flow collects a shipping address from the customer. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :collect_shipping_address - - # The different types of custom CTAs that can be selected. - sig { returns(T.nilable(WhopSDK::CustomCta::OrSymbol)) } - attr_accessor :custom_cta - - # A URL that the call-to-action button links to instead of the default checkout - # flow. - sig { returns(T.nilable(String)) } - attr_accessor :custom_cta_url - - # A custom text label that appears on the customer's bank statement. Must be 5-22 - # characters, contain at least one letter, and not contain <, >, \, ', or " - # characters. - sig { returns(T.nilable(String)) } - attr_accessor :custom_statement_descriptor - - # A written description of the product displayed on its product page. + # A written description displayed on the product page. sig { returns(T.nilable(String)) } attr_accessor :description - # The gallery images for the product. - sig do - returns(T.nilable(T::Array[WhopSDK::ProductUpdateParams::GalleryImage])) - end - attr_accessor :gallery_images - - # The commission rate as a percentage that affiliates earn through the global - # affiliate program. - sig { returns(T.nilable(Float)) } - attr_accessor :global_affiliate_percentage - - # The different statuses of the global affiliate program for a product. - sig { returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) } - attr_accessor :global_affiliate_status - - # A short marketing headline displayed prominently on the product page. + # A short marketing headline for the product page. sig { returns(T.nilable(String)) } attr_accessor :headline - # The commission rate as a percentage that members earn through the member - # affiliate program. - sig { returns(T.nilable(Float)) } - attr_accessor :member_affiliate_percentage - - # The different statuses of the global affiliate program for a product. - sig { returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) } - attr_accessor :member_affiliate_status - - # Custom key-value pairs to store on the product. 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])) } + # Custom key-value pairs to store on the product. + sig { returns(T.nilable(T.anything)) } attr_accessor :metadata - # The unique identifier of the tax classification code to apply to this product. + # The unique identifier of the tax classification code. See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). sig { returns(T.nilable(String)) } attr_accessor :product_tax_code_id - # A URL to redirect the customer to after completing a purchase. - sig { returns(T.nilable(String)) } - attr_accessor :redirect_purchase_url - - # The URL slug for the product's public link. - sig { returns(T.nilable(String)) } - attr_accessor :route - # Whether to send an automated welcome message via support chat when a user joins # this product. sig { returns(T.nilable(T::Boolean)) } attr_accessor :send_welcome_message - # Layout and display configuration for this product on the company's store page. - sig { returns(T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig)) } - attr_reader :store_page_config + # The display name of the product. + sig { returns(T.nilable(String)) } + attr_reader :title - sig do - params( - store_page_config: - T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash) - ).void - end - attr_writer :store_page_config + sig { params(title: String).void } + attr_writer :title - # The display name of the product. Maximum 80 characters. + # Whether the product is visible to customers. sig { returns(T.nilable(String)) } - attr_accessor :title + attr_reader :visibility - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility + sig { params(visibility: String).void } + attr_writer :visibility sig do params( id: String, - collect_shipping_address: T.nilable(T::Boolean), - custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol), - custom_cta_url: T.nilable(String), - custom_statement_descriptor: T.nilable(String), description: T.nilable(String), - gallery_images: - T.nilable( - T::Array[WhopSDK::ProductUpdateParams::GalleryImage::OrHash] - ), - global_affiliate_percentage: T.nilable(Float), - global_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), headline: T.nilable(String), - member_affiliate_percentage: T.nilable(Float), - member_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), + metadata: T.nilable(T.anything), product_tax_code_id: T.nilable(String), - redirect_purchase_url: T.nilable(String), - route: T.nilable(String), send_welcome_message: T.nilable(T::Boolean), - store_page_config: - T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash), - title: T.nilable(String), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + title: String, + visibility: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, - # Whether the checkout flow collects a shipping address from the customer. - collect_shipping_address: nil, - # The different types of custom CTAs that can be selected. - custom_cta: nil, - # A URL that the call-to-action button links to instead of the default checkout - # flow. - custom_cta_url: nil, - # A custom text label that appears on the customer's bank statement. Must be 5-22 - # characters, contain at least one letter, and not contain <, >, \, ', or " - # characters. - custom_statement_descriptor: nil, - # A written description of the product displayed on its product page. + # A written description displayed on the product page. description: nil, - # The gallery images for the product. - gallery_images: nil, - # The commission rate as a percentage that affiliates earn through the global - # affiliate program. - global_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. - global_affiliate_status: nil, - # A short marketing headline displayed prominently on the product page. + # A short marketing headline for the product page. headline: nil, - # The commission rate as a percentage that members earn through the member - # affiliate program. - member_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. - member_affiliate_status: nil, - # Custom key-value pairs to store on the product. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # Custom key-value pairs to store on the product. metadata: nil, - # The unique identifier of the tax classification code to apply to this product. + # The unique identifier of the tax classification code. See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). product_tax_code_id: nil, - # A URL to redirect the customer to after completing a purchase. - redirect_purchase_url: nil, - # The URL slug for the product's public link. - route: nil, # Whether to send an automated welcome message via support chat when a user joins # this product. send_welcome_message: nil, - # Layout and display configuration for this product on the company's store page. - store_page_config: nil, - # The display name of the product. Maximum 80 characters. + # The display name of the product. title: nil, - # Visibility of a resource + # Whether the product is visible to customers. visibility: nil, request_options: {} ) @@ -195,102 +89,19 @@ module WhopSDK override.returns( { id: String, - collect_shipping_address: T.nilable(T::Boolean), - custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol), - custom_cta_url: T.nilable(String), - custom_statement_descriptor: T.nilable(String), description: T.nilable(String), - gallery_images: - T.nilable(T::Array[WhopSDK::ProductUpdateParams::GalleryImage]), - global_affiliate_percentage: T.nilable(Float), - global_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), headline: T.nilable(String), - member_affiliate_percentage: T.nilable(Float), - member_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), + metadata: T.nilable(T.anything), product_tax_code_id: T.nilable(String), - redirect_purchase_url: T.nilable(String), - route: T.nilable(String), send_welcome_message: T.nilable(T::Boolean), - store_page_config: - T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig), - title: T.nilable(String), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + title: String, + visibility: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end - - class GalleryImage < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::ProductUpdateParams::GalleryImage, - WhopSDK::Internal::AnyHash - ) - end - - # The ID of an existing file object. - sig { returns(String) } - attr_accessor :id - - # Input for an 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 - - class StorePageConfig < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::ProductUpdateParams::StorePageConfig, - WhopSDK::Internal::AnyHash - ) - end - - # Custom call-to-action text for the product's store page. - sig { returns(T.nilable(String)) } - attr_accessor :custom_cta - - # Whether or not to show the price on the product's store page. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :show_price - - # Layout and display configuration for this product on the company's store page. - sig do - params( - custom_cta: T.nilable(String), - show_price: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Custom call-to-action text for the product's store page. - custom_cta: nil, - # Whether or not to show the price on the product's store page. - show_price: nil - ) - end - - sig do - override.returns( - { custom_cta: T.nilable(String), show_price: T.nilable(T::Boolean) } - ) - end - def to_hash - end - end end end end diff --git a/rbi/whop_sdk/models/referral_referred_users_params.rbi b/rbi/whop_sdk/models/referral_referred_users_params.rbi new file mode 100644 index 00000000..1658e42b --- /dev/null +++ b/rbi/whop_sdk/models/referral_referred_users_params.rbi @@ -0,0 +1,106 @@ +# typed: strong + +module WhopSDK + module Models + class ReferralReferredUsersParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::ReferralReferredUsersParams, + WhopSDK::Internal::AnyHash + ) + end + + # Cursor to fetch the page after (from page_info.end_cursor). + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Cursor to fetch the page before (from page_info.start_cursor). + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Number of referred users to return from the start of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # When true, only referred users who brought at least one business onto Whop. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_businesses + + sig { params(has_businesses: T::Boolean).void } + attr_writer :has_businesses + + # When true, only referred users with at least one business that has generated + # earnings. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_earning_businesses + + sig { params(has_earning_businesses: T::Boolean).void } + attr_writer :has_earning_businesses + + # Number of referred users to return from the end of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :last + + sig { params(last: Integer).void } + attr_writer :last + + sig do + params( + after: String, + before: String, + first: Integer, + has_businesses: T::Boolean, + has_earning_businesses: T::Boolean, + last: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Number of referred users to return from the start of the window. + first: nil, + # When true, only referred users who brought at least one business onto Whop. + has_businesses: nil, + # When true, only referred users with at least one business that has generated + # earnings. + has_earning_businesses: nil, + # Number of referred users to return from the end of the window. + last: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + after: String, + before: String, + first: Integer, + has_businesses: T::Boolean, + has_earning_businesses: T::Boolean, + last: Integer, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/referral_referred_users_response.rbi b/rbi/whop_sdk/models/referral_referred_users_response.rbi new file mode 100644 index 00000000..3fadd81b --- /dev/null +++ b/rbi/whop_sdk/models/referral_referred_users_response.rbi @@ -0,0 +1,259 @@ +# typed: strong + +module WhopSDK + module Models + class ReferralReferredUsersResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ReferralReferredUsersResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns(T::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data]) + end + attr_accessor :data + + sig { returns(WhopSDK::Models::ReferralReferredUsersResponse::PageInfo) } + attr_reader :page_info + + sig do + params( + page_info: + WhopSDK::Models::ReferralReferredUsersResponse::PageInfo::OrHash + ).void + end + attr_writer :page_info + + sig do + params( + data: + T::Array[ + WhopSDK::Models::ReferralReferredUsersResponse::Data::OrHash + ], + page_info: + WhopSDK::Models::ReferralReferredUsersResponse::PageInfo::OrHash + ).returns(T.attached_class) + end + def self.new(data:, page_info:) + end + + sig do + override.returns( + { + data: + T::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data], + page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ReferralReferredUsersResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :total_earnings_usd + + sig { returns(String) } + attr_accessor :total_volume_usd + + sig do + returns(WhopSDK::Models::ReferralReferredUsersResponse::Data::User) + end + attr_reader :user + + sig do + params( + user: + WhopSDK::Models::ReferralReferredUsersResponse::Data::User::OrHash + ).void + end + attr_writer :user + + sig do + params( + total_earnings_usd: String, + total_volume_usd: String, + user: + WhopSDK::Models::ReferralReferredUsersResponse::Data::User::OrHash + ).returns(T.attached_class) + end + def self.new(total_earnings_usd:, total_volume_usd:, user:) + end + + sig do + override.returns( + { + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + } + ) + end + def to_hash + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ReferralReferredUsersResponse::Data::User, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + returns( + T.nilable( + WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + ) + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + sig do + params( + id: String, + username: String, + city: T.nilable(String), + country: T.nilable(String), + name: T.nilable(String), + profile_picture: + WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + username:, + city: nil, + country: nil, + name: nil, + profile_picture: nil + ) + end + + sig do + override.returns( + { + id: String, + username: String, + city: T.nilable(String), + country: T.nilable(String), + name: T.nilable(String), + profile_picture: + WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :url + + sig { params(url: T.nilable(String)).returns(T.attached_class) } + def self.new(url: nil) + end + + sig { override.returns({ url: T.nilable(String) }) } + def to_hash + end + end + end + end + + class PageInfo < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ReferralReferredUsersResponse::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/referrals/business_leaderboard_params.rbi b/rbi/whop_sdk/models/referrals/business_leaderboard_params.rbi new file mode 100644 index 00000000..f52a598a --- /dev/null +++ b/rbi/whop_sdk/models/referrals/business_leaderboard_params.rbi @@ -0,0 +1,120 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + class BusinessLeaderboardParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Referrals::BusinessLeaderboardParams, + WhopSDK::Internal::AnyHash + ) + end + + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + sig do + returns( + T.nilable( + WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol + ) + ) + end + attr_reader :period + + sig do + params( + period: + WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol + ).void + end + attr_writer :period + + sig do + params( + period: + WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + period: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + period: + WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + module Period + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Referrals::BusinessLeaderboardParams::Period + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAY = + T.let( + :day, + WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol + ) + MONTH = + T.let( + :month, + WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol + ) + YEAR = + T.let( + :year, + WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol + ) + LAST_30_DAYS = + T.let( + :last_30_days, + WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol + ) + ALL_TIME = + T.let( + :all_time, + WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/business_leaderboard_response.rbi b/rbi/whop_sdk/models/referrals/business_leaderboard_response.rbi new file mode 100644 index 00000000..538eb1ff --- /dev/null +++ b/rbi/whop_sdk/models/referrals/business_leaderboard_response.rbi @@ -0,0 +1,535 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + class BusinessLeaderboardResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The top referrers by total earnings, best first. + sig do + returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader + ] + ) + end + attr_accessor :leaders + + # The caller's own standing; null when the caller has no referral earnings. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me + ) + ) + end + attr_reader :me + + sig do + params( + me: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::OrHash + ) + ).void + end + attr_writer :me + + sig do + params( + leaders: + T::Array[ + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::OrHash + ], + me: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # The top referrers by total earnings, best first. + leaders:, + # The caller's own standing; null when the caller has no referral earnings. + me: + ) + end + + sig do + override.returns( + { + leaders: + T::Array[ + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader + ], + me: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me + ) + } + ) + end + def to_hash + end + + class Leader < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader, + WhopSDK::Internal::AnyHash + ) + end + + # When the referrer's earliest business referral became active. + sig { returns(Time) } + attr_accessor :first_referral_started_at + + # 1-based leaderboard position. + sig { returns(Integer) } + attr_accessor :rank + + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + sig { returns(String) } + attr_accessor :total_earnings_usd + + # Credited GMV across all the referrer's referred businesses, in USD. + sig { returns(String) } + attr_accessor :total_volume_usd + + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User + ) + ) + end + attr_reader :user + + sig do + params( + user: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::OrHash + ) + ).void + end + attr_writer :user + + sig do + params( + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # When the referrer's earliest business referral became active. + first_referral_started_at:, + # 1-based leaderboard position. + rank:, + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + total_earnings_usd:, + # Credited GMV across all the referrer's referred businesses, in USD. + total_volume_usd:, + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + user: + ) + end + + sig do + override.returns( + { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User + ) + } + ) + end + def to_hash + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, + WhopSDK::Internal::AnyHash + ) + end + + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # User ID, prefixed `user_`. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # The user's display name. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture. Present only on the caller's own entry. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture + ) + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # The user's unique username. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + city:, + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + country:, + # User ID, prefixed `user_`. Present only on the caller's own entry. + id: nil, + # The user's display name. Present only on the caller's own entry. + name: nil, + # The user's profile picture. Present only on the caller's own entry. + profile_picture: nil, + # The user's unique username. Present only on the caller's own entry. + username: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # The user's profile picture URL. + sig { returns(String) } + attr_accessor :url + + # The user's profile picture. Present only on the caller's own entry. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # The user's profile picture URL. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + end + + class Me < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me, + WhopSDK::Internal::AnyHash + ) + end + + # When the referrer's earliest business referral became active. + sig { returns(Time) } + attr_accessor :first_referral_started_at + + # 1-based leaderboard position. + sig { returns(Integer) } + attr_accessor :rank + + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + sig { returns(String) } + attr_accessor :total_earnings_usd + + # Credited GMV across all the referrer's referred businesses, in USD. + sig { returns(String) } + attr_accessor :total_volume_usd + + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User + ) + ) + end + attr_reader :user + + sig do + params( + user: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::OrHash + ) + ).void + end + attr_writer :user + + # The caller's own standing; null when the caller has no referral earnings. + sig do + params( + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # When the referrer's earliest business referral became active. + first_referral_started_at:, + # 1-based leaderboard position. + rank:, + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + total_earnings_usd:, + # Credited GMV across all the referrer's referred businesses, in USD. + total_volume_usd:, + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + user: + ) + end + + sig do + override.returns( + { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User + ) + } + ) + end + def to_hash + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User, + WhopSDK::Internal::AnyHash + ) + end + + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # User ID, prefixed `user_`. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # The user's display name. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture. Present only on the caller's own entry. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture + ) + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # The user's unique username. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + city:, + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + country:, + # User ID, prefixed `user_`. Present only on the caller's own entry. + id: nil, + # The user's display name. Present only on the caller's own entry. + name: nil, + # The user's profile picture. Present only on the caller's own entry. + profile_picture: nil, + # The user's unique username. Present only on the caller's own entry. + username: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # The user's profile picture URL. + sig { returns(String) } + attr_accessor :url + + # The user's profile picture. Present only on the caller's own entry. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # The user's profile picture URL. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/business_list_params.rbi b/rbi/whop_sdk/models/referrals/business_list_params.rbi new file mode 100644 index 00000000..00cd20ee --- /dev/null +++ b/rbi/whop_sdk/models/referrals/business_list_params.rbi @@ -0,0 +1,376 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + class BusinessListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Referrals::BusinessListParams, + WhopSDK::Internal::AnyHash + ) + end + + # Cursor to fetch the page after (from page_info.end_cursor). + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Cursor to fetch the page before (from page_info.start_cursor). + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Only return business referrals created after this timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_after + + sig { params(created_after: String).void } + attr_writer :created_after + + # Only return business referrals created before this timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_before + + sig { params(created_before: String).void } + attr_writer :created_before + + # Sort direction. + sig do + returns( + T.nilable( + WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol + ) + ) + end + attr_reader :direction + + sig do + params( + direction: + WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol + ).void + end + attr_writer :direction + + # Number of business referrals to return from the start of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # When true, only businesses with pending or completed earnings paid to the + # caller. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_earnings + + sig { params(has_earnings: T::Boolean).void } + attr_writer :has_earnings + + # Number of business referrals to return from the end of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :last + + sig { params(last: Integer).void } + attr_writer :last + + # The field to sort business referrals by. + sig do + returns( + T.nilable(WhopSDK::Referrals::BusinessListParams::Order::OrSymbol) + ) + end + attr_reader :order + + sig do + params( + order: WhopSDK::Referrals::BusinessListParams::Order::OrSymbol + ).void + end + attr_writer :order + + # Filter to referrals attributed to this user. For first-tier referrals, this is + # the referred account owner; for second-tier referrals, this is the partner you + # recruited. + sig { returns(T.nilable(String)) } + attr_reader :referred_user_id + + sig { params(referred_user_id: String).void } + attr_writer :referred_user_id + + # Filter by the referred user's exact username. Ignored when `referred_user_id` is + # present. + sig { returns(T.nilable(String)) } + attr_reader :referred_username + + sig { params(referred_username: String).void } + attr_writer :referred_username + + # Filter by referral status. + sig do + returns( + T.nilable(WhopSDK::Referrals::BusinessListParams::Status::OrSymbol) + ) + end + attr_reader :status + + sig do + params( + status: WhopSDK::Referrals::BusinessListParams::Status::OrSymbol + ).void + end + attr_writer :status + + # Filter to only first-tier referrals or only second-tier referrals. + sig do + returns( + T.nilable(WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol) + ) + end + attr_reader :tier + + sig do + params( + tier: WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol + ).void + end + attr_writer :tier + + sig do + params( + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol, + first: Integer, + has_earnings: T::Boolean, + last: Integer, + order: WhopSDK::Referrals::BusinessListParams::Order::OrSymbol, + referred_user_id: String, + referred_username: String, + status: WhopSDK::Referrals::BusinessListParams::Status::OrSymbol, + tier: WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Only return business referrals created after this timestamp. + created_after: nil, + # Only return business referrals created before this timestamp. + created_before: nil, + # Sort direction. + direction: nil, + # Number of business referrals to return from the start of the window. + first: nil, + # When true, only businesses with pending or completed earnings paid to the + # caller. + has_earnings: nil, + # Number of business referrals to return from the end of the window. + last: nil, + # The field to sort business referrals by. + order: nil, + # Filter to referrals attributed to this user. For first-tier referrals, this is + # the referred account owner; for second-tier referrals, this is the partner you + # recruited. + referred_user_id: nil, + # Filter by the referred user's exact username. Ignored when `referred_user_id` is + # present. + referred_username: nil, + # Filter by referral status. + status: nil, + # Filter to only first-tier referrals or only second-tier referrals. + tier: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol, + first: Integer, + has_earnings: T::Boolean, + last: Integer, + order: WhopSDK::Referrals::BusinessListParams::Order::OrSymbol, + referred_user_id: String, + referred_username: String, + status: WhopSDK::Referrals::BusinessListParams::Status::OrSymbol, + tier: WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Referrals::BusinessListParams::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let( + :asc, + WhopSDK::Referrals::BusinessListParams::Direction::TaggedSymbol + ) + DESC = + T.let( + :desc, + WhopSDK::Referrals::BusinessListParams::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Referrals::BusinessListParams::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The field to sort business referrals by. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Referrals::BusinessListParams::Order) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT = + T.let( + :created_at, + WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + ) + REFERRAL_STARTED_AT = + T.let( + :referral_started_at, + WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + ) + REFERRAL_EXPIRES_AT = + T.let( + :referral_expires_at, + WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + ) + PAYOUT_PERCENTAGE = + T.let( + :payout_percentage, + WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + ) + VOLUME_USD = + T.let( + :volume_usd, + WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + ) + EARNINGS_USD = + T.let( + :earnings_usd, + WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Filter by referral status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Referrals::BusinessListParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Referrals::BusinessListParams::Status::TaggedSymbol + ) + REMOVED = + T.let( + :removed, + WhopSDK::Referrals::BusinessListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Referrals::BusinessListParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Filter to only first-tier referrals or only second-tier referrals. + module Tier + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Referrals::BusinessListParams::Tier) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIRST = + T.let( + :first, + WhopSDK::Referrals::BusinessListParams::Tier::TaggedSymbol + ) + SECOND = + T.let( + :second, + WhopSDK::Referrals::BusinessListParams::Tier::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Referrals::BusinessListParams::Tier::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/business_list_response.rbi b/rbi/whop_sdk/models/referrals/business_list_response.rbi new file mode 100644 index 00000000..e7dbb10f --- /dev/null +++ b/rbi/whop_sdk/models/referrals/business_list_response.rbi @@ -0,0 +1,701 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + class BusinessListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessListResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Business referral ID. + sig { returns(String) } + attr_accessor :id + + # Referred account. + sig do + returns( + T.nilable(WhopSDK::Models::Referrals::BusinessListResponse::Account) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + # When the business referral was created. + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd) + end + attr_reader :earnings_usd + + sig do + params( + earnings_usd: + WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd::OrHash + ).void + end + attr_writer :earnings_usd + + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner + ) + ) + end + attr_reader :first_tier_partner + + sig do + params( + first_tier_partner: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::OrHash + ) + ).void + end + attr_writer :first_tier_partner + + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + sig do + returns( + WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol + ) + end + attr_accessor :my_partner_tier + + sig do + returns( + WhopSDK::Models::Referrals::BusinessListResponse::Object::TaggedSymbol + ) + end + attr_accessor :object + + # The owner of the referred business. + sig do + returns( + T.nilable(WhopSDK::Models::Referrals::BusinessListResponse::Owner) + ) + end + attr_reader :owner + + sig do + params( + owner: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::Owner::OrHash + ) + ).void + end + attr_writer :owner + + # Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier + # referrals earn a flat 0.1. + sig { returns(Float) } + attr_accessor :payout_percentage + + # When the referral expires. + sig { returns(T.nilable(Time)) } + attr_accessor :referral_expires_at + + # When the referral became active. + sig { returns(T.nilable(Time)) } + attr_accessor :referral_started_at + + # Current referral status. + sig do + returns( + WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig do + returns(WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd) + end + attr_reader :volume_usd + + sig do + params( + volume_usd: + WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd::OrHash + ).void + end + attr_writer :volume_usd + + sig do + params( + id: String, + account: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::Account::OrHash + ), + created_at: Time, + earnings_usd: + WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd::OrHash, + first_tier_partner: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::OrHash + ), + my_partner_tier: + WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::OrSymbol, + object: + WhopSDK::Models::Referrals::BusinessListResponse::Object::OrSymbol, + owner: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::Owner::OrHash + ), + payout_percentage: Float, + referral_expires_at: T.nilable(Time), + referral_started_at: T.nilable(Time), + status: + WhopSDK::Models::Referrals::BusinessListResponse::Status::OrSymbol, + volume_usd: + WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd::OrHash + ).returns(T.attached_class) + end + def self.new( + # Business referral ID. + id:, + # Referred account. + account:, + # When the business referral was created. + created_at:, + earnings_usd:, + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + first_tier_partner:, + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + my_partner_tier:, + object:, + # The owner of the referred business. + owner:, + # Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier + # referrals earn a flat 0.1. + payout_percentage:, + # When the referral expires. + referral_expires_at:, + # When the referral became active. + referral_started_at:, + # Current referral status. + status:, + volume_usd: + ) + end + + sig do + override.returns( + { + id: String, + account: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::Account + ), + created_at: Time, + earnings_usd: + WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, + first_tier_partner: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner + ), + my_partner_tier: + WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol, + object: + WhopSDK::Models::Referrals::BusinessListResponse::Object::TaggedSymbol, + owner: + T.nilable( + WhopSDK::Models::Referrals::BusinessListResponse::Owner + ), + payout_percentage: Float, + referral_expires_at: T.nilable(Time), + referral_started_at: T.nilable(Time), + status: + WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol, + volume_usd: + WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + } + ) + end + def to_hash + end + + class Account < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessListResponse::Account, + WhopSDK::Internal::AnyHash + ) + end + + # Referred account ID. + sig { returns(String) } + attr_accessor :id + + # Referred account logo URL. + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + # Referred account route. + sig { returns(String) } + attr_accessor :route + + # Referred account display name. + sig { returns(String) } + attr_accessor :title + + # Referred account. + sig do + params( + id: String, + logo_url: T.nilable(String), + route: String, + title: String + ).returns(T.attached_class) + end + def self.new( + # Referred account ID. + id:, + # Referred account logo URL. + logo_url:, + # Referred account route. + route:, + # Referred account display name. + title: + ) + end + + sig do + override.returns( + { + id: String, + logo_url: T.nilable(String), + route: String, + title: String + } + ) + end + def to_hash + end + end + + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, + WhopSDK::Internal::AnyHash + ) + end + + # Commission already paid out, in USD. + sig { returns(String) } + attr_accessor :completed + + # Commission scheduled but not yet paid, in USD. + sig { returns(String) } + attr_accessor :pending + + # Pending + completed commission, in USD. + sig { returns(String) } + attr_accessor :total + + sig do + params(completed: String, pending: String, total: String).returns( + T.attached_class + ) + end + def self.new( + # Commission already paid out, in USD. + completed:, + # Commission scheduled but not yet paid, in USD. + pending:, + # Pending + completed commission, in USD. + total: + ) + end + + sig do + override.returns( + { completed: String, pending: String, total: String } + ) + end + def to_hash + end + end + + class FirstTierPartner < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner, + WhopSDK::Internal::AnyHash + ) + end + + # User ID, prefixed `user_`. + sig { returns(String) } + attr_accessor :id + + # The user's display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture. + sig do + returns( + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # The user's unique username. + sig { returns(String) } + attr_accessor :username + + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + sig do + params( + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # User ID, prefixed `user_`. + id:, + # The user's display name. + name:, + # The user's profile picture. + profile_picture:, + # The user's unique username. + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # The user's profile picture URL. + sig { returns(String) } + attr_accessor :url + + # The user's profile picture. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # The user's profile picture URL. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + module MyPartnerTier + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIRST = + T.let( + :first, + WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol + ) + SECOND = + T.let( + :second, + WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessListResponse::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS_REFERRAL = + T.let( + :business_referral, + WhopSDK::Models::Referrals::BusinessListResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessListResponse::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Owner < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessListResponse::Owner, + WhopSDK::Internal::AnyHash + ) + end + + # User ID, prefixed `user_`. + sig { returns(String) } + attr_accessor :id + + # The user's display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture. + sig do + returns( + WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # The user's unique username. + sig { returns(String) } + attr_accessor :username + + # The owner of the referred business. + sig do + params( + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # User ID, prefixed `user_`. + id:, + # The user's display name. + name:, + # The user's profile picture. + profile_picture:, + # The user's unique username. + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # The user's profile picture URL. + sig { returns(String) } + attr_accessor :url + + # The user's profile picture. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # The user's profile picture URL. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + + # Current referral status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessListResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol + ) + REMOVED = + T.let( + :removed, + WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class VolumeUsd < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd, + WhopSDK::Internal::AnyHash + ) + end + + # Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in + # USD. + sig { returns(String) } + attr_accessor :attributed + + # GMV awaiting settlement (commission not yet computed), in USD. + sig { returns(String) } + attr_accessor :awaiting_settlement + + # GMV of pending + completed payments, in USD. + sig { returns(String) } + attr_accessor :settled + + sig do + params( + attributed: String, + awaiting_settlement: String, + settled: String + ).returns(T.attached_class) + end + def self.new( + # Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in + # USD. + attributed:, + # GMV awaiting settlement (commission not yet computed), in USD. + awaiting_settlement:, + # GMV of pending + completed payments, in USD. + settled: + ) + end + + sig do + override.returns( + { + attributed: String, + awaiting_settlement: String, + settled: String + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/business_retrieve_params.rbi b/rbi/whop_sdk/models/referrals/business_retrieve_params.rbi new file mode 100644 index 00000000..dfedb4b3 --- /dev/null +++ b/rbi/whop_sdk/models/referrals/business_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + class BusinessRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Referrals::BusinessRetrieveParams, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi b/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi new file mode 100644 index 00000000..8b3f14a2 --- /dev/null +++ b/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi @@ -0,0 +1,1846 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Business referral ID. + sig { returns(String) } + attr_accessor :id + + # Referred account. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + # When the business referral was created. + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd + ) + end + attr_reader :earnings_usd + + sig do + params( + earnings_usd: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd::OrHash + ).void + end + attr_writer :earnings_usd + + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner + ) + ) + end + attr_reader :first_tier_partner + + sig do + params( + first_tier_partner: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::OrHash + ) + ).void + end + attr_writer :first_tier_partner + + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol + ) + end + attr_accessor :my_partner_tier + + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::TaggedSymbol + ) + end + attr_accessor :object + + # The owner of the referred business. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner + ) + ) + end + attr_reader :owner + + sig do + params( + owner: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::OrHash + ) + ).void + end + attr_writer :owner + + # Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier + # referrals earn a flat 0.1. + sig { returns(Float) } + attr_accessor :payout_percentage + + # When the referral expires. + sig { returns(T.nilable(Time)) } + attr_accessor :referral_expires_at + + # When the referral became active. + sig { returns(T.nilable(Time)) } + attr_accessor :referral_started_at + + # Current referral status. + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + ) + end + attr_reader :volume_usd + + sig do + params( + volume_usd: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd::OrHash + ).void + end + attr_writer :volume_usd + + sig do + params( + id: String, + account: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::OrHash + ), + created_at: Time, + earnings_usd: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd::OrHash, + first_tier_partner: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::OrHash + ), + my_partner_tier: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::OrSymbol, + object: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::OrSymbol, + owner: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::OrHash + ), + payout_percentage: Float, + referral_expires_at: T.nilable(Time), + referral_started_at: T.nilable(Time), + status: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::OrSymbol, + volume_usd: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd::OrHash + ).returns(T.attached_class) + end + def self.new( + # Business referral ID. + id:, + # Referred account. + account:, + # When the business referral was created. + created_at:, + earnings_usd:, + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + first_tier_partner:, + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + my_partner_tier:, + object:, + # The owner of the referred business. + owner:, + # Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier + # referrals earn a flat 0.1. + payout_percentage:, + # When the referral expires. + referral_expires_at:, + # When the referral became active. + referral_started_at:, + # Current referral status. + status:, + volume_usd: + ) + end + + sig do + override.returns( + { + id: String, + account: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account + ), + created_at: Time, + earnings_usd: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner + ), + my_partner_tier: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol, + object: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::TaggedSymbol, + owner: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner + ), + payout_percentage: Float, + referral_expires_at: T.nilable(Time), + referral_started_at: T.nilable(Time), + status: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol, + volume_usd: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + } + ) + end + def to_hash + end + + class Account < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account, + WhopSDK::Internal::AnyHash + ) + end + + # Referred account ID. + sig { returns(String) } + attr_accessor :id + + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities + ) + ) + end + attr_reader :capabilities + + sig do + params( + capabilities: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::OrHash + ) + ).void + end + attr_writer :capabilities + + # Referred account logo URL. + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + # Optional actions that unlock capabilities or grow the referred account. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction + ] + ) + ) + end + attr_accessor :recommended_actions + + # Actions the referred account owner must take to unblock capabilities. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction + ] + ) + ) + end + attr_accessor :required_actions + + # Referred account route. + sig { returns(String) } + attr_accessor :route + + # Referred account display name. + sig { returns(String) } + attr_accessor :title + + # Referred account. + sig do + params( + id: String, + capabilities: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::OrHash + ), + logo_url: T.nilable(String), + recommended_actions: + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::OrHash + ] + ), + required_actions: + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::OrHash + ] + ), + route: String, + title: String + ).returns(T.attached_class) + end + def self.new( + # Referred account ID. + id:, + capabilities:, + # Referred account logo URL. + logo_url:, + # Optional actions that unlock capabilities or grow the referred account. + recommended_actions:, + # Actions the referred account owner must take to unblock capabilities. + required_actions:, + # Referred account route. + route:, + # Referred account display name. + title: + ) + end + + sig do + override.returns( + { + id: String, + capabilities: + T.nilable( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities + ), + logo_url: T.nilable(String), + recommended_actions: + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction + ] + ), + required_actions: + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction + ] + ), + route: String, + title: String + } + ) + end + def to_hash + end + + class Capabilities < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities, + WhopSDK::Internal::AnyHash + ) + end + + # Bank payins: debits, transfers, and local bank rails + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ) + end + attr_accessor :accept_bank_payments + + # Buy-now-pay-later payins; requires approval + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ) + end + attr_accessor :accept_bnpl_payments + + # Card payins, including Apple Pay and Google Pay + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ) + end + attr_accessor :accept_card_payments + + # Deposits by bank wire or ACH to the account's virtual bank account + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + ) + end + attr_accessor :bank_deposit + + # Balance top-ups by charging a stored payment method + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + ) + end + attr_accessor :card_deposit + + # Issuing Whop cards; requires card application approval + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + ) + end + attr_accessor :card_issuing + + # On-chain deposits to the account's crypto wallet + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + ) + end + attr_accessor :crypto_deposit + + # On-chain payouts to a crypto wallet + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + ) + end + attr_accessor :crypto_payout + + # Instant payouts to an eligible payout destination + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + ) + end + attr_accessor :instant_payout + + # Standard payouts to an external payout destination + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + ) + end + attr_accessor :standard_payout + + # Transfers to other accounts + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + ) + end + attr_accessor :transfer + + sig do + params( + accept_bank_payments: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::OrSymbol, + accept_bnpl_payments: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::OrSymbol, + accept_card_payments: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::OrSymbol, + bank_deposit: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::OrSymbol, + card_deposit: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::OrSymbol, + card_issuing: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::OrSymbol, + crypto_deposit: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::OrSymbol, + crypto_payout: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::OrSymbol, + instant_payout: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::OrSymbol, + standard_payout: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::OrSymbol, + transfer: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Bank payins: debits, transfers, and local bank rails + accept_bank_payments:, + # Buy-now-pay-later payins; requires approval + accept_bnpl_payments:, + # Card payins, including Apple Pay and Google Pay + accept_card_payments:, + # Deposits by bank wire or ACH to the account's virtual bank account + bank_deposit:, + # Balance top-ups by charging a stored payment method + card_deposit:, + # Issuing Whop cards; requires card application approval + card_issuing:, + # On-chain deposits to the account's crypto wallet + crypto_deposit:, + # On-chain payouts to a crypto wallet + crypto_payout:, + # Instant payouts to an eligible payout destination + instant_payout:, + # Standard payouts to an external payout destination + standard_payout:, + # Transfers to other accounts + transfer: + ) + end + + sig do + override.returns( + { + accept_bank_payments: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol, + accept_bnpl_payments: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol, + accept_card_payments: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol, + bank_deposit: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol, + card_deposit: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol, + card_issuing: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol, + crypto_deposit: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol, + crypto_payout: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol, + instant_payout: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol, + standard_payout: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol, + transfer: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + } + ) + end + def to_hash + end + + # Bank payins: debits, transfers, and local bank rails + module AcceptBankPayments + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Buy-now-pay-later payins; requires approval + module AcceptBnplPayments + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Card payins, including Apple Pay and Google Pay + module AcceptCardPayments + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Deposits by bank wire or ACH to the account's virtual bank account + module BankDeposit + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Balance top-ups by charging a stored payment method + module CardDeposit + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Issuing Whop cards; requires card application approval + module CardIssuing + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + ] + ) + end + def self.values + end + end + + # On-chain deposits to the account's crypto wallet + module CryptoDeposit + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + ] + ) + end + def self.values + end + end + + # On-chain payouts to a crypto wallet + module CryptoPayout + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Instant payouts to an eligible payout destination + module InstantPayout + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Standard payouts to an external payout destination + module StandardPayout + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Transfers to other accounts + module Transfer + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + ) + INACTIVE = + T.let( + :inactive, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class RecommendedAction < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction, + WhopSDK::Internal::AnyHash + ) + end + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + end + attr_accessor :action + + sig { returns(T::Array[String]) } + attr_accessor :blocked_capabilities + + # The URL the call-to-action links to + sig { returns(String) } + attr_accessor :cta + + # Button label + sig { returns(String) } + attr_accessor :cta_label + + # Supporting copy, or empty + sig { returns(String) } + attr_accessor :description + + # Illustration icon URL, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + sig { returns(T.nilable(Integer)) } + attr_accessor :impact_score + + # Why this action was recommended for this account, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :reasoning + + # Always optional — never blocking + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Headline for the recommendation + sig { returns(String) } + attr_accessor :title + + sig do + params( + action: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::OrSymbol, + blocked_capabilities: T::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: T.nilable(String), + impact_score: T.nilable(Integer), + reasoning: T.nilable(String), + status: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::OrSymbol, + title: String + ).returns(T.attached_class) + end + def self.new( + # The recommendation; new values may be added, so handle unknown actions + # gracefully + action:, + blocked_capabilities:, + # The URL the call-to-action links to + cta:, + # Button label + cta_label:, + # Supporting copy, or empty + description:, + # Illustration icon URL, or `null` + icon_url:, + # Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # not ranked + impact_score:, + # Why this action was recommended for this account, or `null` + reasoning:, + # Always optional — never blocking + status:, + # Headline for the recommendation + title: + ) + end + + sig do + override.returns( + { + action: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol, + blocked_capabilities: T::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: T.nilable(String), + impact_score: T.nilable(Integer), + reasoning: T.nilable(String), + status: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol, + title: String + } + ) + end + def to_hash + end + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + THEME_BUSINESS = + T.let( + :theme_business, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + CREATE_PRODUCT = + T.let( + :create_product, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + CREATE_PLAN = + T.let( + :create_plan, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + VERIFY_IDENTITY = + T.let( + :verify_identity, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + CONNECT_AFFILIATE_PROGRAM = + T.let( + :connect_affiliate_program, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + CREATE_PROMOTION = + T.let( + :create_promotion, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + SETUP_TRACKING_PIXEL = + T.let( + :setup_tracking_pixel, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + MIGRATE_FROM_STRIPE = + T.let( + :migrate_from_stripe, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + ACCEPT_FIRST_PAYMENT = + T.let( + :accept_first_payment, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + LAUNCH_FIRST_AD = + T.let( + :launch_first_ad, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + INVITE_TEAM_MEMBER = + T.let( + :invite_team_member, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + ENABLE_TAX_COLLECTION = + T.let( + :enable_tax_collection, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + CREATE_CARD = + T.let( + :create_card, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + JOIN_WHOP_UNIVERSITY = + T.let( + :join_whop_university, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + APPLY_FOR_FINANCING = + T.let( + :apply_for_financing, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Always optional — never blocking + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPTIONAL = + T.let( + :optional, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class RequiredAction < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction, + WhopSDK::Internal::AnyHash + ) + end + + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + ) + end + attr_accessor :action + + sig { returns(T::Array[String]) } + attr_accessor :blocked_capabilities + + # The URL the call-to-action links to, or null when there is no button + sig { returns(T.nilable(String)) } + attr_accessor :cta + + # Button label, or empty when there is no button + sig { returns(String) } + attr_accessor :cta_label + + # Supporting copy, or empty + sig { returns(String) } + attr_accessor :description + + # The URL of the action's illustration icon, or null if it has none + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # required (act now) or pending (under review) + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Headline for the action + sig { returns(String) } + attr_accessor :title + + sig do + params( + action: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::OrSymbol, + blocked_capabilities: T::Array[String], + cta: T.nilable(String), + cta_label: String, + description: String, + icon_url: T.nilable(String), + status: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::OrSymbol, + title: String + ).returns(T.attached_class) + end + def self.new( + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + action:, + blocked_capabilities:, + # The URL the call-to-action links to, or null when there is no button + cta:, + # Button label, or empty when there is no button + cta_label:, + # Supporting copy, or empty + description:, + # The URL of the action's illustration icon, or null if it has none + icon_url:, + # required (act now) or pending (under review) + status:, + # Headline for the action + title: + ) + end + + sig do + override.returns( + { + action: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol, + blocked_capabilities: T::Array[String], + cta: T.nilable(String), + cta_label: String, + description: String, + icon_url: T.nilable(String), + status: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol, + title: String + } + ) + end + def to_hash + end + + # What the holder must do; new values may be added, so handle unknown actions + # gracefully + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPOSIT_FUNDS = + T.let( + :deposit_funds, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + ) + SUBMIT_INFORMATION_REQUEST = + T.let( + :submit_information_request, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + ) + VERIFY_IDENTITY = + T.let( + :verify_identity, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + ) + CONNECT_FULFILLMENT_TRACKER = + T.let( + :connect_fulfillment_tracker, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + # required (act now) or pending (under review) + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUIRED = + T.let( + :required, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, + WhopSDK::Internal::AnyHash + ) + end + + # Commission already paid out, in USD. + sig { returns(String) } + attr_accessor :completed + + # Commission scheduled but not yet paid, in USD. + sig { returns(String) } + attr_accessor :pending + + # Pending + completed commission, in USD. + sig { returns(String) } + attr_accessor :total + + sig do + params(completed: String, pending: String, total: String).returns( + T.attached_class + ) + end + def self.new( + # Commission already paid out, in USD. + completed:, + # Commission scheduled but not yet paid, in USD. + pending:, + # Pending + completed commission, in USD. + total: + ) + end + + sig do + override.returns( + { completed: String, pending: String, total: String } + ) + end + def to_hash + end + end + + class FirstTierPartner < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner, + WhopSDK::Internal::AnyHash + ) + end + + # User ID, prefixed `user_`. + sig { returns(String) } + attr_accessor :id + + # The user's display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture. + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # The user's unique username. + sig { returns(String) } + attr_accessor :username + + # The partner who referred the business owner onto Whop (first tier). Null if + # there is no active first-tier partner. + sig do + params( + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # User ID, prefixed `user_`. + id:, + # The user's display name. + name:, + # The user's profile picture. + profile_picture:, + # The user's unique username. + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # The user's profile picture URL. + sig { returns(String) } + attr_accessor :url + + # The user's profile picture. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # The user's profile picture URL. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + + # Which tier the caller earns on for this business: `first` (they referred the + # owner) or `second` (they referred the first-tier partner). + module MyPartnerTier + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIRST = + T.let( + :first, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol + ) + SECOND = + T.let( + :second, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS_REFERRAL = + T.let( + :business_referral, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Owner < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner, + WhopSDK::Internal::AnyHash + ) + end + + # User ID, prefixed `user_`. + sig { returns(String) } + attr_accessor :id + + # The user's display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture. + sig do + returns( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # The user's unique username. + sig { returns(String) } + attr_accessor :username + + # The owner of the referred business. + sig do + params( + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # User ID, prefixed `user_`. + id:, + # The user's display name. + name:, + # The user's profile picture. + profile_picture:, + # The user's unique username. + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # The user's profile picture URL. + sig { returns(String) } + attr_accessor :url + + # The user's profile picture. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # The user's profile picture URL. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + + # Current referral status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol + ) + REMOVED = + T.let( + :removed, + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class VolumeUsd < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd, + WhopSDK::Internal::AnyHash + ) + end + + # Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in + # USD. + sig { returns(String) } + attr_accessor :attributed + + # GMV awaiting settlement (commission not yet computed), in USD. + sig { returns(String) } + attr_accessor :awaiting_settlement + + # GMV of pending + completed payments, in USD. + sig { returns(String) } + attr_accessor :settled + + sig do + params( + attributed: String, + awaiting_settlement: String, + settled: String + ).returns(T.attached_class) + end + def self.new( + # Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in + # USD. + attributed:, + # GMV awaiting settlement (commission not yet computed), in USD. + awaiting_settlement:, + # GMV of pending + completed payments, in USD. + settled: + ) + end + + sig do + override.returns( + { + attributed: String, + awaiting_settlement: String, + settled: String + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/businesses/earning_list_params.rbi b/rbi/whop_sdk/models/referrals/businesses/earning_list_params.rbi new file mode 100644 index 00000000..a8fe56a2 --- /dev/null +++ b/rbi/whop_sdk/models/referrals/businesses/earning_list_params.rbi @@ -0,0 +1,308 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + module Businesses + class EarningListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Referrals::Businesses::EarningListParams, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Only return earnings created after this timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_after + + sig { params(created_after: String).void } + attr_writer :created_after + + # Only return earnings created before this timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_before + + sig { params(created_before: String).void } + attr_writer :created_before + + # Sort direction. + sig do + returns( + T.nilable( + WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol + ) + ) + end + attr_reader :direction + + sig do + params( + direction: + WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol + ).void + end + attr_writer :direction + + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + sig { returns(T.nilable(Integer)) } + attr_reader :last + + sig { params(last: Integer).void } + attr_writer :last + + # The field to sort earnings by. + sig do + returns( + T.nilable( + WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol + ) + ) + end + attr_reader :order + + sig do + params( + order: + WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol + ).void + end + attr_writer :order + + # Filter by earning status. + sig do + returns( + T.nilable( + WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: + WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol, + status: + WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + after: nil, + before: nil, + # Only return earnings created after this timestamp. + created_after: nil, + # Only return earnings created before this timestamp. + created_before: nil, + # Sort direction. + direction: nil, + first: nil, + last: nil, + # The field to sort earnings by. + order: nil, + # Filter by earning status. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: + WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol, + status: + WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Referrals::Businesses::EarningListParams::Direction + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let( + :asc, + WhopSDK::Referrals::Businesses::EarningListParams::Direction::TaggedSymbol + ) + DESC = + T.let( + :desc, + WhopSDK::Referrals::Businesses::EarningListParams::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Referrals::Businesses::EarningListParams::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The field to sort earnings by. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Referrals::Businesses::EarningListParams::Order + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT = + T.let( + :created_at, + WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + ) + COMMISSION_AMOUNT = + T.let( + :commission_amount, + WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + ) + TRANSACTION_AMOUNT = + T.let( + :transaction_amount, + WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + ) + PAYOUT_AT = + T.let( + :payout_at, + WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Filter by earning status. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Referrals::Businesses::EarningListParams::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AWAITING_SETTLEMENT = + T.let( + :awaiting_settlement, + WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + ) + REVERSED = + T.let( + :reversed, + WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/businesses/earning_list_response.rbi b/rbi/whop_sdk/models/referrals/businesses/earning_list_response.rbi new file mode 100644 index 00000000..decf4ec0 --- /dev/null +++ b/rbi/whop_sdk/models/referrals/businesses/earning_list_response.rbi @@ -0,0 +1,693 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + module Businesses + class EarningListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::Businesses::EarningListResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + # Referred account. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + # Why the earning was canceled or reversed, if applicable. + sig { returns(T.nilable(String)) } + attr_accessor :cancelation_reason + + # What the referrer earns, in USD. Null until the earning settles. + sig { returns(T.nilable(String)) } + attr_accessor :commission_amount_usd + + sig { returns(Time) } + attr_accessor :created_at + + # Income and cost lines behind this earning's commission. Null for earnings + # settled before this data was recorded. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity + ] + ) + ) + end + attr_accessor :financial_activity + + sig do + returns( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(Time)) } + attr_accessor :payout_at + + # The referrer's share of Whop's gross profit, as a fraction (0.3 = 30%). Null + # until the earning settles. + sig { returns(T.nilable(Float)) } + attr_accessor :payout_percentage + + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product + ) + ) + end + attr_reader :product + + sig do + params( + product: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product::OrHash + ) + ).void + end + attr_writer :product + + # The resource that generated the affiliate earning. + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource + ) + ) + end + attr_reader :resource + + sig do + params( + resource: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::OrHash + ) + ).void + end + attr_writer :resource + + # Whether this earning is a second-tier (grandparent) commission. + sig { returns(T::Boolean) } + attr_accessor :second_tier + + # Current status of the earning. + sig do + returns( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The sale amount the commission is calculated from, in USD. + sig { returns(String) } + attr_accessor :transaction_amount_usd + + sig do + params( + id: T.nilable(String), + account: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account::OrHash + ), + cancelation_reason: T.nilable(String), + commission_amount_usd: T.nilable(String), + created_at: Time, + financial_activity: + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::OrHash + ] + ), + object: + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::OrSymbol, + payout_at: T.nilable(Time), + payout_percentage: T.nilable(Float), + product: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product::OrHash + ), + resource: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::OrHash + ), + second_tier: T::Boolean, + status: + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::OrSymbol, + transaction_amount_usd: String + ).returns(T.attached_class) + end + def self.new( + id:, + # Referred account. + account:, + # Why the earning was canceled or reversed, if applicable. + cancelation_reason:, + # What the referrer earns, in USD. Null until the earning settles. + commission_amount_usd:, + created_at:, + # Income and cost lines behind this earning's commission. Null for earnings + # settled before this data was recorded. + financial_activity:, + object:, + payout_at:, + # The referrer's share of Whop's gross profit, as a fraction (0.3 = 30%). Null + # until the earning settles. + payout_percentage:, + product:, + # The resource that generated the affiliate earning. + resource:, + # Whether this earning is a second-tier (grandparent) commission. + second_tier:, + # Current status of the earning. + status:, + # The sale amount the commission is calculated from, in USD. + transaction_amount_usd: + ) + end + + sig do + override.returns( + { + id: T.nilable(String), + account: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account + ), + cancelation_reason: T.nilable(String), + commission_amount_usd: T.nilable(String), + created_at: Time, + financial_activity: + T.nilable( + T::Array[ + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity + ] + ), + object: + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::TaggedSymbol, + payout_at: T.nilable(Time), + payout_percentage: T.nilable(Float), + product: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product + ), + resource: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource + ), + second_tier: T::Boolean, + status: + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol, + transaction_amount_usd: String + } + ) + end + def to_hash + end + + class Account < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account, + WhopSDK::Internal::AnyHash + ) + end + + # Referred account ID. + sig { returns(String) } + attr_accessor :id + + # Referred account logo URL. + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + # Referred account route. + sig { returns(String) } + attr_accessor :route + + # Referred account display name. + sig { returns(String) } + attr_accessor :title + + # Referred account. + sig do + params( + id: String, + logo_url: T.nilable(String), + route: String, + title: String + ).returns(T.attached_class) + end + def self.new( + # Referred account ID. + id:, + # Referred account logo URL. + logo_url:, + # Referred account route. + route:, + # Referred account display name. + title: + ) + end + + sig do + override.returns( + { + id: String, + logo_url: T.nilable(String), + route: String, + title: String + } + ) + end + def to_hash + end + end + + class FinancialActivity < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity, + WhopSDK::Internal::AnyHash + ) + end + + # Line amount in its native currency. + sig { returns(String) } + attr_accessor :amount + + # Line amount in USD. + sig { returns(String) } + attr_accessor :amount_usd + + # Fee or cost category of the line. + sig { returns(T.nilable(String)) } + attr_accessor :category + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at + + # Currency of the native amount. + sig { returns(String) } + attr_accessor :currency + + # Whether the line is income Whop collected or a cost Whop paid. + sig do + returns( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + amount: String, + amount_usd: String, + category: T.nilable(String), + created_at: T.nilable(Time), + currency: String, + type: + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Line amount in its native currency. + amount:, + # Line amount in USD. + amount_usd:, + # Fee or cost category of the line. + category:, + created_at:, + # Currency of the native amount. + currency:, + # Whether the line is income Whop collected or a cost Whop paid. + type: + ) + end + + sig do + override.returns( + { + amount: String, + amount_usd: String, + category: T.nilable(String), + created_at: T.nilable(Time), + currency: String, + type: + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Whether the line is income Whop collected or a cost Whop paid. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCOME = + T.let( + :income, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + ) + EXPENSE = + T.let( + :expense, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS_REFERRAL_EARNING = + T.let( + :business_referral_earning, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Product < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :route + + sig { returns(String) } + attr_accessor :title + + sig do + params(id: String, route: String, title: String).returns( + T.attached_class + ) + end + def self.new(id:, route:, title:) + end + + sig do + override.returns({ id: String, route: String, title: String }) + end + def to_hash + end + end + + class Resource < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod + ) + ) + end + attr_reader :alternative_payment_method + + sig do + params( + alternative_payment_method: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod::OrHash + ) + ).void + end + attr_writer :alternative_payment_method + + sig { returns(T.nilable(String)) } + attr_accessor :brand + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + sig do + returns( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :payment_method_type + + sig { returns(T.nilable(String)) } + attr_accessor :processor + + # The resource that generated the affiliate earning. + sig do + params( + id: String, + alternative_payment_method: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod::OrHash + ), + brand: T.nilable(String), + created_at: Time, + currency: String, + last4: T.nilable(String), + object: + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::OrSymbol, + payment_method_type: T.nilable(String), + processor: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + alternative_payment_method:, + brand:, + created_at:, + currency:, + last4:, + object:, + payment_method_type:, + processor: + ) + end + + sig do + override.returns( + { + id: String, + alternative_payment_method: + T.nilable( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod + ), + brand: T.nilable(String), + created_at: Time, + currency: String, + last4: T.nilable(String), + object: + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::TaggedSymbol, + payment_method_type: T.nilable(String), + processor: T.nilable(String) + } + ) + end + def to_hash + end + + class AlternativePaymentMethod < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :image_url + + sig { returns(String) } + attr_accessor :name + + sig do + params(image_url: T.nilable(String), name: String).returns( + T.attached_class + ) + end + def self.new(image_url:, name:) + end + + sig do + override.returns({ image_url: T.nilable(String), name: String }) + end + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RECEIPT = + T.let( + :receipt, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Current status of the earning. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AWAITING_SETTLEMENT = + T.let( + :awaiting_settlement, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + ) + REVERSED = + T.let( + :reversed, + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/partner_create_params.rbi b/rbi/whop_sdk/models/referrals/partner_create_params.rbi new file mode 100644 index 00000000..00a816cd --- /dev/null +++ b/rbi/whop_sdk/models/referrals/partner_create_params.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Referrals::PartnerCreateParams, + WhopSDK::Internal::AnyHash + ) + end + + sig do + params(request_options: WhopSDK::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: WhopSDK::RequestOptions }) } + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referrals/partner_create_response.rbi b/rbi/whop_sdk/models/referrals/partner_create_response.rbi new file mode 100644 index 00000000..d4d75478 --- /dev/null +++ b/rbi/whop_sdk/models/referrals/partner_create_response.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module WhopSDK + module Models + module Referrals + class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::Referrals::PartnerCreateResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The caller's referral link — businesses that sign up through it are attributed + # to the caller. + sig { returns(String) } + attr_accessor :referral_link + + # When the caller became a Whop partner. + sig { returns(Time) } + attr_accessor :whop_partner_enabled_at + + sig do + params(referral_link: String, whop_partner_enabled_at: Time).returns( + T.attached_class + ) + end + def self.new( + # The caller's referral link — businesses that sign up through it are attributed + # to the caller. + referral_link:, + # When the caller became a Whop partner. + whop_partner_enabled_at: + ) + end + + sig do + override.returns( + { referral_link: String, whop_partner_enabled_at: Time } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/refund_created_webhook_event.rbi b/rbi/whop_sdk/models/refund_created_webhook_event.rbi index 8ffb4d21..a5553990 100644 --- a/rbi/whop_sdk/models/refund_created_webhook_event.rbi +++ b/rbi/whop_sdk/models/refund_created_webhook_event.rbi @@ -630,7 +630,8 @@ module WhopSDK attr_accessor :id # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -645,7 +646,8 @@ module WhopSDK # The unique identifier for the plan. id:, # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: ) end @@ -672,8 +674,9 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -687,8 +690,9 @@ module WhopSDK def self.new( # The unique identifier for the product. id:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata: ) end diff --git a/rbi/whop_sdk/models/refund_retrieve_response.rbi b/rbi/whop_sdk/models/refund_retrieve_response.rbi index 05b87852..a8567f9b 100644 --- a/rbi/whop_sdk/models/refund_retrieve_response.rbi +++ b/rbi/whop_sdk/models/refund_retrieve_response.rbi @@ -542,7 +542,8 @@ module WhopSDK attr_accessor :id # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -557,7 +558,8 @@ module WhopSDK # The unique identifier for the plan. id:, # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: ) end @@ -584,8 +586,9 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -599,8 +602,9 @@ module WhopSDK def self.new( # The unique identifier for the product. id:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata: ) end diff --git a/rbi/whop_sdk/models/refund_updated_webhook_event.rbi b/rbi/whop_sdk/models/refund_updated_webhook_event.rbi index fcdd855f..d7490b5e 100644 --- a/rbi/whop_sdk/models/refund_updated_webhook_event.rbi +++ b/rbi/whop_sdk/models/refund_updated_webhook_event.rbi @@ -630,7 +630,8 @@ module WhopSDK attr_accessor :id # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -645,7 +646,8 @@ module WhopSDK # The unique identifier for the plan. id:, # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: ) end @@ -672,8 +674,9 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -687,8 +690,9 @@ module WhopSDK def self.new( # The unique identifier for the product. id:, - # Custom key-value pairs stored on the product. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the product and included in payment and + # membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters + # per string value. metadata: ) end diff --git a/rbi/whop_sdk/models/result_label_keys.rbi b/rbi/whop_sdk/models/result_label_keys.rbi index 39dd36a1..04219c92 100644 --- a/rbi/whop_sdk/models/result_label_keys.rbi +++ b/rbi/whop_sdk/models/result_label_keys.rbi @@ -47,6 +47,14 @@ module WhopSDK CONTENT_VIEWS = T.let(:content_views, WhopSDK::ResultLabelKeys::TaggedSymbol) SEARCHES = T.let(:searches, WhopSDK::ResultLabelKeys::TaggedSymbol) + ADDS_TO_CART = + T.let(:adds_to_cart, WhopSDK::ResultLabelKeys::TaggedSymbol) + ADDS_TO_WISHLIST = + T.let(:adds_to_wishlist, WhopSDK::ResultLabelKeys::TaggedSymbol) + ADDS_OF_PAYMENT_INFO = + T.let(:adds_of_payment_info, WhopSDK::ResultLabelKeys::TaggedSymbol) + CHECKOUTS_INITIATED = + T.let(:checkouts_initiated, WhopSDK::ResultLabelKeys::TaggedSymbol) WEBSITE_SCHEDULES = T.let(:website_schedules, WhopSDK::ResultLabelKeys::TaggedSymbol) WEBSITE_SUBMIT_APPLICATIONS = @@ -54,6 +62,21 @@ module WhopSDK :website_submit_applications, WhopSDK::ResultLabelKeys::TaggedSymbol ) + WEBSITE_TRIALS_STARTED = + T.let(:website_trials_started, WhopSDK::ResultLabelKeys::TaggedSymbol) + WEBSITE_SUBSCRIPTIONS = + T.let(:website_subscriptions, WhopSDK::ResultLabelKeys::TaggedSymbol) + WEBSITE_CONTACTS = + T.let(:website_contacts, WhopSDK::ResultLabelKeys::TaggedSymbol) + WEBSITE_DONATIONS = + T.let(:website_donations, WhopSDK::ResultLabelKeys::TaggedSymbol) + WEBSITE_FIND_LOCATIONS = + T.let(:website_find_locations, WhopSDK::ResultLabelKeys::TaggedSymbol) + WEBSITE_PRODUCT_CUSTOMIZATIONS = + T.let( + :website_product_customizations, + WhopSDK::ResultLabelKeys::TaggedSymbol + ) CUSTOM = T.let(:custom, WhopSDK::ResultLabelKeys::TaggedSymbol) sig { override.returns(T::Array[WhopSDK::ResultLabelKeys::TaggedSymbol]) } diff --git a/rbi/whop_sdk/models/review_list_response.rbi b/rbi/whop_sdk/models/review_list_response.rbi index d6ffa690..36831303 100644 --- a/rbi/whop_sdk/models/review_list_response.rbi +++ b/rbi/whop_sdk/models/review_list_response.rbi @@ -153,7 +153,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -182,7 +182,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, diff --git a/rbi/whop_sdk/models/review_retrieve_response.rbi b/rbi/whop_sdk/models/review_retrieve_response.rbi index 7e7c034c..1286376f 100644 --- a/rbi/whop_sdk/models/review_retrieve_response.rbi +++ b/rbi/whop_sdk/models/review_retrieve_response.rbi @@ -190,7 +190,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. sig { returns(T.nilable(String)) } attr_accessor :content_type @@ -219,7 +219,7 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, - # The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. content_type:, # The original filename of the uploaded attachment, including its file extension. filename:, @@ -256,7 +256,7 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. sig { returns(String) } attr_accessor :route @@ -273,7 +273,7 @@ module WhopSDK def self.new( # The unique identifier for the company. id:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). + # URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. route:, # The display name of the company shown to customers. title: diff --git a/rbi/whop_sdk/models/setup_intent.rbi b/rbi/whop_sdk/models/setup_intent.rbi index 95c78073..78411d8f 100644 --- a/rbi/whop_sdk/models/setup_intent.rbi +++ b/rbi/whop_sdk/models/setup_intent.rbi @@ -73,6 +73,11 @@ module WhopSDK sig { returns(WhopSDK::SetupIntentStatus::TaggedSymbol) } attr_accessor :status + # Whether 3D Secure authentication was completed when this payment method was set + # up. + sig { returns(T::Boolean) } + attr_accessor :three_ds_verified + # A setup intent allows a user to save a payment method for future use without # making an immediate purchase. sig do @@ -87,7 +92,8 @@ module WhopSDK metadata: T.nilable(T::Hash[Symbol, T.anything]), payment_method: T.nilable(WhopSDK::SetupIntent::PaymentMethod::OrHash), - status: WhopSDK::SetupIntentStatus::OrSymbol + status: WhopSDK::SetupIntentStatus::OrSymbol, + three_ds_verified: T::Boolean ).returns(T.attached_class) end def self.new( @@ -114,7 +120,10 @@ module WhopSDK # completed successfully. payment_method:, # The current status of the setup intent. - status: + status:, + # Whether 3D Secure authentication was completed when this payment method was set + # up. + three_ds_verified: ) end @@ -130,7 +139,8 @@ module WhopSDK member: T.nilable(WhopSDK::SetupIntent::Member), metadata: T.nilable(T::Hash[Symbol, T.anything]), payment_method: T.nilable(WhopSDK::SetupIntent::PaymentMethod), - status: WhopSDK::SetupIntentStatus::TaggedSymbol + status: WhopSDK::SetupIntentStatus::TaggedSymbol, + three_ds_verified: T::Boolean } ) end diff --git a/rbi/whop_sdk/models/social_account.rbi b/rbi/whop_sdk/models/social_account.rbi new file mode 100644 index 00000000..d46f1271 --- /dev/null +++ b/rbi/whop_sdk/models/social_account.rbi @@ -0,0 +1,129 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccount < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::SocialAccount, WhopSDK::Internal::AnyHash) + end + + # Unique identifier for the social account. + sig { returns(String) } + attr_accessor :id + + # The platform-specific ID for this social account. + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + # The display name of the social account on the platform. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The platform the social account exists on. + sig { returns(WhopSDK::SocialAccount::Platform::TaggedSymbol) } + attr_accessor :platform + + # The URL where the profile picture of the social account can be accessed. + sig { returns(T.nilable(String)) } + attr_accessor :profile_picture_url + + sig { returns(T::Array[String]) } + attr_accessor :scopes + + # The URL where the social account can be accessed on the platform. Null while a + # Whop-owned page is still being provisioned. + sig { returns(T.nilable(String)) } + attr_accessor :url + + # The username of the social account on the platform. Null while a Whop-owned page + # is still being provisioned. + sig { returns(T.nilable(String)) } + attr_accessor :username + + # Whether the social account is verified on the platform. + sig { returns(T::Boolean) } + attr_accessor :verified + + sig do + params( + id: String, + external_id: T.nilable(String), + name: T.nilable(String), + platform: WhopSDK::SocialAccount::Platform::OrSymbol, + profile_picture_url: T.nilable(String), + scopes: T::Array[String], + url: T.nilable(String), + username: T.nilable(String), + verified: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the social account. + id:, + # The platform-specific ID for this social account. + external_id:, + # The display name of the social account on the platform. + name:, + # The platform the social account exists on. + platform:, + # The URL where the profile picture of the social account can be accessed. + profile_picture_url:, + scopes:, + # The URL where the social account can be accessed on the platform. Null while a + # Whop-owned page is still being provisioned. + url:, + # The username of the social account on the platform. Null while a Whop-owned page + # is still being provisioned. + username:, + # Whether the social account is verified on the platform. + verified: + ) + end + + sig do + override.returns( + { + id: String, + external_id: T.nilable(String), + name: T.nilable(String), + platform: WhopSDK::SocialAccount::Platform::TaggedSymbol, + profile_picture_url: T.nilable(String), + scopes: T::Array[String], + url: T.nilable(String), + username: T.nilable(String), + verified: T::Boolean + } + ) + end + def to_hash + end + + # The platform the social account exists on. + module Platform + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::SocialAccount::Platform) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + X = T.let(:x, WhopSDK::SocialAccount::Platform::TaggedSymbol) + INSTAGRAM = + T.let(:instagram, WhopSDK::SocialAccount::Platform::TaggedSymbol) + YOUTUBE = + T.let(:youtube, WhopSDK::SocialAccount::Platform::TaggedSymbol) + TIKTOK = T.let(:tiktok, WhopSDK::SocialAccount::Platform::TaggedSymbol) + FACEBOOK = + T.let(:facebook, WhopSDK::SocialAccount::Platform::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::SocialAccount::Platform::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/social_account_connect_params.rbi b/rbi/whop_sdk/models/social_account_connect_params.rbi new file mode 100644 index 00000000..41e5fbf6 --- /dev/null +++ b/rbi/whop_sdk/models/social_account_connect_params.rbi @@ -0,0 +1,146 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccountConnectParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SocialAccountConnectParams, WhopSDK::Internal::AnyHash) + end + + # The platform to connect the social account on. Today, the supported option is + # `meta_business`. + sig { returns(WhopSDK::SocialAccountConnectParams::Platform::OrSymbol) } + attr_accessor :platform + + # The Account (biz\_ identifier) to connect the social account for. An + # account-scoped API key may omit this to default to its own account. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # The Whop URL to redirect the user to after they finish connecting. + sig { returns(T.nilable(String)) } + attr_reader :redirect_url + + sig { params(redirect_url: String).void } + attr_writer :redirect_url + + # Capabilities to grant for the connected social account. Use `advertise` when + # connecting a Meta Business account for ads. + sig do + returns( + T.nilable( + T::Array[WhopSDK::SocialAccountConnectParams::Scope::OrSymbol] + ) + ) + end + attr_reader :scopes + + sig do + params( + scopes: T::Array[WhopSDK::SocialAccountConnectParams::Scope::OrSymbol] + ).void + end + attr_writer :scopes + + sig do + params( + platform: WhopSDK::SocialAccountConnectParams::Platform::OrSymbol, + account_id: String, + redirect_url: String, + scopes: + T::Array[WhopSDK::SocialAccountConnectParams::Scope::OrSymbol], + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The platform to connect the social account on. Today, the supported option is + # `meta_business`. + platform:, + # The Account (biz\_ identifier) to connect the social account for. An + # account-scoped API key may omit this to default to its own account. + account_id: nil, + # The Whop URL to redirect the user to after they finish connecting. + redirect_url: nil, + # Capabilities to grant for the connected social account. Use `advertise` when + # connecting a Meta Business account for ads. + scopes: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + platform: WhopSDK::SocialAccountConnectParams::Platform::OrSymbol, + account_id: String, + redirect_url: String, + scopes: + T::Array[WhopSDK::SocialAccountConnectParams::Scope::OrSymbol], + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # The platform to connect the social account on. Today, the supported option is + # `meta_business`. + module Platform + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::SocialAccountConnectParams::Platform) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + META_BUSINESS = + T.let( + :meta_business, + WhopSDK::SocialAccountConnectParams::Platform::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::SocialAccountConnectParams::Platform::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Scope + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::SocialAccountConnectParams::Scope) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADVERTISE = + T.let( + :advertise, + WhopSDK::SocialAccountConnectParams::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::SocialAccountConnectParams::Scope::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/social_account_connect_response.rbi b/rbi/whop_sdk/models/social_account_connect_response.rbi new file mode 100644 index 00000000..14878e2f --- /dev/null +++ b/rbi/whop_sdk/models/social_account_connect_response.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccountConnectResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::SocialAccountConnectResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The OAuth authorization URL to redirect the user to. + sig { returns(String) } + attr_accessor :authorize_url + + sig { params(authorize_url: String).returns(T.attached_class) } + def self.new( + # The OAuth authorization URL to redirect the user to. + authorize_url: + ) + end + + sig { override.returns({ authorize_url: String }) } + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/social_account_create_params.rbi b/rbi/whop_sdk/models/social_account_create_params.rbi new file mode 100644 index 00000000..7382c493 --- /dev/null +++ b/rbi/whop_sdk/models/social_account_create_params.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccountCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SocialAccountCreateParams, WhopSDK::Internal::AnyHash) + end + + # The platform to create the social account on. + sig { returns(WhopSDK::SocialAccountCreateParams::Platform::OrSymbol) } + attr_accessor :platform + + # The Account (biz\_ identifier) to create the social account for. An + # account-scoped API key may omit this to default to its own account. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + sig do + params( + platform: WhopSDK::SocialAccountCreateParams::Platform::OrSymbol, + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The platform to create the social account on. + platform:, + # The Account (biz\_ identifier) to create the social account for. An + # account-scoped API key may omit this to default to its own account. + account_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + platform: WhopSDK::SocialAccountCreateParams::Platform::OrSymbol, + account_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # The platform to create the social account on. + module Platform + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::SocialAccountCreateParams::Platform) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FACEBOOK = + T.let( + :facebook, + WhopSDK::SocialAccountCreateParams::Platform::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::SocialAccountCreateParams::Platform::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/social_account_delete_params.rbi b/rbi/whop_sdk/models/social_account_delete_params.rbi new file mode 100644 index 00000000..827c9272 --- /dev/null +++ b/rbi/whop_sdk/models/social_account_delete_params.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccountDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SocialAccountDeleteParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + # The Account that the social account is connected to. Provide either this or + # user_id. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # The User that the social account is connected to. Provide either 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( + id: String, + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # The Account that the social account is connected to. Provide either this or + # user_id. + account_id: nil, + # The User that the social account is connected to. Provide either this or + # account_id. + user_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/social_account_delete_response.rbi b/rbi/whop_sdk/models/social_account_delete_response.rbi new file mode 100644 index 00000000..6d2b35ea --- /dev/null +++ b/rbi/whop_sdk/models/social_account_delete_response.rbi @@ -0,0 +1,8 @@ +# typed: strong + +module WhopSDK + module Models + SocialAccountDeleteResponse = + T.let(T::Boolean, WhopSDK::Internal::Type::Converter) + end +end diff --git a/rbi/whop_sdk/models/social_account_list_params.rbi b/rbi/whop_sdk/models/social_account_list_params.rbi new file mode 100644 index 00000000..6a1e93ad --- /dev/null +++ b/rbi/whop_sdk/models/social_account_list_params.rbi @@ -0,0 +1,308 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccountListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SocialAccountListParams, WhopSDK::Internal::AnyHash) + end + + # The Account that the social accounts are connected to. Provide either this or + # user_id. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # Cursor to fetch the page after (from page_info.end_cursor). + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Cursor to fetch the page before (from page_info.start_cursor). + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Sort direction. + sig do + returns( + T.nilable(WhopSDK::SocialAccountListParams::Direction::OrSymbol) + ) + end + attr_reader :direction + + sig do + params( + direction: WhopSDK::SocialAccountListParams::Direction::OrSymbol + ).void + end + attr_writer :direction + + # The number of social accounts to return. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # The number of social accounts to return from the end of the range. + sig { returns(T.nilable(Integer)) } + attr_reader :last + + sig { params(last: Integer).void } + attr_writer :last + + # The field to sort social accounts by. + sig do + returns(T.nilable(WhopSDK::SocialAccountListParams::Order::OrSymbol)) + end + attr_reader :order + + sig do + params(order: WhopSDK::SocialAccountListParams::Order::OrSymbol).void + end + attr_writer :order + + # Only return social accounts for the platform that is specified. + sig do + returns(T.nilable(WhopSDK::SocialAccountListParams::Platform::OrSymbol)) + end + attr_reader :platform + + sig do + params( + platform: WhopSDK::SocialAccountListParams::Platform::OrSymbol + ).void + end + attr_writer :platform + + # Only return social accounts that have these scopes. + sig do + returns( + T.nilable(T::Array[WhopSDK::SocialAccountListParams::Scope::OrSymbol]) + ) + end + attr_reader :scopes + + sig do + params( + scopes: T::Array[WhopSDK::SocialAccountListParams::Scope::OrSymbol] + ).void + end + attr_writer :scopes + + # The User that the social accounts are connected to. Provide either this or + # account_id. + sig { returns(T.nilable(String)) } + attr_reader :user_id + + sig { params(user_id: String).void } + attr_writer :user_id + + # Only return social accounts that are verified on the platform. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified + + sig { params(verified: T::Boolean).void } + attr_writer :verified + + sig do + params( + account_id: String, + after: String, + before: String, + direction: WhopSDK::SocialAccountListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::SocialAccountListParams::Order::OrSymbol, + platform: WhopSDK::SocialAccountListParams::Platform::OrSymbol, + scopes: T::Array[WhopSDK::SocialAccountListParams::Scope::OrSymbol], + user_id: String, + verified: T::Boolean, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The Account that the social accounts are connected to. Provide either this or + # user_id. + account_id: nil, + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Sort direction. + direction: nil, + # The number of social accounts to return. + first: nil, + # The number of social accounts to return from the end of the range. + last: nil, + # The field to sort social accounts by. + order: nil, + # Only return social accounts for the platform that is specified. + platform: nil, + # Only return social accounts that have these scopes. + scopes: nil, + # The User that the social accounts are connected to. Provide either this or + # account_id. + user_id: nil, + # Only return social accounts that are verified on the platform. + verified: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + after: String, + before: String, + direction: WhopSDK::SocialAccountListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::SocialAccountListParams::Order::OrSymbol, + platform: WhopSDK::SocialAccountListParams::Platform::OrSymbol, + scopes: T::Array[WhopSDK::SocialAccountListParams::Scope::OrSymbol], + user_id: String, + verified: T::Boolean, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::SocialAccountListParams::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let(:asc, WhopSDK::SocialAccountListParams::Direction::TaggedSymbol) + DESC = + T.let( + :desc, + WhopSDK::SocialAccountListParams::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::SocialAccountListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # The field to sort social accounts by. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::SocialAccountListParams::Order) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DISPLAY_ORDER = + T.let( + :display_order, + WhopSDK::SocialAccountListParams::Order::TaggedSymbol + ) + CREATED_AT = + T.let( + :created_at, + WhopSDK::SocialAccountListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::SocialAccountListParams::Order::TaggedSymbol] + ) + end + def self.values + end + end + + # Only return social accounts for the platform that is specified. + module Platform + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::SocialAccountListParams::Platform) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + X = T.let(:x, WhopSDK::SocialAccountListParams::Platform::TaggedSymbol) + INSTAGRAM = + T.let( + :instagram, + WhopSDK::SocialAccountListParams::Platform::TaggedSymbol + ) + YOUTUBE = + T.let( + :youtube, + WhopSDK::SocialAccountListParams::Platform::TaggedSymbol + ) + TIKTOK = + T.let( + :tiktok, + WhopSDK::SocialAccountListParams::Platform::TaggedSymbol + ) + FACEBOOK = + T.let( + :facebook, + WhopSDK::SocialAccountListParams::Platform::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::SocialAccountListParams::Platform::TaggedSymbol] + ) + end + def self.values + end + end + + module Scope + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::SocialAccountListParams::Scope) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADVERTISE = + T.let( + :advertise, + WhopSDK::SocialAccountListParams::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::SocialAccountListParams::Scope::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/social_account_post.rbi b/rbi/whop_sdk/models/social_account_post.rbi new file mode 100644 index 00000000..7e0e30cf --- /dev/null +++ b/rbi/whop_sdk/models/social_account_post.rbi @@ -0,0 +1,261 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccountPost < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::SocialAccountPost, WhopSDK::Internal::AnyHash) + end + + # The platform's own identifier for the post or media. Use it to reference the + # post on an ad. + sig { returns(String) } + attr_accessor :id + + # The post's call-to-action button, for example shop_now (Facebook only; null for + # Instagram). + sig do + returns( + T.nilable(WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol) + ) + end + attr_accessor :call_to_action + + # The URL the post's call-to-action drives to (Facebook only; null for Instagram). + sig { returns(T.nilable(String)) } + attr_accessor :destination_url + + # The URL of the post's media — the image for image posts, the playable video file + # for video posts. Meta signs these and they expire after roughly 24 hours, so + # don't store them. + sig { returns(T.nilable(String)) } + attr_accessor :media_url + + # Poster image for video posts; null for image posts, where media_url is already + # the image. Signed and short-lived like media_url. + sig { returns(T.nilable(String)) } + attr_accessor :thumbnail_url + + sig do + params( + id: String, + call_to_action: + T.nilable(WhopSDK::SocialAccountPost::CallToAction::OrSymbol), + destination_url: T.nilable(String), + media_url: T.nilable(String), + thumbnail_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The platform's own identifier for the post or media. Use it to reference the + # post on an ad. + id:, + # The post's call-to-action button, for example shop_now (Facebook only; null for + # Instagram). + call_to_action:, + # The URL the post's call-to-action drives to (Facebook only; null for Instagram). + destination_url:, + # The URL of the post's media — the image for image posts, the playable video file + # for video posts. Meta signs these and they expire after roughly 24 hours, so + # don't store them. + media_url:, + # Poster image for video posts; null for image posts, where media_url is already + # the image. Signed and short-lived like media_url. + thumbnail_url: + ) + end + + sig do + override.returns( + { + id: String, + call_to_action: + T.nilable(WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol), + destination_url: T.nilable(String), + media_url: T.nilable(String), + thumbnail_url: T.nilable(String) + } + ) + end + def to_hash + end + + # The post's call-to-action button, for example shop_now (Facebook only; null for + # Instagram). + module CallToAction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::SocialAccountPost::CallToAction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LEARN_MORE = + T.let( + :learn_more, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + SHOP_NOW = + T.let( + :shop_now, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + SIGN_UP = + T.let( + :sign_up, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + SUBSCRIBE = + T.let( + :subscribe, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + GET_STARTED = + T.let( + :get_started, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + BOOK_NOW = + T.let( + :book_now, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + APPLY_NOW = + T.let( + :apply_now, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + CONTACT_US = + T.let( + :contact_us, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + DOWNLOAD = + T.let( + :download, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + ORDER_NOW = + T.let( + :order_now, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + BUY_NOW = + T.let( + :buy_now, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + GET_QUOTE = + T.let( + :get_quote, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + MESSAGE_PAGE = + T.let( + :message_page, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + WHATSAPP_MESSAGE = + T.let( + :whatsapp_message, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + INSTAGRAM_MESSAGE = + T.let( + :instagram_message, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + CALL_NOW = + T.let( + :call_now, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + GET_DIRECTIONS = + T.let( + :get_directions, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + SEND_UPDATES = + T.let( + :send_updates, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + GET_OFFER = + T.let( + :get_offer, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + WATCH_MORE = + T.let( + :watch_more, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + LISTEN_NOW = + T.let( + :listen_now, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + PLAY_GAME = + T.let( + :play_game, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + OPEN_LINK = + T.let( + :open_link, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + NO_BUTTON = + T.let( + :no_button, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + GET_OFFER_VIEW = + T.let( + :get_offer_view, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + GET_EVENT_TICKETS = + T.let( + :get_event_tickets, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + SEE_MENU = + T.let( + :see_menu, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + REQUEST_TIME = + T.let( + :request_time, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + EVENT_RSVP = + T.let( + :event_rsvp, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + SEE_DETAILS = + T.let( + :see_details, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + VIEW_INSTAGRAM_PROFILE = + T.let( + :view_instagram_profile, + WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::SocialAccountPost::CallToAction::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/social_account_posts_params.rbi b/rbi/whop_sdk/models/social_account_posts_params.rbi new file mode 100644 index 00000000..730de268 --- /dev/null +++ b/rbi/whop_sdk/models/social_account_posts_params.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccountPostsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SocialAccountPostsParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + # The Account (a biz\_ identifier) the social account is connected to. + sig { returns(String) } + attr_accessor :account_id + + # Cursor to fetch the page after (from page_info.end_cursor). + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # The number of posts to return. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # Return only the single post with this platform id, instead of the full list. + sig { returns(T.nilable(String)) } + attr_reader :post_id + + sig { params(post_id: String).void } + attr_writer :post_id + + sig do + params( + id: String, + account_id: String, + after: String, + first: Integer, + post_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # The Account (a biz\_ identifier) the social account is connected to. + account_id:, + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # The number of posts to return. + first: nil, + # Return only the single post with this platform id, instead of the full list. + post_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + account_id: String, + after: String, + first: Integer, + post_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/social_account_posts_response.rbi b/rbi/whop_sdk/models/social_account_posts_response.rbi new file mode 100644 index 00000000..88251d0b --- /dev/null +++ b/rbi/whop_sdk/models/social_account_posts_response.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module WhopSDK + module Models + class SocialAccountPostsResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::SocialAccountPostsResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T::Array[WhopSDK::SocialAccountPost]) } + attr_accessor :data + + sig { returns(WhopSDK::Models::SocialAccountPostsResponse::PageInfo) } + attr_reader :page_info + + sig do + params( + page_info: + WhopSDK::Models::SocialAccountPostsResponse::PageInfo::OrHash + ).void + end + attr_writer :page_info + + sig do + params( + data: T::Array[WhopSDK::SocialAccountPost::OrHash], + page_info: + WhopSDK::Models::SocialAccountPostsResponse::PageInfo::OrHash + ).returns(T.attached_class) + end + def self.new(data:, page_info:) + end + + sig do + override.returns( + { + data: T::Array[WhopSDK::SocialAccountPost], + page_info: WhopSDK::Models::SocialAccountPostsResponse::PageInfo + } + ) + end + def to_hash + end + + class PageInfo < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::SocialAccountPostsResponse::PageInfo, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :end_cursor + + sig { returns(T::Boolean) } + attr_accessor :has_next_page + + sig do + params( + end_cursor: T.nilable(String), + has_next_page: T::Boolean + ).returns(T.attached_class) + end + def self.new(end_cursor:, has_next_page:) + end + + sig do + override.returns( + { end_cursor: T.nilable(String), has_next_page: T::Boolean } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/wallet_list_params.rbi b/rbi/whop_sdk/models/stat_list_params.rbi similarity index 79% rename from rbi/whop_sdk/models/wallet_list_params.rbi rename to rbi/whop_sdk/models/stat_list_params.rbi index 3e33368f..84a38159 100644 --- a/rbi/whop_sdk/models/wallet_list_params.rbi +++ b/rbi/whop_sdk/models/stat_list_params.rbi @@ -2,13 +2,13 @@ module WhopSDK module Models - class WalletListParams < WhopSDK::Internal::Type::BaseModel + class StatListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters OrHash = T.type_alias do - T.any(WhopSDK::WalletListParams, WhopSDK::Internal::AnyHash) + T.any(WhopSDK::StatListParams, WhopSDK::Internal::AnyHash) end sig do diff --git a/rbi/whop_sdk/models/stat_list_response.rbi b/rbi/whop_sdk/models/stat_list_response.rbi new file mode 100644 index 00000000..4ed2a88f --- /dev/null +++ b/rbi/whop_sdk/models/stat_list_response.rbi @@ -0,0 +1,159 @@ +# typed: strong + +module WhopSDK + module Models + class StatListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::StatListResponse, WhopSDK::Internal::AnyHash) + end + + # The available metrics. + sig { returns(T::Array[WhopSDK::Models::StatListResponse::Data]) } + attr_accessor :data + + sig do + params( + data: T::Array[WhopSDK::Models::StatListResponse::Data::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The available metrics. + data: + ) + end + + sig do + override.returns( + { data: T::Array[WhopSDK::Models::StatListResponse::Data] } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::StatListResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + # A short description of what the metric measures. + sig { returns(String) } + attr_accessor :description + + # The metric's key. Pass it to GET /stats/{metric} to query its values. + sig { returns(String) } + attr_accessor :key + + # Human-readable display name for the metric. + sig { returns(String) } + attr_accessor :name + + # The properties you can use with this metric — pass one as a filter + # (property=value) to narrow the series, or as breakdown_by=property to split it. + sig { returns(T::Array[String]) } + attr_accessor :properties + + # How to read the metric's values: count is an integer, currency is a decimal + # amount, and percent is a number where 1.6 means 1.6%. + sig do + returns(WhopSDK::Models::StatListResponse::Data::Unit::TaggedSymbol) + end + attr_accessor :unit + + # Snapshot metrics only: the trailing windows you can pass as snapshot_window, for + # example 30d. Absent on live metrics, which use from/to instead. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :windows + + sig { params(windows: T::Array[String]).void } + attr_writer :windows + + sig do + params( + description: String, + key: String, + name: String, + properties: T::Array[String], + unit: WhopSDK::Models::StatListResponse::Data::Unit::OrSymbol, + windows: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # A short description of what the metric measures. + description:, + # The metric's key. Pass it to GET /stats/{metric} to query its values. + key:, + # Human-readable display name for the metric. + name:, + # The properties you can use with this metric — pass one as a filter + # (property=value) to narrow the series, or as breakdown_by=property to split it. + properties:, + # How to read the metric's values: count is an integer, currency is a decimal + # amount, and percent is a number where 1.6 means 1.6%. + unit:, + # Snapshot metrics only: the trailing windows you can pass as snapshot_window, for + # example 30d. Absent on live metrics, which use from/to instead. + windows: nil + ) + end + + sig do + override.returns( + { + description: String, + key: String, + name: String, + properties: T::Array[String], + unit: WhopSDK::Models::StatListResponse::Data::Unit::TaggedSymbol, + windows: T::Array[String] + } + ) + end + def to_hash + end + + # How to read the metric's values: count is an integer, currency is a decimal + # amount, and percent is a number where 1.6 means 1.6%. + module Unit + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::StatListResponse::Data::Unit) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COUNT = + T.let( + :count, + WhopSDK::Models::StatListResponse::Data::Unit::TaggedSymbol + ) + CURRENCY = + T.let( + :currency, + WhopSDK::Models::StatListResponse::Data::Unit::TaggedSymbol + ) + PERCENT = + T.let( + :percent, + WhopSDK::Models::StatListResponse::Data::Unit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::StatListResponse::Data::Unit::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/stat_retrieve_params.rbi b/rbi/whop_sdk/models/stat_retrieve_params.rbi new file mode 100644 index 00000000..67626870 --- /dev/null +++ b/rbi/whop_sdk/models/stat_retrieve_params.rbi @@ -0,0 +1,411 @@ +# typed: strong + +module WhopSDK + module Models + class StatRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::StatRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :metric + + # Start of the date range (YYYY-MM-DD). + sig { returns(Date) } + attr_accessor :from + + # End of the date range (YYYY-MM-DD). + sig { returns(Date) } + attr_accessor :to + + # Filter to a single access level. Pair with breakdown_by=access_level. Available + # on metrics that list access_level. + sig { returns(T.nilable(String)) } + attr_reader :access_level + + sig { params(access_level: String).void } + attr_writer :access_level + + # The account this query concerns, for example biz_AbC123. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # Ad campaign ids (adcamp\_...) to scope the report to; stats are summed across + # them. Available on metrics that list ad_campaign_ids. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :ad_campaign_ids + + sig { params(ad_campaign_ids: T::Array[String]).void } + attr_writer :ad_campaign_ids + + # Ad group ids (adgrp\_...) to scope the report to; stats are summed across them. + # Available on metrics that list ad_group_ids. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :ad_group_ids + + sig { params(ad_group_ids: T::Array[String]).void } + attr_writer :ad_group_ids + + # Ad ids (ad\_...) to scope the report to; stats are summed across them. Available + # on metrics that list ad_ids. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :ad_ids + + sig { params(ad_ids: T::Array[String]).void } + attr_writer :ad_ids + + # Split the metric out by one of its properties — each point gets a breakdown + # array. For example breakdown_by=currency returns an entry for usd, an entry for + # eur, and so on. + sig { returns(T.nilable(String)) } + attr_reader :breakdown_by + + sig { params(breakdown_by: String).void } + attr_writer :breakdown_by + + # Filter to a single card brand, for example visa. A refinement of + # payment_method=card. Available on metrics that list card_network. + sig { returns(T.nilable(String)) } + attr_reader :card_network + + sig { params(card_network: String).void } + attr_writer :card_network + + # Filter to a single balance-activity category, for example payments. Pair with + # breakdown_by=category to split the activity. Available on metrics that list + # category. + sig { returns(T.nilable(String)) } + attr_reader :category + + sig { params(category: String).void } + attr_writer :category + + # Display currency for money metrics — every amount is converted into this ISO + # currency using the exchange rate on each period's date. Defaults to usd. For the + # ads metrics (ad_spend, ad_report), pass the account's ads reporting currency to + # match the ad entity endpoints. Ignored when you filter or break down by currency + # (those report the original transaction currency, unconverted). + sig { returns(T.nilable(String)) } + attr_reader :convert_to + + sig { params(convert_to: String).void } + attr_writer :convert_to + + # Filter to transactions made in this original ISO currency, for example eur — + # reported in that currency, not converted. Pair with breakdown_by=currency to + # split a metric by currency. Available on metrics that list currency. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # Filter to a single fee type. Pair with breakdown_by=fee_type to split fees by + # type. Available on metrics that list fee_type. + sig { returns(T.nilable(String)) } + attr_reader :fee_type + + sig { params(fee_type: String).void } + attr_writer :fee_type + + # How wide each point is. Defaults to day. Snapshot metrics are day-only. + sig do + returns(T.nilable(WhopSDK::StatRetrieveParams::Interval::OrSymbol)) + end + attr_reader :interval + + sig do + params(interval: WhopSDK::StatRetrieveParams::Interval::OrSymbol).void + end + attr_writer :interval + + # Filter to a single most-recent member action. Pair with + # breakdown_by=most_recent_action. Available on metrics that list + # most_recent_action. + sig { returns(T.nilable(String)) } + attr_reader :most_recent_action + + sig { params(most_recent_action: String).void } + attr_writer :most_recent_action + + # Filter to a single payment method, for example card or crypto. Available on + # metrics that list payment_method. + sig { returns(T.nilable(String)) } + attr_reader :payment_method + + sig { params(payment_method: String).void } + attr_writer :payment_method + + # Filter to a single product (access pass id), for example prod_AbC123. Pair with + # breakdown_by=product. Available on metrics that list product. + sig { returns(T.nilable(String)) } + attr_reader :product + + sig { params(product: String).void } + attr_writer :product + + # Filter a referral metric to the businesses attributed to one person you + # referred, for example user_AbC123. Available on metrics that list + # referred_user_id. + sig { returns(T.nilable(String)) } + attr_reader :referred_user_id + + sig { params(referred_user_id: String).void } + attr_writer :referred_user_id + + # Filter to a single wallet-balance segment, for example available. Pair with + # breakdown_by=segment to split the balance. Available on metrics that list + # segment. + sig { returns(T.nilable(String)) } + attr_reader :segment + + sig { params(segment: String).void } + attr_writer :segment + + # Trailing window for snapshot metrics. Only accepted by snapshot metrics (each + # lists its allowed windows in the catalog); defaults to the metric's first + # supported window. Only 30d today. + sig do + returns( + T.nilable(WhopSDK::StatRetrieveParams::SnapshotWindow::OrSymbol) + ) + end + attr_reader :snapshot_window + + sig do + params( + snapshot_window: WhopSDK::StatRetrieveParams::SnapshotWindow::OrSymbol + ).void + end + attr_writer :snapshot_window + + # Filter to a single GMV source, for example payments. Pair with + # breakdown_by=source to split by source. Available on metrics that list source. + sig { returns(T.nilable(String)) } + attr_reader :source + + sig { params(source: String).void } + attr_writer :source + + # Filter to a single membership status. Pair with breakdown_by=status. Available + # on metrics that list status. + sig { returns(T.nilable(String)) } + attr_reader :status + + sig { params(status: String).void } + attr_writer :status + + # IANA time zone to bucket the series in, for example America/New_York. Defaults + # to UTC. Not accepted by snapshot metrics, which are UTC only. + sig { returns(T.nilable(String)) } + attr_reader :time_zone + + sig { params(time_zone: String).void } + attr_writer :time_zone + + sig do + params( + metric: String, + from: Date, + to: Date, + access_level: String, + account_id: String, + ad_campaign_ids: T::Array[String], + ad_group_ids: T::Array[String], + ad_ids: T::Array[String], + breakdown_by: String, + card_network: String, + category: String, + convert_to: String, + currency: String, + fee_type: String, + interval: WhopSDK::StatRetrieveParams::Interval::OrSymbol, + most_recent_action: String, + payment_method: String, + product: String, + referred_user_id: String, + segment: String, + snapshot_window: + WhopSDK::StatRetrieveParams::SnapshotWindow::OrSymbol, + source: String, + status: String, + time_zone: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + metric:, + # Start of the date range (YYYY-MM-DD). + from:, + # End of the date range (YYYY-MM-DD). + to:, + # Filter to a single access level. Pair with breakdown_by=access_level. Available + # on metrics that list access_level. + access_level: nil, + # The account this query concerns, for example biz_AbC123. + account_id: nil, + # Ad campaign ids (adcamp\_...) to scope the report to; stats are summed across + # them. Available on metrics that list ad_campaign_ids. + ad_campaign_ids: nil, + # Ad group ids (adgrp\_...) to scope the report to; stats are summed across them. + # Available on metrics that list ad_group_ids. + ad_group_ids: nil, + # Ad ids (ad\_...) to scope the report to; stats are summed across them. Available + # on metrics that list ad_ids. + ad_ids: nil, + # Split the metric out by one of its properties — each point gets a breakdown + # array. For example breakdown_by=currency returns an entry for usd, an entry for + # eur, and so on. + breakdown_by: nil, + # Filter to a single card brand, for example visa. A refinement of + # payment_method=card. Available on metrics that list card_network. + card_network: nil, + # Filter to a single balance-activity category, for example payments. Pair with + # breakdown_by=category to split the activity. Available on metrics that list + # category. + category: nil, + # Display currency for money metrics — every amount is converted into this ISO + # currency using the exchange rate on each period's date. Defaults to usd. For the + # ads metrics (ad_spend, ad_report), pass the account's ads reporting currency to + # match the ad entity endpoints. Ignored when you filter or break down by currency + # (those report the original transaction currency, unconverted). + convert_to: nil, + # Filter to transactions made in this original ISO currency, for example eur — + # reported in that currency, not converted. Pair with breakdown_by=currency to + # split a metric by currency. Available on metrics that list currency. + currency: nil, + # Filter to a single fee type. Pair with breakdown_by=fee_type to split fees by + # type. Available on metrics that list fee_type. + fee_type: nil, + # How wide each point is. Defaults to day. Snapshot metrics are day-only. + interval: nil, + # Filter to a single most-recent member action. Pair with + # breakdown_by=most_recent_action. Available on metrics that list + # most_recent_action. + most_recent_action: nil, + # Filter to a single payment method, for example card or crypto. Available on + # metrics that list payment_method. + payment_method: nil, + # Filter to a single product (access pass id), for example prod_AbC123. Pair with + # breakdown_by=product. Available on metrics that list product. + product: nil, + # Filter a referral metric to the businesses attributed to one person you + # referred, for example user_AbC123. Available on metrics that list + # referred_user_id. + referred_user_id: nil, + # Filter to a single wallet-balance segment, for example available. Pair with + # breakdown_by=segment to split the balance. Available on metrics that list + # segment. + segment: nil, + # Trailing window for snapshot metrics. Only accepted by snapshot metrics (each + # lists its allowed windows in the catalog); defaults to the metric's first + # supported window. Only 30d today. + snapshot_window: nil, + # Filter to a single GMV source, for example payments. Pair with + # breakdown_by=source to split by source. Available on metrics that list source. + source: nil, + # Filter to a single membership status. Pair with breakdown_by=status. Available + # on metrics that list status. + status: nil, + # IANA time zone to bucket the series in, for example America/New_York. Defaults + # to UTC. Not accepted by snapshot metrics, which are UTC only. + time_zone: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + metric: String, + from: Date, + to: Date, + access_level: String, + account_id: String, + ad_campaign_ids: T::Array[String], + ad_group_ids: T::Array[String], + ad_ids: T::Array[String], + breakdown_by: String, + card_network: String, + category: String, + convert_to: String, + currency: String, + fee_type: String, + interval: WhopSDK::StatRetrieveParams::Interval::OrSymbol, + most_recent_action: String, + payment_method: String, + product: String, + referred_user_id: String, + segment: String, + snapshot_window: + WhopSDK::StatRetrieveParams::SnapshotWindow::OrSymbol, + source: String, + status: String, + time_zone: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # How wide each point is. Defaults to day. Snapshot metrics are day-only. + module Interval + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::StatRetrieveParams::Interval) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOUR = T.let(:hour, WhopSDK::StatRetrieveParams::Interval::TaggedSymbol) + DAY = T.let(:day, WhopSDK::StatRetrieveParams::Interval::TaggedSymbol) + WEEK = T.let(:week, WhopSDK::StatRetrieveParams::Interval::TaggedSymbol) + MONTH = + T.let(:month, WhopSDK::StatRetrieveParams::Interval::TaggedSymbol) + YEAR = T.let(:year, WhopSDK::StatRetrieveParams::Interval::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::StatRetrieveParams::Interval::TaggedSymbol] + ) + end + def self.values + end + end + + # Trailing window for snapshot metrics. Only accepted by snapshot metrics (each + # lists its allowed windows in the catalog); defaults to the metric's first + # supported window. Only 30d today. + module SnapshotWindow + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::StatRetrieveParams::SnapshotWindow) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SNAPSHOT_WINDOW_30D = + T.let( + :"30d", + WhopSDK::StatRetrieveParams::SnapshotWindow::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::StatRetrieveParams::SnapshotWindow::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/stat_retrieve_response.rbi b/rbi/whop_sdk/models/stat_retrieve_response.rbi new file mode 100644 index 00000000..1b1448d1 --- /dev/null +++ b/rbi/whop_sdk/models/stat_retrieve_response.rbi @@ -0,0 +1,198 @@ +# typed: strong + +module WhopSDK + module Models + class StatRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::StatRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(WhopSDK::Models::StatRetrieveResponse::Data) } + attr_reader :data + + sig do + params(data: WhopSDK::Models::StatRetrieveResponse::Data::OrHash).void + end + attr_writer :data + + sig do + params( + data: WhopSDK::Models::StatRetrieveResponse::Data::OrHash + ).returns(T.attached_class) + end + def self.new(data:) + end + + sig do + override.returns({ data: WhopSDK::Models::StatRetrieveResponse::Data }) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::StatRetrieveResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + # One entry per period, oldest first. + sig do + returns(T::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point]) + end + attr_accessor :points + + # ISO currency the values are denominated in. Present for currency-unit metrics: + # the convert_to currency, or usd. + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig do + params( + points: + T::Array[ + WhopSDK::Models::StatRetrieveResponse::Data::Point::OrHash + ], + currency: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # One entry per period, oldest first. + points:, + # ISO currency the values are denominated in. Present for currency-unit metrics: + # the convert_to currency, or usd. + currency: nil + ) + end + + sig do + override.returns( + { + points: + T::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point], + currency: T.nilable(String) + } + ) + end + def to_hash + end + + class Point < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::StatRetrieveResponse::Data::Point, + WhopSDK::Internal::AnyHash + ) + end + + # Unix timestamp (seconds) of the period start. + sig { returns(Integer) } + attr_accessor :timestamp + + # The metric's value for this period, in the metric's unit. + sig { returns(T.nilable(Float)) } + attr_accessor :value + + # Present only when broken down: one entry per property value in this period. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown + ] + ) + ) + end + attr_reader :breakdown + + sig do + params( + breakdown: + T::Array[ + WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown::OrHash + ] + ).void + end + attr_writer :breakdown + + sig do + params( + timestamp: Integer, + value: T.nilable(Float), + breakdown: + T::Array[ + WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Unix timestamp (seconds) of the period start. + timestamp:, + # The metric's value for this period, in the metric's unit. + value:, + # Present only when broken down: one entry per property value in this period. + breakdown: nil + ) + end + + sig do + override.returns( + { + timestamp: Integer, + value: T.nilable(Float), + breakdown: + T::Array[ + WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown + ] + } + ) + end + def to_hash + end + + class Breakdown < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown, + WhopSDK::Internal::AnyHash + ) + end + + # The property value, for example usd or visa. + sig { returns(String) } + attr_accessor :name + + # The metric's value for this entry. + sig { returns(T.nilable(Float)) } + attr_accessor :value + + sig do + params(name: String, value: T.nilable(Float)).returns( + T.attached_class + ) + end + def self.new( + # The property value, for example usd or visa. + name:, + # The metric's value for this entry. + value: + ) + end + + sig { override.returns({ name: String, value: T.nilable(Float) }) } + def to_hash + end + end + 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 d1ed16e5..073ffd7f 100644 --- a/rbi/whop_sdk/models/swap_create_params.rbi +++ b/rbi/whop_sdk/models/swap_create_params.rbi @@ -15,24 +15,29 @@ module WhopSDK sig { returns(String) } attr_accessor :account_id - # Input token amount. + # Source token amount. sig { returns(String) } attr_accessor :amount - # Source token contract address. + # Source token contract address or ticker symbol, such as "USDT". sig { returns(String) } attr_accessor :from_token - # Destination token contract address. + # Destination token contract address or ticker symbol, such as "XAUT". sig { returns(String) } attr_accessor :to_token + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. sig { returns(T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants)) } attr_accessor :from_chain + # Maximum slippage tolerance in basis points. sig { returns(T.nilable(Integer)) } attr_accessor :slippage_bps + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. sig { returns(T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants)) } attr_accessor :to_chain @@ -51,14 +56,19 @@ module WhopSDK def self.new( # Business or user account ID (biz*\* / user*\*). account_id:, - # Input token amount. + # Source token amount. amount:, - # Source token contract address. + # Source token contract address or ticker symbol, such as "USDT". from_token:, - # Destination token contract address. + # Destination token contract address or ticker symbol, such as "XAUT". to_token:, + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. from_chain: nil, + # Maximum slippage tolerance in basis points. slippage_bps: nil, + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. to_chain: nil, request_options: {} ) @@ -82,6 +92,8 @@ module WhopSDK def to_hash end + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. module FromChain extend WhopSDK::Internal::Type::Union @@ -96,6 +108,8 @@ module WhopSDK end end + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. module ToChain extend WhopSDK::Internal::Type::Union diff --git a/rbi/whop_sdk/models/swap_create_quote_params.rbi b/rbi/whop_sdk/models/swap_create_quote_params.rbi index 0c869d1d..ea585010 100644 --- a/rbi/whop_sdk/models/swap_create_quote_params.rbi +++ b/rbi/whop_sdk/models/swap_create_quote_params.rbi @@ -11,38 +11,46 @@ module WhopSDK T.any(WhopSDK::SwapCreateQuoteParams, WhopSDK::Internal::AnyHash) end - # Input token amount. + # Source token amount. sig { returns(String) } attr_accessor :amount - # Source token contract address. + # Source token contract address or ticker symbol, such as "USDT". sig { returns(String) } attr_accessor :from_token - # Destination token contract address. + # Destination token contract address or ticker symbol, such as "XAUT". sig { returns(String) } attr_accessor :to_token + # Source wallet address used for the quote. sig { returns(T.nilable(String)) } attr_accessor :from_address + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. sig do returns(T.nilable(WhopSDK::SwapCreateQuoteParams::FromChain::Variants)) end attr_accessor :from_chain + # Metadata to include with the quote response. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } attr_writer :metadata + # Maximum slippage tolerance in basis points. sig { returns(T.nilable(Integer)) } attr_accessor :slippage_bps + # Destination wallet address used for the quote. sig { returns(T.nilable(String)) } attr_accessor :to_address + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. sig do returns(T.nilable(WhopSDK::SwapCreateQuoteParams::ToChain::Variants)) end @@ -65,17 +73,25 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # Input token amount. + # Source token amount. amount:, - # Source token contract address. + # Source token contract address or ticker symbol, such as "USDT". from_token:, - # Destination token contract address. + # Destination token contract address or ticker symbol, such as "XAUT". to_token:, + # Source wallet address used for the quote. from_address: nil, + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. from_chain: nil, + # Metadata to include with the quote response. metadata: nil, + # Maximum slippage tolerance in basis points. slippage_bps: nil, + # Destination wallet address used for the quote. to_address: nil, + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. to_chain: nil, request_options: {} ) @@ -102,6 +118,8 @@ module WhopSDK def to_hash end + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. module FromChain extend WhopSDK::Internal::Type::Union @@ -116,6 +134,8 @@ module WhopSDK end end + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. module ToChain extend WhopSDK::Internal::Type::Union diff --git a/rbi/whop_sdk/models/swap_create_quote_response.rbi b/rbi/whop_sdk/models/swap_create_quote_response.rbi index 227f84b6..e386b47e 100644 --- a/rbi/whop_sdk/models/swap_create_quote_response.rbi +++ b/rbi/whop_sdk/models/swap_create_quote_response.rbi @@ -11,18 +11,23 @@ module WhopSDK ) end + # Source token amount used for the quote. sig { returns(String) } attr_accessor :amount_in + # Estimated destination token amount. sig { returns(String) } attr_accessor :amount_out + # Whop fee in basis points. sig { returns(Integer) } attr_accessor :fee_bps + # Resolved source token details. sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :from_token + # Metadata from the request. sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :metadata @@ -31,30 +36,38 @@ module WhopSDK end attr_accessor :object + # Quoted exchange rate. sig { returns(String) } attr_accessor :rate + # Resolved destination token details. sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :to_token + # Minimum destination amount after slippage. sig { returns(T.nilable(String)) } attr_reader :amount_out_min sig { params(amount_out_min: String).void } attr_writer :amount_out_min + # Estimated bridge fee for cross-chain swaps. sig { returns(T.nilable(String)) } attr_accessor :bridge_fee + # Estimated time for the swap to complete. sig { returns(T.nilable(Integer)) } attr_accessor :estimated_duration_seconds + # Source wallet address used for the quote. sig { returns(T.nilable(String)) } attr_accessor :from_address + # Whether the source token needs approval before swapping. sig { returns(T.nilable(T::Boolean)) } attr_accessor :requires_token_approval + # Destination wallet address used for the quote. sig { returns(T.nilable(String)) } attr_accessor :to_address @@ -77,19 +90,32 @@ module WhopSDK ).returns(T.attached_class) end def self.new( + # Source token amount used for the quote. amount_in:, + # Estimated destination token amount. amount_out:, + # Whop fee in basis points. fee_bps:, + # Resolved source token details. from_token:, + # Metadata from the request. metadata:, object:, + # Quoted exchange rate. rate:, + # Resolved destination token details. to_token:, + # Minimum destination amount after slippage. amount_out_min: nil, + # Estimated bridge fee for cross-chain swaps. bridge_fee: nil, + # Estimated time for the swap to complete. estimated_duration_seconds: nil, + # Source wallet address used for the quote. from_address: nil, + # Whether the source token needs approval before swapping. requires_token_approval: nil, + # Destination wallet address used for the quote. to_address: nil ) end diff --git a/rbi/whop_sdk/models/swap_create_response.rbi b/rbi/whop_sdk/models/swap_create_response.rbi index 92668357..c5392e4a 100644 --- a/rbi/whop_sdk/models/swap_create_response.rbi +++ b/rbi/whop_sdk/models/swap_create_response.rbi @@ -8,33 +8,43 @@ module WhopSDK T.any(WhopSDK::Models::SwapCreateResponse, WhopSDK::Internal::AnyHash) end + # Swap ID. Poll `GET /swaps/:id` for status. + sig { returns(String) } + attr_accessor :id + + # Account ID that owns the wallet used for the swap. sig { returns(String) } attr_accessor :account_id sig { returns(WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol) } attr_accessor :object + # Initial swap status. sig { returns(String) } attr_accessor :status + # Expected destination token amount. sig { returns(T.nilable(String)) } attr_reader :amount_out_expected sig { params(amount_out_expected: String).void } attr_writer :amount_out_expected + # Minimum destination amount after slippage. sig { returns(T.nilable(String)) } attr_reader :amount_out_min sig { params(amount_out_min: String).void } attr_writer :amount_out_min + # Quoted exchange rate used to create the swap. sig { returns(T.nilable(String)) } attr_reader :rate sig { params(rate: String).void } attr_writer :rate + # Destination chain for the swap. sig { returns(T.nilable(String)) } attr_reader :to_chain @@ -43,6 +53,7 @@ module WhopSDK sig do params( + id: String, account_id: String, object: WhopSDK::Models::SwapCreateResponse::Object::OrSymbol, status: String, @@ -53,12 +64,20 @@ module WhopSDK ).returns(T.attached_class) end def self.new( + # Swap ID. Poll `GET /swaps/:id` for status. + id:, + # Account ID that owns the wallet used for the swap. account_id:, object:, + # Initial swap status. status:, + # Expected destination token amount. amount_out_expected: nil, + # Minimum destination amount after slippage. amount_out_min: nil, + # Quoted exchange rate used to create the swap. rate: nil, + # Destination chain for the swap. to_chain: nil ) end @@ -66,6 +85,7 @@ module WhopSDK sig do override.returns( { + id: String, account_id: String, object: WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol, status: String, diff --git a/rbi/whop_sdk/models/swap_list_params.rbi b/rbi/whop_sdk/models/swap_list_params.rbi new file mode 100644 index 00000000..d7f296f3 --- /dev/null +++ b/rbi/whop_sdk/models/swap_list_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module WhopSDK + module Models + class SwapListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SwapListParams, WhopSDK::Internal::AnyHash) + end + + # Business or user account ID (biz*\* / user*\*). + 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( + # Business or user account ID (biz*\* / user*\*). + 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_list_response.rbi b/rbi/whop_sdk/models/swap_list_response.rbi new file mode 100644 index 00000000..09e2fd89 --- /dev/null +++ b/rbi/whop_sdk/models/swap_list_response.rbi @@ -0,0 +1,137 @@ +# typed: strong + +module WhopSDK + module Models + class SwapListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::SwapListResponse, WhopSDK::Internal::AnyHash) + end + + # Swaps returned for this account. + sig { returns(T::Array[WhopSDK::Models::SwapListResponse::Data]) } + attr_accessor :data + + sig do + params( + data: T::Array[WhopSDK::Models::SwapListResponse::Data::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Swaps returned for this account. + data: + ) + end + + sig do + override.returns( + { data: T::Array[WhopSDK::Models::SwapListResponse::Data] } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::SwapListResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + # Swap ID. + sig { returns(String) } + attr_accessor :id + + # Account ID that owns the wallet used for the swap. + sig { returns(String) } + attr_accessor :account_id + + sig do + returns(WhopSDK::Models::SwapListResponse::Data::Object::TaggedSymbol) + end + attr_accessor :object + + # Current swap status. + sig { returns(String) } + attr_accessor :status + + # On-chain transaction hashes produced by the swap. + sig { returns(T::Array[String]) } + attr_accessor :tx_hashes + + # Latest error returned for a failed swap. + sig { returns(T.nilable(String)) } + attr_accessor :error + + sig do + params( + id: String, + account_id: String, + object: WhopSDK::Models::SwapListResponse::Data::Object::OrSymbol, + status: String, + tx_hashes: T::Array[String], + error: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Swap ID. + id:, + # Account ID that owns the wallet used for the swap. + account_id:, + object:, + # Current swap status. + status:, + # On-chain transaction hashes produced by the swap. + tx_hashes:, + # Latest error returned for a failed swap. + error: nil + ) + end + + sig do + override.returns( + { + id: String, + account_id: String, + object: + WhopSDK::Models::SwapListResponse::Data::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::SwapListResponse::Data::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SWAP = + T.let( + :swap, + WhopSDK::Models::SwapListResponse::Data::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::SwapListResponse::Data::Object::TaggedSymbol + ] + ) + end + def self.values + end + 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 index 12678a8a..9158271a 100644 --- a/rbi/whop_sdk/models/swap_retrieve_params.rbi +++ b/rbi/whop_sdk/models/swap_retrieve_params.rbi @@ -11,26 +11,21 @@ module WhopSDK T.any(WhopSDK::SwapRetrieveParams, WhopSDK::Internal::AnyHash) end - # Business or user account ID (biz*\* / user*\*). sig { returns(String) } - attr_accessor :account_id + attr_accessor :id sig do params( - account_id: String, + id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new( - # Business or user account ID (biz*\* / user*\*). - account_id:, - request_options: {} - ) + def self.new(id:, request_options: {}) end sig do override.returns( - { account_id: String, request_options: WhopSDK::RequestOptions } + { id: String, request_options: WhopSDK::RequestOptions } ) end def to_hash diff --git a/rbi/whop_sdk/models/swap_retrieve_response.rbi b/rbi/whop_sdk/models/swap_retrieve_response.rbi index 8e9f1209..5f544d57 100644 --- a/rbi/whop_sdk/models/swap_retrieve_response.rbi +++ b/rbi/whop_sdk/models/swap_retrieve_response.rbi @@ -11,6 +11,11 @@ module WhopSDK ) end + # Swap ID. + sig { returns(String) } + attr_accessor :id + + # Account ID that owns the wallet used for the swap. sig { returns(String) } attr_accessor :account_id @@ -19,17 +24,21 @@ module WhopSDK end attr_accessor :object + # Current swap status. sig { returns(String) } attr_accessor :status + # On-chain transaction hashes produced by the swap. sig { returns(T::Array[String]) } attr_accessor :tx_hashes + # Latest error returned for a failed swap. sig { returns(T.nilable(String)) } attr_accessor :error sig do params( + id: String, account_id: String, object: WhopSDK::Models::SwapRetrieveResponse::Object::OrSymbol, status: String, @@ -37,12 +46,25 @@ module WhopSDK error: T.nilable(String) ).returns(T.attached_class) end - def self.new(account_id:, object:, status:, tx_hashes:, error: nil) + def self.new( + # Swap ID. + id:, + # Account ID that owns the wallet used for the swap. + account_id:, + object:, + # Current swap status. + status:, + # On-chain transaction hashes produced by the swap. + tx_hashes:, + # Latest error returned for a failed swap. + error: nil + ) end sig do override.returns( { + id: String, account_id: String, object: WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol, status: String, diff --git a/rbi/whop_sdk/models/tax_identifier_type.rbi b/rbi/whop_sdk/models/tax_identifier_type.rbi index e6fe8da7..de19bc01 100644 --- a/rbi/whop_sdk/models/tax_identifier_type.rbi +++ b/rbi/whop_sdk/models/tax_identifier_type.rbi @@ -12,6 +12,7 @@ module WhopSDK AD_NRT = T.let(:ad_nrt, WhopSDK::TaxIdentifierType::TaggedSymbol) AO_TIN = T.let(:ao_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) AR_CUIT = T.let(:ar_cuit, WhopSDK::TaxIdentifierType::TaggedSymbol) + AL_TIN = T.let(:al_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) AM_TIN = T.let(:am_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) AW_TIN = T.let(:aw_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) AU_ABN = T.let(:au_abn, WhopSDK::TaxIdentifierType::TaggedSymbol) @@ -52,6 +53,7 @@ module WhopSDK ET_TIN = T.let(:et_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) EU_OSS_VAT = T.let(:eu_oss_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) GE_VAT = T.let(:ge_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + GH_TIN = T.let(:gh_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) DE_STN = T.let(:de_stn, WhopSDK::TaxIdentifierType::TaggedSymbol) GB_VAT = T.let(:gb_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) GN_NIF = T.let(:gn_nif, WhopSDK::TaxIdentifierType::TaggedSymbol) diff --git a/rbi/whop_sdk/models/transfer.rbi b/rbi/whop_sdk/models/transfer.rbi deleted file mode 100644 index 1a05c83d..00000000 --- a/rbi/whop_sdk/models/transfer.rbi +++ /dev/null @@ -1,407 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class Transfer < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias { T.any(WhopSDK::Transfer, WhopSDK::Internal::AnyHash) } - - # The unique identifier for the credit transaction transfer. - sig { returns(String) } - attr_accessor :id - - # The transfer amount in the currency specified by the currency field. For - # example, 10.43 represents $10.43 USD. - sig { returns(Float) } - attr_accessor :amount - - # The datetime the credit transaction transfer was created. - sig { returns(Time) } - attr_accessor :created_at - - # The currency in which this transfer amount is denominated. - sig { returns(WhopSDK::Currency::TaggedSymbol) } - attr_accessor :currency - - # The entity receiving the transferred funds. - sig { returns(T.nilable(WhopSDK::Transfer::Destination::Variants)) } - attr_accessor :destination - - # The unique identifier of the ledger account receiving the funds. - sig { returns(String) } - attr_accessor :destination_ledger_account_id - - # The flat fee amount deducted from this transfer, in the transfer's currency. - # Null if no flat fee was applied. - sig { returns(T.nilable(Float)) } - attr_accessor :fee_amount - - # Custom key-value pairs attached to this transfer. Maximum 50 keys, 500 - # characters per key, 5000 characters per value. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :metadata - - # A free-text note attached to this transfer by the sender. Null if no note was - # provided. - sig { returns(T.nilable(String)) } - attr_accessor :notes - - # The entity that sent the transferred funds. - sig { returns(T.nilable(WhopSDK::Transfer::Origin::Variants)) } - attr_accessor :origin - - # The unique identifier of the ledger account that sent the funds. - sig { returns(String) } - attr_accessor :origin_ledger_account_id - - # A transfer of credit between two ledger accounts. - sig do - params( - id: String, - amount: Float, - created_at: Time, - currency: WhopSDK::Currency::OrSymbol, - destination: - T.nilable( - T.any( - WhopSDK::Transfer::Destination::User::OrHash, - WhopSDK::Transfer::Destination::Company::OrHash - ) - ), - destination_ledger_account_id: String, - fee_amount: T.nilable(Float), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - notes: T.nilable(String), - origin: - T.nilable( - T.any( - WhopSDK::Transfer::Origin::User::OrHash, - WhopSDK::Transfer::Origin::Company::OrHash - ) - ), - origin_ledger_account_id: String - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the credit transaction transfer. - id:, - # The transfer amount in the currency specified by the currency field. For - # example, 10.43 represents $10.43 USD. - amount:, - # The datetime the credit transaction transfer was created. - created_at:, - # The currency in which this transfer amount is denominated. - currency:, - # The entity receiving the transferred funds. - destination:, - # The unique identifier of the ledger account receiving the funds. - destination_ledger_account_id:, - # The flat fee amount deducted from this transfer, in the transfer's currency. - # Null if no flat fee was applied. - fee_amount:, - # Custom key-value pairs attached to this transfer. Maximum 50 keys, 500 - # characters per key, 5000 characters per value. - metadata:, - # A free-text note attached to this transfer by the sender. Null if no note was - # provided. - notes:, - # The entity that sent the transferred funds. - origin:, - # The unique identifier of the ledger account that sent the funds. - origin_ledger_account_id: - ) - end - - sig do - override.returns( - { - id: String, - amount: Float, - created_at: Time, - currency: WhopSDK::Currency::TaggedSymbol, - destination: T.nilable(WhopSDK::Transfer::Destination::Variants), - destination_ledger_account_id: String, - fee_amount: T.nilable(Float), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - notes: T.nilable(String), - origin: T.nilable(WhopSDK::Transfer::Origin::Variants), - origin_ledger_account_id: String - } - ) - end - def to_hash - end - - # The entity receiving the transferred funds. - module Destination - extend WhopSDK::Internal::Type::Union - - Variants = - T.type_alias do - T.nilable( - T.any( - WhopSDK::Transfer::Destination::User, - WhopSDK::Transfer::Destination::Company - ) - ) - end - - class User < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Transfer::Destination::User, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the user. - sig { returns(String) } - attr_accessor :id - - # The user's display name shown on their public profile. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The typename of this object - sig { returns(Symbol) } - attr_accessor :typename - - # 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, - name: T.nilable(String), - username: String, - typename: Symbol - ).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:, - # The typename of this object - typename: :User - ) - end - - sig do - override.returns( - { - id: String, - name: T.nilable(String), - typename: Symbol, - username: String - } - ) - end - def to_hash - end - end - - class Company < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Transfer::Destination::Company, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the company. - sig { returns(String) } - attr_accessor :id - - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). - sig { returns(String) } - attr_accessor :route - - # The display name of the company shown to customers. - sig { returns(String) } - attr_accessor :title - - # The typename of this object - sig { returns(Symbol) } - attr_accessor :typename - - # A company is a seller on Whop. Companies own products, manage members, and - # receive payouts. - sig do - params( - id: String, - route: String, - title: String, - typename: Symbol - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the company. - id:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). - route:, - # The display name of the company shown to customers. - title:, - # The typename of this object - typename: :Company - ) - end - - sig do - override.returns( - { id: String, route: String, title: String, typename: Symbol } - ) - end - def to_hash - end - end - - sig do - override.returns(T::Array[WhopSDK::Transfer::Destination::Variants]) - end - def self.variants - end - end - - # The entity that sent the transferred funds. - module Origin - extend WhopSDK::Internal::Type::Union - - Variants = - T.type_alias do - T.nilable( - T.any( - WhopSDK::Transfer::Origin::User, - WhopSDK::Transfer::Origin::Company - ) - ) - end - - class User < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Transfer::Origin::User, WhopSDK::Internal::AnyHash) - end - - # The unique identifier for the user. - sig { returns(String) } - attr_accessor :id - - # The user's display name shown on their public profile. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The typename of this object - sig { returns(Symbol) } - attr_accessor :typename - - # 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, - name: T.nilable(String), - username: String, - typename: Symbol - ).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:, - # The typename of this object - typename: :User - ) - end - - sig do - override.returns( - { - id: String, - name: T.nilable(String), - typename: Symbol, - username: String - } - ) - end - def to_hash - end - end - - class Company < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Transfer::Origin::Company, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the company. - sig { returns(String) } - attr_accessor :id - - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). - sig { returns(String) } - attr_accessor :route - - # The display name of the company shown to customers. - sig { returns(String) } - attr_accessor :title - - # The typename of this object - sig { returns(Symbol) } - attr_accessor :typename - - # A company is a seller on Whop. Companies own products, manage members, and - # receive payouts. - sig do - params( - id: String, - route: String, - title: String, - typename: Symbol - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the company. - id:, - # The URL slug for the company's store page (e.g., 'pickaxe' in whop.com/pickaxe). - route:, - # The display name of the company shown to customers. - title:, - # The typename of this object - typename: :Company - ) - end - - sig do - override.returns( - { id: String, route: String, title: String, typename: Symbol } - ) - end - def to_hash - end - end - - sig { override.returns(T::Array[WhopSDK::Transfer::Origin::Variants]) } - def self.variants - end - end - end - end -end diff --git a/rbi/whop_sdk/models/transfer_create_params.rbi b/rbi/whop_sdk/models/transfer_create_params.rbi index c4abffba..9ea1e97f 100644 --- a/rbi/whop_sdk/models/transfer_create_params.rbi +++ b/rbi/whop_sdk/models/transfer_create_params.rbi @@ -11,75 +11,102 @@ module WhopSDK T.any(WhopSDK::TransferCreateParams, WhopSDK::Internal::AnyHash) end - # The amount to transfer in the specified currency. For example, 25.00 for $25.00 - # USD. + # The amount to move, in the transfer currency. For example 25.00. sig { returns(Float) } attr_accessor :amount - # The currency of the transfer amount, such as 'usd'. - sig { returns(WhopSDK::Currency::OrSymbol) } - attr_accessor :currency - - # The identifier of the account receiving the funds. Accepts a user ID - # ('user_xxx'), company ID ('biz_xxx'), ledger account ID ('ldgr_xxx'), or an - # email address — emails without an existing Whop user trigger a placeholder-user - # signup. - sig { returns(String) } - attr_accessor :destination_id - - # The identifier of the account sending the funds. Accepts a user ID ('user_xxx'), - # company ID ('biz_xxx'), or ledger account ID ('ldgr_xxx'). + # The account sending the funds. A user ID (user_xxx), account ID (biz_xxx), or + # ledger account ID (ldgr_xxx). sig { returns(String) } attr_accessor :origin_id - # A unique key to prevent duplicate transfers. Use a UUID or similar unique - # string. + # Currency, such as `usd`. Required for ledger transfers. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # The recipient. Required for ledger and wallet*send (a user*/biz*/ldgr* ID, or — + # for sends — an email). Omit for claim_link. + sig { returns(T.nilable(String)) } + attr_reader :destination_id + + sig { params(destination_id: String).void } + attr_writer :destination_id + + # claim_link only. Link expiry as an ISO 8601 timestamp. Defaults to 24 hours from + # creation. + sig { returns(T.nilable(Time)) } + attr_accessor :expires_at + + # Ledger transfers only. A unique key to prevent duplicate transfers. sig { returns(T.nilable(String)) } attr_accessor :idempotence_key - # A JSON object of custom metadata to attach to the transfer for tracking - # purposes. + # Ledger transfers only. Custom key-value pairs attached to the transfer. Max 50 + # keys, 100 chars per key, 500 chars per string value. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata - # A short note describing the transfer, up to 50 characters. + # Ledger transfers only. A short note describing the transfer. sig { returns(T.nilable(String)) } attr_accessor :notes + # claim_link only. How many different users can claim the link. Defaults to 1. + sig { returns(T.nilable(Integer)) } + attr_reader :redeemable_count + + sig { params(redeemable_count: Integer).void } + attr_writer :redeemable_count + + # The kind of money movement. Defaults to ledger. + sig { returns(T.nilable(WhopSDK::TransferCreateParams::Type::OrSymbol)) } + attr_reader :type + + sig { params(type: WhopSDK::TransferCreateParams::Type::OrSymbol).void } + attr_writer :type + sig do params( amount: Float, - currency: WhopSDK::Currency::OrSymbol, - destination_id: String, origin_id: String, + currency: String, + destination_id: String, + expires_at: T.nilable(Time), idempotence_key: T.nilable(String), metadata: T.nilable(T::Hash[Symbol, T.anything]), notes: T.nilable(String), + redeemable_count: Integer, + type: WhopSDK::TransferCreateParams::Type::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The amount to transfer in the specified currency. For example, 25.00 for $25.00 - # USD. + # The amount to move, in the transfer currency. For example 25.00. amount:, - # The currency of the transfer amount, such as 'usd'. - currency:, - # The identifier of the account receiving the funds. Accepts a user ID - # ('user_xxx'), company ID ('biz_xxx'), ledger account ID ('ldgr_xxx'), or an - # email address — emails without an existing Whop user trigger a placeholder-user - # signup. - destination_id:, - # The identifier of the account sending the funds. Accepts a user ID ('user_xxx'), - # company ID ('biz_xxx'), or ledger account ID ('ldgr_xxx'). + # The account sending the funds. A user ID (user_xxx), account ID (biz_xxx), or + # ledger account ID (ldgr_xxx). origin_id:, - # A unique key to prevent duplicate transfers. Use a UUID or similar unique - # string. + # Currency, such as `usd`. Required for ledger transfers. + currency: nil, + # The recipient. Required for ledger and wallet*send (a user*/biz*/ldgr* ID, or — + # for sends — an email). Omit for claim_link. + destination_id: nil, + # claim_link only. Link expiry as an ISO 8601 timestamp. Defaults to 24 hours from + # creation. + expires_at: nil, + # Ledger transfers only. A unique key to prevent duplicate transfers. idempotence_key: nil, - # A JSON object of custom metadata to attach to the transfer for tracking - # purposes. + # Ledger transfers only. Custom key-value pairs attached to the transfer. Max 50 + # keys, 100 chars per key, 500 chars per string value. metadata: nil, - # A short note describing the transfer, up to 50 characters. + # Ledger transfers only. A short note describing the transfer. notes: nil, + # claim_link only. How many different users can claim the link. Defaults to 1. + redeemable_count: nil, + # The kind of money movement. Defaults to ledger. + type: nil, request_options: {} ) end @@ -88,18 +115,45 @@ module WhopSDK override.returns( { amount: Float, - currency: WhopSDK::Currency::OrSymbol, - destination_id: String, origin_id: String, + currency: String, + destination_id: String, + expires_at: T.nilable(Time), idempotence_key: T.nilable(String), metadata: T.nilable(T::Hash[Symbol, T.anything]), notes: T.nilable(String), + redeemable_count: Integer, + type: WhopSDK::TransferCreateParams::Type::OrSymbol, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # The kind of money movement. Defaults to ledger. + module Type + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::TransferCreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LEDGER = + T.let(:ledger, WhopSDK::TransferCreateParams::Type::TaggedSymbol) + WALLET_SEND = + T.let(:wallet_send, WhopSDK::TransferCreateParams::Type::TaggedSymbol) + CLAIM_LINK = + T.let(:claim_link, WhopSDK::TransferCreateParams::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::TransferCreateParams::Type::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/transfer_create_response.rbi b/rbi/whop_sdk/models/transfer_create_response.rbi new file mode 100644 index 00000000..c18a923b --- /dev/null +++ b/rbi/whop_sdk/models/transfer_create_response.rbi @@ -0,0 +1,767 @@ +# typed: strong + +module WhopSDK + module Models + # A transfer of credit between two ledger accounts. + module TransferCreateResponse + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer, + WhopSDK::Models::TransferCreateResponse::Send, + WhopSDK::Models::TransferCreateResponse::ClaimLink + ) + end + + class Transfer < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer, + WhopSDK::Internal::AnyHash + ) + end + + # Transfer ID. + sig { returns(String) } + attr_accessor :id + + # Transfer amount. + sig { returns(Float) } + attr_accessor :amount + + # When the transfer was created. + sig { returns(Time) } + attr_accessor :created_at + + # Transfer currency. + sig { returns(String) } + attr_accessor :currency + + # Account or user receiving funds. + sig do + returns( + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Variants + ) + end + attr_accessor :destination + + # Destination ledger account ID. + sig { returns(String) } + attr_accessor :destination_ledger_account_id + + # Account or user sending funds. + sig do + returns( + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Variants + ) + end + attr_accessor :origin + + # Source ledger account ID. + sig { returns(String) } + attr_accessor :origin_ledger_account_id + + # Fee charged for the transfer. + sig { returns(T.nilable(Float)) } + attr_accessor :fee_amount + + # Custom metadata attached to the transfer. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + + # Transfer note. + sig { returns(T.nilable(String)) } + attr_accessor :notes + + # A transfer of credit between two ledger accounts. + sig do + params( + id: String, + amount: Float, + created_at: Time, + currency: String, + destination: + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Company::OrHash, + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::User::OrHash + ), + destination_ledger_account_id: String, + origin: + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Company::OrHash, + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::User::OrHash + ), + origin_ledger_account_id: String, + fee_amount: T.nilable(Float), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + notes: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Transfer ID. + id:, + # Transfer amount. + amount:, + # When the transfer was created. + created_at:, + # Transfer currency. + currency:, + # Account or user receiving funds. + destination:, + # Destination ledger account ID. + destination_ledger_account_id:, + # Account or user sending funds. + origin:, + # Source ledger account ID. + origin_ledger_account_id:, + # Fee charged for the transfer. + fee_amount: nil, + # Custom metadata attached to the transfer. + metadata: nil, + # Transfer note. + notes: nil + ) + end + + sig do + override.returns( + { + id: String, + amount: Float, + created_at: Time, + currency: String, + destination: + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Variants, + destination_ledger_account_id: String, + origin: + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Variants, + origin_ledger_account_id: String, + fee_amount: T.nilable(Float), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + notes: T.nilable(String) + } + ) + end + def to_hash + end + + # Account or user receiving funds. + module Destination + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Company, + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::User + ) + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Company, + WhopSDK::Internal::AnyHash + ) + end + + # Account ID. + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :typename + + # Account route. + sig { returns(T.nilable(String)) } + attr_accessor :route + + # Account display name. + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + route: T.nilable(String), + title: T.nilable(String), + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account ID. + id:, + # Account route. + route: nil, + # Account display name. + title: nil, + typename: :Company + ) + end + + sig do + override.returns( + { + id: String, + typename: Symbol, + route: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::User, + WhopSDK::Internal::AnyHash + ) + end + + # User ID. + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :typename + + # User display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User's username. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + sig do + params( + id: String, + name: T.nilable(String), + username: String, + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # User ID. + id:, + # User display name. + name: nil, + # User's username. + username: nil, + typename: :User + ) + end + + sig do + override.returns( + { + id: String, + typename: Symbol, + name: T.nilable(String), + username: String + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Variants + ] + ) + end + def self.variants + end + end + + # Account or user sending funds. + module Origin + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Company, + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::User + ) + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Company, + WhopSDK::Internal::AnyHash + ) + end + + # Account ID. + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :typename + + # Account route. + sig { returns(T.nilable(String)) } + attr_accessor :route + + # Account display name. + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + route: T.nilable(String), + title: T.nilable(String), + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account ID. + id:, + # Account route. + route: nil, + # Account display name. + title: nil, + typename: :Company + ) + end + + sig do + override.returns( + { + id: String, + typename: Symbol, + route: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::User, + WhopSDK::Internal::AnyHash + ) + end + + # User ID. + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :typename + + # User display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User's username. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + sig do + params( + id: String, + name: T.nilable(String), + username: String, + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # User ID. + id:, + # User display name. + name: nil, + # User's username. + username: nil, + typename: :User + ) + end + + sig do + override.returns( + { + id: String, + typename: Symbol, + name: T.nilable(String), + username: String + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Variants + ] + ) + end + def self.variants + end + end + end + + class Send < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Send, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(WhopSDK::Models::TransferCreateResponse::Send::Destination) + end + attr_reader :destination + + sig do + params( + destination: + WhopSDK::Models::TransferCreateResponse::Send::Destination::OrHash + ).void + end + attr_writer :destination + + sig do + returns( + WhopSDK::Models::TransferCreateResponse::Send::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(WhopSDK::Models::TransferCreateResponse::Send::Source) } + attr_reader :source + + sig do + params( + source: + WhopSDK::Models::TransferCreateResponse::Send::Source::OrHash + ).void + end + attr_writer :source + + sig { returns(String) } + attr_accessor :tx_hash + + # Returned for a wallet_send: an onchain USDT send to a recipient. + sig do + params( + amount: String, + currency: String, + destination: + WhopSDK::Models::TransferCreateResponse::Send::Destination::OrHash, + object: + WhopSDK::Models::TransferCreateResponse::Send::Object::OrSymbol, + source: + WhopSDK::Models::TransferCreateResponse::Send::Source::OrHash, + tx_hash: String + ).returns(T.attached_class) + end + def self.new( + amount:, + currency:, + destination:, + object:, + source:, + tx_hash: + ) + end + + sig do + override.returns( + { + amount: String, + currency: String, + destination: + WhopSDK::Models::TransferCreateResponse::Send::Destination, + object: + WhopSDK::Models::TransferCreateResponse::Send::Object::TaggedSymbol, + source: WhopSDK::Models::TransferCreateResponse::Send::Source, + tx_hash: String + } + ) + end + def to_hash + end + + class Destination < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Send::Destination, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_id + + sig { returns(String) } + attr_accessor :address + + sig do + params(account_id: String, address: String).returns( + T.attached_class + ) + end + def self.new(account_id:, address:) + end + + sig { override.returns({ account_id: String, address: String }) } + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::TransferCreateResponse::Send::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SEND = + T.let( + :send, + WhopSDK::Models::TransferCreateResponse::Send::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::TransferCreateResponse::Send::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Source < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::Send::Source, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_id + + sig { returns(String) } + attr_accessor :address + + sig do + params(account_id: String, address: String).returns( + T.attached_class + ) + end + def self.new(account_id:, address:) + end + + sig { override.returns({ account_id: String, address: String }) } + def to_hash + end + end + end + + class ClaimLink < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::ClaimLink, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :claim_url + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Time)) } + attr_accessor :expires_at + + sig do + returns( + WhopSDK::Models::TransferCreateResponse::ClaimLink::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(Integer) } + attr_accessor :redeemable_count + + sig do + returns(WhopSDK::Models::TransferCreateResponse::ClaimLink::Source) + end + attr_reader :source + + sig do + params( + source: + WhopSDK::Models::TransferCreateResponse::ClaimLink::Source::OrHash + ).void + end + attr_writer :source + + sig { returns(String) } + attr_accessor :status + + # Returned for a claim_link: a shareable URL anyone can open to claim the funds. + sig do + params( + id: String, + amount: String, + claim_url: String, + currency: String, + expires_at: T.nilable(Time), + object: + WhopSDK::Models::TransferCreateResponse::ClaimLink::Object::OrSymbol, + redeemable_count: Integer, + source: + WhopSDK::Models::TransferCreateResponse::ClaimLink::Source::OrHash, + status: String + ).returns(T.attached_class) + end + def self.new( + id:, + amount:, + claim_url:, + currency:, + expires_at:, + object:, + redeemable_count:, + source:, + status: + ) + end + + sig do + override.returns( + { + id: String, + amount: String, + claim_url: String, + currency: String, + expires_at: T.nilable(Time), + object: + WhopSDK::Models::TransferCreateResponse::ClaimLink::Object::TaggedSymbol, + redeemable_count: Integer, + source: + WhopSDK::Models::TransferCreateResponse::ClaimLink::Source, + status: String + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::TransferCreateResponse::ClaimLink::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLAIM_LINK = + T.let( + :claim_link, + WhopSDK::Models::TransferCreateResponse::ClaimLink::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::TransferCreateResponse::ClaimLink::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Source < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferCreateResponse::ClaimLink::Source, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_id + + sig { params(account_id: String).returns(T.attached_class) } + def self.new(account_id:) + end + + sig { override.returns({ account_id: String }) } + def to_hash + end + end + end + + sig do + override.returns( + T::Array[WhopSDK::Models::TransferCreateResponse::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/whop_sdk/models/transfer_list_params.rbi b/rbi/whop_sdk/models/transfer_list_params.rbi index 7e076185..10c20ab2 100644 --- a/rbi/whop_sdk/models/transfer_list_params.rbi +++ b/rbi/whop_sdk/models/transfer_list_params.rbi @@ -11,85 +11,115 @@ module WhopSDK T.any(WhopSDK::TransferListParams, WhopSDK::Internal::AnyHash) end - # Returns the elements in the list that come after the specified cursor. + # Cursor to fetch the page after (from page_info.end_cursor). 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 + + # Cursor to fetch the page before (from page_info.start_cursor). sig { returns(T.nilable(String)) } - attr_accessor :before + attr_reader :before + + sig { params(before: String).void } + attr_writer :before - # Only return transfers created after this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_after + # Only transfers created strictly after this ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_after - # Only return transfers created before this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_before + sig { params(created_after: String).void } + attr_writer :created_after - # Filter to transfers received by this account. Accepts a user, company, or ledger - # account ID. + # Only transfers created strictly before this ISO 8601 timestamp. sig { returns(T.nilable(String)) } - attr_accessor :destination_id + 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 + + # Filter to transfers received by this account. + sig { returns(T.nilable(String)) } + attr_reader :destination_id + + sig { params(destination_id: String).void } + attr_writer :destination_id + + # Sort direction. Defaults to desc. + sig do + returns(T.nilable(WhopSDK::TransferListParams::Direction::OrSymbol)) + end + attr_reader :direction - # Returns the first _n_ elements from the list. + sig do + params(direction: WhopSDK::TransferListParams::Direction::OrSymbol).void + end + attr_writer :direction + + # Number of transfers to return from the start of the window. 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. + # Number of transfers to return from the end of the window. sig { returns(T.nilable(Integer)) } - attr_accessor :last + attr_reader :last - # Which columns can be used to sort. + sig { params(last: Integer).void } + attr_writer :last + + # Sort column. Defaults to created_at. sig { returns(T.nilable(WhopSDK::TransferListParams::Order::OrSymbol)) } - attr_accessor :order + attr_reader :order + + sig { params(order: WhopSDK::TransferListParams::Order::OrSymbol).void } + attr_writer :order - # Filter to transfers sent from this account. Accepts a user, company, or ledger - # account ID. + # Filter to transfers sent from this account. sig { returns(T.nilable(String)) } - attr_accessor :origin_id + attr_reader :origin_id + + sig { params(origin_id: String).void } + attr_writer :origin_id sig do params( - after: T.nilable(String), - before: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - destination_id: T.nilable(String), - direction: T.nilable(WhopSDK::Direction::OrSymbol), - first: T.nilable(Integer), - last: T.nilable(Integer), - order: T.nilable(WhopSDK::TransferListParams::Order::OrSymbol), - origin_id: T.nilable(String), + after: String, + before: String, + created_after: String, + created_before: String, + destination_id: String, + direction: WhopSDK::TransferListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::TransferListParams::Order::OrSymbol, + origin_id: 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. + # Cursor to fetch the page after (from page_info.end_cursor). after: nil, - # Returns the elements in the list that come before the specified cursor. + # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # Only return transfers created after this timestamp. + # Only transfers created strictly after this ISO 8601 timestamp. created_after: nil, - # Only return transfers created before this timestamp. + # Only transfers created strictly before this ISO 8601 timestamp. created_before: nil, - # Filter to transfers received by this account. Accepts a user, company, or ledger - # account ID. + # Filter to transfers received by this account. destination_id: nil, - # The direction of the sort. + # Sort direction. Defaults to desc. direction: nil, - # Returns the first _n_ elements from the list. + # Number of transfers to return from the start of the window. first: nil, - # Returns the last _n_ elements from the list. + # Number of transfers to return from the end of the window. last: nil, - # Which columns can be used to sort. + # Sort column. Defaults to created_at. order: nil, - # Filter to transfers sent from this account. Accepts a user, company, or ledger - # account ID. + # Filter to transfers sent from this account. origin_id: nil, request_options: {} ) @@ -98,16 +128,16 @@ module WhopSDK sig do override.returns( { - after: T.nilable(String), - before: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - destination_id: T.nilable(String), - direction: T.nilable(WhopSDK::Direction::OrSymbol), - first: T.nilable(Integer), - last: T.nilable(Integer), - order: T.nilable(WhopSDK::TransferListParams::Order::OrSymbol), - origin_id: T.nilable(String), + after: String, + before: String, + created_after: String, + created_before: String, + destination_id: String, + direction: WhopSDK::TransferListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::TransferListParams::Order::OrSymbol, + origin_id: String, request_options: WhopSDK::RequestOptions } ) @@ -115,7 +145,28 @@ module WhopSDK def to_hash end - # Which columns can be used to sort. + # Sort direction. Defaults to desc. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::TransferListParams::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = T.let(:asc, WhopSDK::TransferListParams::Direction::TaggedSymbol) + DESC = + T.let(:desc, WhopSDK::TransferListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::TransferListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # Sort column. Defaults to created_at. module Order extend WhopSDK::Internal::Type::Enum @@ -123,10 +174,10 @@ module WhopSDK T.type_alias { T.all(Symbol, WhopSDK::TransferListParams::Order) } OrSymbol = T.type_alias { T.any(Symbol, String) } - AMOUNT = - T.let(:amount, WhopSDK::TransferListParams::Order::TaggedSymbol) CREATED_AT = T.let(:created_at, WhopSDK::TransferListParams::Order::TaggedSymbol) + AMOUNT = + T.let(:amount, WhopSDK::TransferListParams::Order::TaggedSymbol) sig do override.returns( diff --git a/rbi/whop_sdk/models/transfer_list_response.rbi b/rbi/whop_sdk/models/transfer_list_response.rbi index 2613f712..26561bd4 100644 --- a/rbi/whop_sdk/models/transfer_list_response.rbi +++ b/rbi/whop_sdk/models/transfer_list_response.rbi @@ -11,83 +11,75 @@ module WhopSDK ) end - # The unique identifier for the credit transaction transfer. + # Transfer ID. sig { returns(String) } attr_accessor :id - # The transfer amount in the currency specified by the currency field. For - # example, 10.43 represents $10.43 USD. + # Transfer amount. sig { returns(Float) } attr_accessor :amount - # The datetime the credit transaction transfer was created. + # When the transfer was created. sig { returns(Time) } attr_accessor :created_at - # The currency in which this transfer amount is denominated. - sig { returns(WhopSDK::Currency::TaggedSymbol) } + # Transfer currency. + sig { returns(String) } attr_accessor :currency - # The unique identifier of the ledger account receiving the funds. + # Destination ledger account ID. sig { returns(String) } attr_accessor :destination_ledger_account_id - # The flat fee amount deducted from this transfer, in the transfer's currency. - # Null if no flat fee was applied. + # Source ledger account ID. + sig { returns(String) } + attr_accessor :origin_ledger_account_id + + # Fee charged for the transfer. sig { returns(T.nilable(Float)) } attr_accessor :fee_amount - # Custom key-value pairs attached to this transfer. Maximum 50 keys, 500 - # characters per key, 5000 characters per value. + # Custom metadata attached to the transfer. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata - # A free-text note attached to this transfer by the sender. Null if no note was - # provided. + # Transfer note. sig { returns(T.nilable(String)) } attr_accessor :notes - # The unique identifier of the ledger account that sent the funds. - sig { returns(String) } - attr_accessor :origin_ledger_account_id - # A transfer of credit between two ledger accounts. sig do params( id: String, amount: Float, created_at: Time, - currency: WhopSDK::Currency::OrSymbol, + currency: String, destination_ledger_account_id: String, + origin_ledger_account_id: String, fee_amount: T.nilable(Float), metadata: T.nilable(T::Hash[Symbol, T.anything]), - notes: T.nilable(String), - origin_ledger_account_id: String + notes: T.nilable(String) ).returns(T.attached_class) end def self.new( - # The unique identifier for the credit transaction transfer. + # Transfer ID. id:, - # The transfer amount in the currency specified by the currency field. For - # example, 10.43 represents $10.43 USD. + # Transfer amount. amount:, - # The datetime the credit transaction transfer was created. + # When the transfer was created. created_at:, - # The currency in which this transfer amount is denominated. + # Transfer currency. currency:, - # The unique identifier of the ledger account receiving the funds. + # Destination ledger account ID. destination_ledger_account_id:, - # The flat fee amount deducted from this transfer, in the transfer's currency. - # Null if no flat fee was applied. - fee_amount:, - # Custom key-value pairs attached to this transfer. Maximum 50 keys, 500 - # characters per key, 5000 characters per value. - metadata:, - # A free-text note attached to this transfer by the sender. Null if no note was - # provided. - notes:, - # The unique identifier of the ledger account that sent the funds. - origin_ledger_account_id: + # Source ledger account ID. + origin_ledger_account_id:, + # Fee charged for the transfer. + fee_amount: nil, + # Custom metadata attached to the transfer. + metadata: nil, + # Transfer note. + notes: nil ) end @@ -97,12 +89,12 @@ module WhopSDK id: String, amount: Float, created_at: Time, - currency: WhopSDK::Currency::TaggedSymbol, + currency: String, destination_ledger_account_id: String, + origin_ledger_account_id: String, fee_amount: T.nilable(Float), metadata: T.nilable(T::Hash[Symbol, T.anything]), - notes: T.nilable(String), - origin_ledger_account_id: String + notes: T.nilable(String) } ) end diff --git a/rbi/whop_sdk/models/transfer_retrieve_response.rbi b/rbi/whop_sdk/models/transfer_retrieve_response.rbi new file mode 100644 index 00000000..e332a1e7 --- /dev/null +++ b/rbi/whop_sdk/models/transfer_retrieve_response.rbi @@ -0,0 +1,416 @@ +# typed: strong + +module WhopSDK + module Models + class TransferRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Transfer ID. + sig { returns(String) } + attr_accessor :id + + # Transfer amount. + sig { returns(Float) } + attr_accessor :amount + + # When the transfer was created. + sig { returns(Time) } + attr_accessor :created_at + + # Transfer currency. + sig { returns(String) } + attr_accessor :currency + + # Account or user receiving funds. + sig do + returns( + WhopSDK::Models::TransferRetrieveResponse::Destination::Variants + ) + end + attr_accessor :destination + + # Destination ledger account ID. + sig { returns(String) } + attr_accessor :destination_ledger_account_id + + # Account or user sending funds. + sig do + returns(WhopSDK::Models::TransferRetrieveResponse::Origin::Variants) + end + attr_accessor :origin + + # Source ledger account ID. + sig { returns(String) } + attr_accessor :origin_ledger_account_id + + # Fee charged for the transfer. + sig { returns(T.nilable(Float)) } + attr_accessor :fee_amount + + # Custom metadata attached to the transfer. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + + # Transfer note. + sig { returns(T.nilable(String)) } + attr_accessor :notes + + # A transfer of credit between two ledger accounts. + sig do + params( + id: String, + amount: Float, + created_at: Time, + currency: String, + destination: + T.any( + WhopSDK::Models::TransferRetrieveResponse::Destination::Company::OrHash, + WhopSDK::Models::TransferRetrieveResponse::Destination::User::OrHash + ), + destination_ledger_account_id: String, + origin: + T.any( + WhopSDK::Models::TransferRetrieveResponse::Origin::Company::OrHash, + WhopSDK::Models::TransferRetrieveResponse::Origin::User::OrHash + ), + origin_ledger_account_id: String, + fee_amount: T.nilable(Float), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + notes: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Transfer ID. + id:, + # Transfer amount. + amount:, + # When the transfer was created. + created_at:, + # Transfer currency. + currency:, + # Account or user receiving funds. + destination:, + # Destination ledger account ID. + destination_ledger_account_id:, + # Account or user sending funds. + origin:, + # Source ledger account ID. + origin_ledger_account_id:, + # Fee charged for the transfer. + fee_amount: nil, + # Custom metadata attached to the transfer. + metadata: nil, + # Transfer note. + notes: nil + ) + end + + sig do + override.returns( + { + id: String, + amount: Float, + created_at: Time, + currency: String, + destination: + WhopSDK::Models::TransferRetrieveResponse::Destination::Variants, + destination_ledger_account_id: String, + origin: WhopSDK::Models::TransferRetrieveResponse::Origin::Variants, + origin_ledger_account_id: String, + fee_amount: T.nilable(Float), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + notes: T.nilable(String) + } + ) + end + def to_hash + end + + # Account or user receiving funds. + module Destination + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::TransferRetrieveResponse::Destination::Company, + WhopSDK::Models::TransferRetrieveResponse::Destination::User + ) + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferRetrieveResponse::Destination::Company, + WhopSDK::Internal::AnyHash + ) + end + + # Account ID. + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :typename + + # Account route. + sig { returns(T.nilable(String)) } + attr_accessor :route + + # Account display name. + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + route: T.nilable(String), + title: T.nilable(String), + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account ID. + id:, + # Account route. + route: nil, + # Account display name. + title: nil, + typename: :Company + ) + end + + sig do + override.returns( + { + id: String, + typename: Symbol, + route: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferRetrieveResponse::Destination::User, + WhopSDK::Internal::AnyHash + ) + end + + # User ID. + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :typename + + # User display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User's username. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + sig do + params( + id: String, + name: T.nilable(String), + username: String, + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # User ID. + id:, + # User display name. + name: nil, + # User's username. + username: nil, + typename: :User + ) + end + + sig do + override.returns( + { + id: String, + typename: Symbol, + name: T.nilable(String), + username: String + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::TransferRetrieveResponse::Destination::Variants + ] + ) + end + def self.variants + end + end + + # Account or user sending funds. + module Origin + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::TransferRetrieveResponse::Origin::Company, + WhopSDK::Models::TransferRetrieveResponse::Origin::User + ) + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferRetrieveResponse::Origin::Company, + WhopSDK::Internal::AnyHash + ) + end + + # Account ID. + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :typename + + # Account route. + sig { returns(T.nilable(String)) } + attr_accessor :route + + # Account display name. + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + route: T.nilable(String), + title: T.nilable(String), + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account ID. + id:, + # Account route. + route: nil, + # Account display name. + title: nil, + typename: :Company + ) + end + + sig do + override.returns( + { + id: String, + typename: Symbol, + route: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TransferRetrieveResponse::Origin::User, + WhopSDK::Internal::AnyHash + ) + end + + # User ID. + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :typename + + # User display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User's username. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + sig do + params( + id: String, + name: T.nilable(String), + username: String, + typename: Symbol + ).returns(T.attached_class) + end + def self.new( + # User ID. + id:, + # User display name. + name: nil, + # User's username. + username: nil, + typename: :User + ) + end + + sig do + override.returns( + { + id: String, + typename: Symbol, + name: T.nilable(String), + username: String + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::TransferRetrieveResponse::Origin::Variants + ] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/whop_sdk/models/unwrap_webhook_event.rbi b/rbi/whop_sdk/models/unwrap_webhook_event.rbi index b769a92b..c7486a55 100644 --- a/rbi/whop_sdk/models/unwrap_webhook_event.rbi +++ b/rbi/whop_sdk/models/unwrap_webhook_event.rbi @@ -8,6 +8,8 @@ module WhopSDK Variants = T.type_alias do T.any( + WhopSDK::ChatMessageCreatedWebhookEvent, + WhopSDK::ChatReactionCreatedWebhookEvent, WhopSDK::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::DisputeCreatedWebhookEvent, WhopSDK::DisputeUpdatedWebhookEvent, @@ -25,9 +27,11 @@ module WhopSDK WhopSDK::InvoicePaidWebhookEvent, WhopSDK::InvoicePastDueWebhookEvent, WhopSDK::InvoiceVoidedWebhookEvent, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent, WhopSDK::MembershipActivatedWebhookEvent, WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent, WhopSDK::MembershipDeactivatedWebhookEvent, + WhopSDK::MembershipTrialEndingSoonWebhookEvent, WhopSDK::PaymentCreatedWebhookEvent, WhopSDK::PaymentFailedWebhookEvent, WhopSDK::PaymentPendingWebhookEvent, diff --git a/rbi/whop_sdk/models/user.rbi b/rbi/whop_sdk/models/user.rbi index 89daa221..7b87fdba 100644 --- a/rbi/whop_sdk/models/user.rbi +++ b/rbi/whop_sdk/models/user.rbi @@ -5,10 +5,33 @@ module WhopSDK class User < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias { T.any(WhopSDK::User, WhopSDK::Internal::AnyHash) } - # The ID of the user, which will look like user\_******\******* + # User ID, prefixed `user_`. sig { returns(String) } attr_accessor :id + # The user's balance: personal cash + crypto + in-flight treasury deposits, plus + # account balances for accounts they own. Computed only on `GET /users/me` + # self-view for callers with balance-read scope; `null` otherwise. + sig { returns(T.nilable(WhopSDK::UserBalance)) } + attr_reader :balance + + sig { params(balance: T.nilable(WhopSDK::UserBalance::OrHash)).void } + attr_writer :balance + + # The user's cumulative wallet balance over time (USD `{ t, v }` points plus + # last/min/max), for the balance chart. Opt in with `include_balance_history=true` + # on `GET /users/me`; populated only for callers with balance-read scope and + # `null` otherwise. A user with no wallet activity returns an empty series. + sig { returns(T.nilable(WhopSDK::User::BalanceHistory)) } + attr_reader :balance_history + + sig do + params( + balance_history: T.nilable(WhopSDK::User::BalanceHistory::OrHash) + ).void + end + attr_writer :balance_history + # The user's biography sig { returns(T.nilable(String)) } attr_accessor :bio @@ -17,6 +40,16 @@ module WhopSDK sig { returns(String) } attr_accessor :created_at + # The user's gross USD income over time. Populated only on single-user self reads + # for callers with balance-read scope; `null` otherwise. + sig { returns(T.nilable(WhopSDK::User::EarningsUsd)) } + attr_reader :earnings_usd + + sig do + params(earnings_usd: T.nilable(WhopSDK::User::EarningsUsd::OrHash)).void + end + attr_writer :earnings_usd + # The user's display name sig { returns(T.nilable(String)) } attr_accessor :name @@ -29,29 +62,64 @@ module WhopSDK sig { returns(String) } attr_accessor :username + # Identity verification status for the user's `individual` (KYC) and `business` + # (KYB) profiles. Each is `null` until created, otherwise a `status` of + # `not_started`, `pending`, `approved`, or `rejected`. + sig { returns(T.anything) } + attr_accessor :verification + + # When the user became an enrolled Whop Partner, as an ISO 8601 timestamp. `null` + # if never enrolled. + sig { returns(T.nilable(String)) } + attr_accessor :whop_partner_enabled_at + sig do params( id: String, + balance: T.nilable(WhopSDK::UserBalance::OrHash), + balance_history: T.nilable(WhopSDK::User::BalanceHistory::OrHash), bio: T.nilable(String), created_at: String, + earnings_usd: T.nilable(WhopSDK::User::EarningsUsd::OrHash), name: T.nilable(String), profile_picture: T.nilable(T.anything), - username: String + username: String, + verification: T.anything, + whop_partner_enabled_at: T.nilable(String) ).returns(T.attached_class) end def self.new( - # The ID of the user, which will look like user\_******\******* + # User ID, prefixed `user_`. id:, + # The user's balance: personal cash + crypto + in-flight treasury deposits, plus + # account balances for accounts they own. Computed only on `GET /users/me` + # self-view for callers with balance-read scope; `null` otherwise. + balance:, + # The user's cumulative wallet balance over time (USD `{ t, v }` points plus + # last/min/max), for the balance chart. Opt in with `include_balance_history=true` + # on `GET /users/me`; populated only for callers with balance-read scope and + # `null` otherwise. A user with no wallet activity returns an empty series. + balance_history:, # The user's biography bio:, # When the user was created, as an ISO 8601 timestamp created_at:, + # The user's gross USD income over time. Populated only on single-user self reads + # for callers with balance-read scope; `null` otherwise. + earnings_usd:, # The user's display name name:, # The user's profile picture, an object with a url profile_picture:, # The user's unique username - username: + username:, + # Identity verification status for the user's `individual` (KYC) and `business` + # (KYB) profiles. Each is `null` until created, otherwise a `status` of + # `not_started`, `pending`, `approved`, or `rejected`. + verification:, + # When the user became an enrolled Whop Partner, as an ISO 8601 timestamp. `null` + # if never enrolled. + whop_partner_enabled_at: ) end @@ -59,16 +127,367 @@ module WhopSDK override.returns( { id: String, + balance: T.nilable(WhopSDK::UserBalance), + balance_history: T.nilable(WhopSDK::User::BalanceHistory), bio: T.nilable(String), created_at: String, + earnings_usd: T.nilable(WhopSDK::User::EarningsUsd), name: T.nilable(String), profile_picture: T.nilable(T.anything), - username: String + username: String, + verification: T.anything, + whop_partner_enabled_at: T.nilable(String) } ) end def to_hash end + + class BalanceHistory < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::User::BalanceHistory, WhopSDK::Internal::AnyHash) + end + + sig { returns(T::Array[WhopSDK::User::BalanceHistory::Data]) } + attr_accessor :data + + # Value of the most recent point, in USD. + sig { returns(Float) } + attr_accessor :last + + # Maximum value across the window, in USD. + sig { returns(Float) } + attr_accessor :max + + # Minimum value across the window, in USD. + sig { returns(Float) } + attr_accessor :min + + # The user's cumulative wallet balance over time (USD `{ t, v }` points plus + # last/min/max), for the balance chart. Opt in with `include_balance_history=true` + # on `GET /users/me`; populated only for callers with balance-read scope and + # `null` otherwise. A user with no wallet activity returns an empty series. + sig do + params( + data: T::Array[WhopSDK::User::BalanceHistory::Data::OrHash], + last: Float, + max: Float, + min: Float + ).returns(T.attached_class) + end + def self.new( + data:, + # Value of the most recent point, in USD. + last:, + # Maximum value across the window, in USD. + max:, + # Minimum value across the window, in USD. + min: + ) + end + + sig do + override.returns( + { + data: T::Array[WhopSDK::User::BalanceHistory::Data], + last: Float, + max: Float, + min: Float + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::User::BalanceHistory::Data, + WhopSDK::Internal::AnyHash + ) + end + + # Point timestamp, in Unix seconds. + sig { returns(Integer) } + attr_accessor :t + + # Cumulative wallet balance at this point, in USD. + sig { returns(Float) } + attr_accessor :v + + # Cumulative balance points over the requested window, oldest first. + sig { params(t: Integer, v: Float).returns(T.attached_class) } + def self.new( + # Point timestamp, in Unix seconds. + t:, + # Cumulative wallet balance at this point, in USD. + v: + ) + end + + sig { override.returns({ t: Integer, v: Float }) } + def to_hash + end + end + end + + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::User::EarningsUsd, WhopSDK::Internal::AnyHash) + end + + # The first time the user earned gross income, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_accessor :first_earned_at + + # Gross income from accounts the user owns or is owner-authorized on. + sig { returns(WhopSDK::User::EarningsUsd::OwnedAccounts) } + attr_reader :owned_accounts + + sig do + params( + owned_accounts: WhopSDK::User::EarningsUsd::OwnedAccounts::OrHash + ).void + end + attr_writer :owned_accounts + + # Gross income from the user's personal wallet. + sig { returns(WhopSDK::User::EarningsUsd::Personal) } + attr_reader :personal + + sig do + params(personal: WhopSDK::User::EarningsUsd::Personal::OrHash).void + end + attr_writer :personal + + # Gross income from the user's personal wallet plus accounts they own or are + # owner-authorized on. + sig { returns(WhopSDK::User::EarningsUsd::Total) } + attr_reader :total + + sig { params(total: WhopSDK::User::EarningsUsd::Total::OrHash).void } + attr_writer :total + + # The user's gross USD income over time. Populated only on single-user self reads + # for callers with balance-read scope; `null` otherwise. + sig do + params( + first_earned_at: T.nilable(String), + owned_accounts: WhopSDK::User::EarningsUsd::OwnedAccounts::OrHash, + personal: WhopSDK::User::EarningsUsd::Personal::OrHash, + total: WhopSDK::User::EarningsUsd::Total::OrHash + ).returns(T.attached_class) + end + def self.new( + # The first time the user earned gross income, as an ISO 8601 timestamp. + first_earned_at:, + # Gross income from accounts the user owns or is owner-authorized on. + owned_accounts:, + # Gross income from the user's personal wallet. + personal:, + # Gross income from the user's personal wallet plus accounts they own or are + # owner-authorized on. + total: + ) + end + + sig do + override.returns( + { + first_earned_at: T.nilable(String), + owned_accounts: WhopSDK::User::EarningsUsd::OwnedAccounts, + personal: WhopSDK::User::EarningsUsd::Personal, + total: WhopSDK::User::EarningsUsd::Total + } + ) + end + def to_hash + end + + class OwnedAccounts < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::User::EarningsUsd::OwnedAccounts, + WhopSDK::Internal::AnyHash + ) + end + + # Gross income in USD over the last 24 hours. + sig { returns(String) } + attr_accessor :last_24_hours + + # Gross income in USD over the last 30 days. + sig { returns(String) } + attr_accessor :last_30_days + + # Gross income in USD over the last 7 days. + sig { returns(String) } + attr_accessor :last_7_days + + # All-time gross income in USD. + sig { returns(String) } + attr_accessor :lifetime + + # Gross income from accounts the user owns or is owner-authorized on. + sig do + params( + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + ).returns(T.attached_class) + end + def self.new( + # Gross income in USD over the last 24 hours. + last_24_hours:, + # Gross income in USD over the last 30 days. + last_30_days:, + # Gross income in USD over the last 7 days. + last_7_days:, + # All-time gross income in USD. + lifetime: + ) + end + + sig do + override.returns( + { + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + } + ) + end + def to_hash + end + end + + class Personal < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::User::EarningsUsd::Personal, + WhopSDK::Internal::AnyHash + ) + end + + # Gross income in USD over the last 24 hours. + sig { returns(String) } + attr_accessor :last_24_hours + + # Gross income in USD over the last 30 days. + sig { returns(String) } + attr_accessor :last_30_days + + # Gross income in USD over the last 7 days. + sig { returns(String) } + attr_accessor :last_7_days + + # All-time gross income in USD. + sig { returns(String) } + attr_accessor :lifetime + + # Gross income from the user's personal wallet. + sig do + params( + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + ).returns(T.attached_class) + end + def self.new( + # Gross income in USD over the last 24 hours. + last_24_hours:, + # Gross income in USD over the last 30 days. + last_30_days:, + # Gross income in USD over the last 7 days. + last_7_days:, + # All-time gross income in USD. + lifetime: + ) + end + + sig do + override.returns( + { + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + } + ) + end + def to_hash + end + end + + class Total < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::User::EarningsUsd::Total, + WhopSDK::Internal::AnyHash + ) + end + + # Gross income in USD over the last 24 hours. + sig { returns(String) } + attr_accessor :last_24_hours + + # Gross income in USD over the last 30 days. + sig { returns(String) } + attr_accessor :last_30_days + + # Gross income in USD over the last 7 days. + sig { returns(String) } + attr_accessor :last_7_days + + # All-time gross income in USD. + sig { returns(String) } + attr_accessor :lifetime + + # Gross income from the user's personal wallet plus accounts they own or are + # owner-authorized on. + sig do + params( + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + ).returns(T.attached_class) + end + def self.new( + # Gross income in USD over the last 24 hours. + last_24_hours:, + # Gross income in USD over the last 30 days. + last_30_days:, + # Gross income in USD over the last 7 days. + last_7_days:, + # All-time gross income in USD. + lifetime: + ) + end + + sig do + override.returns( + { + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + } + ) + end + def to_hash + end + end + end end end end diff --git a/rbi/whop_sdk/models/user_balance.rbi b/rbi/whop_sdk/models/user_balance.rbi new file mode 100644 index 00000000..fede39c4 --- /dev/null +++ b/rbi/whop_sdk/models/user_balance.rbi @@ -0,0 +1,301 @@ +# typed: strong + +module WhopSDK + module Models + class UserBalance < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(WhopSDK::UserBalance, WhopSDK::Internal::AnyHash) } + + sig { returns(T::Array[WhopSDK::UserBalance::Business]) } + attr_accessor :businesses + + # Combined USD balance across every account the user owns. + sig { returns(String) } + attr_accessor :businesses_total_usd + + sig { returns(T::Array[WhopSDK::UserBalance::Cash]) } + attr_accessor :cash + + # Fiat cash in USD, including pending and reserve. + sig { returns(String) } + attr_accessor :cash_usd + + sig { returns(T::Array[WhopSDK::UserBalance::Crypto]) } + attr_accessor :crypto + + # Crypto holdings in USD. + sig { returns(String) } + attr_accessor :crypto_usd + + # Pending funds in USD: fiat pending + in-flight treasury deposits. + sig { returns(String) } + attr_accessor :pending_usd + + # The user's personal balance in USD: cash (available + pending + reserve) + + # crypto + in-flight treasury deposits. Excludes account balances (see + # businesses_total_usd). + sig { returns(String) } + attr_accessor :total_usd + + # Balance-to-wallet USDT0 withdrawals still in flight, in USD. + sig { returns(String) } + attr_accessor :treasury_pending_usd + + sig do + params( + businesses: T::Array[WhopSDK::UserBalance::Business::OrHash], + businesses_total_usd: String, + cash: T::Array[WhopSDK::UserBalance::Cash::OrHash], + cash_usd: String, + crypto: T::Array[WhopSDK::UserBalance::Crypto::OrHash], + crypto_usd: String, + pending_usd: String, + total_usd: String, + treasury_pending_usd: String + ).returns(T.attached_class) + end + def self.new( + businesses:, + # Combined USD balance across every account the user owns. + businesses_total_usd:, + cash:, + # Fiat cash in USD, including pending and reserve. + cash_usd:, + crypto:, + # Crypto holdings in USD. + crypto_usd:, + # Pending funds in USD: fiat pending + in-flight treasury deposits. + pending_usd:, + # The user's personal balance in USD: cash (available + pending + reserve) + + # crypto + in-flight treasury deposits. Excludes account balances (see + # businesses_total_usd). + total_usd:, + # Balance-to-wallet USDT0 withdrawals still in flight, in USD. + treasury_pending_usd: + ) + end + + sig do + override.returns( + { + businesses: T::Array[WhopSDK::UserBalance::Business], + businesses_total_usd: String, + cash: T::Array[WhopSDK::UserBalance::Cash], + cash_usd: String, + crypto: T::Array[WhopSDK::UserBalance::Crypto], + crypto_usd: String, + pending_usd: String, + total_usd: String, + treasury_pending_usd: String + } + ) + end + def to_hash + end + + class Business < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::UserBalance::Business, WhopSDK::Internal::AnyHash) + end + + # The account ID, which looks like biz\_******\*******. + sig { returns(String) } + attr_accessor :id + + # The account's total balance in USD. + sig { returns(String) } + attr_accessor :balance_usd + + # The account's logo URL. + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + # The account's display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Account balances for accounts the user owns, highest balance first. Excludes + # accounts with no balance. + sig do + params( + id: String, + balance_usd: String, + logo_url: T.nilable(String), + name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The account ID, which looks like biz\_******\*******. + id:, + # The account's total balance in USD. + balance_usd:, + # The account's logo URL. + logo_url:, + # The account's display name. + name: + ) + end + + sig do + override.returns( + { + id: String, + balance_usd: String, + logo_url: T.nilable(String), + name: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Cash < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::UserBalance::Cash, WhopSDK::Internal::AnyHash) + end + + # Available balance in the native currency. + sig { returns(Float) } + attr_accessor :balance + + # Available balance converted to USD. + sig { returns(Float) } + attr_accessor :balance_usd + + # Lowercase ISO currency code, such as `usd` or `eur`. + sig { returns(String) } + attr_accessor :currency + + # Pending balance converted to USD. + sig { returns(Float) } + attr_accessor :pending_balance_usd + + # Reserved balance converted to USD. + sig { returns(Float) } + attr_accessor :reserve_balance_usd + + # Withdrawable amount in the native currency. + sig { returns(Float) } + attr_accessor :total_withdrawable_balance + + # Per-currency fiat cash balances. + sig do + params( + balance: Float, + balance_usd: Float, + currency: String, + pending_balance_usd: Float, + reserve_balance_usd: Float, + total_withdrawable_balance: Float + ).returns(T.attached_class) + end + def self.new( + # Available balance in the native currency. + balance:, + # Available balance converted to USD. + balance_usd:, + # Lowercase ISO currency code, such as `usd` or `eur`. + currency:, + # Pending balance converted to USD. + pending_balance_usd:, + # Reserved balance converted to USD. + reserve_balance_usd:, + # Withdrawable amount in the native currency. + total_withdrawable_balance: + ) + end + + sig do + override.returns( + { + balance: Float, + balance_usd: Float, + currency: String, + pending_balance_usd: Float, + reserve_balance_usd: Float, + total_withdrawable_balance: Float + } + ) + end + def to_hash + end + end + + class Crypto < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::UserBalance::Crypto, WhopSDK::Internal::AnyHash) + end + + # Amount held in native token units, as a decimal string. + sig { returns(String) } + attr_accessor :balance + + # Token icon URL. + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # The token's display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # USD price per token, or `null` when unknown. + sig { returns(T.nilable(Float)) } + attr_accessor :price_usd + + # Token display symbol, such as `USDT`, `XAUT`, or `cbBTC`. + sig { returns(String) } + attr_accessor :symbol + + # Holding USD value. + sig { returns(Float) } + attr_accessor :value_usd + + # Per-token crypto holdings in the ledger's own wallet. + sig do + params( + balance: String, + icon_url: T.nilable(String), + name: T.nilable(String), + price_usd: T.nilable(Float), + symbol: String, + value_usd: Float + ).returns(T.attached_class) + end + def self.new( + # Amount held in native token units, as a decimal string. + balance:, + # Token icon URL. + icon_url:, + # The token's display name. + name:, + # USD price per token, or `null` when unknown. + price_usd:, + # Token display symbol, such as `USDT`, `XAUT`, or `cbBTC`. + symbol:, + # Holding USD value. + value_usd: + ) + end + + sig do + override.returns( + { + balance: String, + icon_url: T.nilable(String), + name: T.nilable(String), + price_usd: T.nilable(Float), + symbol: String, + value_usd: Float + } + ) + end + 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 87cd2305..c589fb02 100644 --- a/rbi/whop_sdk/models/user_retrieve_params.rbi +++ b/rbi/whop_sdk/models/user_retrieve_params.rbi @@ -22,10 +22,60 @@ module WhopSDK sig { params(account_id: String).void } attr_writer :account_id + # Balance-history window start, ISO 8601 date or datetime. Defaults to 30 days + # ago. Only used with `include_balance_history`. + sig { returns(T.nilable(String)) } + attr_reader :from + + sig { params(from: String).void } + attr_writer :from + + # On `GET /users/me`, also compute the caller's balance history (opt-in; runs a + # heavier query). Ignored for other users and for callers without balance-read + # scope. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_balance_history + + sig { params(include_balance_history: T::Boolean).void } + attr_writer :include_balance_history + + # Balance-history point granularity. Defaults to `day`. Only used with + # `include_balance_history`. + sig do + returns(T.nilable(WhopSDK::UserRetrieveParams::Interval::OrSymbol)) + end + attr_reader :interval + + sig do + params(interval: WhopSDK::UserRetrieveParams::Interval::OrSymbol).void + end + attr_writer :interval + + # IANA time zone the balance-history points are bucketed in. Defaults to `UTC`. + # Only used with `include_balance_history`. + sig { returns(T.nilable(String)) } + attr_reader :time_zone + + sig { params(time_zone: String).void } + attr_writer :time_zone + + # Balance-history window end, ISO 8601 date or datetime. Defaults to now. Only + # used with `include_balance_history`. + sig { returns(T.nilable(String)) } + attr_reader :to + + sig { params(to: String).void } + attr_writer :to + sig do params( id: String, account_id: String, + from: String, + include_balance_history: T::Boolean, + interval: WhopSDK::UserRetrieveParams::Interval::OrSymbol, + time_zone: String, + to: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +84,22 @@ module WhopSDK # When set, returns the user's account-specific profile overrides for this # account. account_id: nil, + # Balance-history window start, ISO 8601 date or datetime. Defaults to 30 days + # ago. Only used with `include_balance_history`. + from: nil, + # On `GET /users/me`, also compute the caller's balance history (opt-in; runs a + # heavier query). Ignored for other users and for callers without balance-read + # scope. + include_balance_history: nil, + # Balance-history point granularity. Defaults to `day`. Only used with + # `include_balance_history`. + interval: nil, + # IANA time zone the balance-history points are bucketed in. Defaults to `UTC`. + # Only used with `include_balance_history`. + time_zone: nil, + # Balance-history window end, ISO 8601 date or datetime. Defaults to now. Only + # used with `include_balance_history`. + to: nil, request_options: {} ) end @@ -43,12 +109,41 @@ module WhopSDK { id: String, account_id: String, + from: String, + include_balance_history: T::Boolean, + interval: WhopSDK::UserRetrieveParams::Interval::OrSymbol, + time_zone: String, + to: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # Balance-history point granularity. Defaults to `day`. Only used with + # `include_balance_history`. + module Interval + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::UserRetrieveParams::Interval) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOUR = T.let(:hour, WhopSDK::UserRetrieveParams::Interval::TaggedSymbol) + DAY = T.let(:day, WhopSDK::UserRetrieveParams::Interval::TaggedSymbol) + WEEK = T.let(:week, WhopSDK::UserRetrieveParams::Interval::TaggedSymbol) + MONTH = + T.let(:month, WhopSDK::UserRetrieveParams::Interval::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::UserRetrieveParams::Interval::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/verification_create_params.rbi b/rbi/whop_sdk/models/verification_create_params.rbi new file mode 100644 index 00000000..3e2b8d4d --- /dev/null +++ b/rbi/whop_sdk/models/verification_create_params.rbi @@ -0,0 +1,783 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::VerificationCreateParams, WhopSDK::Internal::AnyHash) + end + + # Account or user ID whose identity you want to verify. Use a `biz_` account ID + # for account verifications, or the caller's `user_` ID for personal verification. + sig { returns(String) } + attr_accessor :account_id + + # Request body for an individual (KYC) verification. Omit `kind` or set it to + # `individual`. KYC is required to pay out funds and is a prerequisite for Whop + # Card access. Accepting payments does not require verification until a business + # reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the + # individual operates under a business entity. This enables payouts to be received + # by a business bank account. + sig do + returns( + T.any( + WhopSDK::VerificationCreateParams::Body::Individual, + WhopSDK::VerificationCreateParams::Body::Business + ) + ) + end + attr_accessor :body + + sig do + params( + account_id: String, + body: + T.any( + WhopSDK::VerificationCreateParams::Body::Individual::OrHash, + WhopSDK::VerificationCreateParams::Body::Business::OrHash + ), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Account or user ID whose identity you want to verify. Use a `biz_` account ID + # for account verifications, or the caller's `user_` ID for personal verification. + account_id:, + # Request body for an individual (KYC) verification. Omit `kind` or set it to + # `individual`. KYC is required to pay out funds and is a prerequisite for Whop + # Card access. Accepting payments does not require verification until a business + # reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the + # individual operates under a business entity. This enables payouts to be received + # by a business bank account. + body:, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + body: + T.any( + WhopSDK::VerificationCreateParams::Body::Individual, + WhopSDK::VerificationCreateParams::Body::Business + ), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Request body for an individual (KYC) verification. Omit `kind` or set it to + # `individual`. KYC is required to pay out funds and is a prerequisite for Whop + # Card access. Accepting payments does not require verification until a business + # reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the + # individual operates under a business entity. This enables payouts to be received + # by a business bank account. + module Body + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::VerificationCreateParams::Body::Individual, + WhopSDK::VerificationCreateParams::Body::Business + ) + end + + class Individual < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationCreateParams::Body::Individual, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + WhopSDK::VerificationCreateParams::Body::Individual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + WhopSDK::VerificationCreateParams::Body::Individual::Address::OrHash + ).void + end + attr_writer :address + + # Legal business name for a sole proprietor or single-member LLC. + sig { returns(T.nilable(String)) } + attr_reader :business_name + + sig { params(business_name: String).void } + attr_writer :business_name + + # Entity type for sole proprietors, such as `single_member_llc`. Supported values + # vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + sig { returns(T.nilable(String)) } + attr_reader :business_structure + + sig { params(business_structure: String).void } + attr_writer :business_structure + + # Business website URL. Whop store pages are not accepted. + sig { returns(T.nilable(String)) } + attr_reader :business_website + + sig { params(business_website: String).void } + attr_writer :business_website + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # Formatted as `YYYY-MM-DD`. + sig { returns(T.nilable(String)) } + attr_reader :date_of_birth + + sig { params(date_of_birth: String).void } + attr_writer :date_of_birth + + # Identity document being sent. Providing it (with `documents`) verifies from + # uploaded documents instead of a hosted session, and determines the expected + # `documents` keys: cards and licenses need front and back, passports only the + # photo page. + sig do + returns( + T.nilable( + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::OrSymbol + ) + ) + end + attr_reader :document_type + + sig do + params( + document_type: + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::OrSymbol + ).void + end + attr_writer :document_type + + # Identity document files, keyed by slot (`id_card_front`, `id_card_back`, + # `selfie`, …) with each value the file's raw bytes base64-encoded. Providing them + # verifies the person from these documents instead of a hosted session — + # individual verifications only, and the request must also carry `document_type`, + # `first_name`, `last_name`, `date_of_birth`, `country`, `phone`, + # `tax_identification_number`, and an `address` with `line1`, `city`, `state`, and + # `postal_code`. JPEG, PNG, and PDF are accepted (selfies must be images), up to + # 5MB per file before encoding. Send the complete set — a missing or rejected file + # fails the whole request and nothing is submitted; review starts automatically + # once every document is accepted. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :documents + + sig { params(documents: T::Hash[Symbol, String]).void } + attr_writer :documents + + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Verification type. Defaults to `individual`. + sig do + returns( + T.nilable( + WhopSDK::VerificationCreateParams::Body::Individual::Kind::OrSymbol + ) + ) + end + attr_reader :kind + + sig do + params( + kind: + WhopSDK::VerificationCreateParams::Body::Individual::Kind::OrSymbol + ).void + end + attr_writer :kind + + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + sig { returns(T.nilable(String)) } + attr_reader :phone + + sig { params(phone: String).void } + attr_writer :phone + + # SSN or ITIN. Tokenized in transit and never stored raw. + sig { returns(T.nilable(String)) } + attr_reader :tax_identification_number + + sig { params(tax_identification_number: String).void } + attr_writer :tax_identification_number + + # Request body for an individual (KYC) verification. Omit `kind` or set it to + # `individual`. KYC is required to pay out funds and is a prerequisite for Whop + # Card access. Accepting payments does not require verification until a business + # reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the + # individual operates under a business entity. This enables payouts to be received + # by a business bank account. + sig do + params( + address: + WhopSDK::VerificationCreateParams::Body::Individual::Address::OrHash, + business_name: String, + business_structure: String, + business_website: String, + country: String, + date_of_birth: String, + document_type: + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::OrSymbol, + documents: T::Hash[Symbol, String], + first_name: String, + kind: + WhopSDK::VerificationCreateParams::Body::Individual::Kind::OrSymbol, + last_name: String, + phone: String, + tax_identification_number: String + ).returns(T.attached_class) + end + def self.new( + address: nil, + # Legal business name for a sole proprietor or single-member LLC. + business_name: nil, + # Entity type for sole proprietors, such as `single_member_llc`. Supported values + # vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + business_structure: nil, + # Business website URL. Whop store pages are not accepted. + business_website: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # Formatted as `YYYY-MM-DD`. + date_of_birth: nil, + # Identity document being sent. Providing it (with `documents`) verifies from + # uploaded documents instead of a hosted session, and determines the expected + # `documents` keys: cards and licenses need front and back, passports only the + # photo page. + document_type: nil, + # Identity document files, keyed by slot (`id_card_front`, `id_card_back`, + # `selfie`, …) with each value the file's raw bytes base64-encoded. Providing them + # verifies the person from these documents instead of a hosted session — + # individual verifications only, and the request must also carry `document_type`, + # `first_name`, `last_name`, `date_of_birth`, `country`, `phone`, + # `tax_identification_number`, and an `address` with `line1`, `city`, `state`, and + # `postal_code`. JPEG, PNG, and PDF are accepted (selfies must be images), up to + # 5MB per file before encoding. Send the complete set — a missing or rejected file + # fails the whole request and nothing is submitted; review starts automatically + # once every document is accepted. + documents: nil, + first_name: nil, + # Verification type. Defaults to `individual`. + kind: nil, + last_name: nil, + phone: nil, + # SSN or ITIN. Tokenized in transit and never stored raw. + tax_identification_number: nil + ) + end + + sig do + override.returns( + { + address: + WhopSDK::VerificationCreateParams::Body::Individual::Address, + business_name: String, + business_structure: String, + business_website: String, + country: String, + date_of_birth: String, + document_type: + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::OrSymbol, + documents: T::Hash[Symbol, String], + first_name: String, + kind: + WhopSDK::VerificationCreateParams::Body::Individual::Kind::OrSymbol, + last_name: String, + phone: String, + tax_identification_number: String + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationCreateParams::Body::Individual::Address, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + params( + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + + # Identity document being sent. Providing it (with `documents`) verifies from + # uploaded documents instead of a hosted session, and determines the expected + # `documents` keys: cards and licenses need front and back, passports only the + # photo page. + module DocumentType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ID_CARD = + T.let( + :ID_CARD, + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::TaggedSymbol + ) + PASSPORT = + T.let( + :PASSPORT, + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::TaggedSymbol + ) + DRIVERS = + T.let( + :DRIVERS, + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::TaggedSymbol + ) + RESIDENCE_PERMIT = + T.let( + :RESIDENCE_PERMIT, + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::VerificationCreateParams::Body::Individual::DocumentType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification type. Defaults to `individual`. + module Kind + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::VerificationCreateParams::Body::Individual::Kind + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INDIVIDUAL = + T.let( + :individual, + WhopSDK::VerificationCreateParams::Body::Individual::Kind::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::VerificationCreateParams::Body::Individual::Kind::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Business < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationCreateParams::Body::Business, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + WhopSDK::VerificationCreateParams::Body::Business::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + WhopSDK::VerificationCreateParams::Body::Business::Address::OrHash + ).void + end + attr_writer :address + + # Legal business name. + sig { returns(T.nilable(String)) } + attr_reader :business_name + + sig { params(business_name: String).void } + attr_writer :business_name + + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + sig { returns(T.nilable(String)) } + attr_reader :business_structure + + sig { params(business_structure: String).void } + attr_writer :business_structure + + # Business website URL. Whop store pages are not accepted. + sig { returns(T.nilable(String)) } + attr_reader :business_website + + sig { params(business_website: String).void } + attr_writer :business_website + + # Country of incorporation as a two-letter ISO 3166-1 country code. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # Must be `business` to start a KYB verification. + sig do + returns( + T.nilable( + WhopSDK::VerificationCreateParams::Body::Business::Kind::OrSymbol + ) + ) + end + attr_reader :kind + + sig do + params( + kind: + WhopSDK::VerificationCreateParams::Body::Business::Kind::OrSymbol + ).void + end + attr_writer :kind + + # State or region where the business is incorporated. + sig { returns(T.nilable(String)) } + attr_reader :place_of_incorporation + + sig { params(place_of_incorporation: String).void } + attr_writer :place_of_incorporation + + # EIN. Tokenized in transit and never stored raw. + sig { returns(T.nilable(String)) } + attr_reader :tax_identification_number + + sig { params(tax_identification_number: String).void } + attr_writer :tax_identification_number + + # Request body for a business entity (KYB) verification. Set `kind` to `business`. + # KYB includes everything KYC provides and additionally unlocks financing options + # for payments and business Whop Cards. + sig do + params( + address: + WhopSDK::VerificationCreateParams::Body::Business::Address::OrHash, + business_name: String, + business_structure: String, + business_website: String, + country: String, + kind: + WhopSDK::VerificationCreateParams::Body::Business::Kind::OrSymbol, + place_of_incorporation: String, + tax_identification_number: String + ).returns(T.attached_class) + end + def self.new( + address: nil, + # Legal business name. + business_name: nil, + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + business_structure: nil, + # Business website URL. Whop store pages are not accepted. + business_website: nil, + # Country of incorporation as a two-letter ISO 3166-1 country code. + country: nil, + # Must be `business` to start a KYB verification. + kind: nil, + # State or region where the business is incorporated. + place_of_incorporation: nil, + # EIN. Tokenized in transit and never stored raw. + tax_identification_number: nil + ) + end + + sig do + override.returns( + { + address: + WhopSDK::VerificationCreateParams::Body::Business::Address, + business_name: String, + business_structure: String, + business_website: String, + country: String, + kind: + WhopSDK::VerificationCreateParams::Body::Business::Kind::OrSymbol, + place_of_incorporation: String, + tax_identification_number: String + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationCreateParams::Body::Business::Address, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + params( + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + + # Must be `business` to start a KYB verification. + module Kind + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::VerificationCreateParams::Body::Business::Kind + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :business, + WhopSDK::VerificationCreateParams::Body::Business::Kind::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::VerificationCreateParams::Body::Business::Kind::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[WhopSDK::VerificationCreateParams::Body::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/whop_sdk/models/verification_create_response.rbi b/rbi/whop_sdk/models/verification_create_response.rbi new file mode 100644 index 00000000..4bdb53c8 --- /dev/null +++ b/rbi/whop_sdk/models/verification_create_response.rbi @@ -0,0 +1,757 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationCreateResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Verification profile ID, prefixed `idpf_`. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Address on the verification profile. `null` when no address is set. + sig do + returns(T.nilable(WhopSDK::Models::VerificationCreateResponse::Address)) + end + attr_reader :address + + sig do + params( + address: + T.nilable( + WhopSDK::Models::VerificationCreateResponse::Address::OrHash + ) + ).void + end + attr_writer :address + + # Legal business name. + sig { returns(T.nilable(String)) } + attr_accessor :business_name + + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + sig { returns(T.nilable(String)) } + attr_accessor :business_structure + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # When the verification profile was created, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_at + + sig { params(created_at: String).void } + attr_writer :created_at + + # Formatted as `YYYY-MM-DD`. + sig { returns(T.nilable(String)) } + attr_accessor :date_of_birth + + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationCreateResponse::Kind::TaggedSymbol + ) + ) + end + attr_reader :kind + + sig do + params( + kind: WhopSDK::Models::VerificationCreateResponse::Kind::OrSymbol + ).void + end + attr_writer :kind + + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequestedInformation + ] + ) + ) + end + attr_reader :requested_information + + sig do + params( + requested_information: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequestedInformation::OrHash + ] + ).void + end + attr_writer :requested_information + + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequiredDocument + ] + ) + ) + end + attr_reader :required_documents + + sig do + params( + required_documents: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::OrHash + ] + ).void + end + attr_writer :required_documents + + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + sig { returns(T.nilable(String)) } + attr_accessor :session_url + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: WhopSDK::Models::VerificationCreateResponse::Status::OrSymbol + ).void + end + attr_writer :status + + # When the verification profile was last updated, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :updated_at + + sig { params(updated_at: String).void } + attr_writer :updated_at + + sig do + params( + id: String, + address: + T.nilable( + WhopSDK::Models::VerificationCreateResponse::Address::OrHash + ), + business_name: T.nilable(String), + business_structure: T.nilable(String), + country: T.nilable(String), + created_at: String, + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + kind: WhopSDK::Models::VerificationCreateResponse::Kind::OrSymbol, + last_name: T.nilable(String), + requested_information: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequestedInformation::OrHash + ], + required_documents: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::OrHash + ], + session_url: T.nilable(String), + status: WhopSDK::Models::VerificationCreateResponse::Status::OrSymbol, + updated_at: String + ).returns(T.attached_class) + end + def self.new( + # Verification profile ID, prefixed `idpf_`. + id: nil, + # Address on the verification profile. `null` when no address is set. + address: nil, + # Legal business name. + business_name: nil, + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + business_structure: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # When the verification profile was created, as an ISO 8601 timestamp. + created_at: nil, + # Formatted as `YYYY-MM-DD`. + date_of_birth: nil, + first_name: nil, + kind: nil, + last_name: nil, + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + requested_information: nil, + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + required_documents: nil, + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + session_url: nil, + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + status: nil, + # When the verification profile was last updated, as an ISO 8601 timestamp. + updated_at: nil + ) + end + + sig do + override.returns( + { + id: String, + address: + T.nilable(WhopSDK::Models::VerificationCreateResponse::Address), + business_name: T.nilable(String), + business_structure: T.nilable(String), + country: T.nilable(String), + created_at: String, + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + kind: + WhopSDK::Models::VerificationCreateResponse::Kind::TaggedSymbol, + last_name: T.nilable(String), + requested_information: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequestedInformation + ], + required_documents: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequiredDocument + ], + session_url: T.nilable(String), + status: + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol, + updated_at: String + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationCreateResponse::Address, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Address on the verification profile. `null` when no address is set. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + module Kind + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::VerificationCreateResponse::Kind) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INDIVIDUAL = + T.let( + :individual, + WhopSDK::Models::VerificationCreateResponse::Kind::TaggedSymbol + ) + BUSINESS = + T.let( + :business, + WhopSDK::Models::VerificationCreateResponse::Kind::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationCreateResponse::Kind::TaggedSymbol + ] + ) + end + def self.values + end + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationCreateResponse::RequestedInformation, + WhopSDK::Internal::AnyHash + ) + end + + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Additional instructions for this requested item, or `null`. + sig { returns(T.nilable(String)) } + attr_accessor :description + + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Stable field key, such as `ssn` or `business_description`. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # Human-readable label for the field, such as `Social Security Number`. + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :options + + sig { params(options: T::Array[String]).void } + attr_writer :options + + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile + ] + ) + ) + end + attr_reader :requested_files + + sig do + params( + requested_files: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile::OrHash + ] + ).void + end + attr_writer :requested_files + + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + sig { returns(T.nilable(String)) } + attr_accessor :type + + sig do + params( + id: String, + description: T.nilable(String), + error_message: T.nilable(String), + field: String, + label: String, + options: T::Array[String], + requested_files: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile::OrHash + ], + type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + id: nil, + # Additional instructions for this requested item, or `null`. + description: nil, + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + error_message: nil, + # Stable field key, such as `ssn` or `business_description`. + field: nil, + # Human-readable label for the field, such as `Social Security Number`. + label: nil, + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + options: nil, + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + requested_files: nil, + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + type: nil + ) + end + + sig do + override.returns( + { + id: String, + description: T.nilable(String), + error_message: T.nilable(String), + field: String, + label: String, + options: T::Array[String], + requested_files: + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile + ], + type: T.nilable(String) + } + ) + end + def to_hash + end + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile, + WhopSDK::Internal::AnyHash + ) + end + + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + sig { returns(T.nilable(String)) } + attr_accessor :category + + # Whether this slot can be left empty. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_optional + + sig { params(is_optional: T::Boolean).void } + attr_writer :is_optional + + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + sig { returns(T.nilable(String)) } + attr_accessor :kind + + # Label for this upload slot, such as `Front of ID Document`. + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + # Whether this slot accepts more than one file. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :multiple + + sig { params(multiple: T::Boolean).void } + attr_writer :multiple + + sig do + params( + category: T.nilable(String), + is_optional: T::Boolean, + kind: T.nilable(String), + label: String, + multiple: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + category: nil, + # Whether this slot can be left empty. + is_optional: nil, + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + kind: nil, + # Label for this upload slot, such as `Front of ID Document`. + label: nil, + # Whether this slot accepts more than one file. + multiple: nil + ) + end + + sig do + override.returns( + { + category: T.nilable(String), + is_optional: T::Boolean, + kind: T.nilable(String), + label: String, + multiple: T::Boolean + } + ) + end + def to_hash + end + end + end + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationCreateResponse::RequiredDocument, + WhopSDK::Internal::AnyHash + ) + end + + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + sig { returns(T.nilable(String)) } + attr_reader :document + + sig { params(document: String).void } + attr_writer :document + + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + sig { returns(T.nilable(String)) } + attr_accessor :rejection_reason + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + document: String, + rejection_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + document: nil, + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + rejection_reason: nil, + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + status: nil + ) + end + + sig do + override.returns( + { + document: String, + rejection_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING_UPLOAD = + T.let( + :pending_upload, + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status::TaggedSymbol + ) + SUBMITTED = + T.let( + :submitted, + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::VerificationCreateResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_STARTED = + T.let( + :not_started, + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol + ) + APPROVED = + T.let( + :approved, + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol + ) + ACTION_REQUIRED = + T.let( + :action_required, + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/verification_list_params.rbi b/rbi/whop_sdk/models/verification_list_params.rbi index c5aded88..c0fd106a 100644 --- a/rbi/whop_sdk/models/verification_list_params.rbi +++ b/rbi/whop_sdk/models/verification_list_params.rbi @@ -11,47 +11,51 @@ module WhopSDK T.any(WhopSDK::VerificationListParams, WhopSDK::Internal::AnyHash) end - # The unique identifier of the payout account to list verifications for. + # Account or user ID whose verifications you want to list. Use a `biz_` account + # ID, or the caller's `user_` ID for personal verifications. sig { returns(String) } - attr_accessor :payout_account_id + attr_accessor :account_id - # Returns the elements in the list that come after the specified cursor. - sig { returns(T.nilable(String)) } - attr_accessor :after + # Sort direction for returned verifications. + sig do + returns(T.nilable(WhopSDK::VerificationListParams::Direction::OrSymbol)) + end + attr_reader :direction - # Returns the elements in the list that come before the specified cursor. - sig { returns(T.nilable(String)) } - attr_accessor :before + sig do + params( + direction: WhopSDK::VerificationListParams::Direction::OrSymbol + ).void + end + attr_writer :direction - # Returns the first _n_ elements from the list. - sig { returns(T.nilable(Integer)) } - attr_accessor :first + # Field used to sort returned verifications. + sig do + returns(T.nilable(WhopSDK::VerificationListParams::Order::OrSymbol)) + end + attr_reader :order - # Returns the last _n_ elements from the list. - sig { returns(T.nilable(Integer)) } - attr_accessor :last + sig do + params(order: WhopSDK::VerificationListParams::Order::OrSymbol).void + end + attr_writer :order sig do params( - payout_account_id: String, - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), + account_id: String, + direction: WhopSDK::VerificationListParams::Direction::OrSymbol, + order: WhopSDK::VerificationListParams::Order::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The unique identifier of the payout account to list verifications for. - payout_account_id:, - # Returns the elements in the list that come after the specified cursor. - after: nil, - # Returns the elements in the list that come before the specified cursor. - before: nil, - # Returns the first _n_ elements from the list. - first: nil, - # Returns the last _n_ elements from the list. - last: nil, + # Account or user ID whose verifications you want to list. Use a `biz_` account + # ID, or the caller's `user_` ID for personal verifications. + account_id:, + # Sort direction for returned verifications. + direction: nil, + # Field used to sort returned verifications. + order: nil, request_options: {} ) end @@ -59,17 +63,67 @@ module WhopSDK sig do override.returns( { - payout_account_id: String, - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), + account_id: String, + direction: WhopSDK::VerificationListParams::Direction::OrSymbol, + order: WhopSDK::VerificationListParams::Order::OrSymbol, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + # Sort direction for returned verifications. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::VerificationListParams::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let(:asc, WhopSDK::VerificationListParams::Direction::TaggedSymbol) + DESC = + T.let(:desc, WhopSDK::VerificationListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::VerificationListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # Field used to sort returned verifications. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::VerificationListParams::Order) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UPDATED_AT = + T.let( + :updated_at, + WhopSDK::VerificationListParams::Order::TaggedSymbol + ) + CREATED_AT = + T.let( + :created_at, + WhopSDK::VerificationListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::VerificationListParams::Order::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/verification_list_response.rbi b/rbi/whop_sdk/models/verification_list_response.rbi index e15d1705..92ff1758 100644 --- a/rbi/whop_sdk/models/verification_list_response.rbi +++ b/rbi/whop_sdk/models/verification_list_response.rbi @@ -11,59 +11,803 @@ module WhopSDK ) end - # The numeric id of the verification record. - sig { returns(String) } - attr_accessor :id - - # An error code for a verification attempt. - sig { returns(T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol)) } - attr_accessor :last_error_code - - # A human-readable explanation of the most recent verification error. Null if no - # error has occurred. - sig { returns(T.nilable(String)) } - attr_accessor :last_error_reason + sig do + returns( + T.nilable(T::Array[WhopSDK::Models::VerificationListResponse::Data]) + ) + end + attr_reader :data - # The current status of this verification session. - sig { returns(WhopSDK::VerificationStatus::TaggedSymbol) } - attr_accessor :status + sig do + params( + data: + T::Array[WhopSDK::Models::VerificationListResponse::Data::OrHash] + ).void + end + attr_writer :data - # An identity verification session used to confirm a person or entity's identity - # for payout account eligibility. sig do params( - id: String, - last_error_code: T.nilable(WhopSDK::VerificationErrorCode::OrSymbol), - last_error_reason: T.nilable(String), - status: WhopSDK::VerificationStatus::OrSymbol + data: + T::Array[WhopSDK::Models::VerificationListResponse::Data::OrHash] ).returns(T.attached_class) end - def self.new( - # The numeric id of the verification record. - id:, - # An error code for a verification attempt. - last_error_code:, - # A human-readable explanation of the most recent verification error. Null if no - # error has occurred. - last_error_reason:, - # The current status of this verification session. - status: - ) + def self.new(data: nil) end sig do override.returns( - { - id: String, - last_error_code: - T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol), - last_error_reason: T.nilable(String), - status: WhopSDK::VerificationStatus::TaggedSymbol - } + { data: T::Array[WhopSDK::Models::VerificationListResponse::Data] } ) end def to_hash end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationListResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + # Verification profile ID, prefixed `idpf_`. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Address on the verification profile. `null` when no address is set. + sig do + returns( + T.nilable(WhopSDK::Models::VerificationListResponse::Data::Address) + ) + end + attr_reader :address + + sig do + params( + address: + T.nilable( + WhopSDK::Models::VerificationListResponse::Data::Address::OrHash + ) + ).void + end + attr_writer :address + + # Legal business name. + sig { returns(T.nilable(String)) } + attr_accessor :business_name + + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + sig { returns(T.nilable(String)) } + attr_accessor :business_structure + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # When the verification profile was created, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_at + + sig { params(created_at: String).void } + attr_writer :created_at + + # Formatted as `YYYY-MM-DD`. + sig { returns(T.nilable(String)) } + attr_accessor :date_of_birth + + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationListResponse::Data::Kind::TaggedSymbol + ) + ) + end + attr_reader :kind + + sig do + params( + kind: + WhopSDK::Models::VerificationListResponse::Data::Kind::OrSymbol + ).void + end + attr_writer :kind + + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation + ] + ) + ) + end + attr_reader :requested_information + + sig do + params( + requested_information: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::OrHash + ] + ).void + end + attr_writer :requested_information + + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument + ] + ) + ) + end + attr_reader :required_documents + + sig do + params( + required_documents: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::OrHash + ] + ).void + end + attr_writer :required_documents + + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + sig { returns(T.nilable(String)) } + attr_accessor :session_url + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + WhopSDK::Models::VerificationListResponse::Data::Status::OrSymbol + ).void + end + attr_writer :status + + # When the verification profile was last updated, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :updated_at + + sig { params(updated_at: String).void } + attr_writer :updated_at + + sig do + params( + id: String, + address: + T.nilable( + WhopSDK::Models::VerificationListResponse::Data::Address::OrHash + ), + business_name: T.nilable(String), + business_structure: T.nilable(String), + country: T.nilable(String), + created_at: String, + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + kind: + WhopSDK::Models::VerificationListResponse::Data::Kind::OrSymbol, + last_name: T.nilable(String), + requested_information: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::OrHash + ], + required_documents: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::OrHash + ], + session_url: T.nilable(String), + status: + WhopSDK::Models::VerificationListResponse::Data::Status::OrSymbol, + updated_at: String + ).returns(T.attached_class) + end + def self.new( + # Verification profile ID, prefixed `idpf_`. + id: nil, + # Address on the verification profile. `null` when no address is set. + address: nil, + # Legal business name. + business_name: nil, + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + business_structure: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # When the verification profile was created, as an ISO 8601 timestamp. + created_at: nil, + # Formatted as `YYYY-MM-DD`. + date_of_birth: nil, + first_name: nil, + kind: nil, + last_name: nil, + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + requested_information: nil, + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + required_documents: nil, + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + session_url: nil, + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + status: nil, + # When the verification profile was last updated, as an ISO 8601 timestamp. + updated_at: nil + ) + end + + sig do + override.returns( + { + id: String, + address: + T.nilable( + WhopSDK::Models::VerificationListResponse::Data::Address + ), + business_name: T.nilable(String), + business_structure: T.nilable(String), + country: T.nilable(String), + created_at: String, + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + kind: + WhopSDK::Models::VerificationListResponse::Data::Kind::TaggedSymbol, + last_name: T.nilable(String), + requested_information: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation + ], + required_documents: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument + ], + session_url: T.nilable(String), + status: + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol, + updated_at: String + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationListResponse::Data::Address, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Address on the verification profile. `null` when no address is set. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + module Kind + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::VerificationListResponse::Data::Kind + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INDIVIDUAL = + T.let( + :individual, + WhopSDK::Models::VerificationListResponse::Data::Kind::TaggedSymbol + ) + BUSINESS = + T.let( + :business, + WhopSDK::Models::VerificationListResponse::Data::Kind::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::Kind::TaggedSymbol + ] + ) + end + def self.values + end + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation, + WhopSDK::Internal::AnyHash + ) + end + + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Additional instructions for this requested item, or `null`. + sig { returns(T.nilable(String)) } + attr_accessor :description + + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Stable field key, such as `ssn` or `business_description`. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # Human-readable label for the field, such as `Social Security Number`. + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :options + + sig { params(options: T::Array[String]).void } + attr_writer :options + + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile + ] + ) + ) + end + attr_reader :requested_files + + sig do + params( + requested_files: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile::OrHash + ] + ).void + end + attr_writer :requested_files + + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + sig { returns(T.nilable(String)) } + attr_accessor :type + + sig do + params( + id: String, + description: T.nilable(String), + error_message: T.nilable(String), + field: String, + label: String, + options: T::Array[String], + requested_files: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile::OrHash + ], + type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + id: nil, + # Additional instructions for this requested item, or `null`. + description: nil, + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + error_message: nil, + # Stable field key, such as `ssn` or `business_description`. + field: nil, + # Human-readable label for the field, such as `Social Security Number`. + label: nil, + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + options: nil, + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + requested_files: nil, + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + type: nil + ) + end + + sig do + override.returns( + { + id: String, + description: T.nilable(String), + error_message: T.nilable(String), + field: String, + label: String, + options: T::Array[String], + requested_files: + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile + ], + type: T.nilable(String) + } + ) + end + def to_hash + end + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile, + WhopSDK::Internal::AnyHash + ) + end + + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + sig { returns(T.nilable(String)) } + attr_accessor :category + + # Whether this slot can be left empty. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_optional + + sig { params(is_optional: T::Boolean).void } + attr_writer :is_optional + + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + sig { returns(T.nilable(String)) } + attr_accessor :kind + + # Label for this upload slot, such as `Front of ID Document`. + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + # Whether this slot accepts more than one file. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :multiple + + sig { params(multiple: T::Boolean).void } + attr_writer :multiple + + sig do + params( + category: T.nilable(String), + is_optional: T::Boolean, + kind: T.nilable(String), + label: String, + multiple: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + category: nil, + # Whether this slot can be left empty. + is_optional: nil, + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + kind: nil, + # Label for this upload slot, such as `Front of ID Document`. + label: nil, + # Whether this slot accepts more than one file. + multiple: nil + ) + end + + sig do + override.returns( + { + category: T.nilable(String), + is_optional: T::Boolean, + kind: T.nilable(String), + label: String, + multiple: T::Boolean + } + ) + end + def to_hash + end + end + end + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument, + WhopSDK::Internal::AnyHash + ) + end + + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + sig { returns(T.nilable(String)) } + attr_reader :document + + sig { params(document: String).void } + attr_writer :document + + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + sig { returns(T.nilable(String)) } + attr_accessor :rejection_reason + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + document: String, + rejection_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + document: nil, + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + rejection_reason: nil, + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + status: nil + ) + end + + sig do + override.returns( + { + document: String, + rejection_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING_UPLOAD = + T.let( + :pending_upload, + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status::TaggedSymbol + ) + SUBMITTED = + T.let( + :submitted, + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::VerificationListResponse::Data::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_STARTED = + T.let( + :not_started, + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol + ) + APPROVED = + T.let( + :approved, + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol + ) + ACTION_REQUIRED = + T.let( + :action_required, + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/whop_sdk/models/verification_retrieve_params.rbi b/rbi/whop_sdk/models/verification_retrieve_params.rbi index 4b397eba..40dbcb83 100644 --- a/rbi/whop_sdk/models/verification_retrieve_params.rbi +++ b/rbi/whop_sdk/models/verification_retrieve_params.rbi @@ -12,20 +12,20 @@ module WhopSDK end sig { returns(String) } - attr_accessor :id + attr_accessor :verification_id sig do params( - id: String, + verification_id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(id:, request_options: {}) + def self.new(verification_id:, request_options: {}) end sig do override.returns( - { id: String, request_options: WhopSDK::RequestOptions } + { verification_id: String, request_options: WhopSDK::RequestOptions } ) end def to_hash diff --git a/rbi/whop_sdk/models/verification_retrieve_response.rbi b/rbi/whop_sdk/models/verification_retrieve_response.rbi index 63e033a5..485b5ef3 100644 --- a/rbi/whop_sdk/models/verification_retrieve_response.rbi +++ b/rbi/whop_sdk/models/verification_retrieve_response.rbi @@ -11,43 +11,228 @@ module WhopSDK ) end - # The numeric id of the verification record. - sig { returns(String) } - attr_accessor :id + # Verification profile ID, prefixed `idpf_`. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Address on the verification profile. `null` when no address is set. + sig do + returns( + T.nilable(WhopSDK::Models::VerificationRetrieveResponse::Address) + ) + end + attr_reader :address + + sig do + params( + address: + T.nilable( + WhopSDK::Models::VerificationRetrieveResponse::Address::OrHash + ) + ).void + end + attr_writer :address + + # Legal business name. + sig { returns(T.nilable(String)) } + attr_accessor :business_name + + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + sig { returns(T.nilable(String)) } + attr_accessor :business_structure + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # When the verification profile was created, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_at + + sig { params(created_at: String).void } + attr_writer :created_at + + # Formatted as `YYYY-MM-DD`. + sig { returns(T.nilable(String)) } + attr_accessor :date_of_birth - # An error code for a verification attempt. - sig { returns(T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol)) } - attr_accessor :last_error_code + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationRetrieveResponse::Kind::TaggedSymbol + ) + ) + end + attr_reader :kind + + sig do + params( + kind: WhopSDK::Models::VerificationRetrieveResponse::Kind::OrSymbol + ).void + end + attr_writer :kind - # A human-readable explanation of the most recent verification error. Null if no - # error has occurred. sig { returns(T.nilable(String)) } - attr_accessor :last_error_reason + attr_accessor :last_name - # The current status of this verification session. - sig { returns(WhopSDK::VerificationStatus::TaggedSymbol) } - attr_accessor :status + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation + ] + ) + ) + end + attr_reader :requested_information + + sig do + params( + requested_information: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::OrHash + ] + ).void + end + attr_writer :requested_information + + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument + ] + ) + ) + end + attr_reader :required_documents + + sig do + params( + required_documents: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::OrHash + ] + ).void + end + attr_writer :required_documents + + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + sig { returns(T.nilable(String)) } + attr_accessor :session_url + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + WhopSDK::Models::VerificationRetrieveResponse::Status::OrSymbol + ).void + end + attr_writer :status + + # When the verification profile was last updated, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :updated_at + + sig { params(updated_at: String).void } + attr_writer :updated_at - # An identity verification session used to confirm a person or entity's identity - # for payout account eligibility. sig do params( id: String, - last_error_code: T.nilable(WhopSDK::VerificationErrorCode::OrSymbol), - last_error_reason: T.nilable(String), - status: WhopSDK::VerificationStatus::OrSymbol + address: + T.nilable( + WhopSDK::Models::VerificationRetrieveResponse::Address::OrHash + ), + business_name: T.nilable(String), + business_structure: T.nilable(String), + country: T.nilable(String), + created_at: String, + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + kind: WhopSDK::Models::VerificationRetrieveResponse::Kind::OrSymbol, + last_name: T.nilable(String), + requested_information: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::OrHash + ], + required_documents: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::OrHash + ], + session_url: T.nilable(String), + status: + WhopSDK::Models::VerificationRetrieveResponse::Status::OrSymbol, + updated_at: String ).returns(T.attached_class) end def self.new( - # The numeric id of the verification record. - id:, - # An error code for a verification attempt. - last_error_code:, - # A human-readable explanation of the most recent verification error. Null if no - # error has occurred. - last_error_reason:, - # The current status of this verification session. - status: + # Verification profile ID, prefixed `idpf_`. + id: nil, + # Address on the verification profile. `null` when no address is set. + address: nil, + # Legal business name. + business_name: nil, + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + business_structure: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # When the verification profile was created, as an ISO 8601 timestamp. + created_at: nil, + # Formatted as `YYYY-MM-DD`. + date_of_birth: nil, + first_name: nil, + kind: nil, + last_name: nil, + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + requested_information: nil, + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + required_documents: nil, + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + session_url: nil, + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + status: nil, + # When the verification profile was last updated, as an ISO 8601 timestamp. + updated_at: nil ) end @@ -55,15 +240,522 @@ module WhopSDK override.returns( { id: String, - last_error_code: - T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol), - last_error_reason: T.nilable(String), - status: WhopSDK::VerificationStatus::TaggedSymbol + address: + T.nilable(WhopSDK::Models::VerificationRetrieveResponse::Address), + business_name: T.nilable(String), + business_structure: T.nilable(String), + country: T.nilable(String), + created_at: String, + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + kind: + WhopSDK::Models::VerificationRetrieveResponse::Kind::TaggedSymbol, + last_name: T.nilable(String), + requested_information: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation + ], + required_documents: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument + ], + session_url: T.nilable(String), + status: + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol, + updated_at: String } ) end def to_hash end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationRetrieveResponse::Address, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Address on the verification profile. `null` when no address is set. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + module Kind + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::VerificationRetrieveResponse::Kind) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INDIVIDUAL = + T.let( + :individual, + WhopSDK::Models::VerificationRetrieveResponse::Kind::TaggedSymbol + ) + BUSINESS = + T.let( + :business, + WhopSDK::Models::VerificationRetrieveResponse::Kind::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::Kind::TaggedSymbol + ] + ) + end + def self.values + end + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation, + WhopSDK::Internal::AnyHash + ) + end + + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Additional instructions for this requested item, or `null`. + sig { returns(T.nilable(String)) } + attr_accessor :description + + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Stable field key, such as `ssn` or `business_description`. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # Human-readable label for the field, such as `Social Security Number`. + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :options + + sig { params(options: T::Array[String]).void } + attr_writer :options + + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile + ] + ) + ) + end + attr_reader :requested_files + + sig do + params( + requested_files: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile::OrHash + ] + ).void + end + attr_writer :requested_files + + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + sig { returns(T.nilable(String)) } + attr_accessor :type + + sig do + params( + id: String, + description: T.nilable(String), + error_message: T.nilable(String), + field: String, + label: String, + options: T::Array[String], + requested_files: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile::OrHash + ], + type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + id: nil, + # Additional instructions for this requested item, or `null`. + description: nil, + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + error_message: nil, + # Stable field key, such as `ssn` or `business_description`. + field: nil, + # Human-readable label for the field, such as `Social Security Number`. + label: nil, + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + options: nil, + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + requested_files: nil, + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + type: nil + ) + end + + sig do + override.returns( + { + id: String, + description: T.nilable(String), + error_message: T.nilable(String), + field: String, + label: String, + options: T::Array[String], + requested_files: + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile + ], + type: T.nilable(String) + } + ) + end + def to_hash + end + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile, + WhopSDK::Internal::AnyHash + ) + end + + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + sig { returns(T.nilable(String)) } + attr_accessor :category + + # Whether this slot can be left empty. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_optional + + sig { params(is_optional: T::Boolean).void } + attr_writer :is_optional + + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + sig { returns(T.nilable(String)) } + attr_accessor :kind + + # Label for this upload slot, such as `Front of ID Document`. + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + # Whether this slot accepts more than one file. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :multiple + + sig { params(multiple: T::Boolean).void } + attr_writer :multiple + + sig do + params( + category: T.nilable(String), + is_optional: T::Boolean, + kind: T.nilable(String), + label: String, + multiple: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + category: nil, + # Whether this slot can be left empty. + is_optional: nil, + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + kind: nil, + # Label for this upload slot, such as `Front of ID Document`. + label: nil, + # Whether this slot accepts more than one file. + multiple: nil + ) + end + + sig do + override.returns( + { + category: T.nilable(String), + is_optional: T::Boolean, + kind: T.nilable(String), + label: String, + multiple: T::Boolean + } + ) + end + def to_hash + end + end + end + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument, + WhopSDK::Internal::AnyHash + ) + end + + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + sig { returns(T.nilable(String)) } + attr_reader :document + + sig { params(document: String).void } + attr_writer :document + + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + sig { returns(T.nilable(String)) } + attr_accessor :rejection_reason + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + document: String, + rejection_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + document: nil, + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + rejection_reason: nil, + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + status: nil + ) + end + + sig do + override.returns( + { + document: String, + rejection_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING_UPLOAD = + T.let( + :pending_upload, + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status::TaggedSymbol + ) + SUBMITTED = + T.let( + :submitted, + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::VerificationRetrieveResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_STARTED = + T.let( + :not_started, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + APPROVED = + T.let( + :approved, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + ACTION_REQUIRED = + T.let( + :action_required, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/verification_update_params.rbi b/rbi/whop_sdk/models/verification_update_params.rbi new file mode 100644 index 00000000..abd97063 --- /dev/null +++ b/rbi/whop_sdk/models/verification_update_params.rbi @@ -0,0 +1,1187 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::VerificationUpdateParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :verification_id + + # Fields that can be updated on an individual (KYC) verification. At least one + # field is required. + sig do + returns( + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification, + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification + ) + ) + end + attr_accessor :body + + sig do + params( + verification_id: String, + body: + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::OrHash, + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::OrHash + ), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + verification_id:, + # Fields that can be updated on an individual (KYC) verification. At least one + # field is required. + body:, + request_options: {} + ) + end + + sig do + override.returns( + { + verification_id: String, + body: + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification, + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification + ), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Fields that can be updated on an individual (KYC) verification. At least one + # field is required. + module Body + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification, + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification + ) + end + + class UpdateIndividualVerification < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification, + WhopSDK::Internal::AnyHash + ) + end + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # Formatted as `YYYY-MM-DD`. + sig { returns(T.nilable(String)) } + attr_reader :date_of_birth + + sig { params(date_of_birth: String).void } + attr_writer :date_of_birth + + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Personal address for the individual. + sig do + returns( + T.nilable( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress + ) + ) + end + attr_reader :personal_address + + sig do + params( + personal_address: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress::OrHash + ).void + end + attr_writer :personal_address + + # Answers to items returned in `requested_information`. Each entry must include + # the requested item `id` and exactly one answer payload matching the item's + # `type`: `value` for `text`, `date`, or `phone`; `address` for `address`; `files` + # for `files`. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation + ] + ) + ) + end + attr_reader :requested_information + + sig do + params( + requested_information: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::OrHash + ] + ).void + end + attr_writer :requested_information + + # Fields that can be updated on an individual (KYC) verification. At least one + # field is required. + sig do + params( + country: String, + date_of_birth: String, + first_name: String, + last_name: String, + personal_address: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress::OrHash, + requested_information: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # Formatted as `YYYY-MM-DD`. + date_of_birth: nil, + first_name: nil, + last_name: nil, + # Personal address for the individual. + personal_address: nil, + # Answers to items returned in `requested_information`. Each entry must include + # the requested item `id` and exactly one answer payload matching the item's + # `type`: `value` for `text`, `date`, or `phone`; `address` for `address`; `files` + # for `files`. + requested_information: nil + ) + end + + sig do + override.returns( + { + country: String, + date_of_birth: String, + first_name: String, + last_name: String, + personal_address: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, + requested_information: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation + ] + } + ) + end + def to_hash + end + + class PersonalAddress < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + # Personal address for the individual. + sig do + params( + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation, + WhopSDK::Internal::AnyHash + ) + end + + # Requested information item ID, prefixed `inrqi_`. + sig { returns(String) } + attr_accessor :id + + # Address payload for `address` items. + sig do + returns( + T.nilable( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address::OrHash + ).void + end + attr_writer :address + + # Uploaded file payloads for `files` items. Each file should include a + # `direct_upload_id` from the upload flow, plus the requested file `category` and + # `kind` when provided. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File + ] + ) + ) + end + attr_reader :files + + sig do + params( + files: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File::OrHash + ] + ).void + end + attr_writer :files + + # Answer value for `text`, `date`, or `phone` items. + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + # Whether `value` is raw input or a vault token. + sig do + returns( + T.nilable( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType::OrSymbol + ) + ) + end + attr_reader :value_type + + sig do + params( + value_type: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType::OrSymbol + ).void + end + attr_writer :value_type + + sig do + params( + id: String, + address: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address::OrHash, + files: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File::OrHash + ], + value: String, + value_type: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Requested information item ID, prefixed `inrqi_`. + id:, + # Address payload for `address` items. + address: nil, + # Uploaded file payloads for `files` items. Each file should include a + # `direct_upload_id` from the upload flow, plus the requested file `category` and + # `kind` when provided. + files: nil, + # Answer value for `text`, `date`, or `phone` items. + value: nil, + # Whether `value` is raw input or a vault token. + value_type: nil + ) + end + + sig do + override.returns( + { + id: String, + address: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address, + files: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File + ], + value: String, + value_type: + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType::OrSymbol + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + # Address payload for `address` items. + sig do + params( + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + + class File < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File, + WhopSDK::Internal::AnyHash + ) + end + + # Existing attachment ID, when reusing an already attached document. + sig { returns(T.nilable(String)) } + attr_reader :attachment_id + + sig { params(attachment_id: String).void } + attr_writer :attachment_id + + # Requested file category copied from `requested_files.category`. + sig { returns(T.nilable(String)) } + attr_reader :category + + sig { params(category: String).void } + attr_writer :category + + # Direct upload ID for the uploaded document. + sig { returns(T.nilable(String)) } + attr_reader :direct_upload_id + + sig { params(direct_upload_id: String).void } + attr_writer :direct_upload_id + + # Requested document kind copied from `requested_files.kind`. + sig { returns(T.nilable(String)) } + attr_reader :kind + + sig { params(kind: String).void } + attr_writer :kind + + sig do + params( + attachment_id: String, + category: String, + direct_upload_id: String, + kind: String + ).returns(T.attached_class) + end + def self.new( + # Existing attachment ID, when reusing an already attached document. + attachment_id: nil, + # Requested file category copied from `requested_files.category`. + category: nil, + # Direct upload ID for the uploaded document. + direct_upload_id: nil, + # Requested document kind copied from `requested_files.kind`. + kind: nil + ) + end + + sig do + override.returns( + { + attachment_id: String, + category: String, + direct_upload_id: String, + kind: String + } + ) + end + def to_hash + end + end + + # Whether `value` is raw input or a vault token. + module ValueType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RAW = + T.let( + :raw, + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType::TaggedSymbol + ) + VAULT_TOKEN = + T.let( + :vault_token, + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::ValueType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class UpdateBusinessVerification < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification, + WhopSDK::Internal::AnyHash + ) + end + + # Business address. + sig do + returns( + T.nilable( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress + ) + ) + end + attr_reader :business_address + + sig do + params( + business_address: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress::OrHash + ).void + end + attr_writer :business_address + + # Legal business name. + sig { returns(T.nilable(String)) } + attr_reader :business_name + + sig { params(business_name: String).void } + attr_writer :business_name + + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + sig { returns(T.nilable(String)) } + attr_reader :business_structure + + sig { params(business_structure: String).void } + attr_writer :business_structure + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # Answers to items returned in `requested_information`. Each entry must include + # the requested item `id` and exactly one answer payload matching the item's + # `type`: `value` for `text`, `date`, or `phone`; `address` for `address`; `files` + # for `files`. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation + ] + ) + ) + end + attr_reader :requested_information + + sig do + params( + requested_information: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::OrHash + ] + ).void + end + attr_writer :requested_information + + # Fields that can be updated on a business entity (KYB) verification. At least one + # field is required. + sig do + params( + business_address: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress::OrHash, + business_name: String, + business_structure: String, + country: String, + requested_information: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Business address. + business_address: nil, + # Legal business name. + business_name: nil, + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + business_structure: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # Answers to items returned in `requested_information`. Each entry must include + # the requested item `id` and exactly one answer payload matching the item's + # `type`: `value` for `text`, `date`, or `phone`; `address` for `address`; `files` + # for `files`. + requested_information: nil + ) + end + + sig do + override.returns( + { + business_address: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, + business_name: String, + business_structure: String, + country: String, + requested_information: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation + ] + } + ) + end + def to_hash + end + + class BusinessAddress < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + # Business address. + sig do + params( + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation, + WhopSDK::Internal::AnyHash + ) + end + + # Requested information item ID, prefixed `inrqi_`. + sig { returns(String) } + attr_accessor :id + + # Address payload for `address` items. + sig do + returns( + T.nilable( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address::OrHash + ).void + end + attr_writer :address + + # Uploaded file payloads for `files` items. Each file should include a + # `direct_upload_id` from the upload flow, plus the requested file `category` and + # `kind` when provided. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File + ] + ) + ) + end + attr_reader :files + + sig do + params( + files: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File::OrHash + ] + ).void + end + attr_writer :files + + # Answer value for `text`, `date`, or `phone` items. + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + # Whether `value` is raw input or a vault token. + sig do + returns( + T.nilable( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType::OrSymbol + ) + ) + end + attr_reader :value_type + + sig do + params( + value_type: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType::OrSymbol + ).void + end + attr_writer :value_type + + sig do + params( + id: String, + address: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address::OrHash, + files: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File::OrHash + ], + value: String, + value_type: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Requested information item ID, prefixed `inrqi_`. + id:, + # Address payload for `address` items. + address: nil, + # Uploaded file payloads for `files` items. Each file should include a + # `direct_upload_id` from the upload flow, plus the requested file `category` and + # `kind` when provided. + files: nil, + # Answer value for `text`, `date`, or `phone` items. + value: nil, + # Whether `value` is raw input or a vault token. + value_type: nil + ) + end + + sig do + override.returns( + { + id: String, + address: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address, + files: + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File + ], + value: String, + value_type: + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType::OrSymbol + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + # Address payload for `address` items. + sig do + params( + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + + class File < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File, + WhopSDK::Internal::AnyHash + ) + end + + # Existing attachment ID, when reusing an already attached document. + sig { returns(T.nilable(String)) } + attr_reader :attachment_id + + sig { params(attachment_id: String).void } + attr_writer :attachment_id + + # Requested file category copied from `requested_files.category`. + sig { returns(T.nilable(String)) } + attr_reader :category + + sig { params(category: String).void } + attr_writer :category + + # Direct upload ID for the uploaded document. + sig { returns(T.nilable(String)) } + attr_reader :direct_upload_id + + sig { params(direct_upload_id: String).void } + attr_writer :direct_upload_id + + # Requested document kind copied from `requested_files.kind`. + sig { returns(T.nilable(String)) } + attr_reader :kind + + sig { params(kind: String).void } + attr_writer :kind + + sig do + params( + attachment_id: String, + category: String, + direct_upload_id: String, + kind: String + ).returns(T.attached_class) + end + def self.new( + # Existing attachment ID, when reusing an already attached document. + attachment_id: nil, + # Requested file category copied from `requested_files.category`. + category: nil, + # Direct upload ID for the uploaded document. + direct_upload_id: nil, + # Requested document kind copied from `requested_files.kind`. + kind: nil + ) + end + + sig do + override.returns( + { + attachment_id: String, + category: String, + direct_upload_id: String, + kind: String + } + ) + end + def to_hash + end + end + + # Whether `value` is raw input or a vault token. + module ValueType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RAW = + T.let( + :raw, + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType::TaggedSymbol + ) + VAULT_TOKEN = + T.let( + :vault_token, + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::ValueType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + sig do + override.returns( + T::Array[WhopSDK::VerificationUpdateParams::Body::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/whop_sdk/models/verification_update_response.rbi b/rbi/whop_sdk/models/verification_update_response.rbi new file mode 100644 index 00000000..2bfd1b49 --- /dev/null +++ b/rbi/whop_sdk/models/verification_update_response.rbi @@ -0,0 +1,757 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationUpdateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationUpdateResponse, + WhopSDK::Internal::AnyHash + ) + end + + # Verification profile ID, prefixed `idpf_`. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Address on the verification profile. `null` when no address is set. + sig do + returns(T.nilable(WhopSDK::Models::VerificationUpdateResponse::Address)) + end + attr_reader :address + + sig do + params( + address: + T.nilable( + WhopSDK::Models::VerificationUpdateResponse::Address::OrHash + ) + ).void + end + attr_writer :address + + # Legal business name. + sig { returns(T.nilable(String)) } + attr_accessor :business_name + + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + sig { returns(T.nilable(String)) } + attr_accessor :business_structure + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # When the verification profile was created, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_at + + sig { params(created_at: String).void } + attr_writer :created_at + + # Formatted as `YYYY-MM-DD`. + sig { returns(T.nilable(String)) } + attr_accessor :date_of_birth + + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationUpdateResponse::Kind::TaggedSymbol + ) + ) + end + attr_reader :kind + + sig do + params( + kind: WhopSDK::Models::VerificationUpdateResponse::Kind::OrSymbol + ).void + end + attr_writer :kind + + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation + ] + ) + ) + end + attr_reader :requested_information + + sig do + params( + requested_information: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::OrHash + ] + ).void + end + attr_writer :requested_information + + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument + ] + ) + ) + end + attr_reader :required_documents + + sig do + params( + required_documents: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::OrHash + ] + ).void + end + attr_writer :required_documents + + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + sig { returns(T.nilable(String)) } + attr_accessor :session_url + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: WhopSDK::Models::VerificationUpdateResponse::Status::OrSymbol + ).void + end + attr_writer :status + + # When the verification profile was last updated, as an ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :updated_at + + sig { params(updated_at: String).void } + attr_writer :updated_at + + sig do + params( + id: String, + address: + T.nilable( + WhopSDK::Models::VerificationUpdateResponse::Address::OrHash + ), + business_name: T.nilable(String), + business_structure: T.nilable(String), + country: T.nilable(String), + created_at: String, + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + kind: WhopSDK::Models::VerificationUpdateResponse::Kind::OrSymbol, + last_name: T.nilable(String), + requested_information: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::OrHash + ], + required_documents: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::OrHash + ], + session_url: T.nilable(String), + status: WhopSDK::Models::VerificationUpdateResponse::Status::OrSymbol, + updated_at: String + ).returns(T.attached_class) + end + def self.new( + # Verification profile ID, prefixed `idpf_`. + id: nil, + # Address on the verification profile. `null` when no address is set. + address: nil, + # Legal business name. + business_name: nil, + # Legal entity structure of the business, such as `private_corporation` or + # `sole_proprietorship`. Supported values vary by country of incorporation — see + # [Business structures](/developer/verification/business-structures). + business_structure: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # When the verification profile was created, as an ISO 8601 timestamp. + created_at: nil, + # Formatted as `YYYY-MM-DD`. + date_of_birth: nil, + first_name: nil, + kind: nil, + last_name: nil, + # Fields or documents Whop still needs before review can continue. Submit answers + # with the Update Verification endpoint. + requested_information: nil, + # Documents for a document-upload verification and their progress. Present only on + # verifications created by sending `documents`. `pending_upload` documents were + # not accepted yet — send the full set again with another Create Verification + # call. + required_documents: nil, + # Hosted verification session URL for the user to complete identity checks. + # Expires 7 days after creation. + session_url: nil, + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + status: nil, + # When the verification profile was last updated, as an ISO 8601 timestamp. + updated_at: nil + ) + end + + sig do + override.returns( + { + id: String, + address: + T.nilable(WhopSDK::Models::VerificationUpdateResponse::Address), + business_name: T.nilable(String), + business_structure: T.nilable(String), + country: T.nilable(String), + created_at: String, + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + kind: + WhopSDK::Models::VerificationUpdateResponse::Kind::TaggedSymbol, + last_name: T.nilable(String), + requested_information: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation + ], + required_documents: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument + ], + session_url: T.nilable(String), + status: + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol, + updated_at: String + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationUpdateResponse::Address, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # First line of the street address. + sig { returns(T.nilable(String)) } + attr_reader :line1 + + sig { params(line1: String).void } + attr_writer :line1 + + # Second line of the street address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # Postal or ZIP code. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State, province, or region code, for example `CA`. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Address on the verification profile. `null` when no address is set. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + city: nil, + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. + country: nil, + # First line of the street address. + line1: nil, + # Second line of the street address. + line2: nil, + # Postal or ZIP code. + postal_code: nil, + # State, province, or region code, for example `CA`. + state: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + module Kind + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::VerificationUpdateResponse::Kind) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INDIVIDUAL = + T.let( + :individual, + WhopSDK::Models::VerificationUpdateResponse::Kind::TaggedSymbol + ) + BUSINESS = + T.let( + :business, + WhopSDK::Models::VerificationUpdateResponse::Kind::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::Kind::TaggedSymbol + ] + ) + end + def self.values + end + end + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation, + WhopSDK::Internal::AnyHash + ) + end + + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Additional instructions for this requested item, or `null`. + sig { returns(T.nilable(String)) } + attr_accessor :description + + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Stable field key, such as `ssn` or `business_description`. + sig { returns(T.nilable(String)) } + attr_reader :field + + sig { params(field: String).void } + attr_writer :field + + # Human-readable label for the field, such as `Social Security Number`. + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :options + + sig { params(options: T::Array[String]).void } + attr_writer :options + + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + sig do + returns( + T.nilable( + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile + ] + ) + ) + end + attr_reader :requested_files + + sig do + params( + requested_files: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile::OrHash + ] + ).void + end + attr_writer :requested_files + + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + sig { returns(T.nilable(String)) } + attr_accessor :type + + sig do + params( + id: String, + description: T.nilable(String), + error_message: T.nilable(String), + field: String, + label: String, + options: T::Array[String], + requested_files: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile::OrHash + ], + type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Requested information item ID, prefixed `inrqi_`. Include this ID when + # submitting an answer. + id: nil, + # Additional instructions for this requested item, or `null`. + description: nil, + # Reason a previously submitted value was rejected. `null` if no submitted value + # has been rejected. + error_message: nil, + # Stable field key, such as `ssn` or `business_description`. + field: nil, + # Human-readable label for the field, such as `Social Security Number`. + label: nil, + # Allowed values for a `select` field (e.g. account_type, business_structure) — + # the submitted value must be one of these; empty for other types. + options: nil, + # Document upload slots for this item. Present when `type` is `files`; upload one + # file for each required slot and include the slot's `category` when submitting + # the answer. + requested_files: nil, + # Input type expected for this item: `text`, `date`, `phone`, `address`, `files`, + # or `select`. + type: nil + ) + end + + sig do + override.returns( + { + id: String, + description: T.nilable(String), + error_message: T.nilable(String), + field: String, + label: String, + options: T::Array[String], + requested_files: + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile + ], + type: T.nilable(String) + } + ) + end + def to_hash + end + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile, + WhopSDK::Internal::AnyHash + ) + end + + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + sig { returns(T.nilable(String)) } + attr_accessor :category + + # Whether this slot can be left empty. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_optional + + sig { params(is_optional: T::Boolean).void } + attr_writer :is_optional + + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + sig { returns(T.nilable(String)) } + attr_accessor :kind + + # Label for this upload slot, such as `Front of ID Document`. + sig { returns(T.nilable(String)) } + attr_reader :label + + sig { params(label: String).void } + attr_writer :label + + # Whether this slot accepts more than one file. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :multiple + + sig { params(multiple: T::Boolean).void } + attr_writer :multiple + + sig do + params( + category: T.nilable(String), + is_optional: T::Boolean, + kind: T.nilable(String), + label: String, + multiple: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # File category to include with the uploaded file so Whop can route the document + # correctly. `null` for a generic upload. + category: nil, + # Whether this slot can be left empty. + is_optional: nil, + # Specific document type requested, such as `Bank Statement`. `null` for standard + # identity and business document uploads. + kind: nil, + # Label for this upload slot, such as `Front of ID Document`. + label: nil, + # Whether this slot accepts more than one file. + multiple: nil + ) + end + + sig do + override.returns( + { + category: T.nilable(String), + is_optional: T::Boolean, + kind: T.nilable(String), + label: String, + multiple: T::Boolean + } + ) + end + def to_hash + end + end + end + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument, + WhopSDK::Internal::AnyHash + ) + end + + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + sig { returns(T.nilable(String)) } + attr_reader :document + + sig { params(document: String).void } + attr_writer :document + + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + sig { returns(T.nilable(String)) } + attr_accessor :rejection_reason + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + document: String, + rejection_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Document slot key, such as `id_card_front`, `id_card_back`, or `selfie`. + document: nil, + # Why the previous submission was rejected, when the provider requested new + # documents or declined the verification. + rejection_reason: nil, + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + status: nil + ) + end + + sig do + override.returns( + { + document: String, + rejection_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # `pending_upload` until the document has been relayed for review; `submitted` + # afterwards. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING_UPLOAD = + T.let( + :pending_upload, + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status::TaggedSymbol + ) + SUBMITTED = + T.let( + :submitted, + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Current verification state. `not_started` before any session has been created; + # `pending` while a session is in progress; `action_required` when items in + # `requested_information` need answers before review can continue; `approved` once + # verification succeeds; `rejected` if it fails. Call the Create Verification + # endpoint again to start a new session. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::VerificationUpdateResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_STARTED = + T.let( + :not_started, + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol + ) + APPROVED = + T.let( + :approved, + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol + ) + ACTION_REQUIRED = + T.let( + :action_required, + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/wallet_balance_response.rbi b/rbi/whop_sdk/models/wallet_balance_response.rbi deleted file mode 100644 index 2e206b73..00000000 --- a/rbi/whop_sdk/models/wallet_balance_response.rbi +++ /dev/null @@ -1,145 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class WalletBalanceResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::WalletBalanceResponse, - WhopSDK::Internal::AnyHash - ) - end - - sig do - returns(WhopSDK::Models::WalletBalanceResponse::Object::TaggedSymbol) - end - attr_accessor :object - - sig { returns(T::Array[WhopSDK::Models::WalletBalanceResponse::Token]) } - attr_accessor :tokens - - sig { returns(String) } - attr_accessor :total_usd - - sig do - params( - object: WhopSDK::Models::WalletBalanceResponse::Object::OrSymbol, - tokens: - T::Array[WhopSDK::Models::WalletBalanceResponse::Token::OrHash], - total_usd: String - ).returns(T.attached_class) - end - def self.new(object:, tokens:, total_usd:) - end - - sig do - override.returns( - { - object: - WhopSDK::Models::WalletBalanceResponse::Object::TaggedSymbol, - tokens: T::Array[WhopSDK::Models::WalletBalanceResponse::Token], - total_usd: String - } - ) - end - def to_hash - end - - module Object - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::Models::WalletBalanceResponse::Object) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - BALANCE = - T.let( - :balance, - WhopSDK::Models::WalletBalanceResponse::Object::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::Models::WalletBalanceResponse::Object::TaggedSymbol - ] - ) - end - def self.values - end - end - - class Token < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::WalletBalanceResponse::Token, - WhopSDK::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :balance - - sig { returns(T.nilable(String)) } - attr_accessor :icon_url - - sig { returns(String) } - attr_accessor :name - - sig { returns(Float) } - attr_accessor :price_usd - - sig { returns(String) } - attr_accessor :symbol - - sig { returns(T.nilable(String)) } - attr_accessor :token_address - - sig { returns(String) } - attr_accessor :value_usd - - sig do - params( - balance: String, - icon_url: T.nilable(String), - name: String, - price_usd: Float, - symbol: String, - token_address: T.nilable(String), - value_usd: String - ).returns(T.attached_class) - end - def self.new( - balance:, - icon_url:, - name:, - price_usd:, - symbol:, - token_address:, - value_usd: - ) - end - - sig do - override.returns( - { - balance: String, - icon_url: T.nilable(String), - name: String, - price_usd: Float, - symbol: String, - token_address: T.nilable(String), - value_usd: String - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/models/wallet_list_response.rbi b/rbi/whop_sdk/models/wallet_list_response.rbi deleted file mode 100644 index 3b70938c..00000000 --- a/rbi/whop_sdk/models/wallet_list_response.rbi +++ /dev/null @@ -1,66 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class WalletListResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Models::WalletListResponse, WhopSDK::Internal::AnyHash) - end - - sig { returns(T::Array[WhopSDK::Models::WalletListResponse::Wallet]) } - attr_accessor :wallets - - sig do - params( - wallets: T::Array[WhopSDK::Models::WalletListResponse::Wallet::OrHash] - ).returns(T.attached_class) - end - def self.new(wallets:) - end - - sig do - override.returns( - { wallets: T::Array[WhopSDK::Models::WalletListResponse::Wallet] } - ) - end - def to_hash - end - - class Wallet < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::WalletListResponse::Wallet, - WhopSDK::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :address - - sig { returns(String) } - attr_accessor :balance_usd - - sig { returns(String) } - attr_accessor :network - - sig do - params(address: String, balance_usd: String, network: String).returns( - T.attached_class - ) - end - def self.new(address:, balance_usd:, network:) - end - - sig do - override.returns( - { address: String, balance_usd: String, network: String } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/models/wallet_send_params.rbi b/rbi/whop_sdk/models/wallet_send_params.rbi deleted file mode 100644 index a7f21fc8..00000000 --- a/rbi/whop_sdk/models/wallet_send_params.rbi +++ /dev/null @@ -1,59 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class WalletSendParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any(WhopSDK::WalletSendParams, WhopSDK::Internal::AnyHash) - end - - # The sending account ID. - sig { returns(String) } - attr_accessor :account_id - - # USDT amount to send. - sig { returns(String) } - attr_accessor :amount - - # Recipient user ID, business account ID, ledger account ID, or email. - sig { returns(String) } - attr_accessor :to - - sig do - params( - account_id: String, - amount: String, - to: String, - request_options: WhopSDK::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The sending account ID. - account_id:, - # USDT amount to send. - amount:, - # Recipient user ID, business account ID, ledger account ID, or email. - to:, - request_options: {} - ) - end - - sig do - override.returns( - { - account_id: String, - amount: String, - to: String, - request_options: WhopSDK::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/whop_sdk/models/wallet_send_response.rbi b/rbi/whop_sdk/models/wallet_send_response.rbi deleted file mode 100644 index 37ce8f73..00000000 --- a/rbi/whop_sdk/models/wallet_send_response.rbi +++ /dev/null @@ -1,146 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class WalletSendResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Models::WalletSendResponse, WhopSDK::Internal::AnyHash) - end - - sig { returns(String) } - attr_accessor :amount - - sig { returns(String) } - attr_accessor :currency - - sig { returns(WhopSDK::Models::WalletSendResponse::Destination) } - attr_reader :destination - - sig do - params( - destination: WhopSDK::Models::WalletSendResponse::Destination::OrHash - ).void - end - attr_writer :destination - - sig { returns(WhopSDK::Models::WalletSendResponse::Object::TaggedSymbol) } - attr_accessor :object - - sig { returns(WhopSDK::Models::WalletSendResponse::Source) } - attr_reader :source - - sig do - params(source: WhopSDK::Models::WalletSendResponse::Source::OrHash).void - end - attr_writer :source - - sig { returns(String) } - attr_accessor :tx_hash - - sig do - params( - amount: String, - currency: String, - destination: WhopSDK::Models::WalletSendResponse::Destination::OrHash, - object: WhopSDK::Models::WalletSendResponse::Object::OrSymbol, - source: WhopSDK::Models::WalletSendResponse::Source::OrHash, - tx_hash: String - ).returns(T.attached_class) - end - def self.new(amount:, currency:, destination:, object:, source:, tx_hash:) - end - - sig do - override.returns( - { - amount: String, - currency: String, - destination: WhopSDK::Models::WalletSendResponse::Destination, - object: WhopSDK::Models::WalletSendResponse::Object::TaggedSymbol, - source: WhopSDK::Models::WalletSendResponse::Source, - tx_hash: String - } - ) - end - def to_hash - end - - class Destination < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::WalletSendResponse::Destination, - WhopSDK::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :account_id - - sig { returns(String) } - attr_accessor :address - - sig do - params(account_id: String, address: String).returns(T.attached_class) - end - def self.new(account_id:, address:) - end - - sig { override.returns({ account_id: String, address: String }) } - def to_hash - end - end - - module Object - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::Models::WalletSendResponse::Object) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - SEND = - T.let( - :send, - WhopSDK::Models::WalletSendResponse::Object::TaggedSymbol - ) - - sig do - override.returns( - T::Array[WhopSDK::Models::WalletSendResponse::Object::TaggedSymbol] - ) - end - def self.values - end - end - - class Source < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::WalletSendResponse::Source, - WhopSDK::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :account_id - - sig { returns(String) } - attr_accessor :address - - sig do - params(account_id: String, address: String).returns(T.attached_class) - end - def self.new(account_id:, address:) - end - - sig { override.returns({ account_id: String, address: String }) } - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/models/webhook_event.rbi b/rbi/whop_sdk/models/webhook_event.rbi index 6a1db4c9..c85f5e7c 100644 --- a/rbi/whop_sdk/models/webhook_event.rbi +++ b/rbi/whop_sdk/models/webhook_event.rbi @@ -25,6 +25,11 @@ module WhopSDK T.let(:"membership.activated", WhopSDK::WebhookEvent::TaggedSymbol) MEMBERSHIP_DEACTIVATED = T.let(:"membership.deactivated", WhopSDK::WebhookEvent::TaggedSymbol) + MEMBERSHIP_TRIAL_ENDING_SOON = + T.let( + :"membership.trial_ending_soon", + WhopSDK::WebhookEvent::TaggedSymbol + ) ENTRY_CREATED = T.let(:"entry.created", WhopSDK::WebhookEvent::TaggedSymbol) ENTRY_APPROVED = @@ -41,6 +46,11 @@ module WhopSDK T.let(:"setup_intent.succeeded", WhopSDK::WebhookEvent::TaggedSymbol) SETUP_INTENT_CANCELED = T.let(:"setup_intent.canceled", WhopSDK::WebhookEvent::TaggedSymbol) + LEDGER_ACCOUNT_FUNDS_AVAILABLE = + T.let( + :"ledger_account.funds_available", + WhopSDK::WebhookEvent::TaggedSymbol + ) WITHDRAWAL_CREATED = T.let(:"withdrawal.created", WhopSDK::WebhookEvent::TaggedSymbol) WITHDRAWAL_UPDATED = @@ -85,6 +95,10 @@ module WhopSDK :"resolution_center_case.decided", WhopSDK::WebhookEvent::TaggedSymbol ) + CHAT_MESSAGE_CREATED = + T.let(:"chat.message.created", WhopSDK::WebhookEvent::TaggedSymbol) + CHAT_REACTION_CREATED = + T.let(:"chat.reaction.created", WhopSDK::WebhookEvent::TaggedSymbol) PAYMENT_CREATED = T.let(:"payment.created", WhopSDK::WebhookEvent::TaggedSymbol) PAYMENT_SUCCEEDED = diff --git a/rbi/whop_sdk/models/withdrawal.rbi b/rbi/whop_sdk/models/withdrawal.rbi index 6a5c4a78..90815731 100644 --- a/rbi/whop_sdk/models/withdrawal.rbi +++ b/rbi/whop_sdk/models/withdrawal.rbi @@ -350,6 +350,11 @@ module WhopSDK :payee_name_invalid, WhopSDK::Withdrawal::ErrorCode::TaggedSymbol ) + BENEFICIARY_NAME_MISMATCH = + T.let( + :beneficiary_name_mismatch, + WhopSDK::Withdrawal::ErrorCode::TaggedSymbol + ) RECEIVING_ACCOUNT_LOCKED = T.let( :receiving_account_locked, diff --git a/rbi/whop_sdk/models/withdrawal_create_params.rbi b/rbi/whop_sdk/models/withdrawal_create_params.rbi index 2cbd9407..3ee76900 100644 --- a/rbi/whop_sdk/models/withdrawal_create_params.rbi +++ b/rbi/whop_sdk/models/withdrawal_create_params.rbi @@ -27,7 +27,7 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :payout_method_id - # Whether the platform covers the payout fees instead of the connected account. + # Whether the platform covers the payout fees. sig { returns(T.nilable(T::Boolean)) } attr_accessor :platform_covers_fees @@ -56,7 +56,7 @@ module WhopSDK currency:, # The ID of the payout method to use for the withdrawal. payout_method_id: nil, - # Whether the platform covers the payout fees instead of the connected account. + # Whether the platform covers the payout fees. platform_covers_fees: nil, # Custom statement descriptor for the withdrawal. Must be between 5 and 22 # characters and contain only alphanumeric characters. diff --git a/rbi/whop_sdk/models/workforce/bounty_list_params.rbi b/rbi/whop_sdk/models/workforce/bounty_list_params.rbi new file mode 100644 index 00000000..d7bbd001 --- /dev/null +++ b/rbi/whop_sdk/models/workforce/bounty_list_params.rbi @@ -0,0 +1,313 @@ +# typed: strong + +module WhopSDK + module Models + module Workforce + class BountyListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::BountyListParams, + WhopSDK::Internal::AnyHash + ) + end + + # Scope the list to this account (`biz_` tag). Requires read access to the + # account; account API keys may pass their own account or a connected account. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # Cursor to paginate forwards from. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Cursor to paginate backwards from. + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Only bounties created after this ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_after + + sig { params(created_after: String).void } + attr_writer :created_after + + # Only bounties created before this ISO 8601 timestamp. + sig { returns(T.nilable(String)) } + attr_reader :created_before + + sig { params(created_before: String).void } + attr_writer :created_before + + # Sort direction. + sig do + returns( + T.nilable(WhopSDK::Workforce::BountyListParams::Direction::OrSymbol) + ) + end + attr_reader :direction + + sig do + params( + direction: WhopSDK::Workforce::BountyListParams::Direction::OrSymbol + ).void + end + attr_writer :direction + + # Number of bounties to return from the start of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first + + # Number of bounties to return from the end of the window. + sig { returns(T.nilable(Integer)) } + attr_reader :last + + sig { params(last: Integer).void } + attr_writer :last + + # Sort field. + sig do + returns( + T.nilable(WhopSDK::Workforce::BountyListParams::Order::OrSymbol) + ) + end + attr_reader :order + + sig do + params( + order: WhopSDK::Workforce::BountyListParams::Order::OrSymbol + ).void + end + attr_writer :order + + # Substring match on the bounty title or ID. + sig { returns(T.nilable(String)) } + attr_reader :query + + sig { params(query: String).void } + attr_writer :query + + # Filter by lifecycle state. + sig do + returns( + T.nilable(WhopSDK::Workforce::BountyListParams::Status::OrSymbol) + ) + end + attr_reader :status + + sig do + params( + status: WhopSDK::Workforce::BountyListParams::Status::OrSymbol + ).void + end + attr_writer :status + + # List the bounties this user participated in (`user_` tag). Must be the + # authenticated user. + 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, + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Workforce::BountyListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::Workforce::BountyListParams::Order::OrSymbol, + query: String, + status: WhopSDK::Workforce::BountyListParams::Status::OrSymbol, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Scope the list to this account (`biz_` tag). Requires read access to the + # account; account API keys may pass their own account or a connected account. + account_id: nil, + # Cursor to paginate forwards from. + after: nil, + # Cursor to paginate backwards from. + before: nil, + # Only bounties created after this ISO 8601 timestamp. + created_after: nil, + # Only bounties created before this ISO 8601 timestamp. + created_before: nil, + # Sort direction. + direction: nil, + # Number of bounties to return from the start of the window. + first: nil, + # Number of bounties to return from the end of the window. + last: nil, + # Sort field. + order: nil, + # Substring match on the bounty title or ID. + query: nil, + # Filter by lifecycle state. + status: nil, + # List the bounties this user participated in (`user_` tag). Must be the + # authenticated user. + user_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Workforce::BountyListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::Workforce::BountyListParams::Order::OrSymbol, + query: String, + status: WhopSDK::Workforce::BountyListParams::Status::OrSymbol, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Sort direction. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Workforce::BountyListParams::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let( + :asc, + WhopSDK::Workforce::BountyListParams::Direction::TaggedSymbol + ) + DESC = + T.let( + :desc, + WhopSDK::Workforce::BountyListParams::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::BountyListParams::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Sort field. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Workforce::BountyListParams::Order) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT = + T.let( + :created_at, + WhopSDK::Workforce::BountyListParams::Order::TaggedSymbol + ) + GROSS_PAID_OUT_AMOUNT = + T.let( + :gross_paid_out_amount, + WhopSDK::Workforce::BountyListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::BountyListParams::Order::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Filter by lifecycle state. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Workforce::BountyListParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SCHEDULED = + T.let( + :scheduled, + WhopSDK::Workforce::BountyListParams::Status::TaggedSymbol + ) + OPEN = + T.let( + :open, + WhopSDK::Workforce::BountyListParams::Status::TaggedSymbol + ) + CLOSED = + T.let( + :closed, + WhopSDK::Workforce::BountyListParams::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + WhopSDK::Workforce::BountyListParams::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Workforce::BountyListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::BountyListParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/workforce/bounty_retrieve_params.rbi b/rbi/whop_sdk/models/workforce/bounty_retrieve_params.rbi new file mode 100644 index 00000000..184e03e3 --- /dev/null +++ b/rbi/whop_sdk/models/workforce/bounty_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module WhopSDK + module Models + module Workforce + class BountyRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::BountyRetrieveParams, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/workforce/workforce_bounty.rbi b/rbi/whop_sdk/models/workforce/workforce_bounty.rbi new file mode 100644 index 00000000..91ce234d --- /dev/null +++ b/rbi/whop_sdk/models/workforce/workforce_bounty.rbi @@ -0,0 +1,588 @@ +# typed: strong + +module WhopSDK + module Models + WorkforceBounty = Workforce::WorkforceBounty + + module Workforce + class WorkforceBounty < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::WorkforceBounty, + WhopSDK::Internal::AnyHash + ) + end + + # Bounty ID, prefixed `bnty_`. + sig { returns(String) } + attr_accessor :id + + # Submissions accepted so far. + sig { returns(Integer) } + attr_accessor :accepted_submissions_count + + # Number of submissions that can be accepted (winner slots). + sig { returns(Integer) } + attr_accessor :accepted_submissions_limit + + sig { returns(T::Array[String]) } + attr_accessor :allowed_country_codes + + # Total gross budget committed to the bounty: `gross_reward_amount` times + # `accepted_submissions_limit`. + sig { returns(Float) } + attr_accessor :budget_amount + + # What the poster wants the work to achieve. + sig do + returns( + T.nilable( + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ) + ) + end + attr_accessor :business_goal_type + + # When the bounty was created, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :created_at + + # Currency for all amounts on the bounty, as a lowercase ISO 4217 code. + sig { returns(String) } + attr_accessor :currency + + # Full task instructions shown to workers. + sig { returns(String) } + attr_accessor :description + + # Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide + # bounties; may belong to a different account than the funder. + sig { returns(T.nilable(String)) } + attr_accessor :experience_id + + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + sig do + returns( + T.nilable(WhopSDK::Workforce::WorkforceBounty::FundingAccount) + ) + end + attr_reader :funding_account + + sig do + params( + funding_account: + T.nilable( + WhopSDK::Workforce::WorkforceBounty::FundingAccount::OrHash + ) + ).void + end + attr_writer :funding_account + + # Gross amount paid out from the bounty pool across accepted submissions — worker + # payouts, platform fees, and affiliate shares together. Tips and reviewer rewards + # are excluded. + sig { returns(Float) } + attr_accessor :gross_paid_out_amount + + # Gross bounty-pool amount allocated per accepted submission, in whole currency + # units. + sig { returns(Float) } + attr_accessor :gross_reward_amount + + # The user who posted the bounty. + sig { returns(WhopSDK::Workforce::WorkforceBounty::Poster) } + attr_reader :poster + + sig do + params( + poster: WhopSDK::Workforce::WorkforceBounty::Poster::OrHash + ).void + end + attr_writer :poster + + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + sig do + returns( + T.nilable( + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::TaggedSymbol + ) + ) + end + attr_accessor :scheduled_frequency + + # When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once + # published, for bounties that were never scheduled, and for terminally failed + # drafts parked for manual rescheduling. + sig { returns(T.nilable(String)) } + attr_accessor :scheduled_publish_at + + # Unfilled winner capacity: `accepted_submissions_limit` minus + # `accepted_submissions_count`, clamped to zero. Not a signal that the bounty + # currently accepts new claims. + sig { returns(Integer) } + attr_accessor :spots_remaining + + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + sig do + returns(WhopSDK::Workforce::WorkforceBounty::Status::TaggedSymbol) + end + attr_accessor :status + + # When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null + # when submissions were never explicitly stopped — including closed or completed + # bounties that simply filled every winner slot. + sig { returns(T.nilable(String)) } + attr_accessor :submissions_closed_at + + # Short name of the task shown to workers. + sig { returns(String) } + attr_accessor :title + + # Submissions still awaiting an outcome: in progress or pending review. + sig { returns(Integer) } + attr_accessor :unresolved_submissions_count + + # When the bounty was last updated, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :updated_at + + sig do + params( + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: T::Array[String], + budget_amount: Float, + business_goal_type: + T.nilable( + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::OrSymbol + ), + created_at: String, + currency: String, + description: String, + experience_id: T.nilable(String), + funding_account: + T.nilable( + WhopSDK::Workforce::WorkforceBounty::FundingAccount::OrHash + ), + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBounty::Poster::OrHash, + scheduled_frequency: + T.nilable( + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::OrSymbol + ), + scheduled_publish_at: T.nilable(String), + spots_remaining: Integer, + status: WhopSDK::Workforce::WorkforceBounty::Status::OrSymbol, + submissions_closed_at: T.nilable(String), + title: String, + unresolved_submissions_count: Integer, + updated_at: String + ).returns(T.attached_class) + end + def self.new( + # Bounty ID, prefixed `bnty_`. + id:, + # Submissions accepted so far. + accepted_submissions_count:, + # Number of submissions that can be accepted (winner slots). + accepted_submissions_limit:, + allowed_country_codes:, + # Total gross budget committed to the bounty: `gross_reward_amount` times + # `accepted_submissions_limit`. + budget_amount:, + # What the poster wants the work to achieve. + business_goal_type:, + # When the bounty was created, as an ISO 8601 timestamp. + created_at:, + # Currency for all amounts on the bounty, as a lowercase ISO 4217 code. + currency:, + # Full task instructions shown to workers. + description:, + # Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide + # bounties; may belong to a different account than the funder. + experience_id:, + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + funding_account:, + # Gross amount paid out from the bounty pool across accepted submissions — worker + # payouts, platform fees, and affiliate shares together. Tips and reviewer rewards + # are excluded. + gross_paid_out_amount:, + # Gross bounty-pool amount allocated per accepted submission, in whole currency + # units. + gross_reward_amount:, + # The user who posted the bounty. + poster:, + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + scheduled_frequency:, + # When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once + # published, for bounties that were never scheduled, and for terminally failed + # drafts parked for manual rescheduling. + scheduled_publish_at:, + # Unfilled winner capacity: `accepted_submissions_limit` minus + # `accepted_submissions_count`, clamped to zero. Not a signal that the bounty + # currently accepts new claims. + spots_remaining:, + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + status:, + # When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null + # when submissions were never explicitly stopped — including closed or completed + # bounties that simply filled every winner slot. + submissions_closed_at:, + # Short name of the task shown to workers. + title:, + # Submissions still awaiting an outcome: in progress or pending review. + unresolved_submissions_count:, + # When the bounty was last updated, as an ISO 8601 timestamp. + updated_at: + ) + end + + sig do + override.returns( + { + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: T::Array[String], + budget_amount: Float, + business_goal_type: + T.nilable( + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ), + created_at: String, + currency: String, + description: String, + experience_id: T.nilable(String), + funding_account: + T.nilable(WhopSDK::Workforce::WorkforceBounty::FundingAccount), + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBounty::Poster, + scheduled_frequency: + T.nilable( + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::TaggedSymbol + ), + scheduled_publish_at: T.nilable(String), + spots_remaining: Integer, + status: WhopSDK::Workforce::WorkforceBounty::Status::TaggedSymbol, + submissions_closed_at: T.nilable(String), + title: String, + unresolved_submissions_count: Integer, + updated_at: String + } + ) + end + def to_hash + end + + # What the poster wants the work to achieve. + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLIPPING = + T.let( + :clipping, + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ) + POST_ENGAGEMENT = + T.let( + :post_engagement, + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ) + OWNED_ACCOUNT_GROWTH = + T.let( + :owned_account_growth, + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ) + UGC_CONTENT = + T.let( + :ugc_content, + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ) + LOCAL_ACTIVATION = + T.let( + :local_activation, + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ) + OTHER = + T.let( + :other, + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::WorkforceBounty::BusinessGoalType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class FundingAccount < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::WorkforceBounty::FundingAccount, + WhopSDK::Internal::AnyHash + ) + end + + # Account ID, prefixed `biz_`. + sig { returns(String) } + attr_accessor :id + + # Account display name. + sig { returns(String) } + attr_accessor :title + + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + sig { params(id: String, title: String).returns(T.attached_class) } + def self.new( + # Account ID, prefixed `biz_`. + id:, + # Account display name. + title: + ) + end + + sig { override.returns({ id: String, title: String }) } + def to_hash + end + end + + class Poster < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::WorkforceBounty::Poster, + WhopSDK::Internal::AnyHash + ) + end + + # User ID, prefixed `user_`. + sig { returns(String) } + attr_accessor :id + + # Display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + sig do + returns(WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # Public username. + sig { returns(String) } + attr_accessor :username + + # The user who posted the bounty. + sig do + params( + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # User ID, prefixed `user_`. + id:, + # Display name. + name:, + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + profile_picture:, + # Public username. + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # Avatar image URL. Always present — a generated placeholder when the user set no + # picture. + sig { returns(String) } + attr_accessor :url + + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # Avatar image URL. Always present — a generated placeholder when the user set no + # picture. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONCE = + T.let( + :once, + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::TaggedSymbol + ) + HOURLY = + T.let( + :hourly, + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::TaggedSymbol + ) + DAILY = + T.let( + :daily, + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::TaggedSymbol + ) + WEEKLY = + T.let( + :weekly, + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Workforce::WorkforceBounty::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SCHEDULED = + T.let( + :scheduled, + WhopSDK::Workforce::WorkforceBounty::Status::TaggedSymbol + ) + OPEN = + T.let( + :open, + WhopSDK::Workforce::WorkforceBounty::Status::TaggedSymbol + ) + CLOSED = + T.let( + :closed, + WhopSDK::Workforce::WorkforceBounty::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + WhopSDK::Workforce::WorkforceBounty::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Workforce::WorkforceBounty::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::WorkforceBounty::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/workforce/workforce_bounty_list_item.rbi b/rbi/whop_sdk/models/workforce/workforce_bounty_list_item.rbi new file mode 100644 index 00000000..eafe0f2a --- /dev/null +++ b/rbi/whop_sdk/models/workforce/workforce_bounty_list_item.rbi @@ -0,0 +1,590 @@ +# typed: strong + +module WhopSDK + module Models + WorkforceBountyListItem = Workforce::WorkforceBountyListItem + + module Workforce + class WorkforceBountyListItem < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::WorkforceBountyListItem, + WhopSDK::Internal::AnyHash + ) + end + + # Bounty ID, prefixed `bnty_`. + sig { returns(String) } + attr_accessor :id + + # Submissions accepted so far. + sig { returns(Integer) } + attr_accessor :accepted_submissions_count + + # Number of submissions that can be accepted (winner slots). + sig { returns(Integer) } + attr_accessor :accepted_submissions_limit + + sig { returns(T::Array[String]) } + attr_accessor :allowed_country_codes + + # Total gross budget committed to the bounty: `gross_reward_amount` times + # `accepted_submissions_limit`. + sig { returns(Float) } + attr_accessor :budget_amount + + # What the poster wants the work to achieve. + sig do + returns( + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ) + ) + end + attr_accessor :business_goal_type + + # When the bounty was created, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :created_at + + # Currency for all amounts on the bounty, as a lowercase ISO 4217 code. + sig { returns(String) } + attr_accessor :currency + + # Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide + # bounties; may belong to a different account than the funder. + sig { returns(T.nilable(String)) } + attr_accessor :experience_id + + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + sig do + returns( + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount + ) + ) + end + attr_reader :funding_account + + sig do + params( + funding_account: + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount::OrHash + ) + ).void + end + attr_writer :funding_account + + # Gross amount paid out from the bounty pool across accepted submissions — worker + # payouts, platform fees, and affiliate shares together. Tips and reviewer rewards + # are excluded. + sig { returns(Float) } + attr_accessor :gross_paid_out_amount + + # Gross bounty-pool amount allocated per accepted submission, in whole currency + # units. + sig { returns(Float) } + attr_accessor :gross_reward_amount + + # The user who posted the bounty. + sig { returns(WhopSDK::Workforce::WorkforceBountyListItem::Poster) } + attr_reader :poster + + sig do + params( + poster: WhopSDK::Workforce::WorkforceBountyListItem::Poster::OrHash + ).void + end + attr_writer :poster + + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + sig do + returns( + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::TaggedSymbol + ) + ) + end + attr_accessor :scheduled_frequency + + # When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once + # published, for bounties that were never scheduled, and for terminally failed + # drafts parked for manual rescheduling. + sig { returns(T.nilable(String)) } + attr_accessor :scheduled_publish_at + + # Unfilled winner capacity: `accepted_submissions_limit` minus + # `accepted_submissions_count`, clamped to zero. Not a signal that the bounty + # currently accepts new claims. + sig { returns(Integer) } + attr_accessor :spots_remaining + + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + sig do + returns( + WhopSDK::Workforce::WorkforceBountyListItem::Status::TaggedSymbol + ) + end + attr_accessor :status + + # When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null + # when submissions were never explicitly stopped — including closed or completed + # bounties that simply filled every winner slot. + sig { returns(T.nilable(String)) } + attr_accessor :submissions_closed_at + + # Short name of the task shown to workers. + sig { returns(String) } + attr_accessor :title + + # Submissions still awaiting an outcome: in progress or pending review. + sig { returns(Integer) } + attr_accessor :unresolved_submissions_count + + # When the bounty was last updated, as an ISO 8601 timestamp. + sig { returns(String) } + attr_accessor :updated_at + + sig do + params( + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: T::Array[String], + budget_amount: Float, + business_goal_type: + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::OrSymbol + ), + created_at: String, + currency: String, + experience_id: T.nilable(String), + funding_account: + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount::OrHash + ), + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBountyListItem::Poster::OrHash, + scheduled_frequency: + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::OrSymbol + ), + scheduled_publish_at: T.nilable(String), + spots_remaining: Integer, + status: + WhopSDK::Workforce::WorkforceBountyListItem::Status::OrSymbol, + submissions_closed_at: T.nilable(String), + title: String, + unresolved_submissions_count: Integer, + updated_at: String + ).returns(T.attached_class) + end + def self.new( + # Bounty ID, prefixed `bnty_`. + id:, + # Submissions accepted so far. + accepted_submissions_count:, + # Number of submissions that can be accepted (winner slots). + accepted_submissions_limit:, + allowed_country_codes:, + # Total gross budget committed to the bounty: `gross_reward_amount` times + # `accepted_submissions_limit`. + budget_amount:, + # What the poster wants the work to achieve. + business_goal_type:, + # When the bounty was created, as an ISO 8601 timestamp. + created_at:, + # Currency for all amounts on the bounty, as a lowercase ISO 4217 code. + currency:, + # Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide + # bounties; may belong to a different account than the funder. + experience_id:, + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + funding_account:, + # Gross amount paid out from the bounty pool across accepted submissions — worker + # payouts, platform fees, and affiliate shares together. Tips and reviewer rewards + # are excluded. + gross_paid_out_amount:, + # Gross bounty-pool amount allocated per accepted submission, in whole currency + # units. + gross_reward_amount:, + # The user who posted the bounty. + poster:, + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + scheduled_frequency:, + # When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once + # published, for bounties that were never scheduled, and for terminally failed + # drafts parked for manual rescheduling. + scheduled_publish_at:, + # Unfilled winner capacity: `accepted_submissions_limit` minus + # `accepted_submissions_count`, clamped to zero. Not a signal that the bounty + # currently accepts new claims. + spots_remaining:, + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + status:, + # When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null + # when submissions were never explicitly stopped — including closed or completed + # bounties that simply filled every winner slot. + submissions_closed_at:, + # Short name of the task shown to workers. + title:, + # Submissions still awaiting an outcome: in progress or pending review. + unresolved_submissions_count:, + # When the bounty was last updated, as an ISO 8601 timestamp. + updated_at: + ) + end + + sig do + override.returns( + { + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: T::Array[String], + budget_amount: Float, + business_goal_type: + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ), + created_at: String, + currency: String, + experience_id: T.nilable(String), + funding_account: + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount + ), + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBountyListItem::Poster, + scheduled_frequency: + T.nilable( + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::TaggedSymbol + ), + scheduled_publish_at: T.nilable(String), + spots_remaining: Integer, + status: + WhopSDK::Workforce::WorkforceBountyListItem::Status::TaggedSymbol, + submissions_closed_at: T.nilable(String), + title: String, + unresolved_submissions_count: Integer, + updated_at: String + } + ) + end + def to_hash + end + + # What the poster wants the work to achieve. + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLIPPING = + T.let( + :clipping, + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ) + POST_ENGAGEMENT = + T.let( + :post_engagement, + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ) + OWNED_ACCOUNT_GROWTH = + T.let( + :owned_account_growth, + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ) + UGC_CONTENT = + T.let( + :ugc_content, + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ) + LOCAL_ACTIVATION = + T.let( + :local_activation, + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ) + OTHER = + T.let( + :other, + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class FundingAccount < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount, + WhopSDK::Internal::AnyHash + ) + end + + # Account ID, prefixed `biz_`. + sig { returns(String) } + attr_accessor :id + + # Account display name. + sig { returns(String) } + attr_accessor :title + + # The account whose balance funds the bounty pool, or `null` when a user funds it + # personally. May differ from the account hosting `experience_id`. + sig { params(id: String, title: String).returns(T.attached_class) } + def self.new( + # Account ID, prefixed `biz_`. + id:, + # Account display name. + title: + ) + end + + sig { override.returns({ id: String, title: String }) } + def to_hash + end + end + + class Poster < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::WorkforceBountyListItem::Poster, + WhopSDK::Internal::AnyHash + ) + end + + # User ID, prefixed `user_`. + sig { returns(String) } + attr_accessor :id + + # Display name. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + sig do + returns( + WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # Public username. + sig { returns(String) } + attr_accessor :username + + # The user who posted the bounty. + sig do + params( + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # User ID, prefixed `user_`. + id:, + # Display name. + name:, + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + profile_picture:, + # Public username. + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # Avatar image URL. Always present — a generated placeholder when the user set no + # picture. + sig { returns(String) } + attr_accessor :url + + # Avatar wrapper; its `url` is always present, using a generated placeholder when + # the user set no picture. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # Avatar image URL. Always present — a generated placeholder when the user set no + # picture. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + + # How often the schedule creates a new bounty. Each occurrence is a separate + # bounty; the original is not republished. + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ONCE = + T.let( + :once, + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::TaggedSymbol + ) + HOURLY = + T.let( + :hourly, + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::TaggedSymbol + ) + DAILY = + T.let( + :daily, + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::TaggedSymbol + ) + WEEKLY = + T.let( + :weekly, + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::TaggedSymbol + ) + MONTHLY = + T.let( + :monthly, + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Lifecycle state. `scheduled` bounties are unpublished drafts, visible to their + # poster and the account's authorized managers; `open` bounties accept new + # submissions; `closed` bounties are live but no longer accept new submissions; + # `completed` bounties paid out every winner slot; `canceled` bounties ended + # before filling their slots. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Workforce::WorkforceBountyListItem::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SCHEDULED = + T.let( + :scheduled, + WhopSDK::Workforce::WorkforceBountyListItem::Status::TaggedSymbol + ) + OPEN = + T.let( + :open, + WhopSDK::Workforce::WorkforceBountyListItem::Status::TaggedSymbol + ) + CLOSED = + T.let( + :closed, + WhopSDK::Workforce::WorkforceBountyListItem::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + WhopSDK::Workforce::WorkforceBountyListItem::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Workforce::WorkforceBountyListItem::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Workforce::WorkforceBountyListItem::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/access_tokens.rbi b/rbi/whop_sdk/resources/access_tokens.rbi index 94061d43..0e37fe9d 100644 --- a/rbi/whop_sdk/resources/access_tokens.rbi +++ b/rbi/whop_sdk/resources/access_tokens.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Access tokens class AccessTokens # Create a short-lived access token for authenticating API requests. When using # API key authentication, provide company_id or user_id. When using OAuth, the diff --git a/rbi/whop_sdk/resources/account_links.rbi b/rbi/whop_sdk/resources/account_links.rbi index 48a16333..65752cf7 100644 --- a/rbi/whop_sdk/resources/account_links.rbi +++ b/rbi/whop_sdk/resources/account_links.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Account links class AccountLinks # Generate a URL that directs a sub-merchant to their account portal, such as the # hosted payouts dashboard or the KYC onboarding flow. diff --git a/rbi/whop_sdk/resources/accounts.rbi b/rbi/whop_sdk/resources/accounts.rbi index 898aec2a..2acffae7 100644 --- a/rbi/whop_sdk/resources/accounts.rbi +++ b/rbi/whop_sdk/resources/accounts.rbi @@ -2,13 +2,33 @@ module WhopSDK module Resources + # An Account represents a person or business on Whop that can have its own + # profile, wallet, and account-scoped settings. Use accounts for customers, + # creators, merchants, sellers, or connected businesses your integration supports. + # + # Use the Accounts API to create accounts, list accounts visible to your + # credentials, retrieve or update an account, and retrieve the account associated + # with the current API key. class Accounts + # An Account represents a person or business on Whop that can have its own + # profile, wallet, and account-scoped settings. Use accounts for customers, + # creators, merchants, sellers, or connected businesses your integration supports. + # + # Use the Accounts API to create accounts, list accounts visible to your + # credentials, retrieve or update an account, and retrieve the account associated + # with the current API key. + sig { returns(WhopSDK::Resources::Accounts::Preferences) } + attr_reader :preferences + # Creates an account. User tokens create business accounts; business account API - # keys create connected accounts. + # keys create connected accounts. Tax fields (`tax_remitted_by`, + # `product_tax_code_id`, `business_address`, `tax_identifiers`) are configured + # with Update Account, not at creation. sig do params( email: String, metadata: T::Hash[Symbol, T.anything], + title: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Account) end @@ -18,6 +38,9 @@ module WhopSDK email: nil, # Arbitrary key/value metadata to store on the account. metadata: nil, + # The display name of the account. Defaults to `metadata.external_id` or the + # owner's email when omitted. + title: nil, request_options: {} ) end @@ -31,7 +54,7 @@ module WhopSDK ).returns(WhopSDK::Account) end def retrieve( - # The ID of the account, which will look like biz\_******\******* + # Account ID, prefixed `biz_`. account_id, request_options: {} ) @@ -45,6 +68,8 @@ module WhopSDK affiliate_application_required: T::Boolean, affiliate_instructions: T.nilable(String), banner_image: T.nilable(T::Hash[Symbol, T.anything]), + business_address: + WhopSDK::AccountUpdateParams::BusinessAddress::OrHash, business_type: T.nilable(String), country: T.nilable(String), description: T.nilable(String), @@ -60,6 +85,7 @@ module WhopSDK opengraph_image_variant: T.nilable(String), other_business_description: T.nilable(String), other_industry_description: T.nilable(String), + product_tax_code_id: T.nilable(String), require_2fa: T::Boolean, route: T.nilable(String), send_customer_emails: T::Boolean, @@ -69,13 +95,17 @@ module WhopSDK social_links: T::Array[T::Hash[Symbol, T.anything]], store_page_config: T.nilable(T::Hash[Symbol, T.anything]), target_audience: T.nilable(String), + tax_identifiers: + T::Array[WhopSDK::AccountUpdateParams::TaxIdentifier::OrHash], + tax_remitted_by: + WhopSDK::AccountUpdateParams::TaxRemittedBy::OrSymbol, title: T.nilable(String), use_logo_as_opengraph_image_fallback: T::Boolean, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Account) end def update( - # The ID of the account, which will look like biz\_******\******* + # Account ID, prefixed `biz_`. account_id, # Whether prospective affiliates must submit an application before promoting this # account. @@ -84,21 +114,24 @@ module WhopSDK affiliate_instructions: nil, # Attachment input for the account banner image. banner_image: nil, - # The high-level business category for the account. + # Account business address used to calculate tax. A complete address in a + # supported country is required when `tax_remitted_by` is `self`. + business_address: nil, + # High-level business category for the account. business_type: nil, - # The country the account is located in. + # Country where the account is located. country: nil, - # A promotional description for the account. + # Account promotional description. description: nil, - # The ID of the product to feature for affiliates. Pass null to clear. + # 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. + # Public account home page preferences. home_preferences: nil, - # The industry group the account belongs to. + # Account industry group. industry_group: nil, - # The specific industry vertical the account operates in. + # Specific industry vertical for the account. industry_type: nil, - # The prefix to use for account invoices. + # Prefix used for account invoices. invoice_prefix: nil, # Attachment input for the account logo. logo: nil, @@ -114,6 +147,10 @@ module WhopSDK other_business_description: nil, # The description of the industry type when industry_type is other. other_industry_description: nil, + # ID of the tax classification code applied by default to the account's products. + # See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). + product_tax_code_id: nil, # Whether the account requires authorized users to have two-factor authentication # enabled. require_2fa: nil, @@ -129,10 +166,19 @@ module WhopSDK 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. + # Account store page display configuration. store_page_config: nil, # The target audience for this account. target_audience: nil, + # Account tax/VAT registrations to add or update. When `tax_remitted_by` is + # `self`, tax is calculated and collected only in the countries where the account + # holds a registration. + tax_identifiers: nil, + # Who calculates and remits tax for the account: `whop` (Whop calculates and + # remits), `self` (Whop calculates; the account collects and remits), or `none` + # (neither; the account is responsible). `self` requires a `business_address` in a + # supported country. + tax_remitted_by: nil, # The display name of the account. title: nil, # Whether the account uses its logo as the fallback Open Graph image. @@ -146,17 +192,28 @@ module WhopSDK # its connected accounts. sig do params( - page: Integer, - per: Integer, + after: String, + before: String, + direction: WhopSDK::AccountListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AccountListParams::Order::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::AccountListResponse) + ).returns(WhopSDK::Internal::CursorPage[WhopSDK::Account]) end def list( - # The page number to retrieve - page: nil, - # The number of resources to return per page. There is a limit of 50 results per - # page. - per: nil, + # A cursor; returns accounts after this position. + after: nil, + # A cursor; returns accounts before this position. + before: nil, + # Sort direction. + direction: nil, + # The number of accounts to return (default 10, max 50). + first: nil, + # The number of accounts to return from the end of the range. + last: nil, + # The field to sort accounts by. + order: nil, request_options: {} ) end @@ -171,6 +228,22 @@ module WhopSDK def me(request_options: {}) end + # Lists the recommended actions computed for the account — the same set embedded + # on the account resource, served on their own so a caller can fetch just the + # recommendations. + sig do + params( + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::AccountRecommendActionsResponse) + end + def recommend_actions( + # Account ID, prefixed `biz_`. + account_id, + 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/accounts/preferences.rbi b/rbi/whop_sdk/resources/accounts/preferences.rbi new file mode 100644 index 00000000..71dd2280 --- /dev/null +++ b/rbi/whop_sdk/resources/accounts/preferences.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module WhopSDK + module Resources + class Accounts + # An Account represents a person or business on Whop that can have its own + # profile, wallet, and account-scoped settings. Use accounts for customers, + # creators, merchants, sellers, or connected businesses your integration supports. + # + # Use the Accounts API to create accounts, list accounts visible to your + # credentials, retrieve or update an account, and retrieve the account associated + # with the current API key. + class Preferences + # Retrieves the account's preferences: a singleton settings document keyed by + # preference name. + sig do + params( + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::Accounts::PreferenceRetrieveResponse) + end + def retrieve( + # Account ID, prefixed `biz_`. + account_id, + request_options: {} + ) + end + + # Updates the account's preferences. Each top-level key present in the body is + # replaced as a whole; omitted keys are left untouched. `ads_payment_methods` + # always requires a `primary` entry. `backup` is optional when the primary is + # `platform_balance` — omitting it removes any configured card — while a `card` + # primary requires a `platform_balance` backup. A `platform_balance` entry may + # omit `id` to use the account's default Whop balance. Changing which funding + # sources are configured requires a user token, while account API keys may only + # swap `primary` and `backup`. + sig do + params( + account_id: String, + ads_payment_methods: + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::OrHash, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::Accounts::PreferenceUpdateResponse) + end + def update( + # Account ID, prefixed `biz_`. + account_id, + # How the account pays for Whop Ads spend. `primary` is charged first; `backup` + # covers the charge when the primary fails. + ads_payment_methods: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/ad_campaigns.rbi b/rbi/whop_sdk/resources/ad_campaigns.rbi index 774d632a..70d1f3e1 100644 --- a/rbi/whop_sdk/resources/ad_campaigns.rbi +++ b/rbi/whop_sdk/resources/ad_campaigns.rbi @@ -2,114 +2,215 @@ module WhopSDK module Resources - # Ad campaigns + # An Ad Campaign is the top-level container for paid ads on an ad network. It sets + # the platform, objective, and budget strategy shared by its + # [ad groups](/api-reference/beta/ad-groups/ad-group) and ads. + # + # Use the Ad Campaigns API to create campaigns, list campaigns for an account, + # retrieve or update campaign settings, and pause or resume campaign delivery. class AdCampaigns - # Retrieves a single ad campaign by its unique identifier. - # - # Required permissions: - # - # - `ad_campaign:basic:read` + # Creates an ad campaign for an account. + sig do + params( + objective: WhopSDK::AdCampaignCreateParams::Objective::OrSymbol, + platform: WhopSDK::AdCampaignCreateParams::Platform::OrSymbol, + title: String, + account_id: String, + bid_type: WhopSDK::AdCampaignCreateParams::BidType::OrSymbol, + budget_amount: Float, + budget_optimization: + WhopSDK::AdCampaignCreateParams::BudgetOptimization::OrSymbol, + budget_type: WhopSDK::AdCampaignCreateParams::BudgetType::OrSymbol, + desired_cost_per_result: Float, + ends_at: String, + special_ad_categories: + T::Array[ + WhopSDK::AdCampaignCreateParams::SpecialAdCategory::OrSymbol + ], + starts_at: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::AdCampaign) + end + def create( + # The goal the campaign optimizes toward. + objective:, + # The ad network the campaign runs on. + platform:, + # The title of the campaign. + title:, + # The account to create the campaign under. Defaults to the account-scoped key's + # own account. + account_id: nil, + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). CBO only. + bid_type: nil, + # The campaign budget, in USD. Required for CBO (budget_optimization: + # ad_campaign); omit for ABO. + budget_amount: nil, + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). + # Defaults to ad_group. + budget_optimization: nil, + # Whether the budget is spent per day or over the campaign's lifetime. Defaults to + # daily. + budget_type: nil, + # Target/cap cost per result in USD for average_target / maximum_target bidding. + # CBO only. + desired_cost_per_result: nil, + # Campaign schedule end (ISO 8601). CBO only. + ends_at: nil, + # Regulated categories the campaign falls under. Ads in these categories are + # subject to extra targeting restrictions. + special_ad_categories: nil, + # Campaign schedule start (ISO 8601). CBO only. + starts_at: nil, + request_options: {} + ) + end + + # Retrieves a single ad campaign with stats over the requested window. sig do params( id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AdCampaign) end def retrieve( - # The unique identifier of the ad campaign. + # The ad campaign ID. id, - # Inclusive start of the window for the campaign's metric fields (spend, - # impressions, …). Omit both statsFrom and statsTo for all-time stats. + # Start of the stats window. stats_from: nil, - # Inclusive end of the window for the campaign's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. stats_to: nil, + # IANA timezone the stats window is interpreted in. Defaults to UTC. + time_zone: nil, request_options: {} ) end - # Updates an ad campaign synchronously. - # - # Required permissions: - # - # - `ad_campaign:update` + # Updates an ad campaign's editable fields (title, budget, schedule, bid strategy, + # and — before launch — budget optimization), and launches a draft campaign by + # setting status to active. Objective, budget type, special ad categories and + # desired cost per result are fixed at creation and cannot be changed. sig do params( id: String, - budget: T.nilable(Float), + bid_type: WhopSDK::AdCampaignUpdateParams::BidType::OrSymbol, + budget_amount: Float, + budget_optimization: + WhopSDK::AdCampaignUpdateParams::BudgetOptimization::OrSymbol, + ends_at: String, + starts_at: String, + status: WhopSDK::AdCampaignUpdateParams::Status::OrSymbol, + title: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AdCampaign) end def update( - # The unique identifier of the ad campaign to update. + # The ad campaign ID. id, - # The campaign budget in dollars. The interpretation (daily or lifetime) follows - # the campaign's existing budget type. - budget: nil, + # CBO bid strategy: minimum_cost (lowest cost), average_target (cost cap), or + # maximum_target (bid cap). Switching to minimum_cost clears the cap amounts + # stored on the campaign's ad groups. CBO only. + bid_type: nil, + # The campaign budget, in the account's currency. Interpreted as daily or lifetime + # per the campaign's existing budget type. + budget_amount: nil, + # Which level owns the budget — the campaign (CBO) or each ad group (ABO). Only + # changeable before the campaign is live on Meta; switching to ad_campaign + # requires budget_amount in the same request, and switching to ad_group clears the + # campaign budget. + budget_optimization: nil, + # Campaign schedule end (ISO 8601). CBO only. + ends_at: nil, + # Campaign schedule start (ISO 8601). CBO only. + starts_at: nil, + # Set to active to launch a draft campaign (moderates and pushes it live). + # Live-campaign pause and resume use the pause and unpause actions. + status: nil, + # The name of the campaign. + title: nil, request_options: {} ) end - # Returns a paginated list of ad campaigns for a company, with optional filtering - # by status, and creation date. - # - # Required permissions: - # - # - `ad_campaign:basic:read` + # Lists the ad campaigns for an account, with stats over the requested window. sig do params( - after: T.nilable(String), - before: T.nilable(String), - company_id: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - 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), + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdCampaignListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdCampaignListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::AdCampaignListParams::Status::OrSymbol, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash - ).returns( - WhopSDK::Internal::CursorPage[WhopSDK::Models::AdCampaignListResponse] - ) + ).returns(WhopSDK::Internal::CursorPage[WhopSDK::AdCampaign]) end def list( - # Returns the elements in the list that come after the specified cursor. + # The account the campaigns belong to. Defaults to the account-scoped key's own + # account. + account_id: nil, + # Cursor to fetch the page after (from page_info.end_cursor). after: nil, - # Returns the elements in the list that come before the specified cursor. + # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # The unique identifier of the company to list ad campaigns for. - company_id: nil, - # Only return ad campaigns created after this timestamp. + # Only return campaigns created after this timestamp. created_after: nil, - # Only return ad campaigns created before this timestamp. + # Only return campaigns created before this timestamp. created_before: nil, - # Returns the first _n_ elements from the list. + # The sort direction. Defaults to desc. + direction: nil, + # The number of campaigns to return. first: nil, - # Returns the last _n_ elements from the list. + # The number of campaigns to return from the end of the range. last: nil, - # Case-insensitive substring match against the campaign title or ID. + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + order: nil, + # Filter campaigns by a title or ID substring. query: nil, - # Inclusive start of the window for each campaign's metric fields (spend, - # impressions, …). Omit both statsFrom and statsTo for all-time stats. + # Start of the stats window. Defaults to all-time. stats_from: nil, - # Inclusive end of the window for each campaign's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. Defaults to now. stats_to: nil, - # The status of an ad campaign. + # Only return campaigns with this status. status: nil, + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + time_zone: nil, + request_options: {} + ) + end + + # Deletes an ad campaign and archives it on the ad platform (cascades to ad groups + # and ads). Returns true on success. + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T::Boolean) + end + def delete( + # The ad campaign ID. + id, request_options: {} ) end - # Pauses an ad campaign, optionally until a specific date. - # - # Required permissions: - # - # - `ad_campaign:update` + # Pauses an active ad campaign. sig do params( id: String, @@ -117,17 +218,13 @@ module WhopSDK ).returns(WhopSDK::AdCampaign) end def pause( - # The unique identifier of the ad campaign to pause. + # The ad campaign ID. id, request_options: {} ) end # Resumes a paused ad campaign. - # - # Required permissions: - # - # - `ad_campaign:update` sig do params( id: String, @@ -135,7 +232,7 @@ module WhopSDK ).returns(WhopSDK::AdCampaign) end def unpause( - # The unique identifier of the ad campaign to unpause. + # The ad campaign ID. id, request_options: {} ) diff --git a/rbi/whop_sdk/resources/ad_groups.rbi b/rbi/whop_sdk/resources/ad_groups.rbi index 9147d0ba..a14f5573 100644 --- a/rbi/whop_sdk/resources/ad_groups.rbi +++ b/rbi/whop_sdk/resources/ad_groups.rbi @@ -2,146 +2,308 @@ module WhopSDK module Resources - # Ad groups + # An Ad Group sits inside an + # [ad campaign](/api-reference/beta/ad-campaigns/ad-campaign) and controls + # delivery for [ads](/api-reference/beta/ads/ad). It sets the audience, + # placements, schedule, budget, and optimization goal for its ads. + # + # Use the Ad Groups API to create ad groups in campaigns, list or retrieve + # targeting and delivery settings, update budgets or targeting, delete groups that + # should stop running, and pause or resume delivery. class AdGroups - # Retrieves a single ad group by its unique identifier. - # - # Required permissions: - # - # - `ad_campaign:basic:read` + # Creates an ad group (ad set) in a campaign. + sig do + params( + ad_campaign_id: String, + audiences: T.anything, + bid_type: WhopSDK::AdGroupCreateParams::BidType::OrSymbol, + budget_amount: Float, + budget_type: WhopSDK::AdGroupCreateParams::BudgetType::OrSymbol, + conversion_event: + T.nilable( + T.any( + WhopSDK::AdGroupCreateParams::ConversionEvent::OrSymbol, + String + ) + ), + conversion_location: + WhopSDK::AdGroupCreateParams::ConversionLocation::OrSymbol, + demographics: T.anything, + desired_cost_per_result: Float, + devices: T.anything, + dynamic_creative: T::Boolean, + ends_at: String, + frequency_cap: T.anything, + languages: T::Array[String], + message_apps: + T::Array[WhopSDK::AdGroupCreateParams::MessageApp::OrSymbol], + minimum_daily_spend: Float, + optimization_goal: String, + placements: T.anything, + regions: T.anything, + starts_at: String, + status: WhopSDK::AdGroupCreateParams::Status::OrSymbol, + title: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::AdGroup) + end + def create( + # The ad campaign to create the ad group in. + ad_campaign_id:, + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # Incompatible with demographics.automatic (Advantage+). + audiences: nil, + # Bid strategy. + bid_type: nil, + # Ad-set budget in dollars (ABO only; omit under CBO). + budget_amount: nil, + # Whether the budget is daily or lifetime. + budget_type: nil, + # The pixel event optimized for. A standard event, or any custom pixel event name. + conversion_event: nil, + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + conversion_location: nil, + # Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + demographics: nil, + # Target/cap cost for average_target / maximum_target. + desired_cost_per_result: nil, + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + devices: nil, + # Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; + # immutable afterward. + dynamic_creative: nil, + # Schedule end, ISO 8601. + ends_at: nil, + # { maximum_impressions, per_days } — only valid for reach optimization. + frequency_cap: nil, + # Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all + # languages. + languages: nil, + # Required when conversion_location is messaging: which apps to message on. + # Combinations map to the matching Meta destination. + message_apps: nil, + # Daily spend floor within the budget. + minimum_daily_spend: nil, + # What the ad group optimizes for (e.g. conversions, link_clicks, reach). + optimization_goal: nil, + # 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # target all of a platform's. + # + # Valid positions per platform: + # + # - `facebook`: `feed`, `right_hand_column`, `marketplace`, `search`, + # `profile_feed`, `notification`, `story`, `instream_video`, `facebook_reels`, + # `facebook_reels_overlay`, `biz_disco_feed` + # - `instagram`: `stream`, `story`, `explore`, `explore_home`, `reels`, + # `profile_feed`, `profile_reels`, `ig_search` + # - `messenger`: `story` + # - `audience_network`: `classic`, `rewarded_video` + # - `threads`: `threads_stream` + # - `whatsapp`: `status` + placements: nil, + # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + regions: nil, + # Schedule start, ISO 8601. + starts_at: nil, + # Initial status (default: active). + status: nil, + # The display name of the ad group. + title: nil, + request_options: {} + ) + end + + # Retrieves a single ad group. sig do params( id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AdGroup) end def retrieve( - # The unique identifier of the ad group. + # The ad group ID. id, - # Inclusive start of the window for the ad group's metric fields (spend, - # impressions, …). Omit both statsFrom and statsTo for all-time stats. + # Start of the stats window. stats_from: nil, - # Inclusive end of the window for the ad group's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. stats_to: nil, + # IANA timezone the stats window is interpreted in. Defaults to UTC. + time_zone: nil, request_options: {} ) end - # Updates an existing ad group. - # - # Required permissions: - # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` + # Updates an ad group's editable fields. Only the keys you send are changed. sig do params( id: String, - budget: T.nilable(Float), - budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), - config: T.nilable(WhopSDK::AdGroupUpdateParams::Config::OrHash), - daily_budget: T.nilable(Float), - name: T.nilable(String), - platform_config: - T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::OrHash), - status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), - title: T.nilable(String), + audiences: T.anything, + bid_type: WhopSDK::AdGroupUpdateParams::BidType::OrSymbol, + budget_amount: Float, + budget_type: WhopSDK::AdGroupUpdateParams::BudgetType::OrSymbol, + conversion_event: + T.nilable( + T.any( + WhopSDK::AdGroupUpdateParams::ConversionEvent::OrSymbol, + String + ) + ), + conversion_location: + WhopSDK::AdGroupUpdateParams::ConversionLocation::OrSymbol, + demographics: T.anything, + desired_cost_per_result: Float, + devices: T.anything, + ends_at: String, + frequency_cap: T.anything, + languages: T::Array[String], + message_apps: + T::Array[WhopSDK::AdGroupUpdateParams::MessageApp::OrSymbol], + minimum_daily_spend: Float, + optimization_goal: String, + placements: T.anything, + regions: T.anything, + starts_at: String, + status: WhopSDK::AdGroupUpdateParams::Status::OrSymbol, + title: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AdGroup) end def update( - # The unique identifier of the ad group to update. + # The ad group ID. id, - # Budget amount in dollars. - budget: nil, - # The budget type for an ad campaign or ad group. + # Saved-audience targeting: { include, exclude } arrays of audience IDs. + # Incompatible with demographics.automatic (Advantage+). + audiences: nil, + # Bid strategy. + bid_type: nil, + # Ad-set budget in dollars (ABO only; omit under CBO). + budget_amount: nil, + # Whether the budget is daily or lifetime. budget_type: nil, - # Unified ad group configuration (bidding, optimization, targeting). - config: nil, - # Daily budget in dollars. - daily_budget: nil, - # Human-readable ad group name. - name: nil, - # Platform-specific ad group configuration. - platform_config: nil, - # The status of an external ad group. + # The pixel event optimized for. A standard event, or any custom pixel event name. + conversion_event: nil, + # Where results happen: website (conversions), profile (IG/FB engagement), + # messaging (DM), on_ad (engagement on the ad, surface follows the optimization + # goal), or the lead destinations (instant_forms, instant_forms_and_messenger, + # website_and_instant_forms). The lead form itself is set on the ad. + conversion_location: nil, + # Demographic targeting: { automatic, minimum_age, maximum_age, gender }. + demographics: nil, + # Target/cap cost for average_target / maximum_target. + desired_cost_per_result: nil, + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. + devices: nil, + # Schedule end, ISO 8601. + ends_at: nil, + # { maximum_impressions, per_days } — only valid for reach optimization. + frequency_cap: nil, + # Languages to target as ISO 639 codes (e.g. en, es). Empty/omitted = all + # languages. + languages: nil, + # Required when conversion_location is messaging: which apps to message on. + # Combinations map to the matching Meta destination. + message_apps: nil, + # Daily spend floor within the budget. + minimum_daily_spend: nil, + # What the ad group optimizes for (e.g. conversions, link_clicks, reach). + optimization_goal: nil, + # 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to + # target all of a platform's. + # + # Valid positions per platform: + # + # - `facebook`: `feed`, `right_hand_column`, `marketplace`, `search`, + # `profile_feed`, `notification`, `story`, `instream_video`, `facebook_reels`, + # `facebook_reels_overlay`, `biz_disco_feed` + # - `instagram`: `stream`, `story`, `explore`, `explore_home`, `reels`, + # `profile_feed`, `profile_reels`, `ig_search` + # - `messenger`: `story` + # - `audience_network`: `classic`, `rewarded_video` + # - `threads`: `threads_stream` + # - `whatsapp`: `status` + placements: nil, + # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + regions: nil, + # Schedule start, ISO 8601. + starts_at: nil, + # Initial status (default: active). status: nil, - # Human-readable ad group title. + # The display name of the ad group. title: nil, request_options: {} ) end - # Returns a paginated list of ad groups scoped by campaign or company, with - # optional filtering by status and creation date. - # - # Required permissions: - # - # - `ad_campaign:basic:read` + # Lists ad groups for the account, newest first. 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), - company_id: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - 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::AdGroupStatus::OrSymbol), + account_id: String, + ad_campaign_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdGroupListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdGroupListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: String, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash - ).returns( - WhopSDK::Internal::CursorPage[WhopSDK::Models::AdGroupListResponse] - ) + ).returns(WhopSDK::Internal::CursorPage[WhopSDK::AdGroup]) end def list( - # Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + # Account whose ad groups to list. Defaults to the authenticated account. + account_id: nil, + # Filter to ad groups in this campaign. 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. + # Cursor to fetch the page after (from page_info.end_cursor). after: nil, - # Returns the elements in the list that come before the specified cursor. + # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # Filter by campaign. - campaign_id: nil, - # Filter by company. Provide companyId or adCampaignIds. - company_id: nil, # Only return ad groups created after this timestamp. created_after: nil, # Only return ad groups created before this timestamp. created_before: nil, - # Returns the first _n_ elements from the list. + # The sort direction. Defaults to desc. + direction: nil, + # The number of ad groups to return. first: nil, - # Returns the last _n_ elements from the list. + # The number of ad groups to return from the end of the range. last: nil, - # Case-insensitive substring match against the ad group name or ID. + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. + order: nil, + # Filter ad groups by a title or ID substring. 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. + # Start of the stats window. Defaults to all-time. stats_from: nil, - # Inclusive end of the window for each ad group's metric fields. Omit both - # statsFrom and statsTo for all-time stats. + # End of the stats window. Defaults to now. stats_to: nil, - # The status of an external ad group. + # Filter to a status (active, paused, in_review, rejected). status: nil, + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + time_zone: nil, request_options: {} ) end - # Soft-deletes an ad group. - # - # Required permissions: - # - # - `ad_campaign:update` + # Deletes an ad group. Returns true on success. sig do params( id: String, @@ -149,18 +311,13 @@ module WhopSDK ).returns(T::Boolean) end def delete( - # The unique identifier of the ad group to delete. + # The ad group ID. id, request_options: {} ) end - # Pauses an ad group. - # - # Required permissions: - # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` + # Pauses delivery of an ad group. sig do params( id: String, @@ -168,18 +325,13 @@ module WhopSDK ).returns(WhopSDK::AdGroup) end def pause( - # The unique identifier of the ad group to pause. + # The ad group ID. id, request_options: {} ) end - # Resumes a paused ad group. - # - # Required permissions: - # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` + # Resumes delivery of a paused ad group. sig do params( id: String, @@ -187,7 +339,7 @@ module WhopSDK ).returns(WhopSDK::AdGroup) end def unpause( - # The unique identifier of the ad group to unpause. + # The ad group ID. id, request_options: {} ) diff --git a/rbi/whop_sdk/resources/ad_reports.rbi b/rbi/whop_sdk/resources/ad_reports.rbi index 0f10ac7c..784cac72 100644 --- a/rbi/whop_sdk/resources/ad_reports.rbi +++ b/rbi/whop_sdk/resources/ad_reports.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # 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` to diff --git a/rbi/whop_sdk/resources/ads.rbi b/rbi/whop_sdk/resources/ads.rbi index 805b66a9..d6cd5447 100644 --- a/rbi/whop_sdk/resources/ads.rbi +++ b/rbi/whop_sdk/resources/ads.rbi @@ -2,125 +2,264 @@ module WhopSDK module Resources - # Ads + # An Ad is the individual creative unit delivered by an + # [ad group](/api-reference/beta/ad-groups/ad-group). It holds the copy, creative + # assets, and destination URL for one ad. + # + # Use the Ads API to list ads for an account, create ads inside ad groups, + # retrieve or update creative details, delete ads that should stop running, and + # pause or resume delivery. class Ads - # Retrieve an ad by its unique identifier. - # - # Required permissions: - # - # - `ad_campaign:basic:read` + # Creates an ad in an ad group. + sig do + params( + ad_group: T.anything, + ad_group_id: String, + call_to_action: WhopSDK::AdCreateParams::CallToAction::OrSymbol, + creatives: T::Array[WhopSDK::AdCreateParams::Creative::OrHash], + descriptions: T::Array[String], + headlines: T::Array[String], + lead_form: WhopSDK::AdCreateParams::LeadForm::OrHash, + lead_form_id: String, + messaging_config: WhopSDK::AdCreateParams::MessagingConfig::OrHash, + multi_advertiser_ads: T::Boolean, + post_id: String, + post_source: WhopSDK::AdCreateParams::PostSource::OrSymbol, + primary_texts: T::Array[String], + social_accounts: + T::Array[WhopSDK::AdCreateParams::SocialAccount::OrHash], + title: String, + url: String, + url_parameters: T.anything, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Ad) + end + def create( + # An inline ad group to create (same shape as POST /ad_groups, including + # ad_campaign_id). Creates the ad group and the ad together. Provide this OR + # ad_group_id. + ad_group: nil, + # The existing ad group to create the ad in. Provide this OR ad_group, not both. + ad_group_id: nil, + # The call-to-action button shown on the ad. + call_to_action: nil, + # The ad's creative assets. Each entry is an uploaded file id with an optional + # format; omit format for the original asset. + creatives: nil, + # The description variants shown on the ad. + descriptions: nil, + # The headline variants shown on the ad. + headlines: nil, + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + lead_form: nil, + # Use an existing Meta instant form instead of creating one — the form's Meta id, + # from a form already on the ad's Facebook page. Only allowed when the ad group's + # conversion_location is an instant-form destination. Mutually exclusive with + # lead_form. + lead_form_id: nil, + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + messaging_config: nil, + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + multi_advertiser_ads: nil, + # Promote an existing post instead of uploading creatives — a Facebook post or + # Instagram media id. Mutually exclusive with creatives. Pair with post_source. + post_id: nil, + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + post_source: nil, + # The primary text variants shown in the ad body. + primary_texts: nil, + # The social accounts (Facebook page, Instagram profile) the ad runs under. + social_accounts: nil, + # The display name of the ad. + title: nil, + # The URL the ad links to. + url: nil, + # Query parameters appended to the destination URL, as a string-to-string map. + url_parameters: nil, + request_options: {} + ) + end + + # Retrieves a single ad with stats over the requested window. sig do params( id: String, - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Ad) end def retrieve( - # The unique identifier of the ad. + # The ad ID. id, - # Inclusive start of the window for the ad's metric fields (spend, impressions, - # …). Omit both statsFrom and statsTo for all-time stats. + # Start of the stats window. stats_from: nil, - # Inclusive end of the window for the ad's metric fields. Omit both statsFrom and - # statsTo for all-time stats. + # End of the stats window. stats_to: nil, + # IANA timezone the stats window is interpreted in. Defaults to UTC. + time_zone: nil, request_options: {} ) end - # List ads scoped by ad group, campaign, or company. - # - # Required permissions: - # - # - `ad_campaign:basic:read` + # Updates an ad's editable fields. 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), - 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), - stats_from: T.nilable(Time), - stats_to: T.nilable(Time), - status: T.nilable(WhopSDK::ExternalAdStatus::OrSymbol), + id: String, + call_to_action: WhopSDK::AdUpdateParams::CallToAction::OrSymbol, + creatives: T::Array[WhopSDK::AdUpdateParams::Creative::OrHash], + descriptions: T::Array[String], + headlines: T::Array[String], + lead_form: WhopSDK::AdUpdateParams::LeadForm::OrHash, + lead_form_id: String, + messaging_config: WhopSDK::AdUpdateParams::MessagingConfig::OrHash, + multi_advertiser_ads: T::Boolean, + post_id: String, + post_source: WhopSDK::AdUpdateParams::PostSource::OrSymbol, + primary_texts: T::Array[String], + social_accounts: + T::Array[WhopSDK::AdUpdateParams::SocialAccount::OrHash], + title: String, + url: String, + url_parameters: T.anything, request_options: WhopSDK::RequestOptions::OrHash - ).returns( - WhopSDK::Internal::CursorPage[WhopSDK::Models::AdListResponse] - ) + ).returns(WhopSDK::Ad) + end + def update( + # The ad ID. + id, + # The call-to-action button shown on the ad. + call_to_action: nil, + # The ad's creative assets. Each entry is an uploaded file id with an optional + # format; omit format for the original asset. Replaces a live ad's creative on the + # platform. + creatives: nil, + # The description variants shown on the ad. + descriptions: nil, + # The headline variants shown on the ad. + headlines: nil, + # Instant lead form for the ad. Only allowed when the ad group's + # conversion_location is an instant-form destination (instant_forms, + # instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with + # lead_form_id. + lead_form: nil, + # Use an existing Meta instant form instead of creating one — the form's Meta id, + # from a form already on the ad's Facebook page. Only allowed when the ad group's + # conversion_location is an instant-form destination. Mutually exclusive with + # lead_form. Replaces a stored lead_form. + lead_form_id: nil, + # Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt + # (keyword). + messaging_config: nil, + # Whether the ad can appear alongside other advertisers' ads in the same unit. + # Defaults to true. + multi_advertiser_ads: nil, + # Promote an existing post instead of uploading creatives — a Facebook post or + # Instagram media id. Mutually exclusive with creatives. Pair with post_source. + post_id: nil, + # Which network post_id refers to — facebook (a page post) or instagram (a media + # id). Authoritative; when omitted the source is inferred from the id shape. + post_source: nil, + # The primary text variants shown in the ad body. + primary_texts: nil, + # The social accounts the ad runs under. + social_accounts: nil, + # The display name of the ad. + title: nil, + # The URL the ad links to. + url: nil, + # Query parameters appended to the destination URL, as a string-to-string map. + url_parameters: nil, + request_options: {} + ) + end + + # Lists the ads for an account, with stats over the requested window. + sig do + params( + account_id: String, + ad_campaign_id: String, + ad_group_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::AdListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::AdListParams::Order::OrSymbol, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::AdListParams::Status::OrSymbol, + time_zone: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Internal::CursorPage[WhopSDK::Ad]) end def list( - # Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or - # company_id. + # The account the ads belong to. Defaults to the account-scoped key's own account. + account_id: nil, + # Only return ads in this ad campaign. 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. + # Only return ads in this ad group. 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. + # Cursor to fetch the page after (from page_info.end_cursor). after: nil, - # Returns the elements in the list that come before the specified cursor. + # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # Filter by campaign. - campaign_id: nil, - # 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. + # The sort direction. Defaults to desc. direction: nil, - # Returns the first _n_ elements from the list. + # The number of ads to return. first: nil, - # Returns the last _n_ elements from the list. + # The number of ads to return from the end of the range. last: nil, - # The fields ad resources can be ordered by. + # The field to sort by. Defaults to created_at. Stat columns (spend, impressions, + # …) rank over the stats_from/stats_to window across the whole list, not just the + # current page. results, cost_per_result and return_on_ad_spend rank by the same + # Whop pixel-attributed values the response reports. 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 ID. + # Filter ads by a title or ID substring. query: nil, - # 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. + # Start of the stats window. Defaults to all-time. stats_from: nil, - # 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. + # End of the stats window. Defaults to now. stats_to: nil, - # The status of an external ad. + # Only return ads with this status. status: nil, + # IANA timezone (e.g. America/New_York) the stats window is interpreted in. Bare + # stats_from/stats_to dates resolve to day boundaries on this clock. Defaults to + # UTC. + time_zone: nil, + request_options: {} + ) + end + + # Deletes an ad. Returns true on success. + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T::Boolean) + end + def delete( + # The ad ID. + id, request_options: {} ) end - # Pauses an ad. - # - # Required permissions: - # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` + # Pauses an active ad. sig do params( id: String, @@ -128,18 +267,13 @@ module WhopSDK ).returns(WhopSDK::Ad) end def pause( - # The unique identifier of the ad to pause. + # The ad ID. id, request_options: {} ) end # Resumes a paused ad. - # - # Required permissions: - # - # - `ad_campaign:update` - # - `ad_campaign:basic:read` sig do params( id: String, @@ -147,7 +281,7 @@ module WhopSDK ).returns(WhopSDK::Ad) end def unpause( - # The unique identifier of the ad to unpause. + # The ad ID. id, request_options: {} ) diff --git a/rbi/whop_sdk/resources/affiliates.rbi b/rbi/whop_sdk/resources/affiliates.rbi index 37674e7e..6c9896e4 100644 --- a/rbi/whop_sdk/resources/affiliates.rbi +++ b/rbi/whop_sdk/resources/affiliates.rbi @@ -2,9 +2,7 @@ module WhopSDK module Resources - # Affiliates class Affiliates - # Affiliates sig { returns(WhopSDK::Resources::Affiliates::Overrides) } attr_reader :overrides diff --git a/rbi/whop_sdk/resources/affiliates/overrides.rbi b/rbi/whop_sdk/resources/affiliates/overrides.rbi index 2875e789..ab335939 100644 --- a/rbi/whop_sdk/resources/affiliates/overrides.rbi +++ b/rbi/whop_sdk/resources/affiliates/overrides.rbi @@ -3,7 +3,6 @@ module WhopSDK module Resources class Affiliates - # Affiliates class Overrides # Creates a commission override for an affiliate. # diff --git a/rbi/whop_sdk/resources/ai_chats.rbi b/rbi/whop_sdk/resources/ai_chats.rbi index db257e4f..caab6681 100644 --- a/rbi/whop_sdk/resources/ai_chats.rbi +++ b/rbi/whop_sdk/resources/ai_chats.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Ai chats class AIChats # Create a new AI chat thread and send the first message to the AI agent. # diff --git a/rbi/whop_sdk/resources/app_builds.rbi b/rbi/whop_sdk/resources/app_builds.rbi index a27fe25d..57a59f2d 100644 --- a/rbi/whop_sdk/resources/app_builds.rbi +++ b/rbi/whop_sdk/resources/app_builds.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # App builds class AppBuilds # Upload a new build artifact for an app. The build must include a compiled code # bundle for the specified platform. @@ -25,7 +24,7 @@ module WhopSDK def create( # The build file to upload. For iOS and Android, this should be a .zip archive # containing a main_js_bundle.hbc file and an optional assets folder. For web, - # this should be a JavaScript file. + # this should be a JavaScript file or a .zip archive of the hosted site. attachment:, # A client-generated checksum of the build file, used to verify file integrity # when unpacked on a device. diff --git a/rbi/whop_sdk/resources/apps.rbi b/rbi/whop_sdk/resources/apps.rbi index 19dab6fc..4cb4ab5d 100644 --- a/rbi/whop_sdk/resources/apps.rbi +++ b/rbi/whop_sdk/resources/apps.rbi @@ -2,7 +2,15 @@ module WhopSDK module Resources - # Apps + # An App is software you build on Whop. It can be a hosted web app served at + # `.whop.app` or an API integration installed as an experience, and it + # belongs to the account that owns its credentials, settings, builds, and runtime + # logs. + # + # Use the Apps API to manage app configuration and, for hosted apps, read server + # runtime logs for console output, uncaught exceptions, and failed requests. Logs + # are retained for 7 days and can be filtered by build, level, time window, and + # message text. class Apps # Register a new app on the Whop developer platform. Apps provide custom # experiences that can be added to products. @@ -11,6 +19,7 @@ module WhopSDK # # - `developer:create_app` # - `developer:manage_api_key` + # - `developer:update_app` sig do params( company_id: String, @@ -18,6 +27,7 @@ module WhopSDK base_url: T.nilable(String), icon: T.nilable(WhopSDK::AppCreateParams::Icon::OrHash), redirect_uris: T.nilable(T::Array[String]), + route: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::App) end @@ -35,6 +45,9 @@ module WhopSDK # The whitelisted OAuth callback URLs that users are redirected to after # authorizing the app. redirect_uris: nil, + # The unique subdomain route where the app's hosted web builds are served, such as + # 'myapp' for myapp.whop.app. + route: nil, request_options: {} ) end @@ -44,6 +57,7 @@ module WhopSDK # Required permissions: # # - `developer:manage_api_key` + # - `developer:update_app` sig do params( id: String, @@ -84,6 +98,8 @@ module WhopSDK T.nilable( T::Array[WhopSDK::AppUpdateParams::RequiredScope::OrSymbol] ), + route: T.nilable(String), + secrets: T.nilable(T::Hash[Symbol, T.anything]), skills_path: T.nilable(String), status: T.nilable(WhopSDK::AppStatuses::OrSymbol), request_options: WhopSDK::RequestOptions::OrHash @@ -122,6 +138,14 @@ module WhopSDK redirect_uris: nil, # The permission scopes the app will request from users when they install it. required_scopes: nil, + # The unique subdomain route where the app's hosted web builds are served, such as + # 'myapp' for myapp.whop.app. + route: nil, + # Secrets to add or overwrite on the app, as an object of string values (e.g. + # {"MAIL_API_KEY": "..."}). Keys not included are left untouched. Pass null or an + # empty string as the value to delete a secret. Secrets are encrypted at rest and + # injected into the app's hosted server runtime as environment bindings. + secrets: nil, # The URL path to the skills directory of the app, such as '/assets/skills/'. skills_path: nil, # The status of an experience interface @@ -178,6 +202,47 @@ module WhopSDK ) end + # Lists a hosted app's server runtime logs, most recent first: console output, + # uncaught exceptions, and failed-request summaries captured on whop.app hosting. + # Logs are retained for 7 days. + sig do + params( + id: String, + after: String, + app_build_id: String, + before: String, + created_after: Time, + created_before: Time, + first: Integer, + level: WhopSDK::AppLogsParams::Level::OrSymbol, + query: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::AppLogsResponse) + end + def logs( + # The ID of the app, which will look like app\_******\*******. + id, + # A cursor for fetching logs after a previous page. + after: nil, + # Only return logs from this build. + app_build_id: nil, + # A cursor for fetching logs before a later page. + before: nil, + # Start of the time window as an ISO 8601 timestamp. Defaults to 7 days before + # created_before. + created_after: nil, + # End of the time window as an ISO 8601 timestamp. Defaults to now. + created_before: nil, + # The number of log lines to return (max 500). + first: nil, + # Only return console lines of this level. + level: nil, + # Only return logs whose message contains this text (case-insensitive). + query: 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/audiences.rbi b/rbi/whop_sdk/resources/audiences.rbi new file mode 100644 index 00000000..4d7a0531 --- /dev/null +++ b/rbi/whop_sdk/resources/audiences.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module WhopSDK + module Resources + # An Audience represents a customer list uploaded to Whop for ad targeting. + # Audiences belong to an account and sync to supported ad platforms as custom + # audiences. + # + # Use the Audiences API to create audiences from CSV uploads, monitor processing + # status, and list or delete audiences for an account. Created audiences are + # usable for targeting after processing reaches `ready` or `partial`. + class Audiences + # Creates an audience from an uploaded customer identity CSV file and starts + # processing it. + sig do + params( + account_id: String, + column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping::OrHash, + file_id: String, + name: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Audience) + end + def create( + # Account ID, prefixed `biz_`. + account_id:, + # Maps supported identity fields to CSV column headers. Map at least one of + # `email` or `phone`. + column_mapping:, + # Direct upload ID from the standard media upload endpoint. + file_id:, + # Audience display name. + name:, + request_options: {} + ) + end + + # Lists uploaded customer-list audiences for an account. Pass `audience_id` to + # return a specific audience. + sig do + params( + account_id: String, + after: String, + audience_id: String, + first: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Internal::CursorPage[WhopSDK::Audience]) + end + def list( + # Account ID, prefixed `biz_`. + account_id:, + # Cursor for the next page of audiences. + after: nil, + # Audience ID, prefixed `adaud_`, used to filter the response to one audience. + audience_id: nil, + # Number of audiences to return. Defaults to 20; maximum 100. + first: nil, + request_options: {} + ) + end + + # Deletes an audience so it is no longer available for targeting. + sig do + params( + audience_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::AudienceDeleteResponse) + end + def delete( + # Audience ID, prefixed `adaud_`. + audience_id, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/whop_sdk/resources/authorized_users.rbi b/rbi/whop_sdk/resources/authorized_users.rbi index 881b4bf2..b9b143a2 100644 --- a/rbi/whop_sdk/resources/authorized_users.rbi +++ b/rbi/whop_sdk/resources/authorized_users.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Authorized users class AuthorizedUsers # Add a new authorized user to a company. # @@ -15,6 +14,8 @@ module WhopSDK company_id: String, role: WhopSDK::AuthorizedUserRoles::OrSymbol, user_id: String, + elevation: + T.nilable(WhopSDK::AuthorizedUserCreateParams::Elevation::OrHash), send_emails: T.nilable(T::Boolean), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AuthorizedUser) @@ -27,6 +28,8 @@ module WhopSDK role:, # The ID of the user to add as an authorized user. user_id:, + # Re-authentication proof required to perform this sensitive action. + elevation: nil, # Whether to send notification emails to the user on creation. send_emails: nil, request_options: {} diff --git a/rbi/whop_sdk/resources/bounties.rbi b/rbi/whop_sdk/resources/bounties.rbi index d2a6de17..ff3e4547 100644 --- a/rbi/whop_sdk/resources/bounties.rbi +++ b/rbi/whop_sdk/resources/bounties.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Bounties class Bounties # Create a new workforce bounty by funding a dedicated bounty pool. # @@ -17,16 +16,25 @@ module WhopSDK title: String, accepted_submissions_limit: T.nilable(Integer), allowed_country_codes: T.nilable(T::Array[String]), + business_goal_type: + T.nilable(WhopSDK::BountyCreateParams::BusinessGoalType::OrSymbol), experience_id: T.nilable(String), origin_account_id: T.nilable(String), post_markdown_content: T.nilable(String), post_title: T.nilable(String), + scheduled_frequency: + T.nilable( + WhopSDK::BountyCreateParams::ScheduledFrequency::OrSymbol + ), + scheduled_publish_at: T.nilable(Time), + scheduled_timezone: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Models::BountyCreateResponse) end def create( # The amount paid to each approved submission. The total bounty pool funded is - # this amount times accepted_submissions_limit. + # this amount times accepted_submissions_limit, and must be at least 5 in the + # bounty's currency. base_unit_amount:, # The currency for the bounty pool funding amount. currency:, @@ -35,11 +43,15 @@ module WhopSDK # The title of the bounty. title:, # The number of submissions that can be approved before the bounty closes. - # Defaults to 1. + # Defaults to 1. The total pool (base_unit_amount times this limit) must be at + # least 5 in the bounty's currency. accepted_submissions_limit: nil, # The ISO3166 country codes where this bounty should be visible. Empty means # globally visible. allowed_country_codes: nil, + # What the poster is trying to accomplish with a workforce bounty. Used for + # product taxonomy and analytics, separate from the bounty's implementation type. + business_goal_type: nil, # An optional experience to scope the bounty to. experience_id: nil, # The user (user*\*) or company (biz*\*) tag whose balance funds this bounty pool. @@ -52,6 +64,14 @@ module WhopSDK # Optional title for the anchor forum post. Falls back to the bounty title when # omitted. post_title: nil, + # How often a scheduled bounty republishes a new bounty. + scheduled_frequency: nil, + # When to publish the bounty. When provided, the bounty is created as a hidden + # draft and published at this time instead of immediately. Must be in the future. + scheduled_publish_at: nil, + # The IANA timezone used for recurring occurrences. Required when + # scheduled_publish_at is provided. + scheduled_timezone: nil, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/cards.rbi b/rbi/whop_sdk/resources/cards.rbi new file mode 100644 index 00000000..7e430e5b --- /dev/null +++ b/rbi/whop_sdk/resources/cards.rbi @@ -0,0 +1,160 @@ +# typed: strong + +module WhopSDK + module Resources + # Cards represent Whop-issued virtual payment cards that spend from an account or + # user balance. Cards can be assigned to cardholders and configured with spending + # limits for controlled spending. + # + # Use the Cards API to issue cards, list cards for an account or user, and + # retrieve active card details such as the card number and CVC. + class Cards + # Issues a virtual card. For an individual (consumer) card issuing account, the + # card is issued to the account's own cardholder. For a company (business) card + # issuing account, pass assigned*user_id to issue the card to a company member; if + # that member is not yet an approved card-issuing user, the card is provisioned + # asynchronously or an onboarding invitation is sent (HTTP 202). Pass exactly one + # of account_id (a biz* identifier) or user*id (a user* identifier). Returns the + # newly created card resource. + sig do + params( + account_id: String, + assigned_user_id: String, + name: String, + spend_limit: Float, + spend_limit_frequency: + WhopSDK::CardCreateParams::SpendLimitFrequency::OrSymbol, + transaction_limit: Float, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::CardCreateResponse) + end + def create( + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # The company member (a user\_ identifier) to assign the card to. Required for + # company (business) card issuing accounts. + assigned_user_id: nil, + # A display name for the card. + name: nil, + # Spending limit amount, in dollars. + spend_limit: nil, + # The spending limit window. + spend_limit_frequency: nil, + # Per-transaction limit amount, in dollars. + transaction_limit: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: nil, + request_options: {} + ) + end + + # Retrieves a single card by its icrd\_ identifier, including its secrets (full + # card number, CVC, and cardholder name) for active cards. + sig do + params( + card_id: String, + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::CardRetrieveResponse) + end + def retrieve( + # Card ID to retrieve, prefixed `icrd_`. + card_id, + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: nil, + request_options: {} + ) + end + + # Updates an issued card. All fields are optional; only the fields you pass are + # changed. Updates the card name, billing address, and spending limits in one + # call, sets a new PIN, freezes or unfreezes the card, or cancels it. Pass + # canceled: true alone to cancel the card — cancellation is permanent and a + # canceled card cannot be uncanceled. Pass exactly one of account*id (a biz* + # identifier) or user*id (a user* identifier). Assigned cardholders without the + # payout:account:update scope can update the PIN and freeze state of their own + # card. The PIN can only be changed on a card assigned to the acting user. Returns + # the updated card resource. + sig do + params( + card_id: String, + account_id: String, + billing: WhopSDK::CardUpdateParams::Billing::OrHash, + canceled: T::Boolean, + frozen: T::Boolean, + name: String, + pin: String, + remove_limit: T::Boolean, + spend_limit: Float, + spend_limit_frequency: + WhopSDK::CardUpdateParams::SpendLimitFrequency::OrSymbol, + transaction_limit: Float, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::CardUpdateResponse) + end + def update( + # Card ID to retrieve, prefixed `icrd_`. + card_id, + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # New billing address. Requires line1, city, region, postal_code, and + # country_code. + billing: nil, + # Pass `true` to permanently cancel the card. A canceled card cannot be + # uncanceled. Cannot be combined with other fields. + canceled: nil, + # Pass `true` to freeze the card, `false` to unfreeze it. + frozen: nil, + # A display name for the card. + name: nil, + # New 4-digit PIN. Can only be set on a card assigned to the acting user. + pin: nil, + # Pass `true` to remove the spending limit (make the card unlimited). + remove_limit: nil, + # Spending limit amount, in dollars. + spend_limit: nil, + # The spending limit window. + spend_limit_frequency: nil, + # Per-transaction limit amount, in dollars. + transaction_limit: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: nil, + request_options: {} + ) + end + + # Lists issued Whop virtual cards for an account or user, including pending + # invitation cards that have not been issued by the card provider yet. Pass + # exactly one of account*id (a biz* identifier) or user*id (a user* identifier). + # Non-owner team members only see cards assigned to them. Users without the + # payout:account:read scope can still list cards assigned to them (for example + # moderators or external cardholders). Use GET /cards/:card_id to retrieve a + # single card with its secrets. + sig do + params( + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::CardListResponse) + end + def list( + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: 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/chat_channels.rbi b/rbi/whop_sdk/resources/chat_channels.rbi index 5425c3f2..e95cc157 100644 --- a/rbi/whop_sdk/resources/chat_channels.rbi +++ b/rbi/whop_sdk/resources/chat_channels.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Chat channels class ChatChannels # Retrieves the details of an existing chat channel. # diff --git a/rbi/whop_sdk/resources/checkout_configurations.rbi b/rbi/whop_sdk/resources/checkout_configurations.rbi index 2d0147fd..fcb25b4d 100644 --- a/rbi/whop_sdk/resources/checkout_configurations.rbi +++ b/rbi/whop_sdk/resources/checkout_configurations.rbi @@ -2,70 +2,90 @@ module WhopSDK module Resources - # Checkout configurations + # A Checkout Configuration is a reusable checkout link owned by an account. In + # `payment` mode it sells a specific plan; in `setup` mode it collects and saves + # payment details without charging. Each configuration can also override which + # payment methods are accepted and how 3D Secure is enforced for that checkout. + # + # Use the Checkout Configurations API to create checkout links for an existing or + # inline plan, list configurations for an account, retrieve the configuration + # behind a checkout URL, and delete links that should no longer be used. class CheckoutConfigurations - # Creates a new checkout configuration - # - # Required permissions: - # - # - `checkout_configuration:create` - # - `plan:create` - # - `access_pass:create` - # - `access_pass:update` - # - `checkout_configuration:basic:read` + # Creates a reusable checkout configuration for an existing or inline plan. sig do params( - body: - T.any( - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::OrHash, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::OrHash, - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::OrHash + affiliate_code: T.nilable(String), + company_id: String, + currency: T.nilable(String), + metadata: T.nilable(T.anything), + mode: WhopSDK::CheckoutConfigurationCreateParams::Mode::OrSymbol, + payment_method_configuration: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration::OrHash ), + plan: + T.nilable(WhopSDK::CheckoutConfigurationCreateParams::Plan::OrHash), + plan_id: T.nilable(String), + redirect_url: T.nilable(String), + three_ds_level: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::CheckoutConfiguration) + ).returns(WhopSDK::Models::CheckoutConfigurationCreateResponse) end def create( - # Parameters for CreateCheckoutSession - body:, + # Affiliate code to apply to the checkout. + affiliate_code: nil, + # Account ID, prefixed `biz_`. + company_id: nil, + # Currency used for setup-mode payment method availability. + currency: nil, + # Custom key-value metadata copied to payments and memberships. + metadata: nil, + # Checkout mode: `payment` collects payment for a plan now; `setup` saves payment + # details without charging. Defaults to `payment`. + mode: nil, + # Payment method overrides for this checkout. `null` uses the plan or platform + # defaults. + payment_method_configuration: nil, + # Plan attributes used to create or find a plan for this checkout configuration. + # Mutually exclusive with `plan_id`. + plan: nil, + # Existing plan ID, prefixed `plan_`. Mutually exclusive with `plan`. + plan_id: nil, + # URL customers are sent to after checkout. + redirect_url: nil, + # 3D Secure behavior for this checkout. + three_ds_level: nil, request_options: {} ) end - # Retrieves the details of an existing checkout configuration. - # - # Required permissions: - # - # - `checkout_configuration:basic:read` + # Retrieves a checkout configuration by ID. This endpoint is public so a checkout + # page can load from the configuration URL. sig do params( id: String, request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::CheckoutConfiguration) + ).returns(WhopSDK::Models::CheckoutConfigurationRetrieveResponse) end def retrieve( - # The unique identifier of the checkout configuration. + # The ID of the checkout configuration. id, request_options: {} ) end - # Returns a paginated list of checkout configurations for a company, with optional - # filtering by plan and creation date. - # - # Required permissions: - # - # - `checkout_configuration:basic:read` + # Lists checkout configurations for an account. 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), - plan_id: T.nilable(String), + after: String, + created_after: Integer, + created_before: Integer, + direction: + WhopSDK::CheckoutConfigurationListParams::Direction::OrSymbol, + first: Integer, + order: WhopSDK::CheckoutConfigurationListParams::Order::OrSymbol, + plan_id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns( WhopSDK::Internal::CursorPage[ @@ -74,29 +94,40 @@ module WhopSDK ) end def list( - # The unique identifier of the company to list checkout configurations for. + # Account ID, prefixed `biz_`. company_id:, - # Returns the elements in the list that come after the specified cursor. + # Cursor for the next page of results. after: nil, - # Returns the elements in the list that come before the specified cursor. - before: nil, - # Only return checkout configurations created after this timestamp. + # Only return checkout configurations created after this Unix timestamp. created_after: nil, - # Only return checkout configurations created before this timestamp. + # Only return checkout configurations created before this Unix timestamp. created_before: nil, - # The direction of the sort. + # Sort direction. Defaults to `desc`. direction: nil, - # Returns the first _n_ elements from the list. + # Number of checkout configurations to return. first: nil, - # Returns the last _n_ elements from the list. - last: nil, - # Filter checkout configurations to only those associated with this plan - # identifier. + # Field used to sort checkout configurations. + order: nil, + # Only return checkout configurations for this plan ID, prefixed `plan_`. plan_id: nil, request_options: {} ) end + # Deletes a checkout configuration so its checkout URL can no longer be used. + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).void + end + def delete( + # The ID of the checkout configuration. + id, + 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/companies.rbi b/rbi/whop_sdk/resources/companies.rbi index c2fda4b7..fc666150 100644 --- a/rbi/whop_sdk/resources/companies.rbi +++ b/rbi/whop_sdk/resources/companies.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Companies class Companies # Create a new company. Pass parent_company_id to create a connected account under # a platform, or omit it to create a company for the current user. diff --git a/rbi/whop_sdk/resources/company_token_transactions.rbi b/rbi/whop_sdk/resources/company_token_transactions.rbi index bdcc6865..690265fe 100644 --- a/rbi/whop_sdk/resources/company_token_transactions.rbi +++ b/rbi/whop_sdk/resources/company_token_transactions.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Company token transactions class CompanyTokenTransactions # Create a token transaction to add, subtract, or transfer tokens for a member # within a company. diff --git a/rbi/whop_sdk/resources/conversions.rbi b/rbi/whop_sdk/resources/conversions.rbi deleted file mode 100644 index bab59cca..00000000 --- a/rbi/whop_sdk/resources/conversions.rbi +++ /dev/null @@ -1,84 +0,0 @@ -# typed: strong - -module WhopSDK - module Resources - # Conversions - class Conversions - # Track a conversion or engagement event for a company. - # - # Required permissions: - # - # - `event:create` - sig do - params( - company_id: String, - event_name: WhopSDK::ConversionCreateParams::EventName::OrSymbol, - action_source: - T.nilable(WhopSDK::ConversionCreateParams::ActionSource::OrSymbol), - 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), - request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::ConversionCreateResponse) - end - def create( - # The company to associate with this event. - company_id:, - # The type of event. - event_name:, - # The channel where an event originated - action_source: nil, - # Tracking and attribution context. - context: nil, - # The available currencies on the platform - currency: nil, - # 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, - # Client-provided identifier for deduplication. Generated if omitted. - event_id: nil, - # When the event occurred. Defaults to now. - event_time: nil, - # The plan associated with the event. - plan_id: nil, - # The product associated with the event. - 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. - user: nil, - # Monetary value associated with the event. - value: 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/course_chapters.rbi b/rbi/whop_sdk/resources/course_chapters.rbi index 13479bb2..98442820 100644 --- a/rbi/whop_sdk/resources/course_chapters.rbi +++ b/rbi/whop_sdk/resources/course_chapters.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Course chapters class CourseChapters # Create a new chapter within a course to organize lessons into sections. # diff --git a/rbi/whop_sdk/resources/course_lesson_interactions.rbi b/rbi/whop_sdk/resources/course_lesson_interactions.rbi index f94057bb..df8a96c9 100644 --- a/rbi/whop_sdk/resources/course_lesson_interactions.rbi +++ b/rbi/whop_sdk/resources/course_lesson_interactions.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Course lesson interactions class CourseLessonInteractions # Retrieves the details of an existing course lesson interaction. # diff --git a/rbi/whop_sdk/resources/course_lessons.rbi b/rbi/whop_sdk/resources/course_lessons.rbi index ba733690..218e6e2b 100644 --- a/rbi/whop_sdk/resources/course_lessons.rbi +++ b/rbi/whop_sdk/resources/course_lessons.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Course lessons class CourseLessons # Create a new lesson within a course chapter. Lessons can contain video, text, or # assessment content. diff --git a/rbi/whop_sdk/resources/course_students.rbi b/rbi/whop_sdk/resources/course_students.rbi index 2c3ac848..4d287760 100644 --- a/rbi/whop_sdk/resources/course_students.rbi +++ b/rbi/whop_sdk/resources/course_students.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Course students class CourseStudents # Retrieves the details of an existing course student. # diff --git a/rbi/whop_sdk/resources/courses.rbi b/rbi/whop_sdk/resources/courses.rbi index 42be8b46..bee3211e 100644 --- a/rbi/whop_sdk/resources/courses.rbi +++ b/rbi/whop_sdk/resources/courses.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Courses class Courses # Create a new course within an experience, with optional chapters, lessons, and a # certificate. diff --git a/rbi/whop_sdk/resources/deposits.rbi b/rbi/whop_sdk/resources/deposits.rbi index 6bb4d39c..8ee4c5af 100644 --- a/rbi/whop_sdk/resources/deposits.rbi +++ b/rbi/whop_sdk/resources/deposits.rbi @@ -2,36 +2,58 @@ module WhopSDK module Resources + # Deposits describe ways to add funds to an account balance, including hosted + # deposit pages, bank deposit instructions, and supported crypto wallet addresses. + # + # Use the Deposits API to create deposit instructions for an account and retrieve + # existing bank deposit activity. class Deposits # Resolves a deposit destination and returns the on-chain addresses that can fund - # it. + # it. No authentication is required; any business can be resolved by its account + # ID. A caller authenticated as a user can additionally resolve their own user + # account. sig do params( - amount: Float, destination: T.any( String, WhopSDK::DepositCreateParams::Destination::UnionMember1::OrHash ), + amount: Float, metadata: T::Hash[Symbol, T.anything], network: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Models::DepositCreateResponse) end def create( - # Amount to deposit. - amount:, # Destination account ID or wallet address. Object form is supported for # compatibility. destination:, - # Arbitrary metadata echoed in the response. + # Amount to prefill on hosted deposit page. + amount: nil, + # Metadata to include with the deposit response. metadata: nil, - # Optional destination network override. + # Destination network override. network: nil, request_options: {} ) end + # Returns deposit transactions for a business account. Bank deposit transactions + # are nested under the bank field. + sig do + params( + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::DepositListResponse) + end + def list( + # Business account ID (biz\_\*). + account_id:, + 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/dispute_alerts.rbi b/rbi/whop_sdk/resources/dispute_alerts.rbi index 893e7eee..5024f0ad 100644 --- a/rbi/whop_sdk/resources/dispute_alerts.rbi +++ b/rbi/whop_sdk/resources/dispute_alerts.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Dispute alerts class DisputeAlerts # Retrieves the details of an existing dispute alert. # diff --git a/rbi/whop_sdk/resources/disputes.rbi b/rbi/whop_sdk/resources/disputes.rbi index 2e97b8ba..c1f57c39 100644 --- a/rbi/whop_sdk/resources/disputes.rbi +++ b/rbi/whop_sdk/resources/disputes.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Disputes class Disputes # Retrieves the details of an existing dispute. # diff --git a/rbi/whop_sdk/resources/dm_channels.rbi b/rbi/whop_sdk/resources/dm_channels.rbi index 60431b17..78f18df9 100644 --- a/rbi/whop_sdk/resources/dm_channels.rbi +++ b/rbi/whop_sdk/resources/dm_channels.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Dm channels class DmChannels # Create a new DM channel between two or more users, optionally scoped to a # specific company. Returns the existing channel if one already exists. diff --git a/rbi/whop_sdk/resources/dm_members.rbi b/rbi/whop_sdk/resources/dm_members.rbi index edac852a..b5dfb1bd 100644 --- a/rbi/whop_sdk/resources/dm_members.rbi +++ b/rbi/whop_sdk/resources/dm_members.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Dm members class DmMembers # Add a new user to an existing DM channel. Only an admin of the channel can add # members. diff --git a/rbi/whop_sdk/resources/entries.rbi b/rbi/whop_sdk/resources/entries.rbi index 2ccb9fbb..e2db5694 100644 --- a/rbi/whop_sdk/resources/entries.rbi +++ b/rbi/whop_sdk/resources/entries.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Entries class Entries # Retrieves the details of an existing waitlist entry. # diff --git a/rbi/whop_sdk/resources/events.rbi b/rbi/whop_sdk/resources/events.rbi new file mode 100644 index 00000000..6c3d8e0c --- /dev/null +++ b/rbi/whop_sdk/resources/events.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module WhopSDK + module Resources + # An Event records conversion or engagement activity for an account, such as page + # views, purchases, or leads. Each event ties the action to the + # [person](/api-reference/beta/people/person) who took it, so activity can be + # attributed to the ads and links that drove it. + # + # Use the Events API to send new tracking events and list the events recorded for + # a person. + class Events + # Tracks a conversion or engagement event for an account. + sig do + params( + account_id: String, + event_name: WhopSDK::EventCreateParams::EventName::OrSymbol, + action_source: + T.nilable(WhopSDK::EventCreateParams::ActionSource::OrSymbol), + context: T.nilable(WhopSDK::EventCreateParams::Context::OrHash), + currency: T.nilable(WhopSDK::EventCreateParams::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::EventCreateParams::User::OrHash), + value: T.nilable(Float), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::EventCreateResponse) + end + def create( + # The account to associate with this event. + account_id:, + # The type of conversion or engagement event + event_name:, + # The channel where an event originated + action_source: nil, + # Tracking and attribution context. + context: nil, + # The available currencies on the platform + currency: nil, + # 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, + # Client-provided identifier for deduplication. Generated if omitted. + event_id: nil, + # When the event occurred. Defaults to now. + event_time: nil, + # The plan associated with the event. + plan_id: nil, + # The product associated with the event. + 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. + user: nil, + # Monetary value associated with the event. + value: nil, + request_options: {} + ) + end + + # Lists pixel events for a person, most recent first. Events are shaped like the + # POST /events intake: attribution in context, identity in user. + sig do + params( + person_id: String, + account_id: String, + after: String, + before: String, + first: Integer, + from: Integer, + to: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[WhopSDK::Models::EventListResponse] + ) + end + def list( + # The ID of the person. + person_id:, + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + account_id: nil, + # A cursor for fetching events after a previous page. + after: nil, + # A cursor for fetching events before a later page. + before: nil, + # The number of events to return. + first: nil, + # Start of the time range as a Unix timestamp. + from: nil, + # End of the time range as a Unix timestamp. Defaults to now. + to: 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/experiences.rbi b/rbi/whop_sdk/resources/experiences.rbi index ec92076d..d7cb433d 100644 --- a/rbi/whop_sdk/resources/experiences.rbi +++ b/rbi/whop_sdk/resources/experiences.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Experiences class Experiences # Required permissions: # diff --git a/rbi/whop_sdk/resources/fee_markups.rbi b/rbi/whop_sdk/resources/fee_markups.rbi index c65413c1..48606b63 100644 --- a/rbi/whop_sdk/resources/fee_markups.rbi +++ b/rbi/whop_sdk/resources/fee_markups.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Fee markups class FeeMarkups # Create or update a fee markup for a company. If a markup for the specified fee # type already exists, it will be updated with the new values. diff --git a/rbi/whop_sdk/resources/files.rbi b/rbi/whop_sdk/resources/files.rbi index 6e10ea0d..b78e7767 100644 --- a/rbi/whop_sdk/resources/files.rbi +++ b/rbi/whop_sdk/resources/files.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Files class Files # Create a new file record and receive a presigned URL for uploading content to # S3. diff --git a/rbi/whop_sdk/resources/financial_activity.rbi b/rbi/whop_sdk/resources/financial_activity.rbi index cdb67559..16a1d788 100644 --- a/rbi/whop_sdk/resources/financial_activity.rbi +++ b/rbi/whop_sdk/resources/financial_activity.rbi @@ -2,16 +2,32 @@ module WhopSDK module Resources + # A Ledger Activity row is a single financial event on an account's ledger — a + # payment, withdrawal, refund, transfer, on-chain deposit, swap, or card + # transaction. Each row is derived from the underlying ledger lines and carries a + # typed `resource` and `source` so you can present and link the event without + # extra lookups. + # + # Use Ledger Activity to build a statement or transaction feed for an account or + # user. Reconcile against your own records with `amount` (signed, in the + # currency's smallest precision units) and `posted_at`, and use `available_at` to + # know when inflows became withdrawable. 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). + # Returns a paginated activity feed for one account or user, derived from ledger + # lines with typed resource and source objects for presentation. Pass exactly one + # of `account_id` (a `biz_` identifier) or `user_id` (a `user_` identifier). + # Filter by line type, currency, posted timestamp, or settlement date to reconcile + # a specific window. Pass `include_owned_accounts=true` with your own `user_id` to + # aggregate your personal ledger and the businesses you own into one feed; each + # row then carries the owning `account`. sig do params( account_id: String, + available_after: Date, + available_before: Date, currency: String, cursor: String, + include_owned_accounts: T::Boolean, limit: Integer, line_types: T::Array[String], posted_after: Time, @@ -23,13 +39,27 @@ module WhopSDK def list( # The owning account ID (a biz\_ identifier). Provide this or user_id. account_id: nil, - # Optional currency code filter, for example usd. + # Only include rows whose funds became withdrawable on or after this `YYYY-MM-DD` + # settlement date (UTC), distinct from posted_at. Requires currency. + available_after: nil, + # Only include rows whose funds became withdrawable on or before this `YYYY-MM-DD` + # settlement date (UTC). Set equal to available_after for a single day. Requires + # currency. + available_before: nil, + # Optional currency code filter, for example `usd`. currency: nil, # Cursor returned by the previous page. cursor: nil, + # When true, aggregates the authenticated user's personal ledger with the + # businesses they own (owner role with balance read) into one feed. Requires + # user_id to be the authenticated user; cannot be combined with account_id or the + # settlement-date filters. Each returned row includes the owning `account`. + include_owned_accounts: nil, # Maximum number of rows to return. limit: nil, - # Optional ledger line categories to include. + # Optional ledger line categories to include. Some categories (for example + # `onchain_deposit`, which covers inbound crypto deposits such as MoonPay onramps) + # are only returned when explicitly requested here. line_types: nil, # Only include rows posted after this ISO 8601 timestamp. posted_after: nil, diff --git a/rbi/whop_sdk/resources/forum_posts.rbi b/rbi/whop_sdk/resources/forum_posts.rbi index bc293cd4..a9e7bc34 100644 --- a/rbi/whop_sdk/resources/forum_posts.rbi +++ b/rbi/whop_sdk/resources/forum_posts.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Forum posts class ForumPosts # Create a new forum post or comment within an experience. Supports text content, # attachments, polls, paywalling, and pinning. Pass experience_id 'public' with a diff --git a/rbi/whop_sdk/resources/forums.rbi b/rbi/whop_sdk/resources/forums.rbi index 16803fb8..0e4c20bc 100644 --- a/rbi/whop_sdk/resources/forums.rbi +++ b/rbi/whop_sdk/resources/forums.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Forums class Forums # Retrieves the details of an existing forum. # diff --git a/rbi/whop_sdk/resources/invoices.rbi b/rbi/whop_sdk/resources/invoices.rbi index a1390e29..a759c667 100644 --- a/rbi/whop_sdk/resources/invoices.rbi +++ b/rbi/whop_sdk/resources/invoices.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Invoices class Invoices # Create an invoice for a customer. The invoice can be charged automatically using # a stored payment method, or sent to the customer for manual payment. diff --git a/rbi/whop_sdk/resources/leads.rbi b/rbi/whop_sdk/resources/leads.rbi index 36d01cb0..80452570 100644 --- a/rbi/whop_sdk/resources/leads.rbi +++ b/rbi/whop_sdk/resources/leads.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Leads class Leads # Record a new lead for a company, capturing a potential customer's interest in a # specific product. diff --git a/rbi/whop_sdk/resources/ledger_accounts.rbi b/rbi/whop_sdk/resources/ledger_accounts.rbi index 75309fc1..ff663775 100644 --- a/rbi/whop_sdk/resources/ledger_accounts.rbi +++ b/rbi/whop_sdk/resources/ledger_accounts.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Ledger accounts class LedgerAccounts # Retrieves the details of an existing ledger account. # diff --git a/rbi/whop_sdk/resources/media.rbi b/rbi/whop_sdk/resources/media.rbi new file mode 100644 index 00000000..f122aab0 --- /dev/null +++ b/rbi/whop_sdk/resources/media.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module WhopSDK + module Resources + # A Media Asset is an AI-generated image or video created from a prompt and billed + # from an account balance. When generation finishes, the asset includes a file + # that can be attached anywhere Whop accepts files. + # + # Use the Media API to start a generation job and retrieve the asset while it + # processes or after it is ready. + class Media + # Retrieves a media asset by ID. Poll this while the asset is `processing`. + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::MediaAsset) + end + def retrieve( + # Media asset ID, prefixed `media_`. + id, + request_options: {} + ) + end + + # Starts an AI media generation job billed from the account's balance. Generation + # is asynchronous — poll `GET /media/{id}` until the asset is `ready`, then use + # `file.id` anywhere attachments are accepted. + sig do + params( + prompt: String, + type: WhopSDK::MediaGenerateParams::Type::OrSymbol, + account_id: String, + duration_seconds: + WhopSDK::MediaGenerateParams::DurationSeconds::OrInteger, + reference_media: T::Array[String], + resolution: WhopSDK::MediaGenerateParams::Resolution::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::MediaAsset) + end + def generate( + # What to generate. Up to 2,000 characters. + prompt:, + # The kind of media to generate. + type:, + # Account ID, prefixed `biz_`. Defaults to the account the API key belongs to. + account_id: nil, + # Video length in seconds. Video only; defaults to 5. + duration_seconds: nil, + # Optional reference image file IDs (`file_` prefixed), up to 4. For video, a + # single reference seeds the opening frame; multiple references guide subject and + # style instead. + reference_media: nil, + # Video resolution. Video only; defaults to `1080p`. `1080p` is not supported by + # Seedance 2.0 Fast or Mini; `4k` is only supported by Seedance 2.0. + resolution: 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/members.rbi b/rbi/whop_sdk/resources/members.rbi index 32e56c8f..0f117d29 100644 --- a/rbi/whop_sdk/resources/members.rbi +++ b/rbi/whop_sdk/resources/members.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Members class Members # Retrieves the details of an existing member. # diff --git a/rbi/whop_sdk/resources/memberships.rbi b/rbi/whop_sdk/resources/memberships.rbi index 6c1bba89..897ba42a 100644 --- a/rbi/whop_sdk/resources/memberships.rbi +++ b/rbi/whop_sdk/resources/memberships.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Memberships class Memberships # Retrieves the details of an existing membership. # diff --git a/rbi/whop_sdk/resources/messages.rbi b/rbi/whop_sdk/resources/messages.rbi index 8565aa07..1e20a38b 100644 --- a/rbi/whop_sdk/resources/messages.rbi +++ b/rbi/whop_sdk/resources/messages.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Messages class Messages # Send a new message in an experience chat, DM, or group chat channel. Supports # text content, attachments, polls, and replies. diff --git a/rbi/whop_sdk/resources/notifications.rbi b/rbi/whop_sdk/resources/notifications.rbi index c5ca49ac..37a50037 100644 --- a/rbi/whop_sdk/resources/notifications.rbi +++ b/rbi/whop_sdk/resources/notifications.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Notifications class Notifications # Send a push notification to users in an experience or company team. The # notification is processed asynchronously and supports targeting specific users. diff --git a/rbi/whop_sdk/resources/payment_methods.rbi b/rbi/whop_sdk/resources/payment_methods.rbi index 8dd7e5f6..03cd7387 100644 --- a/rbi/whop_sdk/resources/payment_methods.rbi +++ b/rbi/whop_sdk/resources/payment_methods.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Payment methods class PaymentMethods # Retrieves the details of an existing payment method. # diff --git a/rbi/whop_sdk/resources/payments.rbi b/rbi/whop_sdk/resources/payments.rbi index 6084b794..91c0846f 100644 --- a/rbi/whop_sdk/resources/payments.rbi +++ b/rbi/whop_sdk/resources/payments.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Payments class Payments # Charge an existing member off-session using one of their stored payment methods. # You can provide an existing plan, or create a new one in-line. This endpoint diff --git a/rbi/whop_sdk/resources/payout_accounts.rbi b/rbi/whop_sdk/resources/payout_accounts.rbi index 99b1833a..96f1127a 100644 --- a/rbi/whop_sdk/resources/payout_accounts.rbi +++ b/rbi/whop_sdk/resources/payout_accounts.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Payout accounts class PayoutAccounts # Retrieves the details of an existing payout account. # diff --git a/rbi/whop_sdk/resources/payout_methods.rbi b/rbi/whop_sdk/resources/payout_methods.rbi deleted file mode 100644 index 92caefa3..00000000 --- a/rbi/whop_sdk/resources/payout_methods.rbi +++ /dev/null @@ -1,66 +0,0 @@ -# typed: strong - -module WhopSDK - module Resources - # Payout methods - class PayoutMethods - # Retrieves the details of an existing payout method. - # - # Required permissions: - # - # - `payout:destination:read` - sig do - params( - id: String, - request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::PayoutMethodRetrieveResponse) - end - def retrieve( - # The unique identifier of the payout method to retrieve. - id, - request_options: {} - ) - end - - # Returns a list of active payout methods configured for a company, ordered by - # most recently created. - # - # Required permissions: - # - # - `payout:destination:read` - sig do - params( - company_id: String, - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), - request_options: WhopSDK::RequestOptions::OrHash - ).returns( - WhopSDK::Internal::CursorPage[ - WhopSDK::Models::PayoutMethodListResponse - ] - ) - end - def list( - # The unique identifier of the company to list payout methods for. - company_id:, - # Returns the elements in the list that come after the specified cursor. - after: nil, - # Returns the elements in the list that come before the specified cursor. - before: nil, - # Returns the first _n_ elements from the list. - first: nil, - # Returns the last _n_ elements from the list. - last: 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/payouts.rbi b/rbi/whop_sdk/resources/payouts.rbi new file mode 100644 index 00000000..230a751d --- /dev/null +++ b/rbi/whop_sdk/resources/payouts.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module WhopSDK + module Resources + # Payouts represent money sent from an account or user balance to an external + # destination, such as a bank account, wallet, or other saved payout method. + # + # Use the Payouts API to create payouts from stablecoin accounts, list payout + # history for accounts or users, monitor payout statuses, and show expected + # arrival details for funds leaving Whop. + class Payouts + # Payouts represent money sent from an account or user balance to an external + # destination, such as a bank account, wallet, or other saved payout method. + # + # Use the Payouts API to create payouts from stablecoin accounts, list payout + # history for accounts or users, monitor payout statuses, and show expected + # arrival details for funds leaving Whop. + sig { returns(WhopSDK::Resources::Payouts::Methods) } + attr_reader :methods_ + + # Creates a payout from a stablecoin account to a saved payout method. The + # account's funds move from its stablecoin balance to an external bank account, + # wallet, or crypto address. Accounts that pay out from a fiat balance use POST + # /withdrawals. Requires the payouts API to be enabled for the account; contact + # support to enable it. The payout settles asynchronously; poll GET /payouts for + # the entry whose payout_request_id matches this payout's id. + sig do + params( + account_id: String, + amount: Float, + payout_method_id: String, + currency: String, + idempotency_key: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::PayoutCreateResponse) + end + def create( + # The account to pay out from (a biz\_ identifier). + account_id:, + # The amount to pay out in the specified currency. + amount:, + # The saved payout method to deliver to (a potk\_ identifier). + payout_method_id:, + # The payout currency. Defaults to usd. + currency: nil, + # A client-generated key that makes retries safe. Retrying with the same key + # returns the original payout instead of creating a second one. + idempotency_key: nil, + request_options: {} + ) + end + + # Lists payouts (withdrawal requests) for an account or user, most recent first. + # Pass exactly one of account*id (a biz* identifier) or user*id (a user* + # identifier). The saved payout method on each payout additionally requires the + # payout:destination:read scope and is null without it. + sig do + params( + account_id: String, + after: String, + before: String, + currency: String, + first: Integer, + last: Integer, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[WhopSDK::Models::PayoutListResponse] + ) + end + def list( + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Optional currency code filter, for example `usd`. + currency: nil, + # Number of payouts to return from the start of the window. + first: nil, + # Number of payouts to return from the end of the window. + last: 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/payouts/methods.rbi b/rbi/whop_sdk/resources/payouts/methods.rbi new file mode 100644 index 00000000..db190a0e --- /dev/null +++ b/rbi/whop_sdk/resources/payouts/methods.rbi @@ -0,0 +1,76 @@ +# typed: strong + +module WhopSDK + module Resources + class Payouts + # Payouts represent money sent from an account or user balance to an external + # destination, such as a bank account, wallet, or other saved payout method. + # + # Use the Payouts API to create payouts from stablecoin accounts, list payout + # history for accounts or users, monitor payout statuses, and show expected + # arrival details for funds leaving Whop. + class Methods + # Lists the saved payout methods (bank accounts, digital wallets, crypto + # addresses) that an account or user can withdraw to, most recently added first. + # Pass exactly one of account*id (a biz* identifier) or user*id (a user* + # identifier). Pass an amount to additionally get a fee and delivery quote per + # method for withdrawing that amount. + sig do + params( + account_id: String, + after: String, + amount: Float, + before: String, + currency: String, + first: Integer, + include_available: T::Boolean, + last: Integer, + status: WhopSDK::Payouts::MethodListParams::Status::OrSymbol, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[ + WhopSDK::Models::Payouts::MethodListResponse + ] + ) + end + def list( + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Optional withdrawal amount in whole currency units, for example `250.00`. When + # provided, each method includes a quote with the estimated fee, amount received, + # and delivery date for that amount. + amount: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Currency code of the amount, for example `usd`. Only meaningful with amount. + currency: nil, + # Number of payout methods to return from the start of the window. Capped at 25 + # when an amount is provided. + first: nil, + # When true, the response also carries available_destinations — payout rails the + # account could add as a new payout method, with per-currency quotes when an + # amount is provided. + include_available: nil, + # Number of payout methods to return from the end of the window. + last: nil, + # Optional status filter. `created` means saved but unused, `active` means a + # payout through it succeeded, `broken` means the last payout failed and the + # method needs fixing. + status: 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 +end diff --git a/rbi/whop_sdk/resources/people.rbi b/rbi/whop_sdk/resources/people.rbi new file mode 100644 index 00000000..194402b0 --- /dev/null +++ b/rbi/whop_sdk/resources/people.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module WhopSDK + module Resources + # A Person represents a visitor or customer of an account, assembled from + # [pixel events](/api-reference/beta/events/event) and purchase activity — ad + # clicks, storefront visits, and checkouts. + # + # Use the People API to list the people of an account and retrieve a single + # person. + class People + # Retrieves one person for an account, aggregated from pixel events. + sig do + params( + person_id: String, + account_id: String, + from: Integer, + to: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::PersonRetrieveResponse) + end + def retrieve( + # The ID of the person. + person_id, + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + account_id: nil, + # Start of the time range as a Unix timestamp. + from: nil, + # End of the time range as a Unix timestamp. Defaults to now. + to: nil, + request_options: {} + ) + end + + # Lists the people (visitors and customers) of an account, aggregated from pixel + # events. The account is inferred from an account API key; other credentials must + # pass account_id. + sig do + params( + account_id: String, + after: String, + before: String, + direction: WhopSDK::PersonListParams::Direction::OrSymbol, + filters: String, + first: Integer, + from: Integer, + sort: String, + to: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[WhopSDK::Models::PersonListResponse] + ) + end + def list( + # The ID of the account, which will look like biz\_******\*******. Optional for + # account API keys; required for credentials that can access multiple accounts. + account_id: nil, + # A cursor for fetching people after a previous page. + after: nil, + # A cursor for fetching people before a later page. + before: nil, + # Sort direction. Defaults to desc. + direction: nil, + # A JSON-encoded array of filters, each with field, operator, and value keys. + filters: nil, + # The number of people to return (default 100, max 100). + first: nil, + # Start of the time range as a Unix timestamp. Defaults to 366 days before `to`. + from: nil, + # Column to sort by (e.g. last_seen_at, ltv, purchase_count). Defaults to + # last_seen_at. + sort: nil, + # End of the time range as a Unix timestamp. Defaults to now. + to: 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/plans.rbi b/rbi/whop_sdk/resources/plans.rbi index 66eadf1c..9d42ad40 100644 --- a/rbi/whop_sdk/resources/plans.rbi +++ b/rbi/whop_sdk/resources/plans.rbi @@ -2,16 +2,21 @@ module WhopSDK module Resources + # A Plan defines how customers buy a product. It controls pricing, billing + # cadence, availability, tax behavior, checkout fields, and purchase visibility. + # + # Use the Plans API to create plans for products, list existing plans, retrieve or + # update plan configuration, calculate tax for checkout, and delete plans that + # should no longer be offered. class Plans # Create a new pricing plan for a product. The plan defines the billing interval, # price, and availability for customers. sig do params( - product_id: String, + account_id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), checkout_styling: T.nilable(T.anything), - company_id: String, currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField::OrHash]), @@ -28,6 +33,7 @@ module WhopSDK WhopSDK::PlanCreateParams::PaymentMethodConfiguration::OrHash ), plan_type: String, + product_id: String, release_method: String, renewal_price: T.nilable(Float), split_pay_required_payments: T.nilable(Integer), @@ -41,18 +47,15 @@ module WhopSDK ).returns(WhopSDK::Plan) end def create( - # The unique identifier of the product to attach this plan to. - product_id:, + # The unique identifier of the account to create this plan for. Defaults to the + # caller's account. + account_id: nil, # 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. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. billing_period: nil, # Checkout styling overrides for this plan. checkout_styling: nil, - # 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. @@ -60,42 +63,44 @@ module WhopSDK 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. + # Access duration in days before the membership expires. expiration_days: nil, # An image displayed on the product page to represent this plan. image: nil, - # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 - # for $10.43). + # Initial amount charged 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. + # Private notes visible only to the account 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. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: nil, # 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. + # account's defaults apply. payment_method_configuration: nil, - # The billing type of the plan, such as one_time or renewal. + # Plan billing type, such as `one_time` or `renewal`. plan_type: nil, - # The method used to sell this plan (e.g., buy_now, waitlist). + # The unique identifier of the product to attach this plan to. + product_id: nil, + # Sales method for this plan, such as `buy_now` or `waitlist`. release_method: nil, # 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. + # 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 this plan. Send null to inherit the account default. + # 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. + # Free trial duration before the first recurring charge. trial_period_days: nil, # Whether the plan has unlimited stock. When true, the stock field is ignored. unlimited_stock: nil, @@ -113,7 +118,7 @@ module WhopSDK ).returns(WhopSDK::Plan) end def retrieve( - # The unique identifier of the plan, which will look like plan\_******\*******. + # Plan ID, prefixed `plan_`. id, request_options: {} ) @@ -156,12 +161,11 @@ module WhopSDK ).returns(WhopSDK::Plan) end def update( - # The unique identifier of the plan, which will look like plan\_******\*******. + # Plan ID, prefixed `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. + # Recurring billing interval in days, such as 30 for monthly or 365 for annual. billing_period: nil, # Checkout styling overrides for this plan. checkout_styling: nil, @@ -172,26 +176,26 @@ module WhopSDK 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. + # Access duration in days before the membership expires. expiration_days: nil, # An image displayed on the product page to represent this plan. image: nil, - # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 - # for $10.43). + # Initial amount charged 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. + # Private notes visible only to the account 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. + # payment and membership events. Max 50 keys, 100 chars per key, 500 chars per + # string value. metadata: nil, # Whether to offer a retention discount when a customer attempts to cancel. offer_cancel_discount: nil, # 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. + # account's defaults apply. payment_method_configuration: nil, # The amount charged each billing period for recurring plans, in the plan's # currency. @@ -203,11 +207,11 @@ module WhopSDK strike_through_initial_price: nil, # A comparison price displayed with a strikethrough for the renewal price. strike_through_renewal_price: nil, - # The 3D Secure behavior for this plan. Send null to inherit the account default. + # 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. + # Free trial duration before the first recurring charge. trial_period_days: nil, # Whether the plan has unlimited stock. When true, the stock field is ignored. unlimited_stock: nil, @@ -217,11 +221,11 @@ module WhopSDK ) end - # Returns a paginated list of plans belonging to a company, with optional + # Returns a paginated list of plans belonging to an account, with optional # filtering by visibility, type, release method, and product. sig do params( - company_id: String, + account_id: String, after: String, before: String, created_after: String, @@ -240,8 +244,8 @@ module WhopSDK ) end def list( - # The unique identifier of the company to list plans for. - company_id:, + # The unique identifier of the account to list plans for. + account_id:, # A cursor; returns plans after this position. after: nil, # A cursor; returns plans before this position. @@ -279,8 +283,34 @@ module WhopSDK ).returns(T::Boolean) end def delete( - # The unique identifier of the plan, which will look like plan\_******\*******. + # Plan ID, prefixed `plan_`. + id, + request_options: {} + ) + end + + # Previews tax for a plan before checkout, based on the buyer's location. + sig do + params( + id: String, + address: T.nilable(WhopSDK::PlanCalculateTaxParams::Address::OrHash), + ip_address: String, + tax_ids: + T.nilable(T::Array[WhopSDK::PlanCalculateTaxParams::TaxID::OrHash]), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::PlanCalculateTaxResponse) + end + def calculate_tax( + # Plan ID, prefixed `plan_`. id, + # Buyer billing address used for tax calculation. Provide either `address.country` + # or `ip_address`; include state and postal code when available for more accurate + # results. + address: nil, + # Buyer IP address used to infer location when no billing address is provided. + ip_address: nil, + # Optional buyer tax ID for B2B exemptions. At most one entry is supported. + tax_ids: nil, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/products.rbi b/rbi/whop_sdk/resources/products.rbi index f50524af..ecd40644 100644 --- a/rbi/whop_sdk/resources/products.rbi +++ b/rbi/whop_sdk/resources/products.rbi @@ -2,101 +2,82 @@ module WhopSDK module Resources - # Products + # A Product is a digital good or service sold on Whop. Products may contain plans + # for pricing and/or experiences for content delivery. + # + # Use the Products API to create products, list products visible to your + # credentials, retrieve product details, update product metadata or merchandising + # fields, and delete products that should no longer be sold. class Products - # Create a new product for a company. The product serves as the top-level - # container for plans and experiences. - # - # Required permissions: - # - # - `access_pass:create` - # - `access_pass:basic:read` + # Creates a new product for a company. sig do params( - company_id: String, title: String, collect_shipping_address: T.nilable(T::Boolean), - custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol), + company_id: String, + custom_cta: T.nilable(String), custom_cta_url: T.nilable(String), custom_statement_descriptor: T.nilable(String), description: T.nilable(String), - experience_ids: T.nilable(T::Array[String]), global_affiliate_percentage: T.nilable(Float), - global_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), + global_affiliate_status: String, headline: T.nilable(String), member_affiliate_percentage: T.nilable(Float), - member_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - plan_options: - T.nilable(WhopSDK::ProductCreateParams::PlanOptions::OrHash), + member_affiliate_status: String, + metadata: T.nilable(T.anything), product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), send_welcome_message: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Product) end def create( - # The unique identifier of the company to create this product for. - company_id:, # The display name of the product. Maximum 80 characters. title:, - # Whether the checkout flow collects a shipping address from the customer. + # Whether to collect a shipping address at checkout. collect_shipping_address: nil, - # The different types of custom CTAs that can be selected. + # The unique identifier of the company to create this product for. + company_id: nil, + # The call-to-action button label. custom_cta: nil, - # A URL that the call-to-action button links to instead of the default checkout - # flow. + # A URL the call-to-action button links to. custom_cta_url: nil, - # A custom text label that appears on the customer's bank statement. Must be 5-22 - # characters, contain at least one letter, and not contain <, >, \, ', or " - # characters. + # Custom bank statement descriptor. Must start with WHOP\*. custom_statement_descriptor: nil, - # A written description of the product displayed on its product page. + # A written description displayed on the product page. description: nil, - # The unique identifiers of experiences to connect to this product. - experience_ids: nil, - # The commission rate as a percentage that affiliates earn through the global - # affiliate program. + # The commission rate affiliates earn. global_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. + # The enrollment status in the global affiliate program. global_affiliate_status: nil, - # A short marketing headline displayed prominently on the product page. + # A short marketing headline for the product page. headline: nil, - # The commission rate as a percentage that members earn through the member - # affiliate program. + # The commission rate members earn. member_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. + # The enrollment status in the member affiliate program. member_affiliate_status: nil, - # Custom key-value pairs to store on the product. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # Custom key-value pairs to store on the product. metadata: nil, - # Configuration for an automatically generated plan to attach to this product. - plan_options: nil, - # The unique identifier of the tax classification code to apply to this product. + # The unique identifier of the tax classification code. See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). product_tax_code_id: nil, - # A URL to redirect the customer to after completing a purchase. + # A URL to redirect the customer to after purchase. redirect_purchase_url: nil, # The URL slug for the product's public link. route: nil, # Whether to send an automated welcome message via support chat when a user joins # this product. Defaults to true. send_welcome_message: nil, - # Visibility of a resource + # Whether the product is visible to customers. visibility: nil, request_options: {} ) end - # Retrieves the details of an existing product. - # - # Required permissions: - # - # - `access_pass:basic:read` + # Retrieves the details of an existing product. This endpoint is publicly + # accessible. sig do params( id: String, @@ -104,157 +85,89 @@ module WhopSDK ).returns(WhopSDK::Product) end def retrieve( - # The unique identifier or route slug of the product. + # The unique identifier of the product. id, request_options: {} ) end - # Update a product's title, description, visibility, and other settings. - # - # Required permissions: - # - # - `access_pass:update` - # - `access_pass:basic:read` + # Updates an existing product. sig do params( id: String, - collect_shipping_address: T.nilable(T::Boolean), - custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol), - custom_cta_url: T.nilable(String), - custom_statement_descriptor: T.nilable(String), description: T.nilable(String), - gallery_images: - T.nilable( - T::Array[WhopSDK::ProductUpdateParams::GalleryImage::OrHash] - ), - global_affiliate_percentage: T.nilable(Float), - global_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), headline: T.nilable(String), - member_affiliate_percentage: T.nilable(Float), - member_affiliate_status: - T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol), - metadata: T.nilable(T::Hash[Symbol, T.anything]), + metadata: T.nilable(T.anything), product_tax_code_id: T.nilable(String), - redirect_purchase_url: T.nilable(String), - route: T.nilable(String), send_welcome_message: T.nilable(T::Boolean), - store_page_config: - T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash), - title: T.nilable(String), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + title: String, + visibility: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Product) end def update( - # The unique identifier of the product to update. + # The unique identifier of the product. id, - # Whether the checkout flow collects a shipping address from the customer. - collect_shipping_address: nil, - # The different types of custom CTAs that can be selected. - custom_cta: nil, - # A URL that the call-to-action button links to instead of the default checkout - # flow. - custom_cta_url: nil, - # A custom text label that appears on the customer's bank statement. Must be 5-22 - # characters, contain at least one letter, and not contain <, >, \, ', or " - # characters. - custom_statement_descriptor: nil, - # A written description of the product displayed on its product page. + # A written description displayed on the product page. description: nil, - # The gallery images for the product. - gallery_images: nil, - # The commission rate as a percentage that affiliates earn through the global - # affiliate program. - global_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. - global_affiliate_status: nil, - # A short marketing headline displayed prominently on the product page. + # A short marketing headline for the product page. headline: nil, - # The commission rate as a percentage that members earn through the member - # affiliate program. - member_affiliate_percentage: nil, - # The different statuses of the global affiliate program for a product. - member_affiliate_status: nil, - # Custom key-value pairs to store on the product. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # Custom key-value pairs to store on the product. metadata: nil, - # The unique identifier of the tax classification code to apply to this product. + # The unique identifier of the tax classification code. See the available + # [product categories](https://docs.numeral.com/essentials/product-categories). product_tax_code_id: nil, - # A URL to redirect the customer to after completing a purchase. - redirect_purchase_url: nil, - # The URL slug for the product's public link. - route: nil, # Whether to send an automated welcome message via support chat when a user joins # this product. send_welcome_message: nil, - # Layout and display configuration for this product on the company's store page. - store_page_config: nil, - # The display name of the product. Maximum 80 characters. + # The display name of the product. title: nil, - # Visibility of a resource + # Whether the product is visible to customers. visibility: nil, request_options: {} ) end - # Returns a paginated list of products belonging to a company, with optional - # filtering by type, visibility, and creation date. - # - # Required permissions: - # - # - `access_pass:basic:read` + # Returns a paginated list of products belonging to a company. 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::ProductListParams::Order::OrSymbol), - product_types: T.nilable(T::Array[WhopSDK::AccessPassType::OrSymbol]), - visibilities: - T.nilable(T::Array[WhopSDK::VisibilityFilter::OrSymbol]), + access_pass_types: T::Array[String], + after: String, + before: String, + direction: WhopSDK::ProductListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: String, + visibilities: T::Array[String], request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Internal::CursorPage[WhopSDK::ProductListItem]) end def list( # The unique identifier of the company to list products for. company_id:, - # Returns the elements in the list that come after the specified cursor. + # Filter to only products matching these types. + access_pass_types: nil, + # A cursor; returns products after this position. after: nil, - # Returns the elements in the list that come before the specified cursor. + # A cursor; returns products before this position. before: nil, - # Only return products created after this timestamp. - created_after: nil, - # Only return products 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 products to return (default and max 100). first: nil, - # Returns the last _n_ elements from the list. + # The number of products to return from the end of the range. last: nil, - # The ways a relation of AccessPasses can be ordered + # The field to sort results by. Defaults to created_at. order: nil, - # Filter to only products matching these type classifications. - product_types: nil, # Filter to only products matching these visibility states. visibilities: nil, request_options: {} ) end - # Permanently delete a product and remove it from the company's catalog. - # - # Required permissions: - # - # - `access_pass:delete` + # Deletes a product. Only products with no memberships, entries, reviews, or + # invoices can be deleted. sig do params( id: String, @@ -262,7 +175,7 @@ module WhopSDK ).returns(T::Boolean) end def delete( - # The unique identifier of the product to delete. + # The unique identifier of the product. id, request_options: {} ) diff --git a/rbi/whop_sdk/resources/promo_codes.rbi b/rbi/whop_sdk/resources/promo_codes.rbi index 4872aa70..fd8f360e 100644 --- a/rbi/whop_sdk/resources/promo_codes.rbi +++ b/rbi/whop_sdk/resources/promo_codes.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Promo codes class PromoCodes # Create a new promo code that applies a discount at checkout. Can be scoped to # specific products or plans. diff --git a/rbi/whop_sdk/resources/reactions.rbi b/rbi/whop_sdk/resources/reactions.rbi index 2438998e..c8414e1c 100644 --- a/rbi/whop_sdk/resources/reactions.rbi +++ b/rbi/whop_sdk/resources/reactions.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Reactions class Reactions # Add an emoji reaction or poll vote to a message or forum post. In forums, the # reaction is always a like. diff --git a/rbi/whop_sdk/resources/referrals.rbi b/rbi/whop_sdk/resources/referrals.rbi new file mode 100644 index 00000000..12ddbef6 --- /dev/null +++ b/rbi/whop_sdk/resources/referrals.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module WhopSDK + module Resources + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Referrals + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + sig { returns(WhopSDK::Resources::Referrals::Businesses) } + attr_reader :businesses + + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + sig { returns(WhopSDK::Resources::Referrals::Partners) } + attr_reader :partners + + # Lists the users the caller referred onto Whop (newest first), each with the + # second-tier earnings the caller has made from that user's businesses. + sig do + params( + after: String, + before: String, + first: Integer, + has_businesses: T::Boolean, + has_earning_businesses: T::Boolean, + last: Integer, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::ReferralReferredUsersResponse) + end + def referred_users( + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Number of referred users to return from the start of the window. + first: nil, + # When true, only referred users who brought at least one business onto Whop. + has_businesses: nil, + # When true, only referred users with at least one business that has generated + # earnings. + has_earning_businesses: nil, + # Number of referred users to return from the end of the window. + last: 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/referrals/businesses.rbi b/rbi/whop_sdk/resources/referrals/businesses.rbi new file mode 100644 index 00000000..68969c91 --- /dev/null +++ b/rbi/whop_sdk/resources/referrals/businesses.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module WhopSDK + module Resources + class Referrals + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Businesses + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + sig { returns(WhopSDK::Resources::Referrals::Businesses::Earnings) } + attr_reader :earnings + + # Retrieves a single referred business and its referral terms. + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::Referrals::BusinessRetrieveResponse) + end + def retrieve( + # The business referral ID (a coma\_ identifier). + id, + request_options: {} + ) + end + + # Lists the businesses the authenticated user referred onto Whop, most recent + # first. + sig do + params( + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol, + first: Integer, + has_earnings: T::Boolean, + last: Integer, + order: WhopSDK::Referrals::BusinessListParams::Order::OrSymbol, + referred_user_id: String, + referred_username: String, + status: WhopSDK::Referrals::BusinessListParams::Status::OrSymbol, + tier: WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[ + WhopSDK::Models::Referrals::BusinessListResponse + ] + ) + end + def list( + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Only return business referrals created after this timestamp. + created_after: nil, + # Only return business referrals created before this timestamp. + created_before: nil, + # Sort direction. + direction: nil, + # Number of business referrals to return from the start of the window. + first: nil, + # When true, only businesses with pending or completed earnings paid to the + # caller. + has_earnings: nil, + # Number of business referrals to return from the end of the window. + last: nil, + # The field to sort business referrals by. + order: nil, + # Filter to referrals attributed to this user. For first-tier referrals, this is + # the referred account owner; for second-tier referrals, this is the partner you + # recruited. + referred_user_id: nil, + # Filter by the referred user's exact username. Ignored when `referred_user_id` is + # present. + referred_username: nil, + # Filter by referral status. + status: nil, + # Filter to only first-tier referrals or only second-tier referrals. + tier: nil, + request_options: {} + ) + end + + # Ranks referrers by business referral earnings — all-time by default, or over the + # current day, month, year, or trailing 30 days — and includes the caller's own + # standing. + sig do + params( + period: + WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::Referrals::BusinessLeaderboardResponse) + end + def leaderboard( + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + period: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/referrals/businesses/earnings.rbi b/rbi/whop_sdk/resources/referrals/businesses/earnings.rbi new file mode 100644 index 00000000..4c5dda10 --- /dev/null +++ b/rbi/whop_sdk/resources/referrals/businesses/earnings.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module WhopSDK + module Resources + class Referrals + class Businesses + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Earnings + # Lists the earnings Whop pays out for one referred business's activity, most + # recent first. + sig do + params( + id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: + WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol, + status: + WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[ + WhopSDK::Models::Referrals::Businesses::EarningListResponse + ] + ) + end + def list( + # The business referral ID (a coma\_ identifier). + id, + after: nil, + before: nil, + # Only return earnings created after this timestamp. + created_after: nil, + # Only return earnings created before this timestamp. + created_before: nil, + # Sort direction. + direction: nil, + first: nil, + last: nil, + # The field to sort earnings by. + order: nil, + # Filter by earning status. + status: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/referrals/partners.rbi b/rbi/whop_sdk/resources/referrals/partners.rbi new file mode 100644 index 00000000..706e46ac --- /dev/null +++ b/rbi/whop_sdk/resources/referrals/partners.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module WhopSDK + module Resources + class Referrals + # The Referrals API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Partners + # Enrolls the calling user in the Whop partner program, making their business + # referrals eligible for earnings. Idempotent — enrolling again keeps the original + # enrollment time. + sig do + params(request_options: WhopSDK::RequestOptions::OrHash).returns( + WhopSDK::Models::Referrals::PartnerCreateResponse + ) + end + def create(request_options: {}) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/refunds.rbi b/rbi/whop_sdk/resources/refunds.rbi index fbb92a25..21f24f0d 100644 --- a/rbi/whop_sdk/resources/refunds.rbi +++ b/rbi/whop_sdk/resources/refunds.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Refunds class Refunds # Retrieves the details of an existing refund. # diff --git a/rbi/whop_sdk/resources/resolution_center_cases.rbi b/rbi/whop_sdk/resources/resolution_center_cases.rbi index abd270fa..eee18984 100644 --- a/rbi/whop_sdk/resources/resolution_center_cases.rbi +++ b/rbi/whop_sdk/resources/resolution_center_cases.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Resolution center cases class ResolutionCenterCases # Retrieves the details of an existing resolution center case. # diff --git a/rbi/whop_sdk/resources/reviews.rbi b/rbi/whop_sdk/resources/reviews.rbi index 1d455458..0dfa0407 100644 --- a/rbi/whop_sdk/resources/reviews.rbi +++ b/rbi/whop_sdk/resources/reviews.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Reviews class Reviews # Retrieves the details of an existing review. sig do diff --git a/rbi/whop_sdk/resources/setup_intents.rbi b/rbi/whop_sdk/resources/setup_intents.rbi index a68a78f0..489a59eb 100644 --- a/rbi/whop_sdk/resources/setup_intents.rbi +++ b/rbi/whop_sdk/resources/setup_intents.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Setup intents class SetupIntents # Retrieves the details of an existing setup intent. # diff --git a/rbi/whop_sdk/resources/shipments.rbi b/rbi/whop_sdk/resources/shipments.rbi index b9693a3c..c13ca01e 100644 --- a/rbi/whop_sdk/resources/shipments.rbi +++ b/rbi/whop_sdk/resources/shipments.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Shipments class Shipments # Create a new shipment with a tracking code for a specific payment within a # company. diff --git a/rbi/whop_sdk/resources/social_accounts.rbi b/rbi/whop_sdk/resources/social_accounts.rbi new file mode 100644 index 00000000..468baa69 --- /dev/null +++ b/rbi/whop_sdk/resources/social_accounts.rbi @@ -0,0 +1,161 @@ +# typed: strong + +module WhopSDK + module Resources + # A Social Account represents an external profile connected to a Whop account or + # user, such as a Facebook page or Instagram account. Connecting a social account + # lets Whop run [ads](/api-reference/beta/ads/ad) under that profile's identity + # and promote its existing posts. + # + # Use the Social Accounts API to list connected accounts, create a Whop-managed + # Facebook page, start an OAuth connection, disconnect a social account, and list + # a connected profile's posts. + class SocialAccounts + # Creates or returns a Whop-managed Facebook page for an account. + sig do + params( + platform: WhopSDK::SocialAccountCreateParams::Platform::OrSymbol, + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::SocialAccount) + end + def create( + # The platform to create the social account on. + platform:, + # The Account (biz\_ identifier) to create the social account for. An + # account-scoped API key may omit this to default to its own account. + account_id: nil, + request_options: {} + ) + end + + # Lists the social accounts linked to an account or user. + sig do + params( + account_id: String, + after: String, + before: String, + direction: WhopSDK::SocialAccountListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::SocialAccountListParams::Order::OrSymbol, + platform: WhopSDK::SocialAccountListParams::Platform::OrSymbol, + scopes: T::Array[WhopSDK::SocialAccountListParams::Scope::OrSymbol], + user_id: String, + verified: T::Boolean, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Internal::CursorPage[WhopSDK::SocialAccount]) + end + def list( + # The Account that the social accounts are connected to. Provide either this or + # user_id. + account_id: nil, + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # Cursor to fetch the page before (from page_info.start_cursor). + before: nil, + # Sort direction. + direction: nil, + # The number of social accounts to return. + first: nil, + # The number of social accounts to return from the end of the range. + last: nil, + # The field to sort social accounts by. + order: nil, + # Only return social accounts for the platform that is specified. + platform: nil, + # Only return social accounts that have these scopes. + scopes: nil, + # The User that the social accounts are connected to. Provide either this or + # account_id. + user_id: nil, + # Only return social accounts that are verified on the platform. + verified: nil, + request_options: {} + ) + end + + # Disconnects a social account from an account or user without deleting the + # underlying platform account. + sig do + params( + id: String, + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T::Boolean) + end + def delete( + # The ID of the social account to disconnect. + id, + # The Account that the social account is connected to. Provide either this or + # user_id. + account_id: nil, + # The User that the social account is connected to. Provide either this or + # account_id. + user_id: nil, + request_options: {} + ) + end + + # Starts an OAuth connection flow and returns an authorize_url where the user can + # connect a social account. + sig do + params( + platform: WhopSDK::SocialAccountConnectParams::Platform::OrSymbol, + account_id: String, + redirect_url: String, + scopes: + T::Array[WhopSDK::SocialAccountConnectParams::Scope::OrSymbol], + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::SocialAccountConnectResponse) + end + def connect( + # The platform to connect the social account on. Today, the supported option is + # `meta_business`. + platform:, + # The Account (biz\_ identifier) to connect the social account for. An + # account-scoped API key may omit this to default to its own account. + account_id: nil, + # The Whop URL to redirect the user to after they finish connecting. + redirect_url: nil, + # Capabilities to grant for the connected social account. Use `advertise` when + # connecting a Meta Business account for ads. + scopes: nil, + request_options: {} + ) + end + + # Lists the existing posts of a connected Facebook page or Instagram account. + sig do + params( + id: String, + account_id: String, + after: String, + first: Integer, + post_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::SocialAccountPostsResponse) + end + def posts( + # The social account (a sacc\_ identifier) whose posts to list. + id, + # The Account (a biz\_ identifier) the social account is connected to. + account_id:, + # Cursor to fetch the page after (from page_info.end_cursor). + after: nil, + # The number of posts to return. + first: nil, + # Return only the single post with this platform id, instead of the full list. + post_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/stats.rbi b/rbi/whop_sdk/resources/stats.rbi new file mode 100644 index 00000000..c3c52495 --- /dev/null +++ b/rbi/whop_sdk/resources/stats.rbi @@ -0,0 +1,143 @@ +# typed: strong + +module WhopSDK + module Resources + # Stats represent aggregated activity for an account over time. They help you + # understand revenue, transactions, disputes, members, referrals, and advertising + # performance across reporting periods like days, weeks, or months. + # + # Use the Stats API to list available metrics and their filterable properties, + # then retrieve time-series values for a date range. + class Stats + # Retrieves a metric as a time series of points for an account over a date range. + sig do + params( + metric: String, + from: Date, + to: Date, + access_level: String, + account_id: String, + ad_campaign_ids: T::Array[String], + ad_group_ids: T::Array[String], + ad_ids: T::Array[String], + breakdown_by: String, + card_network: String, + category: String, + convert_to: String, + currency: String, + fee_type: String, + interval: WhopSDK::StatRetrieveParams::Interval::OrSymbol, + most_recent_action: String, + payment_method: String, + product: String, + referred_user_id: String, + segment: String, + snapshot_window: + WhopSDK::StatRetrieveParams::SnapshotWindow::OrSymbol, + source: String, + status: String, + time_zone: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::StatRetrieveResponse) + end + def retrieve( + # The metric to retrieve, for example net_revenue. Use GET /stats to see every + # metric key. The metric sets the unit and the properties you can filter or break + # down by. + metric, + # Start of the date range (YYYY-MM-DD). + from:, + # End of the date range (YYYY-MM-DD). + to:, + # Filter to a single access level. Pair with breakdown_by=access_level. Available + # on metrics that list access_level. + access_level: nil, + # The account this query concerns, for example biz_AbC123. + account_id: nil, + # Ad campaign ids (adcamp\_...) to scope the report to; stats are summed across + # them. Available on metrics that list ad_campaign_ids. + ad_campaign_ids: nil, + # Ad group ids (adgrp\_...) to scope the report to; stats are summed across them. + # Available on metrics that list ad_group_ids. + ad_group_ids: nil, + # Ad ids (ad\_...) to scope the report to; stats are summed across them. Available + # on metrics that list ad_ids. + ad_ids: nil, + # Split the metric out by one of its properties — each point gets a breakdown + # array. For example breakdown_by=currency returns an entry for usd, an entry for + # eur, and so on. + breakdown_by: nil, + # Filter to a single card brand, for example visa. A refinement of + # payment_method=card. Available on metrics that list card_network. + card_network: nil, + # Filter to a single balance-activity category, for example payments. Pair with + # breakdown_by=category to split the activity. Available on metrics that list + # category. + category: nil, + # Display currency for money metrics — every amount is converted into this ISO + # currency using the exchange rate on each period's date. Defaults to usd. For the + # ads metrics (ad_spend, ad_report), pass the account's ads reporting currency to + # match the ad entity endpoints. Ignored when you filter or break down by currency + # (those report the original transaction currency, unconverted). + convert_to: nil, + # Filter to transactions made in this original ISO currency, for example eur — + # reported in that currency, not converted. Pair with breakdown_by=currency to + # split a metric by currency. Available on metrics that list currency. + currency: nil, + # Filter to a single fee type. Pair with breakdown_by=fee_type to split fees by + # type. Available on metrics that list fee_type. + fee_type: nil, + # How wide each point is. Defaults to day. Snapshot metrics are day-only. + interval: nil, + # Filter to a single most-recent member action. Pair with + # breakdown_by=most_recent_action. Available on metrics that list + # most_recent_action. + most_recent_action: nil, + # Filter to a single payment method, for example card or crypto. Available on + # metrics that list payment_method. + payment_method: nil, + # Filter to a single product (access pass id), for example prod_AbC123. Pair with + # breakdown_by=product. Available on metrics that list product. + product: nil, + # Filter a referral metric to the businesses attributed to one person you + # referred, for example user_AbC123. Available on metrics that list + # referred_user_id. + referred_user_id: nil, + # Filter to a single wallet-balance segment, for example available. Pair with + # breakdown_by=segment to split the balance. Available on metrics that list + # segment. + segment: nil, + # Trailing window for snapshot metrics. Only accepted by snapshot metrics (each + # lists its allowed windows in the catalog); defaults to the metric's first + # supported window. Only 30d today. + snapshot_window: nil, + # Filter to a single GMV source, for example payments. Pair with + # breakdown_by=source to split by source. Available on metrics that list source. + source: nil, + # Filter to a single membership status. Pair with breakdown_by=status. Available + # on metrics that list status. + status: nil, + # IANA time zone to bucket the series in, for example America/New_York. Defaults + # to UTC. Not accepted by snapshot metrics, which are UTC only. + time_zone: nil, + request_options: {} + ) + end + + # Lists every metric you can query, with its unit and the properties you can + # filter or break it down by. + sig do + params(request_options: WhopSDK::RequestOptions::OrHash).returns( + WhopSDK::Models::StatListResponse + ) + end + def list(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/support_channels.rbi b/rbi/whop_sdk/resources/support_channels.rbi index 4f2813ec..15eb55e2 100644 --- a/rbi/whop_sdk/resources/support_channels.rbi +++ b/rbi/whop_sdk/resources/support_channels.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Support channels class SupportChannels # Open a new support channel between a company team member and a customer. Returns # the existing channel if one already exists for that user. diff --git a/rbi/whop_sdk/resources/swaps.rbi b/rbi/whop_sdk/resources/swaps.rbi index 005b9aff..965752ed 100644 --- a/rbi/whop_sdk/resources/swaps.rbi +++ b/rbi/whop_sdk/resources/swaps.rbi @@ -2,9 +2,15 @@ module WhopSDK module Resources + # Swaps convert value between supported tokens, chains, or wallet destinations for + # an account. A swap quote describes the expected output, fees, and approval + # requirements before you create the swap. + # + # Use the Swaps API to quote a conversion, create the swap, list recent swaps, and + # retrieve status until the transaction completes. class Swaps - # Executes a swap from the account's wallet. Runs asynchronously — poll GET - # /swaps?account_id=... for status. + # Executes a swap from the account's wallet. Runs asynchronously; poll GET + # /swaps/{id} for status. sig do params( account_id: String, @@ -20,27 +26,47 @@ module WhopSDK def create( # Business or user account ID (biz*\* / user*\*). account_id:, - # Input token amount. + # Source token amount. amount:, - # Source token contract address. + # Source token contract address or ticker symbol, such as "USDT". from_token:, - # Destination token contract address. + # Destination token contract address or ticker symbol, such as "XAUT". to_token:, + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. from_chain: nil, + # Maximum slippage tolerance in basis points. slippage_bps: nil, + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. to_chain: nil, request_options: {} ) end - # Returns the status of the account's in-flight or most recent swap. + # Returns the status of a specific swap, by the id returned from POST /swaps. sig do params( - account_id: String, + id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Models::SwapRetrieveResponse) end def retrieve( + # Swap ID returned from POST /swaps. + id, + request_options: {} + ) + end + + # Lists the account's swaps. Currently returns the in-flight or most recent swap, + # so zero or one rows. + sig do + params( + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::SwapListResponse) + end + def list( # Business or user account ID (biz*\* / user*\*). account_id:, request_options: {} @@ -65,17 +91,25 @@ module WhopSDK ).returns(WhopSDK::Models::SwapCreateQuoteResponse) end def create_quote( - # Input token amount. + # Source token amount. amount:, - # Source token contract address. + # Source token contract address or ticker symbol, such as "USDT". from_token:, - # Destination token contract address. + # Destination token contract address or ticker symbol, such as "XAUT". to_token:, + # Source wallet address used for the quote. from_address: nil, + # Source chain name or chain ID. Defaults to the source token's chain when + # omitted. from_chain: nil, + # Metadata to include with the quote response. metadata: nil, + # Maximum slippage tolerance in basis points. slippage_bps: nil, + # Destination wallet address used for the quote. to_address: nil, + # Destination chain name or chain ID. Defaults to the destination token's chain + # when omitted. to_chain: nil, request_options: {} ) diff --git a/rbi/whop_sdk/resources/topups.rbi b/rbi/whop_sdk/resources/topups.rbi index c465c113..59ae38ea 100644 --- a/rbi/whop_sdk/resources/topups.rbi +++ b/rbi/whop_sdk/resources/topups.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Topups class Topups # Add funds to a company's platform balance by charging a stored payment method. # Top-ups have no fees or taxes and do not count as revenue. diff --git a/rbi/whop_sdk/resources/transfers.rbi b/rbi/whop_sdk/resources/transfers.rbi index 35000fde..fc2acba0 100644 --- a/rbi/whop_sdk/resources/transfers.rbi +++ b/rbi/whop_sdk/resources/transfers.rbi @@ -2,115 +2,116 @@ module WhopSDK module Resources - # Transfers + # Transfers move value between identities on Whop. They are used for + # account-to-account money movement, user payouts inside Whop, crypto transfers, + # and claim links depending on the destination type. + # + # Use the Transfers API to create a transfer, list previous transfers, and + # retrieve a transfer by ID when reconciling money movement between accounts or + # users. class Transfers - # Transfer funds between two ledger accounts, such as from a company balance to a - # user balance. - # - # Required permissions: - # - # - `payout:transfer_funds` + # Moves funds out of an account. `type` selects the kind of movement (default + # `ledger`): `ledger` transfers credit between two ledger accounts and returns a + # Transfer; `wallet_send` sends USDT from the origin account's Ethereum wallet to + # a recipient; `claim_link` funds a shareable claim link anyone with the URL can + # redeem. sig do params( amount: Float, - currency: WhopSDK::Currency::OrSymbol, - destination_id: String, origin_id: String, + currency: String, + destination_id: String, + expires_at: T.nilable(Time), idempotence_key: T.nilable(String), metadata: T.nilable(T::Hash[Symbol, T.anything]), notes: T.nilable(String), + redeemable_count: Integer, + type: WhopSDK::TransferCreateParams::Type::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Transfer) + ).returns(WhopSDK::Models::TransferCreateResponse::Variants) end def create( - # The amount to transfer in the specified currency. For example, 25.00 for $25.00 - # USD. + # The amount to move, in the transfer currency. For example 25.00. amount:, - # The currency of the transfer amount, such as 'usd'. - currency:, - # The identifier of the account receiving the funds. Accepts a user ID - # ('user_xxx'), company ID ('biz_xxx'), ledger account ID ('ldgr_xxx'), or an - # email address — emails without an existing Whop user trigger a placeholder-user - # signup. - destination_id:, - # The identifier of the account sending the funds. Accepts a user ID ('user_xxx'), - # company ID ('biz_xxx'), or ledger account ID ('ldgr_xxx'). + # The account sending the funds. A user ID (user_xxx), account ID (biz_xxx), or + # ledger account ID (ldgr_xxx). origin_id:, - # A unique key to prevent duplicate transfers. Use a UUID or similar unique - # string. + # Currency, such as `usd`. Required for ledger transfers. + currency: nil, + # The recipient. Required for ledger and wallet*send (a user*/biz*/ldgr* ID, or — + # for sends — an email). Omit for claim_link. + destination_id: nil, + # claim_link only. Link expiry as an ISO 8601 timestamp. Defaults to 24 hours from + # creation. + expires_at: nil, + # Ledger transfers only. A unique key to prevent duplicate transfers. idempotence_key: nil, - # A JSON object of custom metadata to attach to the transfer for tracking - # purposes. + # Ledger transfers only. Custom key-value pairs attached to the transfer. Max 50 + # keys, 100 chars per key, 500 chars per string value. metadata: nil, - # A short note describing the transfer, up to 50 characters. + # Ledger transfers only. A short note describing the transfer. notes: nil, + # claim_link only. How many different users can claim the link. Defaults to 1. + redeemable_count: nil, + # The kind of money movement. Defaults to ledger. + type: nil, request_options: {} ) end - # Retrieves the details of an existing transfer. - # - # Required permissions: - # - # - `payout:transfer:read` + # Retrieves a ledger transfer by ID. sig do params( id: String, request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Transfer) + ).returns(WhopSDK::Models::TransferRetrieveResponse) end def retrieve( - # The unique identifier of the transfer to retrieve. + # The transfer ID. id, request_options: {} ) end - # Returns a paginated list of fund transfers, filtered by origin or destination - # account, with optional sorting and date filtering. - # - # Required permissions: - # - # - `payout:transfer:read` + # Lists ledger transfers for an account. You must specify an origin_id or a + # destination_id. sig do params( - after: T.nilable(String), - before: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - destination_id: T.nilable(String), - direction: T.nilable(WhopSDK::Direction::OrSymbol), - first: T.nilable(Integer), - last: T.nilable(Integer), - order: T.nilable(WhopSDK::TransferListParams::Order::OrSymbol), - origin_id: T.nilable(String), + after: String, + before: String, + created_after: String, + created_before: String, + destination_id: String, + direction: WhopSDK::TransferListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::TransferListParams::Order::OrSymbol, + origin_id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns( WhopSDK::Internal::CursorPage[WhopSDK::Models::TransferListResponse] ) end def list( - # Returns the elements in the list that come after the specified cursor. + # Cursor to fetch the page after (from page_info.end_cursor). after: nil, - # Returns the elements in the list that come before the specified cursor. + # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # Only return transfers created after this timestamp. + # Only transfers created strictly after this ISO 8601 timestamp. created_after: nil, - # Only return transfers created before this timestamp. + # Only transfers created strictly before this ISO 8601 timestamp. created_before: nil, - # Filter to transfers received by this account. Accepts a user, company, or ledger - # account ID. + # Filter to transfers received by this account. destination_id: nil, - # The direction of the sort. + # Sort direction. Defaults to desc. direction: nil, - # Returns the first _n_ elements from the list. + # Number of transfers to return from the start of the window. first: nil, - # Returns the last _n_ elements from the list. + # Number of transfers to return from the end of the window. last: nil, - # Which columns can be used to sort. + # Sort column. Defaults to created_at. order: nil, - # Filter to transfers sent from this account. Accepts a user, company, or ledger - # account ID. + # Filter to transfers sent from this account. origin_id: nil, request_options: {} ) diff --git a/rbi/whop_sdk/resources/users.rbi b/rbi/whop_sdk/resources/users.rbi index f26d2040..b3847f79 100644 --- a/rbi/whop_sdk/resources/users.rbi +++ b/rbi/whop_sdk/resources/users.rbi @@ -2,22 +2,47 @@ module WhopSDK module Resources + # A User represents a person on Whop. Users have a public profile and can buy + # products, join accounts, and access experiences. + # + # Use the Users API to search for users, retrieve or update profiles, and check + # whether a user has access to an account, product, or experience. class Users # Retrieves a user's public profile by user\_ tag, username, or 'me'. sig do params( id: String, account_id: String, + from: String, + include_balance_history: T::Boolean, + interval: WhopSDK::UserRetrieveParams::Interval::OrSymbol, + time_zone: String, + to: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::User) end def retrieve( - # The ID of the user, which will look like user\_******\*******, a username, or - # 'me'. + # User ID (prefixed `user_`), username, or `me`. id, # When set, returns the user's account-specific profile overrides for this # account. account_id: nil, + # Balance-history window start, ISO 8601 date or datetime. Defaults to 30 days + # ago. Only used with `include_balance_history`. + from: nil, + # On `GET /users/me`, also compute the caller's balance history (opt-in; runs a + # heavier query). Ignored for other users and for callers without balance-read + # scope. + include_balance_history: nil, + # Balance-history point granularity. Defaults to `day`. Only used with + # `include_balance_history`. + interval: nil, + # IANA time zone the balance-history points are bucketed in. Defaults to `UTC`. + # Only used with `include_balance_history`. + time_zone: nil, + # Balance-history window end, ISO 8601 date or datetime. Defaults to now. Only + # used with `include_balance_history`. + to: nil, request_options: {} ) end @@ -36,8 +61,7 @@ module WhopSDK ).returns(WhopSDK::User) end def update( - # Path param: The ID of the user, which will look like user\_******\*******, a - # username, or 'me'. + # Path param: User ID (prefixed `user_`), username, or `me`. id, # Query param: The account whose profile override to update. Required for API key # callers. @@ -82,8 +106,8 @@ module WhopSDK ) end - # Checks whether a user has access to a company, product, or experience the caller - # can reach. + # Checks whether a user has access to an account, product, or experience the + # caller can reach. sig do params( resource_id: String, @@ -92,7 +116,7 @@ module WhopSDK ).returns(WhopSDK::Models::UserCheckAccessResponse) end def check_access( - # A company (biz*), product (prod*), or experience (exp\_) ID. + # An account (biz*), product (prod*), or experience (exp\_) ID. resource_id, # The user\_ tag or username to check access for. id:, diff --git a/rbi/whop_sdk/resources/verifications.rbi b/rbi/whop_sdk/resources/verifications.rbi index b77d0e30..60e80830 100644 --- a/rbi/whop_sdk/resources/verifications.rbi +++ b/rbi/whop_sdk/resources/verifications.rbi @@ -2,57 +2,107 @@ module WhopSDK module Resources - # Verifications + # A Verification represents an identity review for a person or business. Accounts + # and users complete verification when Whop needs to confirm who they are before + # enabling payouts or compliance-sensitive workflows. + # + # Use the Verifications API to start or resume a hosted verification session, + # check review status, and submit requested details or documents. If + # `requested_information` contains items, submit answers with + # [Update Verification](/api-reference/beta/verifications/update-verification). class Verifications - # Retrieves the details of an existing verification. - # - # Required permissions: - # - # - `payout:account:read` + # Starts a hosted verification session for an account or user, or returns the + # active session when one already exists. Any fields you include in the request + # body are used to prefill the session. Send `documents` (with `document_type`) to + # instead verify the person from identity documents included in this request — no + # hosted session involved. If the account already has an `approved` verification + # the request is rejected; unlink it first to start a new one. sig do params( - id: String, + account_id: String, + body: + T.any( + WhopSDK::VerificationCreateParams::Body::Individual::OrHash, + WhopSDK::VerificationCreateParams::Body::Business::OrHash + ), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::VerificationCreateResponse) + end + def create( + # Query param: Account or user ID whose identity you want to verify. Use a `biz_` + # account ID for account verifications, or the caller's `user_` ID for personal + # verification. + account_id:, + # Body param: Request body for an individual (KYC) verification. Omit `kind` or + # set it to `individual`. KYC is required to pay out funds and is a prerequisite + # for Whop Card access. Accepting payments does not require verification until a + # business reaches $5000 in payments. + # + # Add `business_name`, `business_structure`, and `country` of incorporation if the + # individual operates under a business entity. This enables payouts to be received + # by a business bank account. + body:, + request_options: {} + ) + end + + # Returns verifications for an account, including their status and any required + # actions. + sig do + params( + verification_id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Models::VerificationRetrieveResponse) end def retrieve( - # The unique identifier of the verification to retrieve. - id, + # Verification profile ID, prefixed `idpf_`. + verification_id, + request_options: {} + ) + end + + # Updates editable profile details or submits answers for items returned in + # `requested_information`. Once a verification is `approved` its profile details + # are locked and can no longer be edited. + sig do + params( + verification_id: String, + body: + T.any( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::OrHash, + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::OrHash + ), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::VerificationUpdateResponse) + end + def update( + # Verification profile ID, prefixed `idpf_`. + verification_id, + # Fields that can be updated on an individual (KYC) verification. At least one + # field is required. + body:, request_options: {} ) end - # Returns a list of identity verifications for a payout account, ordered by most - # recent first. - # - # Required permissions: - # - # - `payout:account:read` + # Returns verifications for an account, including their status and any required + # actions. sig do params( - payout_account_id: String, - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), + account_id: String, + direction: WhopSDK::VerificationListParams::Direction::OrSymbol, + order: WhopSDK::VerificationListParams::Order::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash - ).returns( - WhopSDK::Internal::CursorPage[ - WhopSDK::Models::VerificationListResponse - ] - ) + ).returns(WhopSDK::Models::VerificationListResponse) end def list( - # The unique identifier of the payout account to list verifications for. - payout_account_id:, - # Returns the elements in the list that come after the specified cursor. - after: nil, - # Returns the elements in the list that come before the specified cursor. - before: nil, - # Returns the first _n_ elements from the list. - first: nil, - # Returns the last _n_ elements from the list. - last: nil, + # Account or user ID whose verifications you want to list. Use a `biz_` account + # ID, or the caller's `user_` ID for personal verifications. + account_id:, + # Sort direction for returned verifications. + direction: nil, + # Field used to sort returned verifications. + order: nil, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/wallets.rbi b/rbi/whop_sdk/resources/wallets.rbi deleted file mode 100644 index 0a7d19d1..00000000 --- a/rbi/whop_sdk/resources/wallets.rbi +++ /dev/null @@ -1,55 +0,0 @@ -# typed: strong - -module WhopSDK - module Resources - class Wallets - # Lists every crypto wallet linked to the authenticated resource. - sig do - params(request_options: WhopSDK::RequestOptions::OrHash).returns( - WhopSDK::Models::WalletListResponse - ) - end - def list(request_options: {}) - end - - # Returns per-token balances held in an account's wallet. - sig do - params( - account_id: String, - request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::WalletBalanceResponse) - end - def balance( - # The business or user account ID whose wallet balance should be returned. - account_id:, - request_options: {} - ) - end - - # Sends USDT from an account's wallet to another Whop user or business. - sig do - params( - account_id: String, - amount: String, - to: String, - request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::WalletSendResponse) - end - def send_( - # Query param: The sending account ID. - account_id:, - # Body param: USDT amount to send. - amount:, - # Body param: Recipient user ID, business account ID, ledger account ID, or email. - to:, - request_options: {} - ) - end - - # @api private - sig { params(client: WhopSDK::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/whop_sdk/resources/webhooks.rbi b/rbi/whop_sdk/resources/webhooks.rbi index 6b64ec10..436107a0 100644 --- a/rbi/whop_sdk/resources/webhooks.rbi +++ b/rbi/whop_sdk/resources/webhooks.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Webhooks class Webhooks # Creates a new webhook # @@ -148,6 +147,8 @@ module WhopSDK key: T.nilable(String) ).returns( T.any( + WhopSDK::ChatMessageCreatedWebhookEvent, + WhopSDK::ChatReactionCreatedWebhookEvent, WhopSDK::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::DisputeCreatedWebhookEvent, WhopSDK::DisputeUpdatedWebhookEvent, @@ -165,9 +166,11 @@ module WhopSDK WhopSDK::InvoicePaidWebhookEvent, WhopSDK::InvoicePastDueWebhookEvent, WhopSDK::InvoiceVoidedWebhookEvent, + WhopSDK::LedgerAccountFundsAvailableWebhookEvent, WhopSDK::MembershipActivatedWebhookEvent, WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent, WhopSDK::MembershipDeactivatedWebhookEvent, + WhopSDK::MembershipTrialEndingSoonWebhookEvent, WhopSDK::PaymentCreatedWebhookEvent, WhopSDK::PaymentFailedWebhookEvent, WhopSDK::PaymentPendingWebhookEvent, diff --git a/rbi/whop_sdk/resources/withdrawals.rbi b/rbi/whop_sdk/resources/withdrawals.rbi index 98793621..ffb7e380 100644 --- a/rbi/whop_sdk/resources/withdrawals.rbi +++ b/rbi/whop_sdk/resources/withdrawals.rbi @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Withdrawals class Withdrawals # Creates a withdrawal request for a ledger account # @@ -30,7 +29,7 @@ module WhopSDK currency:, # The ID of the payout method to use for the withdrawal. payout_method_id: nil, - # Whether the platform covers the payout fees instead of the connected account. + # Whether the platform covers the payout fees. platform_covers_fees: nil, # Custom statement descriptor for the withdrawal. Must be between 5 and 22 # characters and contain only alphanumeric characters. diff --git a/rbi/whop_sdk/resources/workforce.rbi b/rbi/whop_sdk/resources/workforce.rbi new file mode 100644 index 00000000..e12a05f2 --- /dev/null +++ b/rbi/whop_sdk/resources/workforce.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module WhopSDK + module Resources + class Workforce + # A Workforce Bounty is a paid task posted by an account or user. The reward is + # held in escrow when the bounty publishes, workers submit proof of completed + # work, and each accepted submission is paid out until every winner slot fills. + # + # Use the Workforce Bounties API to list an account's bounties for reporting or + # dashboards, list the bounties a user can work or has participated in, and + # retrieve a single bounty by ID. + sig { returns(WhopSDK::Resources::Workforce::Bounties) } + attr_reader :bounties + + # @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/workforce/bounties.rbi b/rbi/whop_sdk/resources/workforce/bounties.rbi new file mode 100644 index 00000000..95500c73 --- /dev/null +++ b/rbi/whop_sdk/resources/workforce/bounties.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module WhopSDK + module Resources + class Workforce + # A Workforce Bounty is a paid task posted by an account or user. The reward is + # held in escrow when the bounty publishes, workers submit proof of completed + # work, and each accepted submission is paid out until every winner slot fills. + # + # Use the Workforce Bounties API to list an account's bounties for reporting or + # dashboards, list the bounties a user can work or has participated in, and + # retrieve a single bounty by ID. + class Bounties + # Retrieves one workforce bounty by ID. The bounty must be visible to the + # credential; bounties outside the caller's scope return 404. + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Workforce::WorkforceBounty) + end + def retrieve( + # Bounty ID (`bnty_` tag). + id, + request_options: {} + ) + end + + # Lists workforce bounties visible to the credential. Account API keys return the + # account's bounties, scheduled drafts included; user tokens return the bounties + # the user can see and work. Pass account_id to view one account's bounties as a + # team member (or a connected account of the caller's), or user_id (your own) to + # list the bounties you participated in. + sig do + params( + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: + WhopSDK::Workforce::BountyListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::Workforce::BountyListParams::Order::OrSymbol, + query: String, + status: WhopSDK::Workforce::BountyListParams::Status::OrSymbol, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[ + WhopSDK::Workforce::WorkforceBountyListItem + ] + ) + end + def list( + # Scope the list to this account (`biz_` tag). Requires read access to the + # account; account API keys may pass their own account or a connected account. + account_id: nil, + # Cursor to paginate forwards from. + after: nil, + # Cursor to paginate backwards from. + before: nil, + # Only bounties created after this ISO 8601 timestamp. + created_after: nil, + # Only bounties created before this ISO 8601 timestamp. + created_before: nil, + # Sort direction. + direction: nil, + # Number of bounties to return from the start of the window. + first: nil, + # Number of bounties to return from the end of the window. + last: nil, + # Sort field. + order: nil, + # Substring match on the bounty title or ID. + query: nil, + # Filter by lifecycle state. + status: nil, + # List the bounties this user participated in (`user_` tag). Must be the + # authenticated user. + 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 +end diff --git a/sig/whop_sdk/client.rbs b/sig/whop_sdk/client.rbs index 08f224a3..a3ef5e41 100644 --- a/sig/whop_sdk/client.rbs +++ b/sig/whop_sdk/client.rbs @@ -24,6 +24,16 @@ module WhopSDK attr_reader products: WhopSDK::Resources::Products + attr_reader social_accounts: WhopSDK::Resources::SocialAccounts + + attr_reader audiences: WhopSDK::Resources::Audiences + + attr_reader media: WhopSDK::Resources::Media + + attr_reader people: WhopSDK::Resources::People + + attr_reader events: WhopSDK::Resources::Events + attr_reader companies: WhopSDK::Resources::Companies attr_reader webhooks: WhopSDK::Resources::Webhooks @@ -92,10 +102,16 @@ module WhopSDK attr_reader accounts: WhopSDK::Resources::Accounts - attr_reader wallets: WhopSDK::Resources::Wallets - attr_reader financial_activity: WhopSDK::Resources::FinancialActivity + attr_reader stats: WhopSDK::Resources::Stats + + attr_reader payouts: WhopSDK::Resources::Payouts + + attr_reader referrals: WhopSDK::Resources::Referrals + + attr_reader cards: WhopSDK::Resources::Cards + attr_reader swaps: WhopSDK::Resources::Swaps attr_reader deposits: WhopSDK::Resources::Deposits @@ -106,8 +122,6 @@ module WhopSDK attr_reader fee_markups: WhopSDK::Resources::FeeMarkups - attr_reader payout_methods: WhopSDK::Resources::PayoutMethods - attr_reader verifications: WhopSDK::Resources::Verifications attr_reader leads: WhopSDK::Resources::Leads @@ -134,14 +148,14 @@ module WhopSDK attr_reader bounties: WhopSDK::Resources::Bounties + attr_reader workforce: WhopSDK::Resources::Workforce + attr_reader ad_campaigns: WhopSDK::Resources::AdCampaigns attr_reader ad_groups: WhopSDK::Resources::AdGroups attr_reader ads: WhopSDK::Resources::Ads - attr_reader conversions: WhopSDK::Resources::Conversions - attr_reader ad_reports: WhopSDK::Resources::AdReports private def auth_headers: -> ::Hash[String, String] diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index 291c9b3e..758b2865 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -15,36 +15,42 @@ module WhopSDK class AccountMeParams = WhopSDK::Models::AccountMeParams + class AccountRecommendActionsParams = WhopSDK::Models::AccountRecommendActionsParams + class AccountRetrieveParams = WhopSDK::Models::AccountRetrieveParams + module Accounts = WhopSDK::Models::Accounts + class AccountSocialLink = WhopSDK::Models::AccountSocialLink class AccountUpdateParams = WhopSDK::Models::AccountUpdateParams - class AccountWallet = WhopSDK::Models::AccountWallet - class Ad = WhopSDK::Models::Ad - module AdBudgetType = WhopSDK::Models::AdBudgetType - class AdCampaign = WhopSDK::Models::AdCampaign + class AdCampaignCreateParams = WhopSDK::Models::AdCampaignCreateParams + + class AdCampaignDeleteParams = WhopSDK::Models::AdCampaignDeleteParams + class AdCampaignListParams = WhopSDK::Models::AdCampaignListParams class AdCampaignPauseParams = WhopSDK::Models::AdCampaignPauseParams - module AdCampaignPlatform = WhopSDK::Models::AdCampaignPlatform - class AdCampaignRetrieveParams = WhopSDK::Models::AdCampaignRetrieveParams - module AdCampaignStatus = WhopSDK::Models::AdCampaignStatus - class AdCampaignUnpauseParams = WhopSDK::Models::AdCampaignUnpauseParams class AdCampaignUpdateParams = WhopSDK::Models::AdCampaignUpdateParams + class AdCreateParams = WhopSDK::Models::AdCreateParams + + class AdDeleteParams = WhopSDK::Models::AdDeleteParams + class AdGroup = WhopSDK::Models::AdGroup + class AdGroupCreateParams = WhopSDK::Models::AdGroupCreateParams + class AdGroupDeleteParams = WhopSDK::Models::AdGroupDeleteParams class AdGroupListParams = WhopSDK::Models::AdGroupListParams @@ -53,8 +59,6 @@ module WhopSDK class AdGroupRetrieveParams = WhopSDK::Models::AdGroupRetrieveParams - module AdGroupStatus = WhopSDK::Models::AdGroupStatus - class AdGroupUnpauseParams = WhopSDK::Models::AdGroupUnpauseParams class AdGroupUpdateParams = WhopSDK::Models::AdGroupUpdateParams @@ -69,6 +73,8 @@ module WhopSDK class AdUnpauseParams = WhopSDK::Models::AdUnpauseParams + class AdUpdateParams = WhopSDK::Models::AdUpdateParams + class Affiliate = WhopSDK::Models::Affiliate class AffiliateArchiveParams = WhopSDK::Models::AffiliateArchiveParams @@ -117,6 +123,8 @@ module WhopSDK class AppListParams = WhopSDK::Models::AppListParams + class AppLogsParams = WhopSDK::Models::AppLogsParams + class AppRetrieveParams = WhopSDK::Models::AppRetrieveParams module AppStatuses = WhopSDK::Models::AppStatuses @@ -129,6 +137,14 @@ module WhopSDK module AssessmentQuestionTypes = WhopSDK::Models::AssessmentQuestionTypes + class Audience = WhopSDK::Models::Audience + + class AudienceCreateParams = WhopSDK::Models::AudienceCreateParams + + class AudienceDeleteParams = WhopSDK::Models::AudienceDeleteParams + + class AudienceListParams = WhopSDK::Models::AudienceListParams + class AuthorizedUser = WhopSDK::Models::AuthorizedUser class AuthorizedUserCreateParams = WhopSDK::Models::AuthorizedUserCreateParams @@ -153,6 +169,14 @@ module WhopSDK module CardBrands = WhopSDK::Models::CardBrands + class CardCreateParams = WhopSDK::Models::CardCreateParams + + class CardListParams = WhopSDK::Models::CardListParams + + class CardRetrieveParams = WhopSDK::Models::CardRetrieveParams + + class CardUpdateParams = WhopSDK::Models::CardUpdateParams + class ChatChannel = WhopSDK::Models::ChatChannel class ChatChannelListParams = WhopSDK::Models::ChatChannelListParams @@ -161,10 +185,16 @@ module WhopSDK class ChatChannelUpdateParams = WhopSDK::Models::ChatChannelUpdateParams + class ChatMessageCreatedWebhookEvent = WhopSDK::Models::ChatMessageCreatedWebhookEvent + + class ChatReactionCreatedWebhookEvent = WhopSDK::Models::ChatReactionCreatedWebhookEvent + class CheckoutConfiguration = WhopSDK::Models::CheckoutConfiguration class CheckoutConfigurationCreateParams = WhopSDK::Models::CheckoutConfigurationCreateParams + class CheckoutConfigurationDeleteParams = WhopSDK::Models::CheckoutConfigurationDeleteParams + class CheckoutConfigurationListParams = WhopSDK::Models::CheckoutConfigurationListParams class CheckoutConfigurationRetrieveParams = WhopSDK::Models::CheckoutConfigurationRetrieveParams @@ -199,8 +229,6 @@ module WhopSDK class CompanyUpdateParams = WhopSDK::Models::CompanyUpdateParams - class ConversionCreateParams = WhopSDK::Models::ConversionCreateParams - class Course = WhopSDK::Models::Course class CourseChapter = WhopSDK::Models::CourseChapter @@ -263,6 +291,8 @@ module WhopSDK class DepositCreateParams = WhopSDK::Models::DepositCreateParams + class DepositListParams = WhopSDK::Models::DepositListParams + module Direction = WhopSDK::Models::Direction class Dispute = WhopSDK::Models::Dispute @@ -343,6 +373,10 @@ module WhopSDK module EntryStatus = WhopSDK::Models::EntryStatus + class EventCreateParams = WhopSDK::Models::EventCreateParams + + class EventListParams = WhopSDK::Models::EventListParams + class Experience = WhopSDK::Models::Experience class ExperienceAttachParams = WhopSDK::Models::ExperienceAttachParams @@ -361,8 +395,6 @@ module WhopSDK class ExperienceUpdateParams = WhopSDK::Models::ExperienceUpdateParams - module ExternalAdStatus = WhopSDK::Models::ExternalAdStatus - class FeeMarkupCreateParams = WhopSDK::Models::FeeMarkupCreateParams class FeeMarkupDeleteParams = WhopSDK::Models::FeeMarkupDeleteParams @@ -457,6 +489,8 @@ module WhopSDK class LeadUpdateParams = WhopSDK::Models::LeadUpdateParams + class LedgerAccountFundsAvailableWebhookEvent = WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent + class LedgerAccountRetrieveParams = WhopSDK::Models::LedgerAccountRetrieveParams class Lesson = WhopSDK::Models::Lesson @@ -465,6 +499,12 @@ module WhopSDK module LessonVisibilities = WhopSDK::Models::LessonVisibilities + class MediaAsset = WhopSDK::Models::MediaAsset + + class MediaGenerateParams = WhopSDK::Models::MediaGenerateParams + + class MediaRetrieveParams = WhopSDK::Models::MediaRetrieveParams + class MemberListParams = WhopSDK::Models::MemberListParams module MemberMostRecentActions = WhopSDK::Models::MemberMostRecentActions @@ -493,6 +533,8 @@ module WhopSDK module MembershipStatus = WhopSDK::Models::MembershipStatus + class MembershipTrialEndingSoonWebhookEvent = WhopSDK::Models::MembershipTrialEndingSoonWebhookEvent + class MembershipUncancelParams = WhopSDK::Models::MembershipUncancelParams class MembershipUpdateParams = WhopSDK::Models::MembershipUpdateParams @@ -555,16 +597,22 @@ module WhopSDK class PayoutAccountStatusUpdatedWebhookEvent = WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent - module PayoutDestinationCategory = WhopSDK::Models::PayoutDestinationCategory + class PayoutCreateParams = WhopSDK::Models::PayoutCreateParams + + class PayoutListParams = WhopSDK::Models::PayoutListParams class PayoutMethodCreatedWebhookEvent = WhopSDK::Models::PayoutMethodCreatedWebhookEvent - class PayoutMethodListParams = WhopSDK::Models::PayoutMethodListParams + module Payouts = WhopSDK::Models::Payouts + + class PersonListParams = WhopSDK::Models::PersonListParams - class PayoutMethodRetrieveParams = WhopSDK::Models::PayoutMethodRetrieveParams + class PersonRetrieveParams = WhopSDK::Models::PersonRetrieveParams class Plan = WhopSDK::Models::Plan + class PlanCalculateTaxParams = WhopSDK::Models::PlanCalculateTaxParams + class PlanCreateParams = WhopSDK::Models::PlanCreateParams class PlanDeleteParams = WhopSDK::Models::PlanDeleteParams @@ -621,6 +669,10 @@ module WhopSDK module ReceiptTaxBehavior = WhopSDK::Models::ReceiptTaxBehavior + class ReferralReferredUsersParams = WhopSDK::Models::ReferralReferredUsersParams + + module Referrals = WhopSDK::Models::Referrals + class RefundCreatedWebhookEvent = WhopSDK::Models::RefundCreatedWebhookEvent class RefundListParams = WhopSDK::Models::RefundListParams @@ -693,8 +745,26 @@ module WhopSDK module ShipmentSubstatus = WhopSDK::Models::ShipmentSubstatus + class SocialAccount = WhopSDK::Models::SocialAccount + + class SocialAccountConnectParams = WhopSDK::Models::SocialAccountConnectParams + + class SocialAccountCreateParams = WhopSDK::Models::SocialAccountCreateParams + + class SocialAccountDeleteParams = WhopSDK::Models::SocialAccountDeleteParams + + class SocialAccountListParams = WhopSDK::Models::SocialAccountListParams + + class SocialAccountPost = WhopSDK::Models::SocialAccountPost + + class SocialAccountPostsParams = WhopSDK::Models::SocialAccountPostsParams + module SocialLinkWebsites = WhopSDK::Models::SocialLinkWebsites + class StatListParams = WhopSDK::Models::StatListParams + + class StatRetrieveParams = WhopSDK::Models::StatRetrieveParams + module Status = WhopSDK::Models::Status class SupportChannel = WhopSDK::Models::SupportChannel @@ -709,6 +779,8 @@ module WhopSDK class SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + class SwapListParams = WhopSDK::Models::SwapListParams + class SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams module TaxIdentifierType = WhopSDK::Models::TaxIdentifierType @@ -717,8 +789,6 @@ module WhopSDK class TopupCreateParams = WhopSDK::Models::TopupCreateParams - class Transfer = WhopSDK::Models::Transfer - class TransferCreateParams = WhopSDK::Models::TransferCreateParams class TransferListParams = WhopSDK::Models::TransferListParams @@ -731,6 +801,8 @@ module WhopSDK class User = WhopSDK::Models::User + class UserBalance = WhopSDK::Models::UserBalance + class UserCheckAccessParams = WhopSDK::Models::UserCheckAccessParams class UserListParams = WhopSDK::Models::UserListParams @@ -741,6 +813,8 @@ module WhopSDK class UserUpdateParams = WhopSDK::Models::UserUpdateParams + class VerificationCreateParams = WhopSDK::Models::VerificationCreateParams + module VerificationErrorCode = WhopSDK::Models::VerificationErrorCode class VerificationListParams = WhopSDK::Models::VerificationListParams @@ -751,16 +825,12 @@ module WhopSDK class VerificationSucceededWebhookEvent = WhopSDK::Models::VerificationSucceededWebhookEvent + class VerificationUpdateParams = WhopSDK::Models::VerificationUpdateParams + module Visibility = WhopSDK::Models::Visibility module VisibilityFilter = WhopSDK::Models::VisibilityFilter - class WalletBalanceParams = WhopSDK::Models::WalletBalanceParams - - class WalletListParams = WhopSDK::Models::WalletListParams - - class WalletSendParams = WhopSDK::Models::WalletSendParams - class Webhook = WhopSDK::Models::Webhook class WebhookCreateParams = WhopSDK::Models::WebhookCreateParams @@ -802,4 +872,6 @@ module WhopSDK module WithdrawalStatus = WhopSDK::Models::WithdrawalStatus class WithdrawalUpdatedWebhookEvent = WhopSDK::Models::WithdrawalUpdatedWebhookEvent + + module Workforce = WhopSDK::Models::Workforce end diff --git a/sig/whop_sdk/models/account.rbs b/sig/whop_sdk/models/account.rbs index 210e05a1..fc46dc1b 100644 --- a/sig/whop_sdk/models/account.rbs +++ b/sig/whop_sdk/models/account.rbs @@ -3,8 +3,11 @@ module WhopSDK type account = { id: String, + balances: ::Array[WhopSDK::Account::Balance], banner_image_url: String?, + business_address: top?, business_type: String?, + capabilities: WhopSDK::Account::Capabilities?, country: String?, created_at: String, description: String?, @@ -21,27 +24,42 @@ module WhopSDK other_business_description: String?, other_industry_description: String?, parent_account_id: String?, + product_tax_code: top?, + recommended_actions: ::Array[WhopSDK::Account::RecommendedAction]?, :require_2fa => bool, + required_actions: ::Array[WhopSDK::Account::RequiredAction]?, route: String, send_customer_emails: bool, show_joined_whops: bool, show_reviews_dtc: bool, show_user_directory: bool, social_links: ::Array[WhopSDK::AccountSocialLink], + status: String?, store_page_config: top, target_audience: String?, + tax_identifiers: ::Array[top], + tax_remitted_by: String?, title: String, + total_earned_usd: Float?, + total_usd: String?, use_logo_as_opengraph_image_fallback: bool, - wallet: WhopSDK::AccountWallet? + verification: top, + wallet: WhopSDK::Account::Wallet? } class Account < WhopSDK::Internal::Type::BaseModel attr_accessor id: String + attr_accessor balances: ::Array[WhopSDK::Account::Balance] + attr_accessor banner_image_url: String? + attr_accessor business_address: top? + attr_accessor business_type: String? + attr_accessor capabilities: WhopSDK::Account::Capabilities? + attr_accessor country: String? attr_accessor created_at: String @@ -74,8 +92,14 @@ module WhopSDK attr_accessor parent_account_id: String? + attr_accessor product_tax_code: top? + + attr_accessor recommended_actions: ::Array[WhopSDK::Account::RecommendedAction]? + attr_accessor require_2fa: bool + attr_accessor required_actions: ::Array[WhopSDK::Account::RequiredAction]? + attr_accessor route: String attr_accessor send_customer_emails: bool @@ -88,20 +112,35 @@ module WhopSDK attr_accessor social_links: ::Array[WhopSDK::AccountSocialLink] + attr_accessor status: String? + attr_accessor store_page_config: top attr_accessor target_audience: String? + attr_accessor tax_identifiers: ::Array[top] + + attr_accessor tax_remitted_by: String? + attr_accessor title: String + attr_accessor total_earned_usd: Float? + + attr_accessor total_usd: String? + attr_accessor use_logo_as_opengraph_image_fallback: bool - attr_accessor wallet: WhopSDK::AccountWallet? + attr_accessor verification: top + + attr_accessor wallet: WhopSDK::Account::Wallet? def initialize: ( id: String, + balances: ::Array[WhopSDK::Account::Balance], banner_image_url: String?, + business_address: top?, business_type: String?, + capabilities: WhopSDK::Account::Capabilities?, country: String?, created_at: String, description: String?, @@ -118,24 +157,36 @@ module WhopSDK other_business_description: String?, other_industry_description: String?, parent_account_id: String?, + product_tax_code: top?, + recommended_actions: ::Array[WhopSDK::Account::RecommendedAction]?, require_2fa: bool, + required_actions: ::Array[WhopSDK::Account::RequiredAction]?, route: String, send_customer_emails: bool, show_joined_whops: bool, show_reviews_dtc: bool, show_user_directory: bool, social_links: ::Array[WhopSDK::AccountSocialLink], + status: String?, store_page_config: top, target_audience: String?, + tax_identifiers: ::Array[top], + tax_remitted_by: String?, title: String, + total_earned_usd: Float?, + total_usd: String?, use_logo_as_opengraph_image_fallback: bool, - wallet: WhopSDK::AccountWallet? + verification: top, + wallet: WhopSDK::Account::Wallet? ) -> void def to_hash: -> { id: String, + balances: ::Array[WhopSDK::Account::Balance], banner_image_url: String?, + business_address: top?, business_type: String?, + capabilities: WhopSDK::Account::Capabilities?, country: String?, created_at: String, description: String?, @@ -152,19 +203,504 @@ module WhopSDK other_business_description: String?, other_industry_description: String?, parent_account_id: String?, + product_tax_code: top?, + recommended_actions: ::Array[WhopSDK::Account::RecommendedAction]?, :require_2fa => bool, + required_actions: ::Array[WhopSDK::Account::RequiredAction]?, route: String, send_customer_emails: bool, show_joined_whops: bool, show_reviews_dtc: bool, show_user_directory: bool, social_links: ::Array[WhopSDK::AccountSocialLink], + status: String?, store_page_config: top, target_audience: String?, + tax_identifiers: ::Array[top], + tax_remitted_by: String?, title: String, + total_earned_usd: Float?, + total_usd: String?, use_logo_as_opengraph_image_fallback: bool, - wallet: WhopSDK::AccountWallet? + verification: top, + wallet: WhopSDK::Account::Wallet? } + + type balance = + { + balance: String, + breakdown: top, + icon_url: String?, + name: String, + price_usd: Float?, + symbol: String, + value_usd: String? + } + + class Balance < WhopSDK::Internal::Type::BaseModel + attr_accessor balance: String + + attr_accessor breakdown: top + + attr_accessor icon_url: String? + + attr_accessor name: String + + attr_accessor price_usd: Float? + + attr_accessor symbol: String + + attr_accessor value_usd: String? + + def initialize: ( + balance: String, + breakdown: top, + icon_url: String?, + name: String, + price_usd: Float?, + symbol: String, + value_usd: String? + ) -> void + + def to_hash: -> { + balance: String, + breakdown: top, + icon_url: String?, + name: String, + price_usd: Float?, + symbol: String, + value_usd: String? + } + end + + type capabilities = + { + accept_bank_payments: WhopSDK::Models::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Account::Capabilities::transfer + } + + class Capabilities < WhopSDK::Internal::Type::BaseModel + attr_accessor accept_bank_payments: WhopSDK::Models::Account::Capabilities::accept_bank_payments + + attr_accessor accept_bnpl_payments: WhopSDK::Models::Account::Capabilities::accept_bnpl_payments + + attr_accessor accept_card_payments: WhopSDK::Models::Account::Capabilities::accept_card_payments + + attr_accessor bank_deposit: WhopSDK::Models::Account::Capabilities::bank_deposit + + attr_accessor card_deposit: WhopSDK::Models::Account::Capabilities::card_deposit + + attr_accessor card_issuing: WhopSDK::Models::Account::Capabilities::card_issuing + + attr_accessor crypto_deposit: WhopSDK::Models::Account::Capabilities::crypto_deposit + + attr_accessor crypto_payout: WhopSDK::Models::Account::Capabilities::crypto_payout + + attr_accessor instant_payout: WhopSDK::Models::Account::Capabilities::instant_payout + + attr_accessor standard_payout: WhopSDK::Models::Account::Capabilities::standard_payout + + attr_accessor transfer: WhopSDK::Models::Account::Capabilities::transfer + + def initialize: ( + accept_bank_payments: WhopSDK::Models::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Account::Capabilities::transfer + ) -> void + + def to_hash: -> { + accept_bank_payments: WhopSDK::Models::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Account::Capabilities::transfer + } + + type accept_bank_payments = :active | :inactive | :pending + + module AcceptBankPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::accept_bank_payments] + end + + type accept_bnpl_payments = :active | :inactive | :pending + + module AcceptBnplPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::accept_bnpl_payments] + end + + type accept_card_payments = :active | :inactive | :pending + + module AcceptCardPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::accept_card_payments] + end + + type bank_deposit = :active | :inactive | :pending + + module BankDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::bank_deposit] + end + + type card_deposit = :active | :inactive | :pending + + module CardDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::card_deposit] + end + + type card_issuing = :active | :inactive | :pending + + module CardIssuing + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::card_issuing] + end + + type crypto_deposit = :active | :inactive | :pending + + module CryptoDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::crypto_deposit] + end + + type crypto_payout = :active | :inactive | :pending + + module CryptoPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::crypto_payout] + end + + type instant_payout = :active | :inactive | :pending + + module InstantPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::instant_payout] + end + + type standard_payout = :active | :inactive | :pending + + module StandardPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::standard_payout] + end + + type transfer = :active | :inactive | :pending + + module Transfer + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::Capabilities::transfer] + end + end + + type recommended_action = + { + action: WhopSDK::Models::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Account::RecommendedAction::status, + title: String + } + + class RecommendedAction < WhopSDK::Internal::Type::BaseModel + attr_accessor action: WhopSDK::Models::Account::RecommendedAction::action + + attr_accessor blocked_capabilities: ::Array[String] + + attr_accessor cta: String + + attr_accessor cta_label: String + + attr_accessor description: String + + attr_accessor icon_url: String? + + attr_accessor impact_score: Integer? + + attr_accessor reasoning: String? + + attr_accessor status: WhopSDK::Models::Account::RecommendedAction::status + + attr_accessor title: String + + def initialize: ( + action: WhopSDK::Models::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Account::RecommendedAction::status, + title: String + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Account::RecommendedAction::status, + title: String + } + + type action = + :theme_business + | :create_product + | :create_plan + | :verify_identity + | :connect_affiliate_program + | :create_promotion + | :setup_tracking_pixel + | :migrate_from_stripe + | :accept_first_payment + | :launch_first_ad + | :invite_team_member + | :enable_tax_collection + | :create_card + | :join_whop_university + | :apply_for_financing + + module Action + extend WhopSDK::Internal::Type::Enum + + THEME_BUSINESS: :theme_business + CREATE_PRODUCT: :create_product + CREATE_PLAN: :create_plan + VERIFY_IDENTITY: :verify_identity + CONNECT_AFFILIATE_PROGRAM: :connect_affiliate_program + CREATE_PROMOTION: :create_promotion + SETUP_TRACKING_PIXEL: :setup_tracking_pixel + MIGRATE_FROM_STRIPE: :migrate_from_stripe + ACCEPT_FIRST_PAYMENT: :accept_first_payment + LAUNCH_FIRST_AD: :launch_first_ad + INVITE_TEAM_MEMBER: :invite_team_member + ENABLE_TAX_COLLECTION: :enable_tax_collection + CREATE_CARD: :create_card + JOIN_WHOP_UNIVERSITY: :join_whop_university + APPLY_FOR_FINANCING: :apply_for_financing + + def self?.values: -> ::Array[WhopSDK::Models::Account::RecommendedAction::action] + end + + type status = :optional + + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL: :optional + + def self?.values: -> ::Array[WhopSDK::Models::Account::RecommendedAction::status] + end + end + + type required_action = + { + action: WhopSDK::Models::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Account::RequiredAction::status, + title: String + } + + class RequiredAction < WhopSDK::Internal::Type::BaseModel + attr_accessor action: WhopSDK::Models::Account::RequiredAction::action + + attr_accessor blocked_capabilities: ::Array[String] + + attr_accessor cta: String? + + attr_accessor cta_label: String + + attr_accessor description: String + + attr_accessor icon_url: String? + + attr_accessor status: WhopSDK::Models::Account::RequiredAction::status + + attr_accessor title: String + + def initialize: ( + action: WhopSDK::Models::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Account::RequiredAction::status, + title: String + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Account::RequiredAction::status, + title: String + } + + type action = + :deposit_funds + | :submit_information_request + | :verify_identity + | :connect_fulfillment_tracker + + module Action + extend WhopSDK::Internal::Type::Enum + + DEPOSIT_FUNDS: :deposit_funds + SUBMIT_INFORMATION_REQUEST: :submit_information_request + VERIFY_IDENTITY: :verify_identity + CONNECT_FULFILLMENT_TRACKER: :connect_fulfillment_tracker + + def self?.values: -> ::Array[WhopSDK::Models::Account::RequiredAction::action] + end + + type status = :required | :pending + + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRED: :required + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Account::RequiredAction::status] + end + end + + type wallet = + { + id: String, + address: String, + network: WhopSDK::Models::Account::Wallet::network + } + + class Wallet < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor address: String + + attr_accessor network: WhopSDK::Models::Account::Wallet::network + + def initialize: ( + id: String, + address: String, + network: WhopSDK::Models::Account::Wallet::network + ) -> void + + def to_hash: -> { + id: String, + address: String, + network: WhopSDK::Models::Account::Wallet::network + } + + type network = :solana | :ethereum | :bitcoin + + module Network + extend WhopSDK::Internal::Type::Enum + + SOLANA: :solana + ETHEREUM: :ethereum + BITCOIN: :bitcoin + + def self?.values: -> ::Array[WhopSDK::Models::Account::Wallet::network] + end + end end end end diff --git a/sig/whop_sdk/models/account_create_params.rbs b/sig/whop_sdk/models/account_create_params.rbs index d95523fa..baccfd2f 100644 --- a/sig/whop_sdk/models/account_create_params.rbs +++ b/sig/whop_sdk/models/account_create_params.rbs @@ -1,7 +1,7 @@ module WhopSDK module Models type account_create_params = - { email: String, metadata: ::Hash[Symbol, top] } + { email: String, metadata: ::Hash[Symbol, top], title: String } & WhopSDK::Internal::Type::request_parameters class AccountCreateParams < WhopSDK::Internal::Type::BaseModel @@ -16,15 +16,21 @@ module WhopSDK def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + attr_reader title: String? + + def title=: (String) -> String + def initialize: ( ?email: String, ?metadata: ::Hash[Symbol, top], + ?title: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { email: String, metadata: ::Hash[Symbol, top], + title: String, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/account_list_params.rbs b/sig/whop_sdk/models/account_list_params.rbs index 23147e08..df6d9944 100644 --- a/sig/whop_sdk/models/account_list_params.rbs +++ b/sig/whop_sdk/models/account_list_params.rbs @@ -1,32 +1,88 @@ module WhopSDK module Models type account_list_params = - { page: Integer, per: Integer } + { + after: String, + before: String, + direction: WhopSDK::Models::AccountListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::AccountListParams::order + } & WhopSDK::Internal::Type::request_parameters class AccountListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_reader page: Integer? + attr_reader after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader direction: WhopSDK::Models::AccountListParams::direction? + + def direction=: ( + WhopSDK::Models::AccountListParams::direction + ) -> WhopSDK::Models::AccountListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? - def page=: (Integer) -> Integer + def last=: (Integer) -> Integer - attr_reader per: Integer? + attr_reader order: WhopSDK::Models::AccountListParams::order? - def per=: (Integer) -> Integer + def order=: ( + WhopSDK::Models::AccountListParams::order + ) -> WhopSDK::Models::AccountListParams::order def initialize: ( - ?page: Integer, - ?per: Integer, + ?after: String, + ?before: String, + ?direction: WhopSDK::Models::AccountListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::AccountListParams::order, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - page: Integer, - per: Integer, + after: String, + before: String, + direction: WhopSDK::Models::AccountListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::AccountListParams::order, 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::AccountListParams::direction] + end + + type order = :created_at + + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT: :created_at + + def self?.values: -> ::Array[WhopSDK::Models::AccountListParams::order] + end end end end diff --git a/sig/whop_sdk/models/account_list_response.rbs b/sig/whop_sdk/models/account_list_response.rbs deleted file mode 100644 index 962bf803..00000000 --- a/sig/whop_sdk/models/account_list_response.rbs +++ /dev/null @@ -1,62 +0,0 @@ -module WhopSDK - module Models - type account_list_response = - { - accounts: ::Array[WhopSDK::Account], - pagination: WhopSDK::Models::AccountListResponse::Pagination - } - - class AccountListResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor accounts: ::Array[WhopSDK::Account] - - attr_accessor pagination: WhopSDK::Models::AccountListResponse::Pagination - - def initialize: ( - accounts: ::Array[WhopSDK::Account], - pagination: WhopSDK::Models::AccountListResponse::Pagination - ) -> void - - def to_hash: -> { - accounts: ::Array[WhopSDK::Account], - pagination: WhopSDK::Models::AccountListResponse::Pagination - } - - type pagination = - { - current_page: Float, - next_page: Float?, - prev_page: Float?, - total_count: Float, - total_pages: Float - } - - class Pagination < WhopSDK::Internal::Type::BaseModel - attr_accessor current_page: Float - - attr_accessor next_page: Float? - - attr_accessor prev_page: Float? - - attr_accessor total_count: Float - - attr_accessor total_pages: Float - - def initialize: ( - current_page: Float, - next_page: Float?, - prev_page: Float?, - total_count: Float, - total_pages: Float - ) -> void - - def to_hash: -> { - current_page: Float, - next_page: Float?, - prev_page: Float?, - total_count: Float, - total_pages: Float - } - end - end - end -end diff --git a/sig/whop_sdk/models/wallet_send_params.rbs b/sig/whop_sdk/models/account_recommend_actions_params.rbs similarity index 55% rename from sig/whop_sdk/models/wallet_send_params.rbs rename to sig/whop_sdk/models/account_recommend_actions_params.rbs index 03e28514..6dddd22e 100644 --- a/sig/whop_sdk/models/wallet_send_params.rbs +++ b/sig/whop_sdk/models/account_recommend_actions_params.rbs @@ -1,30 +1,21 @@ module WhopSDK module Models - type wallet_send_params = - { account_id: String, amount: String, to: String } - & WhopSDK::Internal::Type::request_parameters + type account_recommend_actions_params = + { account_id: String } & WhopSDK::Internal::Type::request_parameters - class WalletSendParams < WhopSDK::Internal::Type::BaseModel + class AccountRecommendActionsParams < 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 to: String - def initialize: ( account_id: String, - amount: String, - to: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { account_id: String, - amount: String, - to: String, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/account_recommend_actions_response.rbs b/sig/whop_sdk/models/account_recommend_actions_response.rbs new file mode 100644 index 00000000..0f9b7538 --- /dev/null +++ b/sig/whop_sdk/models/account_recommend_actions_response.rbs @@ -0,0 +1,129 @@ +module WhopSDK + module Models + type account_recommend_actions_response = + { data: ::Array[WhopSDK::Models::AccountRecommendActionsResponse::Data] } + + class AccountRecommendActionsResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::AccountRecommendActionsResponse::Data] + + def initialize: ( + data: ::Array[WhopSDK::Models::AccountRecommendActionsResponse::Data] + ) -> void + + def to_hash: -> { + data: ::Array[WhopSDK::Models::AccountRecommendActionsResponse::Data] + } + + type data = + { + action: WhopSDK::Models::AccountRecommendActionsResponse::Data::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::AccountRecommendActionsResponse::Data::status, + title: String + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor action: WhopSDK::Models::AccountRecommendActionsResponse::Data::action + + attr_accessor blocked_capabilities: ::Array[String] + + attr_accessor cta: String + + attr_accessor cta_label: String + + attr_accessor description: String + + attr_accessor icon_url: String? + + attr_accessor impact_score: Integer? + + attr_accessor reasoning: String? + + attr_accessor status: WhopSDK::Models::AccountRecommendActionsResponse::Data::status + + attr_accessor title: String + + def initialize: ( + action: WhopSDK::Models::AccountRecommendActionsResponse::Data::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::AccountRecommendActionsResponse::Data::status, + title: String + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::AccountRecommendActionsResponse::Data::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::AccountRecommendActionsResponse::Data::status, + title: String + } + + type action = + :theme_business + | :create_product + | :create_plan + | :verify_identity + | :connect_affiliate_program + | :create_promotion + | :setup_tracking_pixel + | :migrate_from_stripe + | :accept_first_payment + | :launch_first_ad + | :invite_team_member + | :enable_tax_collection + | :create_card + | :join_whop_university + | :apply_for_financing + + module Action + extend WhopSDK::Internal::Type::Enum + + THEME_BUSINESS: :theme_business + CREATE_PRODUCT: :create_product + CREATE_PLAN: :create_plan + VERIFY_IDENTITY: :verify_identity + CONNECT_AFFILIATE_PROGRAM: :connect_affiliate_program + CREATE_PROMOTION: :create_promotion + SETUP_TRACKING_PIXEL: :setup_tracking_pixel + MIGRATE_FROM_STRIPE: :migrate_from_stripe + ACCEPT_FIRST_PAYMENT: :accept_first_payment + LAUNCH_FIRST_AD: :launch_first_ad + INVITE_TEAM_MEMBER: :invite_team_member + ENABLE_TAX_COLLECTION: :enable_tax_collection + CREATE_CARD: :create_card + JOIN_WHOP_UNIVERSITY: :join_whop_university + APPLY_FOR_FINANCING: :apply_for_financing + + def self?.values: -> ::Array[WhopSDK::Models::AccountRecommendActionsResponse::Data::action] + end + + type status = :optional + + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL: :optional + + def self?.values: -> ::Array[WhopSDK::Models::AccountRecommendActionsResponse::Data::status] + end + end + end + end +end diff --git a/sig/whop_sdk/models/account_update_params.rbs b/sig/whop_sdk/models/account_update_params.rbs index 7cfd5923..4b86e008 100644 --- a/sig/whop_sdk/models/account_update_params.rbs +++ b/sig/whop_sdk/models/account_update_params.rbs @@ -6,6 +6,7 @@ module WhopSDK affiliate_application_required: bool, affiliate_instructions: String?, banner_image: ::Hash[Symbol, top]?, + business_address: WhopSDK::AccountUpdateParams::BusinessAddress, business_type: String?, country: String?, description: String?, @@ -21,6 +22,7 @@ module WhopSDK opengraph_image_variant: String?, other_business_description: String?, other_industry_description: String?, + product_tax_code_id: String?, :require_2fa => bool, route: String?, send_customer_emails: bool, @@ -30,6 +32,8 @@ module WhopSDK social_links: ::Array[::Hash[Symbol, top]], store_page_config: ::Hash[Symbol, top]?, target_audience: String?, + tax_identifiers: ::Array[WhopSDK::AccountUpdateParams::TaxIdentifier], + tax_remitted_by: WhopSDK::Models::AccountUpdateParams::tax_remitted_by, title: String?, use_logo_as_opengraph_image_fallback: bool } @@ -49,6 +53,12 @@ module WhopSDK attr_accessor banner_image: ::Hash[Symbol, top]? + attr_reader business_address: WhopSDK::AccountUpdateParams::BusinessAddress? + + def business_address=: ( + WhopSDK::AccountUpdateParams::BusinessAddress + ) -> WhopSDK::AccountUpdateParams::BusinessAddress + attr_accessor business_type: String? attr_accessor country: String? @@ -83,6 +93,8 @@ module WhopSDK attr_accessor other_industry_description: String? + attr_accessor product_tax_code_id: String? + attr_reader require_2fa: bool? def require_2fa=: (bool) -> bool @@ -115,6 +127,18 @@ module WhopSDK attr_accessor target_audience: String? + attr_reader tax_identifiers: ::Array[WhopSDK::AccountUpdateParams::TaxIdentifier]? + + def tax_identifiers=: ( + ::Array[WhopSDK::AccountUpdateParams::TaxIdentifier] + ) -> ::Array[WhopSDK::AccountUpdateParams::TaxIdentifier] + + attr_reader tax_remitted_by: WhopSDK::Models::AccountUpdateParams::tax_remitted_by? + + def tax_remitted_by=: ( + WhopSDK::Models::AccountUpdateParams::tax_remitted_by + ) -> WhopSDK::Models::AccountUpdateParams::tax_remitted_by + attr_accessor title: String? attr_reader use_logo_as_opengraph_image_fallback: bool? @@ -126,6 +150,7 @@ module WhopSDK ?affiliate_application_required: bool, ?affiliate_instructions: String?, ?banner_image: ::Hash[Symbol, top]?, + ?business_address: WhopSDK::AccountUpdateParams::BusinessAddress, ?business_type: String?, ?country: String?, ?description: String?, @@ -141,6 +166,7 @@ module WhopSDK ?opengraph_image_variant: String?, ?other_business_description: String?, ?other_industry_description: String?, + ?product_tax_code_id: String?, ?require_2fa: bool, ?route: String?, ?send_customer_emails: bool, @@ -150,6 +176,8 @@ module WhopSDK ?social_links: ::Array[::Hash[Symbol, top]], ?store_page_config: ::Hash[Symbol, top]?, ?target_audience: String?, + ?tax_identifiers: ::Array[WhopSDK::AccountUpdateParams::TaxIdentifier], + ?tax_remitted_by: WhopSDK::Models::AccountUpdateParams::tax_remitted_by, ?title: String?, ?use_logo_as_opengraph_image_fallback: bool, ?request_options: WhopSDK::request_opts @@ -160,6 +188,7 @@ module WhopSDK affiliate_application_required: bool, affiliate_instructions: String?, banner_image: ::Hash[Symbol, top]?, + business_address: WhopSDK::AccountUpdateParams::BusinessAddress, business_type: String?, country: String?, description: String?, @@ -175,6 +204,7 @@ module WhopSDK opengraph_image_variant: String?, other_business_description: String?, other_industry_description: String?, + product_tax_code_id: String?, :require_2fa => bool, route: String?, send_customer_emails: bool, @@ -184,10 +214,323 @@ module WhopSDK social_links: ::Array[::Hash[Symbol, top]], store_page_config: ::Hash[Symbol, top]?, target_audience: String?, + tax_identifiers: ::Array[WhopSDK::AccountUpdateParams::TaxIdentifier], + tax_remitted_by: WhopSDK::Models::AccountUpdateParams::tax_remitted_by, title: String?, use_logo_as_opengraph_image_fallback: bool, request_options: WhopSDK::RequestOptions } + + type business_address = + { + city: String?, + country: String, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + + class BusinessAddress < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + ?city: String?, + ?country: String, + ?line1: String, + ?line2: String?, + ?postal_code: String?, + ?state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type tax_identifier = + { + tax_id_type: WhopSDK::Models::AccountUpdateParams::TaxIdentifier::tax_id_type, + tax_id_value: String + } + + class TaxIdentifier < WhopSDK::Internal::Type::BaseModel + attr_accessor tax_id_type: WhopSDK::Models::AccountUpdateParams::TaxIdentifier::tax_id_type + + attr_accessor tax_id_value: String + + def initialize: ( + tax_id_type: WhopSDK::Models::AccountUpdateParams::TaxIdentifier::tax_id_type, + tax_id_value: String + ) -> void + + def to_hash: -> { + tax_id_type: WhopSDK::Models::AccountUpdateParams::TaxIdentifier::tax_id_type, + tax_id_value: String + } + + type tax_id_type = + :ad_nrt + | :ao_tin + | :ar_cuit + | :al_tin + | :am_tin + | :aw_tin + | :au_abn + | :au_arn + | :eu_vat + | :az_tin + | :bs_tin + | :bh_vat + | :bd_bin + | :bb_tin + | :by_tin + | :bj_ifu + | :bo_tin + | :ba_tin + | :br_cnpj + | :br_cpf + | :bg_uic + | :bf_ifu + | :kh_tin + | :cm_niu + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :cv_nif + | :cl_tin + | :cn_tin + | :co_nit + | :cd_nif + | :cr_tin + | :hr_oib + | :do_rcn + | :ec_ruc + | :eg_tin + | :sv_nit + | :et_tin + | :eu_oss_vat + | :ge_vat + | :gh_tin + | :de_stn + | :gb_vat + | :gn_nif + | :hk_br + | :hu_tin + | :is_vat + | :in_gst + | :id_npwp + | :il_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :kz_bin + | :ke_pin + | :kg_tin + | :la_tin + | :li_uid + | :li_vat + | :my_frp + | :my_itn + | :my_sst + | :mr_nif + | :mx_rfc + | :md_vat + | :me_pib + | :ma_vat + | :np_pan + | :nz_gst + | :ng_tin + | :mk_vat + | :no_vat + | :no_voec + | :om_vat + | :pe_ruc + | :ph_tin + | :ro_tin + | :ru_inn + | :ru_kpp + | :sa_vat + | :sn_ninea + | :rs_pib + | :sg_gst + | :sg_uen + | :si_tin + | :za_vat + | :kr_brn + | :es_cif + | :ch_uid + | :ch_vat + | :tw_vat + | :tj_tin + | :tz_vat + | :th_vat + | :tr_tin + | :ug_tin + | :ua_vat + | :ae_trn + | :us_ein + | :uy_ruc + | :uz_tin + | :uz_vat + | :ve_rif + | :vn_tin + | :zm_tin + | :zw_tin + | :sr_fin + + module TaxIDType + extend WhopSDK::Internal::Type::Enum + + AD_NRT: :ad_nrt + AO_TIN: :ao_tin + AR_CUIT: :ar_cuit + AL_TIN: :al_tin + AM_TIN: :am_tin + AW_TIN: :aw_tin + AU_ABN: :au_abn + AU_ARN: :au_arn + EU_VAT: :eu_vat + AZ_TIN: :az_tin + BS_TIN: :bs_tin + BH_VAT: :bh_vat + BD_BIN: :bd_bin + BB_TIN: :bb_tin + BY_TIN: :by_tin + BJ_IFU: :bj_ifu + BO_TIN: :bo_tin + BA_TIN: :ba_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + BG_UIC: :bg_uic + BF_IFU: :bf_ifu + KH_TIN: :kh_tin + CM_NIU: :cm_niu + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CV_NIF: :cv_nif + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CD_NIF: :cd_nif + CR_TIN: :cr_tin + HR_OIB: :hr_oib + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + SV_NIT: :sv_nit + ET_TIN: :et_tin + EU_OSS_VAT: :eu_oss_vat + GE_VAT: :ge_vat + GH_TIN: :gh_tin + DE_STN: :de_stn + GB_VAT: :gb_vat + GN_NIF: :gn_nif + HK_BR: :hk_br + HU_TIN: :hu_tin + IS_VAT: :is_vat + IN_GST: :in_gst + ID_NPWP: :id_npwp + IL_VAT: :il_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KZ_BIN: :kz_bin + KE_PIN: :ke_pin + KG_TIN: :kg_tin + LA_TIN: :la_tin + LI_UID: :li_uid + LI_VAT: :li_vat + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + MR_NIF: :mr_nif + MX_RFC: :mx_rfc + MD_VAT: :md_vat + ME_PIB: :me_pib + MA_VAT: :ma_vat + NP_PAN: :np_pan + NZ_GST: :nz_gst + NG_TIN: :ng_tin + MK_VAT: :mk_vat + NO_VAT: :no_vat + NO_VOEC: :no_voec + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + RO_TIN: :ro_tin + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SN_NINEA: :sn_ninea + RS_PIB: :rs_pib + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + ZA_VAT: :za_vat + KR_BRN: :kr_brn + ES_CIF: :es_cif + CH_UID: :ch_uid + CH_VAT: :ch_vat + TW_VAT: :tw_vat + TJ_TIN: :tj_tin + TZ_VAT: :tz_vat + TH_VAT: :th_vat + TR_TIN: :tr_tin + UG_TIN: :ug_tin + UA_VAT: :ua_vat + AE_TRN: :ae_trn + US_EIN: :us_ein + UY_RUC: :uy_ruc + UZ_TIN: :uz_tin + UZ_VAT: :uz_vat + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZM_TIN: :zm_tin + ZW_TIN: :zw_tin + SR_FIN: :sr_fin + + def self?.values: -> ::Array[WhopSDK::Models::AccountUpdateParams::TaxIdentifier::tax_id_type] + end + end + + type tax_remitted_by = :whop | :self | :none + + module TaxRemittedBy + extend WhopSDK::Internal::Type::Enum + + WHOP: :whop + SELF: :self + NONE: :none + + def self?.values: -> ::Array[WhopSDK::Models::AccountUpdateParams::tax_remitted_by] + end end end end diff --git a/sig/whop_sdk/models/account_wallet.rbs b/sig/whop_sdk/models/account_wallet.rbs deleted file mode 100644 index eb4f5d8a..00000000 --- a/sig/whop_sdk/models/account_wallet.rbs +++ /dev/null @@ -1,42 +0,0 @@ -module WhopSDK - module Models - type account_wallet = - { - id: String, - address: String, - network: WhopSDK::Models::AccountWallet::network - } - - class AccountWallet < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor address: String - - attr_accessor network: WhopSDK::Models::AccountWallet::network - - def initialize: ( - id: String, - address: String, - network: WhopSDK::Models::AccountWallet::network - ) -> void - - def to_hash: -> { - id: String, - address: String, - network: WhopSDK::Models::AccountWallet::network - } - - type network = :solana | :ethereum | :bitcoin - - module Network - extend WhopSDK::Internal::Type::Enum - - SOLANA: :solana - ETHEREUM: :ethereum - BITCOIN: :bitcoin - - def self?.values: -> ::Array[WhopSDK::Models::AccountWallet::network] - end - end - end -end diff --git a/sig/whop_sdk/models/accounts/preference_retrieve_params.rbs b/sig/whop_sdk/models/accounts/preference_retrieve_params.rbs new file mode 100644 index 00000000..0d51fb30 --- /dev/null +++ b/sig/whop_sdk/models/accounts/preference_retrieve_params.rbs @@ -0,0 +1,25 @@ +module WhopSDK + module Models + module Accounts + type preference_retrieve_params = + { account_id: String } & WhopSDK::Internal::Type::request_parameters + + class PreferenceRetrieveParams < 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 +end diff --git a/sig/whop_sdk/models/accounts/preference_retrieve_response.rbs b/sig/whop_sdk/models/accounts/preference_retrieve_response.rbs new file mode 100644 index 00000000..5f38e3f3 --- /dev/null +++ b/sig/whop_sdk/models/accounts/preference_retrieve_response.rbs @@ -0,0 +1,110 @@ +module WhopSDK + module Models + module Accounts + type preference_retrieve_response = + { + ads_payment_methods: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods? + } + + class PreferenceRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor ads_payment_methods: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods? + + def initialize: ( + ads_payment_methods: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods? + ) -> void + + def to_hash: -> { + ads_payment_methods: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods? + } + + type ads_payment_methods = + { + backup: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup?, + primary: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary? + } + + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + attr_accessor backup: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup? + + attr_accessor primary: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary? + + def initialize: ( + backup: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup?, + primary: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary? + ) -> void + + def to_hash: -> { + backup: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup?, + primary: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary? + } + + type backup = + { + id: String, + type: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::type_ + } + + class Backup < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::type_ + + def initialize: ( + id: String, + type: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::type_ + ) -> void + + def to_hash: -> { + id: String, + type: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::type_ + } + + type type_ = :platform_balance | :card + + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE: :platform_balance + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Backup::type_] + end + end + + type primary = + { + id: String, + type: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::type_ + } + + class Primary < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::type_ + + def initialize: ( + id: String, + type: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::type_ + ) -> void + + def to_hash: -> { + id: String, + type: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::type_ + } + + type type_ = :platform_balance | :card + + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE: :platform_balance + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods::Primary::type_] + end + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/accounts/preference_update_params.rbs b/sig/whop_sdk/models/accounts/preference_update_params.rbs new file mode 100644 index 00000000..ad9fe058 --- /dev/null +++ b/sig/whop_sdk/models/accounts/preference_update_params.rbs @@ -0,0 +1,133 @@ +module WhopSDK + module Models + module Accounts + type preference_update_params = + { + account_id: String, + ads_payment_methods: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods + } + & WhopSDK::Internal::Type::request_parameters + + class PreferenceUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_reader ads_payment_methods: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods? + + def ads_payment_methods=: ( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods + ) -> WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods + + def initialize: ( + account_id: String, + ?ads_payment_methods: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + ads_payment_methods: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods, + request_options: WhopSDK::RequestOptions + } + + type ads_payment_methods = + { + primary: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary, + backup: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup + } + + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + attr_accessor primary: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary + + attr_reader backup: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup? + + def backup=: ( + WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup + ) -> WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup + + def initialize: ( + primary: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary, + ?backup: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup + ) -> void + + def to_hash: -> { + primary: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary, + backup: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup + } + + type primary = + { + type: WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::type_, + id: String + } + + class Primary < WhopSDK::Internal::Type::BaseModel + attr_accessor type: WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::type_ + + attr_reader id: String? + + def id=: (String) -> String + + def initialize: ( + type: WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::type_, + ?id: String + ) -> void + + def to_hash: -> { + type: WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::type_, + id: String + } + + type type_ = :platform_balance | :card + + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE: :platform_balance + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Primary::type_] + end + end + + type backup = + { + type: WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::type_, + id: String + } + + class Backup < WhopSDK::Internal::Type::BaseModel + attr_accessor type: WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::type_ + + attr_reader id: String? + + def id=: (String) -> String + + def initialize: ( + type: WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::type_, + ?id: String + ) -> void + + def to_hash: -> { + type: WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::type_, + id: String + } + + type type_ = :platform_balance | :card + + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE: :platform_balance + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::Accounts::PreferenceUpdateParams::AdsPaymentMethods::Backup::type_] + end + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/accounts/preference_update_response.rbs b/sig/whop_sdk/models/accounts/preference_update_response.rbs new file mode 100644 index 00000000..496d62f2 --- /dev/null +++ b/sig/whop_sdk/models/accounts/preference_update_response.rbs @@ -0,0 +1,110 @@ +module WhopSDK + module Models + module Accounts + type preference_update_response = + { + ads_payment_methods: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods? + } + + class PreferenceUpdateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor ads_payment_methods: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods? + + def initialize: ( + ads_payment_methods: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods? + ) -> void + + def to_hash: -> { + ads_payment_methods: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods? + } + + type ads_payment_methods = + { + backup: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup?, + primary: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary? + } + + class AdsPaymentMethods < WhopSDK::Internal::Type::BaseModel + attr_accessor backup: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup? + + attr_accessor primary: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary? + + def initialize: ( + backup: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup?, + primary: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary? + ) -> void + + def to_hash: -> { + backup: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup?, + primary: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary? + } + + type backup = + { + id: String, + type: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::type_ + } + + class Backup < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::type_ + + def initialize: ( + id: String, + type: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::type_ + ) -> void + + def to_hash: -> { + id: String, + type: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::type_ + } + + type type_ = :platform_balance | :card + + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE: :platform_balance + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Backup::type_] + end + end + + type primary = + { + id: String, + type: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::type_ + } + + class Primary < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::type_ + + def initialize: ( + id: String, + type: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::type_ + ) -> void + + def to_hash: -> { + id: String, + type: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::type_ + } + + type type_ = :platform_balance | :card + + module Type + extend WhopSDK::Internal::Type::Enum + + PLATFORM_BALANCE: :platform_balance + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods::Primary::type_] + end + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/ad.rbs b/sig/whop_sdk/models/ad.rbs index f11e9d44..b123db0e 100644 --- a/sig/whop_sdk/models/ad.rbs +++ b/sig/whop_sdk/models/ad.rbs @@ -5,30 +5,60 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Models::Ad::call_to_action?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + creatives: ::Array[WhopSDK::Ad::Creative], + custom_conversions: Float, + delivery_status: WhopSDK::Models::Ad::delivery_status, + descriptions: ::Array[String], frequency: Float?, - impressions: Integer, + headlines: ::Array[String], + impressions: Float, issues: ::Array[WhopSDK::Ad::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + lead_form: top?, + lead_form_id: String?, + leads: Float, + messaging_config: top?, + multi_advertiser_ads: bool, + post_id: String?, + post_source: WhopSDK::Models::Ad::post_source?, + post_thumbnail_url: String?, + primary_texts: ::Array[String], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Models::Ad::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, + social_accounts: ::Array[top], spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::external_ad_status, + spend_currency: String?, + status: WhopSDK::Models::Ad::status, + submitted_applications: Float, title: String?, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: String?, + url_parameters: top, + viewed_contents: Float } class Ad < WhopSDK::Internal::Type::BaseModel @@ -38,12 +68,26 @@ module WhopSDK attr_accessor ad_group: WhopSDK::Ad::AdGroup + attr_accessor added_to_carts: Float + + attr_accessor call_to_action: WhopSDK::Models::Ad::call_to_action? + attr_accessor click_through_rate: Float - attr_accessor clicks: Integer + attr_accessor clicks: Float + + attr_accessor completed_registrations: Float + + attr_accessor contacts: Float + + attr_accessor cost_per_added_to_cart: Float? attr_accessor cost_per_click: Float + attr_accessor cost_per_completed_registration: Float? + + attr_accessor cost_per_contact: Float? + attr_accessor cost_per_lead: Float? attr_accessor cost_per_mille: Float @@ -52,98 +96,204 @@ module WhopSDK attr_accessor cost_per_result: Float? - attr_accessor created_at: Time + attr_accessor cost_per_schedule: Float? + + attr_accessor cost_per_submitted_application: Float? + + attr_accessor cost_per_viewed_content: Float? + + attr_accessor created_at: String + + attr_accessor creatives: ::Array[WhopSDK::Ad::Creative] + + attr_accessor custom_conversions: Float + + attr_accessor delivery_status: WhopSDK::Models::Ad::delivery_status + + attr_accessor descriptions: ::Array[String] attr_accessor frequency: Float? - attr_accessor impressions: Integer + attr_accessor headlines: ::Array[String] + + attr_accessor impressions: Float attr_accessor issues: ::Array[WhopSDK::Ad::Issue] - attr_accessor leads: Integer + attr_accessor lead_form: top? + + attr_accessor lead_form_id: String? + + attr_accessor leads: Float + + attr_accessor messaging_config: top? + + attr_accessor multi_advertiser_ads: bool + + attr_accessor post_id: String? - attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor post_source: WhopSDK::Models::Ad::post_source? + + attr_accessor post_thumbnail_url: String? + + attr_accessor primary_texts: ::Array[String] attr_accessor purchase_value: Float - attr_accessor purchases: Integer + attr_accessor purchases: Float + + attr_accessor reach: Float - attr_accessor reach: Integer + attr_accessor result_event: WhopSDK::Models::Ad::result_event? + + attr_accessor result_event_name: String? attr_accessor return_on_ad_spend: Float + attr_accessor schedules: Float + + attr_accessor social_accounts: ::Array[top] + attr_accessor spend: Float - attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor spend_currency: String? + + attr_accessor status: WhopSDK::Models::Ad::status - attr_accessor status: WhopSDK::Models::external_ad_status + attr_accessor submitted_applications: Float attr_accessor title: String? attr_accessor unique_click_through_rate: Float? - attr_accessor unique_clicks: Integer + attr_accessor unique_clicks: Float + + attr_accessor updated_at: String + + attr_accessor url: String? + + attr_accessor url_parameters: top - attr_accessor updated_at: Time + attr_accessor viewed_contents: Float def initialize: ( id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Models::Ad::call_to_action?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + creatives: ::Array[WhopSDK::Ad::Creative], + custom_conversions: Float, + delivery_status: WhopSDK::Models::Ad::delivery_status, + descriptions: ::Array[String], frequency: Float?, - impressions: Integer, + headlines: ::Array[String], + impressions: Float, issues: ::Array[WhopSDK::Ad::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + lead_form: top?, + lead_form_id: String?, + leads: Float, + messaging_config: top?, + multi_advertiser_ads: bool, + post_id: String?, + post_source: WhopSDK::Models::Ad::post_source?, + post_thumbnail_url: String?, + primary_texts: ::Array[String], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Models::Ad::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, + social_accounts: ::Array[top], spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::external_ad_status, + spend_currency: String?, + status: WhopSDK::Models::Ad::status, + submitted_applications: Float, title: String?, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: String?, + url_parameters: top, + viewed_contents: Float ) -> void def to_hash: -> { id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Models::Ad::call_to_action?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + creatives: ::Array[WhopSDK::Ad::Creative], + custom_conversions: Float, + delivery_status: WhopSDK::Models::Ad::delivery_status, + descriptions: ::Array[String], frequency: Float?, - impressions: Integer, + headlines: ::Array[String], + impressions: Float, issues: ::Array[WhopSDK::Ad::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + lead_form: top?, + lead_form_id: String?, + leads: Float, + messaging_config: top?, + multi_advertiser_ads: bool, + post_id: String?, + post_source: WhopSDK::Models::Ad::post_source?, + post_thumbnail_url: String?, + primary_texts: ::Array[String], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Models::Ad::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, + social_accounts: ::Array[top], spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::external_ad_status, + spend_currency: String?, + status: WhopSDK::Models::Ad::status, + submitted_applications: Float, title: String?, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: String?, + url_parameters: top, + viewed_contents: Float } type ad_campaign = { id: String } @@ -166,75 +316,271 @@ module WhopSDK def to_hash: -> { id: String } end + type call_to_action = + :learn_more + | :shop_now + | :sign_up + | :subscribe + | :get_started + | :book_now + | :apply_now + | :contact_us + | :download + | :order_now + | :buy_now + | :get_quote + | :message_page + | :whatsapp_message + | :instagram_message + | :call_now + | :get_directions + | :send_updates + | :get_offer + | :watch_more + | :listen_now + | :play_game + | :open_link + | :no_button + | :get_offer_view + | :get_event_tickets + | :see_menu + | :request_time + | :event_rsvp + | :see_details + | :view_instagram_profile + + module CallToAction + extend WhopSDK::Internal::Type::Enum + + LEARN_MORE: :learn_more + SHOP_NOW: :shop_now + SIGN_UP: :sign_up + SUBSCRIBE: :subscribe + GET_STARTED: :get_started + BOOK_NOW: :book_now + APPLY_NOW: :apply_now + CONTACT_US: :contact_us + DOWNLOAD: :download + ORDER_NOW: :order_now + BUY_NOW: :buy_now + GET_QUOTE: :get_quote + MESSAGE_PAGE: :message_page + WHATSAPP_MESSAGE: :whatsapp_message + INSTAGRAM_MESSAGE: :instagram_message + CALL_NOW: :call_now + GET_DIRECTIONS: :get_directions + SEND_UPDATES: :send_updates + GET_OFFER: :get_offer + WATCH_MORE: :watch_more + LISTEN_NOW: :listen_now + PLAY_GAME: :play_game + OPEN_LINK: :open_link + NO_BUTTON: :no_button + GET_OFFER_VIEW: :get_offer_view + GET_EVENT_TICKETS: :get_event_tickets + SEE_MENU: :see_menu + REQUEST_TIME: :request_time + EVENT_RSVP: :event_rsvp + SEE_DETAILS: :see_details + VIEW_INSTAGRAM_PROFILE: :view_instagram_profile + + def self?.values: -> ::Array[WhopSDK::Models::Ad::call_to_action] + end + + type creative = + { + id: String, + crop: WhopSDK::Ad::Creative::Crop?, + format_: WhopSDK::Models::Ad::Creative::format_?, + media_type: String?, + url: String? + } + + class Creative < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor crop: WhopSDK::Ad::Creative::Crop? + + attr_accessor format_: WhopSDK::Models::Ad::Creative::format_? + + attr_accessor media_type: String? + + attr_accessor url: String? + + def initialize: ( + id: String, + crop: WhopSDK::Ad::Creative::Crop?, + format_: WhopSDK::Models::Ad::Creative::format_?, + media_type: String?, + url: String? + ) -> void + + def to_hash: -> { + id: String, + crop: WhopSDK::Ad::Creative::Crop?, + format_: WhopSDK::Models::Ad::Creative::format_?, + media_type: String?, + url: String? + } + + type crop = { height: Float, width: Float, x: Float, y_: Float } + + class Crop < WhopSDK::Internal::Type::BaseModel + attr_accessor height: Float + + attr_accessor width: Float + + attr_accessor x: Float + + attr_accessor y_: Float + + def initialize: ( + height: Float, + width: Float, + x: Float, + y_: Float + ) -> void + + def to_hash: -> { height: Float, width: Float, x: Float, y_: Float } + end + + type format_ = :square | :vertical | :horizontal + + module Format + extend WhopSDK::Internal::Type::Enum + + SQUARE: :square + VERTICAL: :vertical + HORIZONTAL: :horizontal + + def self?.values: -> ::Array[WhopSDK::Models::Ad::Creative::format_] + end + end + + type delivery_status = + :rejected + | :in_review + | :draft + | :campaign_paused + | :ad_group_paused + | :paused + | :processing + | :issues + | :learning_limited + | :learning + | :active + + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + REJECTED: :rejected + IN_REVIEW: :in_review + DRAFT: :draft + CAMPAIGN_PAUSED: :campaign_paused + AD_GROUP_PAUSED: :ad_group_paused + PAUSED: :paused + PROCESSING: :processing + ISSUES: :issues + LEARNING_LIMITED: :learning_limited + LEARNING: :learning + ACTIVE: :active + + def self?.values: -> ::Array[WhopSDK::Models::Ad::delivery_status] + end + type issue = { - category: WhopSDK::Models::Ad::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::Ad::Issue::resource_type } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::Ad::Issue::category? - - attr_accessor created_at: Time + attr_accessor id: String - attr_accessor resolution_status: WhopSDK::Models::Ad::Issue::resolution_status + attr_accessor message: String attr_accessor resource_id: String? - attr_accessor resource_type: String - - attr_accessor subtype: String? + attr_accessor resource_type: WhopSDK::Models::Ad::Issue::resource_type def initialize: ( - category: WhopSDK::Models::Ad::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::Ad::Issue::resource_type ) -> void def to_hash: -> { - category: WhopSDK::Models::Ad::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::Ad::Issue::resource_type } - type category = - :policy_rejection - | :creative_media - | :audience_targeting - | :ad_volume_limit + type resource_type = :ad_campaign | :ad_group | :ad - module Category + module ResourceType extend WhopSDK::Internal::Type::Enum - POLICY_REJECTION: :policy_rejection - CREATIVE_MEDIA: :creative_media - AUDIENCE_TARGETING: :audience_targeting - AD_VOLUME_LIMIT: :ad_volume_limit + AD_CAMPAIGN: :ad_campaign + AD_GROUP: :ad_group + AD: :ad - def self?.values: -> ::Array[WhopSDK::Models::Ad::Issue::category] + def self?.values: -> ::Array[WhopSDK::Models::Ad::Issue::resource_type] end + end - type resolution_status = :open | :resolved | :acknowledged + type post_source = :facebook | :instagram - module ResolutionStatus - extend WhopSDK::Internal::Type::Enum + module PostSource + extend WhopSDK::Internal::Type::Enum - OPEN: :open - RESOLVED: :resolved - ACKNOWLEDGED: :acknowledged + FACEBOOK: :facebook + INSTAGRAM: :instagram - def self?.values: -> ::Array[WhopSDK::Models::Ad::Issue::resolution_status] - end + def self?.values: -> ::Array[WhopSDK::Models::Ad::post_source] + end + + type result_event = + :purchase + | :lead + | :schedule + | :submit_application + | :contact + | :complete_registration + | :view_content + | :add_to_cart + | :custom + + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + PURCHASE: :purchase + LEAD: :lead + SCHEDULE: :schedule + SUBMIT_APPLICATION: :submit_application + CONTACT: :contact + COMPLETE_REGISTRATION: :complete_registration + VIEW_CONTENT: :view_content + ADD_TO_CART: :add_to_cart + CUSTOM: :custom + + def self?.values: -> ::Array[WhopSDK::Models::Ad::result_event] + end + + type status = :active | :paused | :in_review | :rejected + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + PAUSED: :paused + IN_REVIEW: :in_review + REJECTED: :rejected + + def self?.values: -> ::Array[WhopSDK::Models::Ad::status] end end end diff --git a/sig/whop_sdk/models/ad_budget_type.rbs b/sig/whop_sdk/models/ad_budget_type.rbs deleted file mode 100644 index ea7e9e7b..00000000 --- a/sig/whop_sdk/models/ad_budget_type.rbs +++ /dev/null @@ -1,14 +0,0 @@ -module WhopSDK - module Models - type ad_budget_type = :daily | :lifetime - - module AdBudgetType - extend WhopSDK::Internal::Type::Enum - - DAILY: :daily - LIFETIME: :lifetime - - def self?.values: -> ::Array[WhopSDK::Models::ad_budget_type] - end - end -end diff --git a/sig/whop_sdk/models/ad_campaign.rbs b/sig/whop_sdk/models/ad_campaign.rbs index aaacd317..eda378d7 100644 --- a/sig/whop_sdk/models/ad_campaign.rbs +++ b/sig/whop_sdk/models/ad_campaign.rbs @@ -3,47 +3,84 @@ module WhopSDK type ad_campaign = { id: String, - budget: Float?, - budget_type: WhopSDK::Models::ad_budget_type?, + added_to_carts: Float, + bid_type: WhopSDK::Models::AdCampaign::bid_type?, + budget_amount: Float?, + budget_optimization: WhopSDK::Models::AdCampaign::budget_optimization?, + budget_type: WhopSDK::Models::AdCampaign::budget_type?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::Models::AdCampaign::delivery_status, frequency: Float?, - impressions: Integer, + impressions: Float, issues: ::Array[WhopSDK::AdCampaign::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + leads: Float, + objective: WhopSDK::Models::AdCampaign::objective?, + optimization_goal: String?, + platform: WhopSDK::Models::AdCampaign::platform, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Models::AdCampaign::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ::Array[WhopSDK::Models::AdCampaign::special_ad_category], spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::ad_campaign_status, + spend_currency: String?, + status: WhopSDK::Models::AdCampaign::status, + submitted_applications: Float, title: String, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } class AdCampaign < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor budget: Float? + attr_accessor added_to_carts: Float - attr_accessor budget_type: WhopSDK::Models::ad_budget_type? + attr_accessor bid_type: WhopSDK::Models::AdCampaign::bid_type? + + attr_accessor budget_amount: Float? + + attr_accessor budget_optimization: WhopSDK::Models::AdCampaign::budget_optimization? + + attr_accessor budget_type: WhopSDK::Models::AdCampaign::budget_type? attr_accessor click_through_rate: Float - attr_accessor clicks: Integer + attr_accessor clicks: Float + + attr_accessor completed_registrations: Float + + attr_accessor contacts: Float + + attr_accessor cost_per_added_to_cart: Float? attr_accessor cost_per_click: Float + attr_accessor cost_per_completed_registration: Float? + + attr_accessor cost_per_contact: Float? + attr_accessor cost_per_lead: Float? attr_accessor cost_per_mille: Float @@ -52,169 +89,373 @@ module WhopSDK attr_accessor cost_per_result: Float? - attr_accessor created_at: Time + attr_accessor cost_per_schedule: Float? + + attr_accessor cost_per_submitted_application: Float? + + attr_accessor cost_per_viewed_content: Float? + + attr_accessor created_at: String + + attr_accessor custom_conversions: Float + + attr_accessor delivery_status: WhopSDK::Models::AdCampaign::delivery_status attr_accessor frequency: Float? - attr_accessor impressions: Integer + attr_accessor impressions: Float attr_accessor issues: ::Array[WhopSDK::AdCampaign::Issue] - attr_accessor leads: Integer + attr_accessor leads: Float + + attr_accessor objective: WhopSDK::Models::AdCampaign::objective? + + attr_accessor optimization_goal: String? - attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor platform: WhopSDK::Models::AdCampaign::platform attr_accessor purchase_value: Float - attr_accessor purchases: Integer + attr_accessor purchases: Float - attr_accessor reach: Integer + attr_accessor reach: Float + + attr_accessor result_event: WhopSDK::Models::AdCampaign::result_event? + + attr_accessor result_event_name: String? attr_accessor return_on_ad_spend: Float + attr_accessor schedules: Float + + attr_accessor special_ad_categories: ::Array[WhopSDK::Models::AdCampaign::special_ad_category] + attr_accessor spend: Float - attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor spend_currency: String? - attr_accessor status: WhopSDK::Models::ad_campaign_status + attr_accessor status: WhopSDK::Models::AdCampaign::status + + attr_accessor submitted_applications: Float attr_accessor title: String attr_accessor unique_click_through_rate: Float? - attr_accessor unique_clicks: Integer + attr_accessor unique_clicks: Float + + attr_accessor updated_at: String - attr_accessor updated_at: Time + attr_accessor viewed_contents: Float def initialize: ( id: String, - budget: Float?, - budget_type: WhopSDK::Models::ad_budget_type?, + added_to_carts: Float, + bid_type: WhopSDK::Models::AdCampaign::bid_type?, + budget_amount: Float?, + budget_optimization: WhopSDK::Models::AdCampaign::budget_optimization?, + budget_type: WhopSDK::Models::AdCampaign::budget_type?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::Models::AdCampaign::delivery_status, frequency: Float?, - impressions: Integer, + impressions: Float, issues: ::Array[WhopSDK::AdCampaign::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + leads: Float, + objective: WhopSDK::Models::AdCampaign::objective?, + optimization_goal: String?, + platform: WhopSDK::Models::AdCampaign::platform, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Models::AdCampaign::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ::Array[WhopSDK::Models::AdCampaign::special_ad_category], spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::ad_campaign_status, + spend_currency: String?, + status: WhopSDK::Models::AdCampaign::status, + submitted_applications: Float, title: String, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float ) -> void def to_hash: -> { id: String, - budget: Float?, - budget_type: WhopSDK::Models::ad_budget_type?, + added_to_carts: Float, + bid_type: WhopSDK::Models::AdCampaign::bid_type?, + budget_amount: Float?, + budget_optimization: WhopSDK::Models::AdCampaign::budget_optimization?, + budget_type: WhopSDK::Models::AdCampaign::budget_type?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::Models::AdCampaign::delivery_status, frequency: Float?, - impressions: Integer, + impressions: Float, issues: ::Array[WhopSDK::AdCampaign::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + leads: Float, + objective: WhopSDK::Models::AdCampaign::objective?, + optimization_goal: String?, + platform: WhopSDK::Models::AdCampaign::platform, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Models::AdCampaign::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ::Array[WhopSDK::Models::AdCampaign::special_ad_category], spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::ad_campaign_status, + spend_currency: String?, + status: WhopSDK::Models::AdCampaign::status, + submitted_applications: Float, title: String, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } + type bid_type = :minimum_cost | :average_target | :maximum_target + + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST: :minimum_cost + AVERAGE_TARGET: :average_target + MAXIMUM_TARGET: :maximum_target + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::bid_type] + end + + type budget_optimization = :ad_campaign | :ad_group + + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + AD_CAMPAIGN: :ad_campaign + AD_GROUP: :ad_group + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::budget_optimization] + end + + type budget_type = :daily | :lifetime + + module BudgetType + extend WhopSDK::Internal::Type::Enum + + DAILY: :daily + LIFETIME: :lifetime + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::budget_type] + end + + type delivery_status = + :payment_failed + | :all_ads_rejected + | :draft + | :no_ad_groups + | :no_ads + | :paused + | :processing + | :issues + | :scheduled + | :completed + | :ad_groups_off + | :active + + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + PAYMENT_FAILED: :payment_failed + ALL_ADS_REJECTED: :all_ads_rejected + DRAFT: :draft + NO_AD_GROUPS: :no_ad_groups + NO_ADS: :no_ads + PAUSED: :paused + PROCESSING: :processing + ISSUES: :issues + SCHEDULED: :scheduled + COMPLETED: :completed + AD_GROUPS_OFF: :ad_groups_off + ACTIVE: :active + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::delivery_status] + end + type issue = { - category: WhopSDK::Models::AdCampaign::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::AdCampaign::Issue::resource_type } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::AdCampaign::Issue::category? + attr_accessor id: String - attr_accessor created_at: Time - - attr_accessor resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status + attr_accessor message: String attr_accessor resource_id: String? - attr_accessor resource_type: String - - attr_accessor subtype: String? + attr_accessor resource_type: WhopSDK::Models::AdCampaign::Issue::resource_type def initialize: ( - category: WhopSDK::Models::AdCampaign::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::AdCampaign::Issue::resource_type ) -> void def to_hash: -> { - category: WhopSDK::Models::AdCampaign::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::AdCampaign::Issue::resource_type } - type category = - :policy_rejection - | :creative_media - | :audience_targeting - | :ad_volume_limit + type resource_type = :ad_campaign | :ad_group | :ad - module Category + module ResourceType extend WhopSDK::Internal::Type::Enum - POLICY_REJECTION: :policy_rejection - CREATIVE_MEDIA: :creative_media - AUDIENCE_TARGETING: :audience_targeting - AD_VOLUME_LIMIT: :ad_volume_limit + AD_CAMPAIGN: :ad_campaign + AD_GROUP: :ad_group + AD: :ad - def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::Issue::category] + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::Issue::resource_type] end + end - type resolution_status = :open | :resolved | :acknowledged + type objective = :awareness | :traffic | :engagement | :leads | :sales - module ResolutionStatus - extend WhopSDK::Internal::Type::Enum + module Objective + extend WhopSDK::Internal::Type::Enum - OPEN: :open - RESOLVED: :resolved - ACKNOWLEDGED: :acknowledged + AWARENESS: :awareness + TRAFFIC: :traffic + ENGAGEMENT: :engagement + LEADS: :leads + SALES: :sales - def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::Issue::resolution_status] - end + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::objective] + end + + type platform = :meta + + module Platform + extend WhopSDK::Internal::Type::Enum + + META: :meta + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::platform] + end + + type result_event = + :purchase + | :lead + | :schedule + | :submit_application + | :contact + | :complete_registration + | :view_content + | :add_to_cart + | :custom + + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + PURCHASE: :purchase + LEAD: :lead + SCHEDULE: :schedule + SUBMIT_APPLICATION: :submit_application + CONTACT: :contact + COMPLETE_REGISTRATION: :complete_registration + VIEW_CONTENT: :view_content + ADD_TO_CART: :add_to_cart + CUSTOM: :custom + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::result_event] + end + + type special_ad_category = + :housing | :employment | :financial_products | :politics + + module SpecialAdCategory + extend WhopSDK::Internal::Type::Enum + + HOUSING: :housing + EMPLOYMENT: :employment + FINANCIAL_PRODUCTS: :financial_products + POLITICS: :politics + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::special_ad_category] + end + + type status = + :active + | :paused + | :inactive + | :stale + | :pending_refund + | :payment_failed + | :draft + | :in_review + | :flagged + | :importing + | :imported + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + PAUSED: :paused + INACTIVE: :inactive + STALE: :stale + PENDING_REFUND: :pending_refund + PAYMENT_FAILED: :payment_failed + DRAFT: :draft + IN_REVIEW: :in_review + FLAGGED: :flagged + IMPORTING: :importing + IMPORTED: :imported + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::status] end end end diff --git a/sig/whop_sdk/models/ad_campaign_create_params.rbs b/sig/whop_sdk/models/ad_campaign_create_params.rbs new file mode 100644 index 00000000..9f30f3c3 --- /dev/null +++ b/sig/whop_sdk/models/ad_campaign_create_params.rbs @@ -0,0 +1,179 @@ +module WhopSDK + module Models + type ad_campaign_create_params = + { + objective: WhopSDK::Models::AdCampaignCreateParams::objective, + platform: WhopSDK::Models::AdCampaignCreateParams::platform, + title: String, + account_id: String, + bid_type: WhopSDK::Models::AdCampaignCreateParams::bid_type, + budget_amount: Float, + budget_optimization: WhopSDK::Models::AdCampaignCreateParams::budget_optimization, + budget_type: WhopSDK::Models::AdCampaignCreateParams::budget_type, + desired_cost_per_result: Float, + ends_at: String, + special_ad_categories: ::Array[WhopSDK::Models::AdCampaignCreateParams::special_ad_category], + starts_at: String + } + & WhopSDK::Internal::Type::request_parameters + + class AdCampaignCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor objective: WhopSDK::Models::AdCampaignCreateParams::objective + + attr_accessor platform: WhopSDK::Models::AdCampaignCreateParams::platform + + attr_accessor title: String + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader bid_type: WhopSDK::Models::AdCampaignCreateParams::bid_type? + + def bid_type=: ( + WhopSDK::Models::AdCampaignCreateParams::bid_type + ) -> WhopSDK::Models::AdCampaignCreateParams::bid_type + + attr_reader budget_amount: Float? + + def budget_amount=: (Float) -> Float + + attr_reader budget_optimization: WhopSDK::Models::AdCampaignCreateParams::budget_optimization? + + def budget_optimization=: ( + WhopSDK::Models::AdCampaignCreateParams::budget_optimization + ) -> WhopSDK::Models::AdCampaignCreateParams::budget_optimization + + attr_reader budget_type: WhopSDK::Models::AdCampaignCreateParams::budget_type? + + def budget_type=: ( + WhopSDK::Models::AdCampaignCreateParams::budget_type + ) -> WhopSDK::Models::AdCampaignCreateParams::budget_type + + attr_reader desired_cost_per_result: Float? + + def desired_cost_per_result=: (Float) -> Float + + attr_reader ends_at: String? + + def ends_at=: (String) -> String + + attr_reader special_ad_categories: ::Array[WhopSDK::Models::AdCampaignCreateParams::special_ad_category]? + + def special_ad_categories=: ( + ::Array[WhopSDK::Models::AdCampaignCreateParams::special_ad_category] + ) -> ::Array[WhopSDK::Models::AdCampaignCreateParams::special_ad_category] + + attr_reader starts_at: String? + + def starts_at=: (String) -> String + + def initialize: ( + objective: WhopSDK::Models::AdCampaignCreateParams::objective, + platform: WhopSDK::Models::AdCampaignCreateParams::platform, + title: String, + ?account_id: String, + ?bid_type: WhopSDK::Models::AdCampaignCreateParams::bid_type, + ?budget_amount: Float, + ?budget_optimization: WhopSDK::Models::AdCampaignCreateParams::budget_optimization, + ?budget_type: WhopSDK::Models::AdCampaignCreateParams::budget_type, + ?desired_cost_per_result: Float, + ?ends_at: String, + ?special_ad_categories: ::Array[WhopSDK::Models::AdCampaignCreateParams::special_ad_category], + ?starts_at: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + objective: WhopSDK::Models::AdCampaignCreateParams::objective, + platform: WhopSDK::Models::AdCampaignCreateParams::platform, + title: String, + account_id: String, + bid_type: WhopSDK::Models::AdCampaignCreateParams::bid_type, + budget_amount: Float, + budget_optimization: WhopSDK::Models::AdCampaignCreateParams::budget_optimization, + budget_type: WhopSDK::Models::AdCampaignCreateParams::budget_type, + desired_cost_per_result: Float, + ends_at: String, + special_ad_categories: ::Array[WhopSDK::Models::AdCampaignCreateParams::special_ad_category], + starts_at: String, + request_options: WhopSDK::RequestOptions + } + + 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::AdCampaignCreateParams::objective] + end + + type platform = :meta + + module Platform + extend WhopSDK::Internal::Type::Enum + + META: :meta + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignCreateParams::platform] + end + + type bid_type = :minimum_cost | :average_target | :maximum_target + + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST: :minimum_cost + AVERAGE_TARGET: :average_target + MAXIMUM_TARGET: :maximum_target + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignCreateParams::bid_type] + end + + type budget_optimization = :ad_campaign | :ad_group + + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + AD_CAMPAIGN: :ad_campaign + AD_GROUP: :ad_group + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignCreateParams::budget_optimization] + end + + type budget_type = :daily | :lifetime + + module BudgetType + extend WhopSDK::Internal::Type::Enum + + DAILY: :daily + LIFETIME: :lifetime + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignCreateParams::budget_type] + end + + type special_ad_category = + :housing | :employment | :financial_products | :politics + + module SpecialAdCategory + extend WhopSDK::Internal::Type::Enum + + HOUSING: :housing + EMPLOYMENT: :employment + FINANCIAL_PRODUCTS: :financial_products + POLITICS: :politics + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignCreateParams::special_ad_category] + end + end + end +end diff --git a/sig/whop_sdk/models/payout_method_retrieve_params.rbs b/sig/whop_sdk/models/ad_campaign_delete_params.rbs similarity index 80% rename from sig/whop_sdk/models/payout_method_retrieve_params.rbs rename to sig/whop_sdk/models/ad_campaign_delete_params.rbs index 616398fd..38262cd9 100644 --- a/sig/whop_sdk/models/payout_method_retrieve_params.rbs +++ b/sig/whop_sdk/models/ad_campaign_delete_params.rbs @@ -1,9 +1,9 @@ module WhopSDK module Models - type payout_method_retrieve_params = + type ad_campaign_delete_params = { id: String } & WhopSDK::Internal::Type::request_parameters - class PayoutMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel + class AdCampaignDeleteParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters diff --git a/sig/whop_sdk/models/ad_campaign_delete_response.rbs b/sig/whop_sdk/models/ad_campaign_delete_response.rbs new file mode 100644 index 00000000..5c7c8c18 --- /dev/null +++ b/sig/whop_sdk/models/ad_campaign_delete_response.rbs @@ -0,0 +1,5 @@ +module WhopSDK + module Models + AdCampaignDeleteResponse: WhopSDK::Internal::Type::Converter + 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 a387ceb7..f394394e 100644 --- a/sig/whop_sdk/models/ad_campaign_list_params.rbs +++ b/sig/whop_sdk/models/ad_campaign_list_params.rbs @@ -2,17 +2,20 @@ module WhopSDK module Models type ad_campaign_list_params = { - after: String?, - before: String?, - company_id: String?, - created_after: Time?, - created_before: Time?, - first: Integer?, - last: Integer?, - query: String?, - stats_from: Time?, - stats_to: Time?, - status: WhopSDK::Models::ad_campaign_status? + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::AdCampaignListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::AdCampaignListParams::order, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::Models::AdCampaignListParams::status, + time_zone: String } & WhopSDK::Internal::Type::request_parameters @@ -20,57 +23,164 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor after: String? + attr_reader account_id: String? - attr_accessor before: String? + def account_id=: (String) -> String - attr_accessor company_id: String? + attr_reader after: String? - attr_accessor created_after: Time? + def after=: (String) -> String - attr_accessor created_before: Time? + attr_reader before: String? - attr_accessor first: Integer? + def before=: (String) -> String - attr_accessor last: Integer? + attr_reader created_after: String? - attr_accessor query: String? + def created_after=: (String) -> String - attr_accessor stats_from: Time? + attr_reader created_before: String? - attr_accessor stats_to: Time? + def created_before=: (String) -> String - attr_accessor status: WhopSDK::Models::ad_campaign_status? + attr_reader direction: WhopSDK::Models::AdCampaignListParams::direction? + + def direction=: ( + WhopSDK::Models::AdCampaignListParams::direction + ) -> WhopSDK::Models::AdCampaignListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::AdCampaignListParams::order? + + def order=: ( + WhopSDK::Models::AdCampaignListParams::order + ) -> WhopSDK::Models::AdCampaignListParams::order + + attr_reader query: String? + + def query=: (String) -> String + + attr_reader stats_from: String? + + def stats_from=: (String) -> String + + attr_reader stats_to: String? + + def stats_to=: (String) -> String + + attr_reader status: WhopSDK::Models::AdCampaignListParams::status? + + def status=: ( + WhopSDK::Models::AdCampaignListParams::status + ) -> WhopSDK::Models::AdCampaignListParams::status + + attr_reader time_zone: String? + + def time_zone=: (String) -> String def initialize: ( - ?after: String?, - ?before: String?, - ?company_id: String?, - ?created_after: Time?, - ?created_before: Time?, - ?first: Integer?, - ?last: Integer?, - ?query: String?, - ?stats_from: Time?, - ?stats_to: Time?, - ?status: WhopSDK::Models::ad_campaign_status?, + ?account_id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::AdCampaignListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::AdCampaignListParams::order, + ?query: String, + ?stats_from: String, + ?stats_to: String, + ?status: WhopSDK::Models::AdCampaignListParams::status, + ?time_zone: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - after: String?, - before: String?, - company_id: String?, - created_after: Time?, - created_before: Time?, - first: Integer?, - last: Integer?, - query: String?, - stats_from: Time?, - stats_to: Time?, - status: WhopSDK::Models::ad_campaign_status?, + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::AdCampaignListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::AdCampaignListParams::order, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::Models::AdCampaignListParams::status, + time_zone: 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::AdCampaignListParams::direction] + end + + type order = + :created_at + | :updated_at + | :spend + | :impressions + | :reach + | :clicks + | :unique_clicks + | :frequency + | :click_through_rate + | :results + | :cost_per_mille + | :cost_per_click + | :cost_per_result + | :return_on_ad_spend + + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT: :created_at + UPDATED_AT: :updated_at + SPEND: :spend + IMPRESSIONS: :impressions + REACH: :reach + CLICKS: :clicks + UNIQUE_CLICKS: :unique_clicks + FREQUENCY: :frequency + CLICK_THROUGH_RATE: :click_through_rate + RESULTS: :results + COST_PER_MILLE: :cost_per_mille + COST_PER_CLICK: :cost_per_click + COST_PER_RESULT: :cost_per_result + RETURN_ON_AD_SPEND: :return_on_ad_spend + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignListParams::order] + end + + type status = :draft | :active | :paused | :payment_failed + + module Status + extend WhopSDK::Internal::Type::Enum + + DRAFT: :draft + ACTIVE: :active + PAUSED: :paused + PAYMENT_FAILED: :payment_failed + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignListParams::status] + end end end end diff --git a/sig/whop_sdk/models/ad_campaign_list_response.rbs b/sig/whop_sdk/models/ad_campaign_list_response.rbs deleted file mode 100644 index d8e0f073..00000000 --- a/sig/whop_sdk/models/ad_campaign_list_response.rbs +++ /dev/null @@ -1,221 +0,0 @@ -module WhopSDK - module Models - type ad_campaign_list_response = - { - 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, - unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time - } - - class AdCampaignListResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor budget: Float? - - 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 unique_click_through_rate: Float? - - attr_accessor unique_clicks: Integer - - attr_accessor updated_at: Time - - def initialize: ( - 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, - unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time - ) -> void - - def to_hash: -> { - 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, - unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time - } - - type issue = - { - category: WhopSDK::Models::AdCampaignListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, - resource_id: String?, - resource_type: String, - subtype: String? - } - - class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::AdCampaignListResponse::Issue::category? - - attr_accessor created_at: Time - - attr_accessor resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status - - attr_accessor resource_id: String? - - attr_accessor resource_type: String - - attr_accessor subtype: String? - - def initialize: ( - category: WhopSDK::Models::AdCampaignListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, - resource_id: String?, - resource_type: String, - subtype: String? - ) -> void - - def to_hash: -> { - category: WhopSDK::Models::AdCampaignListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, - resource_id: 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 - 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_platform.rbs b/sig/whop_sdk/models/ad_campaign_platform.rbs deleted file mode 100644 index 281bcb6e..00000000 --- a/sig/whop_sdk/models/ad_campaign_platform.rbs +++ /dev/null @@ -1,14 +0,0 @@ -module WhopSDK - module Models - type ad_campaign_platform = :meta | :tiktok - - module AdCampaignPlatform - extend WhopSDK::Internal::Type::Enum - - META: :meta - TIKTOK: :tiktok - - def self?.values: -> ::Array[WhopSDK::Models::ad_campaign_platform] - 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 f0d7d198..85f5bb44 100644 --- a/sig/whop_sdk/models/ad_campaign_retrieve_params.rbs +++ b/sig/whop_sdk/models/ad_campaign_retrieve_params.rbs @@ -1,7 +1,7 @@ module WhopSDK module Models type ad_campaign_retrieve_params = - { id: String, stats_from: Time?, stats_to: Time? } + { id: String, stats_from: String, stats_to: String, time_zone: String } & WhopSDK::Internal::Type::request_parameters class AdCampaignRetrieveParams < WhopSDK::Internal::Type::BaseModel @@ -10,21 +10,31 @@ module WhopSDK attr_accessor id: String - attr_accessor stats_from: Time? + attr_reader stats_from: String? - attr_accessor stats_to: Time? + def stats_from=: (String) -> String + + attr_reader stats_to: String? + + def stats_to=: (String) -> String + + attr_reader time_zone: String? + + def time_zone=: (String) -> String def initialize: ( id: String, - ?stats_from: Time?, - ?stats_to: Time?, + ?stats_from: String, + ?stats_to: String, + ?time_zone: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { id: String, - stats_from: Time?, - stats_to: Time?, + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/ad_campaign_status.rbs b/sig/whop_sdk/models/ad_campaign_status.rbs deleted file mode 100644 index 65f5a9c5..00000000 --- a/sig/whop_sdk/models/ad_campaign_status.rbs +++ /dev/null @@ -1,19 +0,0 @@ -module WhopSDK - module Models - type ad_campaign_status = - :active | :paused | :payment_failed | :draft | :in_review | :flagged - - module AdCampaignStatus - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - PAUSED: :paused - PAYMENT_FAILED: :payment_failed - DRAFT: :draft - IN_REVIEW: :in_review - FLAGGED: :flagged - - def self?.values: -> ::Array[WhopSDK::Models::ad_campaign_status] - end - end -end diff --git a/sig/whop_sdk/models/ad_campaign_update_params.rbs b/sig/whop_sdk/models/ad_campaign_update_params.rbs index 4e0d44f4..b0fe755c 100644 --- a/sig/whop_sdk/models/ad_campaign_update_params.rbs +++ b/sig/whop_sdk/models/ad_campaign_update_params.rbs @@ -1,7 +1,16 @@ module WhopSDK module Models type ad_campaign_update_params = - { id: String, budget: Float? } + { + id: String, + bid_type: WhopSDK::Models::AdCampaignUpdateParams::bid_type, + budget_amount: Float, + budget_optimization: WhopSDK::Models::AdCampaignUpdateParams::budget_optimization, + ends_at: String, + starts_at: String, + status: WhopSDK::Models::AdCampaignUpdateParams::status, + title: String + } & WhopSDK::Internal::Type::request_parameters class AdCampaignUpdateParams < WhopSDK::Internal::Type::BaseModel @@ -10,19 +19,96 @@ module WhopSDK attr_accessor id: String - attr_accessor budget: Float? + attr_reader bid_type: WhopSDK::Models::AdCampaignUpdateParams::bid_type? + + def bid_type=: ( + WhopSDK::Models::AdCampaignUpdateParams::bid_type + ) -> WhopSDK::Models::AdCampaignUpdateParams::bid_type + + attr_reader budget_amount: Float? + + def budget_amount=: (Float) -> Float + + attr_reader budget_optimization: WhopSDK::Models::AdCampaignUpdateParams::budget_optimization? + + def budget_optimization=: ( + WhopSDK::Models::AdCampaignUpdateParams::budget_optimization + ) -> WhopSDK::Models::AdCampaignUpdateParams::budget_optimization + + attr_reader ends_at: String? + + def ends_at=: (String) -> String + + attr_reader starts_at: String? + + def starts_at=: (String) -> String + + attr_reader status: WhopSDK::Models::AdCampaignUpdateParams::status? + + def status=: ( + WhopSDK::Models::AdCampaignUpdateParams::status + ) -> WhopSDK::Models::AdCampaignUpdateParams::status + + attr_reader title: String? + + def title=: (String) -> String def initialize: ( id: String, - ?budget: Float?, + ?bid_type: WhopSDK::Models::AdCampaignUpdateParams::bid_type, + ?budget_amount: Float, + ?budget_optimization: WhopSDK::Models::AdCampaignUpdateParams::budget_optimization, + ?ends_at: String, + ?starts_at: String, + ?status: WhopSDK::Models::AdCampaignUpdateParams::status, + ?title: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { id: String, - budget: Float?, + bid_type: WhopSDK::Models::AdCampaignUpdateParams::bid_type, + budget_amount: Float, + budget_optimization: WhopSDK::Models::AdCampaignUpdateParams::budget_optimization, + ends_at: String, + starts_at: String, + status: WhopSDK::Models::AdCampaignUpdateParams::status, + title: String, request_options: WhopSDK::RequestOptions } + + type bid_type = :minimum_cost | :average_target | :maximum_target + + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST: :minimum_cost + AVERAGE_TARGET: :average_target + MAXIMUM_TARGET: :maximum_target + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignUpdateParams::bid_type] + end + + type budget_optimization = :ad_campaign | :ad_group + + module BudgetOptimization + extend WhopSDK::Internal::Type::Enum + + AD_CAMPAIGN: :ad_campaign + AD_GROUP: :ad_group + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignUpdateParams::budget_optimization] + end + + type status = :active + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignUpdateParams::status] + end end end end diff --git a/sig/whop_sdk/models/ad_create_params.rbs b/sig/whop_sdk/models/ad_create_params.rbs new file mode 100644 index 00000000..f6491d12 --- /dev/null +++ b/sig/whop_sdk/models/ad_create_params.rbs @@ -0,0 +1,751 @@ +module WhopSDK + module Models + type ad_create_params = + { + ad_group: top, + ad_group_id: String, + call_to_action: WhopSDK::Models::AdCreateParams::call_to_action, + creatives: ::Array[WhopSDK::AdCreateParams::Creative], + descriptions: ::Array[String], + headlines: ::Array[String], + lead_form: WhopSDK::AdCreateParams::LeadForm, + lead_form_id: String, + messaging_config: WhopSDK::AdCreateParams::MessagingConfig, + multi_advertiser_ads: bool, + post_id: String, + post_source: WhopSDK::Models::AdCreateParams::post_source, + primary_texts: ::Array[String], + social_accounts: ::Array[WhopSDK::AdCreateParams::SocialAccount], + title: String, + url: String, + url_parameters: top + } + & WhopSDK::Internal::Type::request_parameters + + class AdCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_reader ad_group: top? + + def ad_group=: (top) -> top + + attr_reader ad_group_id: String? + + def ad_group_id=: (String) -> String + + attr_reader call_to_action: WhopSDK::Models::AdCreateParams::call_to_action? + + def call_to_action=: ( + WhopSDK::Models::AdCreateParams::call_to_action + ) -> WhopSDK::Models::AdCreateParams::call_to_action + + attr_reader creatives: ::Array[WhopSDK::AdCreateParams::Creative]? + + def creatives=: ( + ::Array[WhopSDK::AdCreateParams::Creative] + ) -> ::Array[WhopSDK::AdCreateParams::Creative] + + attr_reader descriptions: ::Array[String]? + + def descriptions=: (::Array[String]) -> ::Array[String] + + attr_reader headlines: ::Array[String]? + + def headlines=: (::Array[String]) -> ::Array[String] + + attr_reader lead_form: WhopSDK::AdCreateParams::LeadForm? + + def lead_form=: ( + WhopSDK::AdCreateParams::LeadForm + ) -> WhopSDK::AdCreateParams::LeadForm + + attr_reader lead_form_id: String? + + def lead_form_id=: (String) -> String + + attr_reader messaging_config: WhopSDK::AdCreateParams::MessagingConfig? + + def messaging_config=: ( + WhopSDK::AdCreateParams::MessagingConfig + ) -> WhopSDK::AdCreateParams::MessagingConfig + + attr_reader multi_advertiser_ads: bool? + + def multi_advertiser_ads=: (bool) -> bool + + attr_reader post_id: String? + + def post_id=: (String) -> String + + attr_reader post_source: WhopSDK::Models::AdCreateParams::post_source? + + def post_source=: ( + WhopSDK::Models::AdCreateParams::post_source + ) -> WhopSDK::Models::AdCreateParams::post_source + + attr_reader primary_texts: ::Array[String]? + + def primary_texts=: (::Array[String]) -> ::Array[String] + + attr_reader social_accounts: ::Array[WhopSDK::AdCreateParams::SocialAccount]? + + def social_accounts=: ( + ::Array[WhopSDK::AdCreateParams::SocialAccount] + ) -> ::Array[WhopSDK::AdCreateParams::SocialAccount] + + attr_reader title: String? + + def title=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader url_parameters: top? + + def url_parameters=: (top) -> top + + def initialize: ( + ?ad_group: top, + ?ad_group_id: String, + ?call_to_action: WhopSDK::Models::AdCreateParams::call_to_action, + ?creatives: ::Array[WhopSDK::AdCreateParams::Creative], + ?descriptions: ::Array[String], + ?headlines: ::Array[String], + ?lead_form: WhopSDK::AdCreateParams::LeadForm, + ?lead_form_id: String, + ?messaging_config: WhopSDK::AdCreateParams::MessagingConfig, + ?multi_advertiser_ads: bool, + ?post_id: String, + ?post_source: WhopSDK::Models::AdCreateParams::post_source, + ?primary_texts: ::Array[String], + ?social_accounts: ::Array[WhopSDK::AdCreateParams::SocialAccount], + ?title: String, + ?url: String, + ?url_parameters: top, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + ad_group: top, + ad_group_id: String, + call_to_action: WhopSDK::Models::AdCreateParams::call_to_action, + creatives: ::Array[WhopSDK::AdCreateParams::Creative], + descriptions: ::Array[String], + headlines: ::Array[String], + lead_form: WhopSDK::AdCreateParams::LeadForm, + lead_form_id: String, + messaging_config: WhopSDK::AdCreateParams::MessagingConfig, + multi_advertiser_ads: bool, + post_id: String, + post_source: WhopSDK::Models::AdCreateParams::post_source, + primary_texts: ::Array[String], + social_accounts: ::Array[WhopSDK::AdCreateParams::SocialAccount], + title: String, + url: String, + url_parameters: top, + request_options: WhopSDK::RequestOptions + } + + type call_to_action = + :apply_now + | :book_now + | :call_now + | :contact_us + | :download + | :get_directions + | :get_offer + | :get_quote + | :learn_more + | :listen_now + | :message_page + | :no_button + | :open_link + | :order_now + | :request_time + | :see_details + | :see_menu + | :send_updates + | :shop_now + | :sign_up + | :subscribe + | :watch_more + + module CallToAction + extend WhopSDK::Internal::Type::Enum + + APPLY_NOW: :apply_now + BOOK_NOW: :book_now + CALL_NOW: :call_now + CONTACT_US: :contact_us + DOWNLOAD: :download + GET_DIRECTIONS: :get_directions + GET_OFFER: :get_offer + GET_QUOTE: :get_quote + LEARN_MORE: :learn_more + LISTEN_NOW: :listen_now + MESSAGE_PAGE: :message_page + NO_BUTTON: :no_button + OPEN_LINK: :open_link + ORDER_NOW: :order_now + REQUEST_TIME: :request_time + SEE_DETAILS: :see_details + SEE_MENU: :see_menu + SEND_UPDATES: :send_updates + SHOP_NOW: :shop_now + SIGN_UP: :sign_up + SUBSCRIBE: :subscribe + WATCH_MORE: :watch_more + + def self?.values: -> ::Array[WhopSDK::Models::AdCreateParams::call_to_action] + end + + type creative = + { + id: String, + crop: WhopSDK::AdCreateParams::Creative::Crop, + format_: WhopSDK::Models::AdCreateParams::Creative::format_ + } + + class Creative < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader crop: WhopSDK::AdCreateParams::Creative::Crop? + + def crop=: ( + WhopSDK::AdCreateParams::Creative::Crop + ) -> WhopSDK::AdCreateParams::Creative::Crop + + attr_reader format_: WhopSDK::Models::AdCreateParams::Creative::format_? + + def format_=: ( + WhopSDK::Models::AdCreateParams::Creative::format_ + ) -> WhopSDK::Models::AdCreateParams::Creative::format_ + + def initialize: ( + ?id: String, + ?crop: WhopSDK::AdCreateParams::Creative::Crop, + ?format_: WhopSDK::Models::AdCreateParams::Creative::format_ + ) -> void + + def to_hash: -> { + id: String, + crop: WhopSDK::AdCreateParams::Creative::Crop, + format_: WhopSDK::Models::AdCreateParams::Creative::format_ + } + + type crop = { height: Float, width: Float, x: Float, y_: Float } + + class Crop < WhopSDK::Internal::Type::BaseModel + attr_reader height: Float? + + def height=: (Float) -> Float + + attr_reader width: Float? + + def width=: (Float) -> Float + + attr_reader x: Float? + + def x=: (Float) -> Float + + attr_reader y_: Float? + + def y_=: (Float) -> Float + + def initialize: ( + ?height: Float, + ?width: Float, + ?x: Float, + ?y_: Float + ) -> void + + def to_hash: -> { height: Float, width: Float, x: Float, y_: Float } + end + + type format_ = :square | :vertical | :horizontal + + module Format + extend WhopSDK::Internal::Type::Enum + + SQUARE: :square + VERTICAL: :vertical + HORIZONTAL: :horizontal + + def self?.values: -> ::Array[WhopSDK::Models::AdCreateParams::Creative::format_] + end + end + + type lead_form = + { + completion: WhopSDK::AdCreateParams::LeadForm::Completion, + disclaimer: WhopSDK::AdCreateParams::LeadForm::Disclaimer, + form_type: WhopSDK::Models::AdCreateParams::LeadForm::form_type, + intro: WhopSDK::AdCreateParams::LeadForm::Intro, + name: String, + phone_verification: bool, + privacy_policy: WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy, + questions: ::Array[WhopSDK::AdCreateParams::LeadForm::Question] + } + + class LeadForm < WhopSDK::Internal::Type::BaseModel + attr_reader completion: WhopSDK::AdCreateParams::LeadForm::Completion? + + def completion=: ( + WhopSDK::AdCreateParams::LeadForm::Completion + ) -> WhopSDK::AdCreateParams::LeadForm::Completion + + attr_reader disclaimer: WhopSDK::AdCreateParams::LeadForm::Disclaimer? + + def disclaimer=: ( + WhopSDK::AdCreateParams::LeadForm::Disclaimer + ) -> WhopSDK::AdCreateParams::LeadForm::Disclaimer + + attr_reader form_type: WhopSDK::Models::AdCreateParams::LeadForm::form_type? + + def form_type=: ( + WhopSDK::Models::AdCreateParams::LeadForm::form_type + ) -> WhopSDK::Models::AdCreateParams::LeadForm::form_type + + attr_reader intro: WhopSDK::AdCreateParams::LeadForm::Intro? + + def intro=: ( + WhopSDK::AdCreateParams::LeadForm::Intro + ) -> WhopSDK::AdCreateParams::LeadForm::Intro + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader phone_verification: bool? + + def phone_verification=: (bool) -> bool + + attr_reader privacy_policy: WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy? + + def privacy_policy=: ( + WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy + ) -> WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy + + attr_reader questions: ::Array[WhopSDK::AdCreateParams::LeadForm::Question]? + + def questions=: ( + ::Array[WhopSDK::AdCreateParams::LeadForm::Question] + ) -> ::Array[WhopSDK::AdCreateParams::LeadForm::Question] + + def initialize: ( + ?completion: WhopSDK::AdCreateParams::LeadForm::Completion, + ?disclaimer: WhopSDK::AdCreateParams::LeadForm::Disclaimer, + ?form_type: WhopSDK::Models::AdCreateParams::LeadForm::form_type, + ?intro: WhopSDK::AdCreateParams::LeadForm::Intro, + ?name: String, + ?phone_verification: bool, + ?privacy_policy: WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy, + ?questions: ::Array[WhopSDK::AdCreateParams::LeadForm::Question] + ) -> void + + def to_hash: -> { + completion: WhopSDK::AdCreateParams::LeadForm::Completion, + disclaimer: WhopSDK::AdCreateParams::LeadForm::Disclaimer, + form_type: WhopSDK::Models::AdCreateParams::LeadForm::form_type, + intro: WhopSDK::AdCreateParams::LeadForm::Intro, + name: String, + phone_verification: bool, + privacy_policy: WhopSDK::AdCreateParams::LeadForm::PrivacyPolicy, + questions: ::Array[WhopSDK::AdCreateParams::LeadForm::Question] + } + + type completion = + { + button_text: String, + description: String, + headline: String, + url: String + } + + class Completion < WhopSDK::Internal::Type::BaseModel + attr_reader button_text: String? + + def button_text=: (String) -> String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader headline: String? + + def headline=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?button_text: String, + ?description: String, + ?headline: String, + ?url: String + ) -> void + + def to_hash: -> { + button_text: String, + description: String, + headline: String, + url: String + } + end + + type disclaimer = + { + body: String, + checkboxes: ::Array[WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox], + title: String + } + + class Disclaimer < WhopSDK::Internal::Type::BaseModel + attr_reader body: String? + + def body=: (String) -> String + + attr_reader checkboxes: ::Array[WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox]? + + def checkboxes=: ( + ::Array[WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox] + ) -> ::Array[WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox] + + attr_reader title: String? + + def title=: (String) -> String + + def initialize: ( + ?body: String, + ?checkboxes: ::Array[WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox], + ?title: String + ) -> void + + def to_hash: -> { + body: String, + checkboxes: ::Array[WhopSDK::AdCreateParams::LeadForm::Disclaimer::Checkbox], + title: String + } + + type checkbox = + { + checked_by_default: bool, + key: String, + required: bool, + text: String + } + + class Checkbox < WhopSDK::Internal::Type::BaseModel + attr_reader checked_by_default: bool? + + def checked_by_default=: (bool) -> bool + + attr_reader key: String? + + def key=: (String) -> String + + attr_reader required: bool? + + def required=: (bool) -> bool + + attr_reader text: String? + + def text=: (String) -> String + + def initialize: ( + ?checked_by_default: bool, + ?key: String, + ?required: bool, + ?text: String + ) -> void + + def to_hash: -> { + checked_by_default: bool, + key: String, + required: bool, + text: String + } + end + end + + type form_type = :more_volume | :higher_intent + + module FormType + extend WhopSDK::Internal::Type::Enum + + MORE_VOLUME: :more_volume + HIGHER_INTENT: :higher_intent + + def self?.values: -> ::Array[WhopSDK::Models::AdCreateParams::LeadForm::form_type] + end + + type intro = { description: String, headline: String } + + class Intro < WhopSDK::Internal::Type::BaseModel + attr_reader description: String? + + def description=: (String) -> String + + attr_reader headline: String? + + def headline=: (String) -> String + + def initialize: (?description: String, ?headline: String) -> void + + def to_hash: -> { description: String, headline: String } + end + + type privacy_policy = { link_text: String, url: String } + + class PrivacyPolicy < WhopSDK::Internal::Type::BaseModel + attr_reader link_text: String? + + def link_text=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: (?link_text: String, ?url: String) -> void + + def to_hash: -> { link_text: String, url: String } + end + + type question = + { + format_: WhopSDK::Models::AdCreateParams::LeadForm::Question::format_, + label: String, + options: ::Array[WhopSDK::AdCreateParams::LeadForm::Question::Option], + type: WhopSDK::Models::AdCreateParams::LeadForm::Question::type_ + } + + class Question < WhopSDK::Internal::Type::BaseModel + attr_reader format_: WhopSDK::Models::AdCreateParams::LeadForm::Question::format_? + + def format_=: ( + WhopSDK::Models::AdCreateParams::LeadForm::Question::format_ + ) -> WhopSDK::Models::AdCreateParams::LeadForm::Question::format_ + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader options: ::Array[WhopSDK::AdCreateParams::LeadForm::Question::Option]? + + def options=: ( + ::Array[WhopSDK::AdCreateParams::LeadForm::Question::Option] + ) -> ::Array[WhopSDK::AdCreateParams::LeadForm::Question::Option] + + attr_reader type: WhopSDK::Models::AdCreateParams::LeadForm::Question::type_? + + def type=: ( + WhopSDK::Models::AdCreateParams::LeadForm::Question::type_ + ) -> WhopSDK::Models::AdCreateParams::LeadForm::Question::type_ + + def initialize: ( + ?format_: WhopSDK::Models::AdCreateParams::LeadForm::Question::format_, + ?label: String, + ?options: ::Array[WhopSDK::AdCreateParams::LeadForm::Question::Option], + ?type: WhopSDK::Models::AdCreateParams::LeadForm::Question::type_ + ) -> void + + def to_hash: -> { + format_: WhopSDK::Models::AdCreateParams::LeadForm::Question::format_, + label: String, + options: ::Array[WhopSDK::AdCreateParams::LeadForm::Question::Option], + type: WhopSDK::Models::AdCreateParams::LeadForm::Question::type_ + } + + type format_ = :short_answer | :multiple_choice | :appointment + + module Format + extend WhopSDK::Internal::Type::Enum + + SHORT_ANSWER: :short_answer + MULTIPLE_CHOICE: :multiple_choice + APPOINTMENT: :appointment + + def self?.values: -> ::Array[WhopSDK::Models::AdCreateParams::LeadForm::Question::format_] + end + + type option = + { + key: String, + logic: WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic, + value: String + } + + class Option < WhopSDK::Internal::Type::BaseModel + attr_reader key: String? + + def key=: (String) -> String + + attr_reader logic: WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic? + + def logic=: ( + WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic + ) -> WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?key: String, + ?logic: WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic, + ?value: String + ) -> void + + def to_hash: -> { + key: String, + logic: WhopSDK::AdCreateParams::LeadForm::Question::Option::Logic, + value: String + } + + type logic = + { + action: WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::action, + target_end_page_index: Integer, + target_question_index: Integer + } + + class Logic < WhopSDK::Internal::Type::BaseModel + attr_reader action: WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::action? + + def action=: ( + WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::action + ) -> WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::action + + attr_reader target_end_page_index: Integer? + + def target_end_page_index=: (Integer) -> Integer + + attr_reader target_question_index: Integer? + + def target_question_index=: (Integer) -> Integer + + def initialize: ( + ?action: WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::action, + ?target_end_page_index: Integer, + ?target_question_index: Integer + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::action, + target_end_page_index: Integer, + target_question_index: Integer + } + + type action = :go_to_question | :submit_form | :close_form + + module Action + extend WhopSDK::Internal::Type::Enum + + GO_TO_QUESTION: :go_to_question + SUBMIT_FORM: :submit_form + CLOSE_FORM: :close_form + + def self?.values: -> ::Array[WhopSDK::Models::AdCreateParams::LeadForm::Question::Option::Logic::action] + end + end + end + + type type_ = + :email + | :phone + | :full_name + | :first_name + | :last_name + | :city + | :state + | :zip + | :country + | :street_address + | :job_title + | :company_name + | :work_email + | :work_phone_number + | :dob + | :gender + | :marital_status + | :relationship_status + | :military_status + | :date_time + | :custom + + module Type + extend WhopSDK::Internal::Type::Enum + + EMAIL: :email + PHONE: :phone + FULL_NAME: :full_name + FIRST_NAME: :first_name + LAST_NAME: :last_name + CITY: :city + STATE: :state + ZIP: :zip + COUNTRY: :country + STREET_ADDRESS: :street_address + JOB_TITLE: :job_title + COMPANY_NAME: :company_name + WORK_EMAIL: :work_email + WORK_PHONE_NUMBER: :work_phone_number + DOB: :dob + GENDER: :gender + MARITAL_STATUS: :marital_status + RELATIONSHIP_STATUS: :relationship_status + MILITARY_STATUS: :military_status + DATE_TIME: :date_time + CUSTOM: :custom + + def self?.values: -> ::Array[WhopSDK::Models::AdCreateParams::LeadForm::Question::type_] + end + end + end + + type messaging_config = { keyword: String, message: String } + + class MessagingConfig < WhopSDK::Internal::Type::BaseModel + attr_reader keyword: String? + + def keyword=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + def initialize: (?keyword: String, ?message: String) -> void + + def to_hash: -> { keyword: String, message: String } + end + + type post_source = :facebook | :instagram + + module PostSource + extend WhopSDK::Internal::Type::Enum + + FACEBOOK: :facebook + INSTAGRAM: :instagram + + def self?.values: -> ::Array[WhopSDK::Models::AdCreateParams::post_source] + end + + type social_account = { id: String } + + class SocialAccount < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + def initialize: (?id: String) -> void + + def to_hash: -> { id: String } + end + end + end +end diff --git a/sig/whop_sdk/models/ad_delete_params.rbs b/sig/whop_sdk/models/ad_delete_params.rbs new file mode 100644 index 00000000..1af35ec1 --- /dev/null +++ b/sig/whop_sdk/models/ad_delete_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type ad_delete_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class AdDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/ad_delete_response.rbs b/sig/whop_sdk/models/ad_delete_response.rbs new file mode 100644 index 00000000..bfb9d08a --- /dev/null +++ b/sig/whop_sdk/models/ad_delete_response.rbs @@ -0,0 +1,5 @@ +module WhopSDK + module Models + AdDeleteResponse: WhopSDK::Internal::Type::Converter + end +end diff --git a/sig/whop_sdk/models/ad_group.rbs b/sig/whop_sdk/models/ad_group.rbs index 6c3366b2..83649da7 100644 --- a/sig/whop_sdk/models/ad_group.rbs +++ b/sig/whop_sdk/models/ad_group.rbs @@ -4,32 +4,64 @@ module WhopSDK { id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign, - budget: Float?, - budget_type: WhopSDK::Models::ad_budget_type?, + added_to_carts: Float, + audiences: top, + bid_type: WhopSDK::Models::AdGroup::bid_type?, + budget_amount: Float?, + budget_type: WhopSDK::Models::AdGroup::budget_type?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::Models::AdGroup::conversion_event?, + conversion_location: WhopSDK::Models::AdGroup::conversion_location?, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::Models::AdGroup::delivery_status, + demographics: top, + desired_cost_per_result: Float?, + devices: top, + dynamic_creative: bool, + ends_at: String?, frequency: Float?, - impressions: Integer, + frequency_cap: top?, + impressions: Float, issues: ::Array[WhopSDK::AdGroup::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + languages: ::Array[String], + leads: Float, + message_apps: ::Array[String], + minimum_daily_spend: Float?, + optimization_goal: String?, + placements: ::Array[top], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: top, + result_event: WhopSDK::Models::AdGroup::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::ad_group_status, + spend_currency: String?, + starts_at: String?, + status: WhopSDK::Models::AdGroup::status, + submitted_applications: Float, title: String?, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } class AdGroup < WhopSDK::Internal::Type::BaseModel @@ -37,16 +69,36 @@ module WhopSDK attr_accessor ad_campaign: WhopSDK::AdGroup::AdCampaign - attr_accessor budget: Float? + attr_accessor added_to_carts: Float - attr_accessor budget_type: WhopSDK::Models::ad_budget_type? + attr_accessor audiences: top + + attr_accessor bid_type: WhopSDK::Models::AdGroup::bid_type? + + attr_accessor budget_amount: Float? + + attr_accessor budget_type: WhopSDK::Models::AdGroup::budget_type? attr_accessor click_through_rate: Float - attr_accessor clicks: Integer + attr_accessor clicks: Float + + attr_accessor completed_registrations: Float + + attr_accessor contacts: Float + + attr_accessor conversion_event: WhopSDK::Models::AdGroup::conversion_event? + + attr_accessor conversion_location: WhopSDK::Models::AdGroup::conversion_location? + + attr_accessor cost_per_added_to_cart: Float? attr_accessor cost_per_click: Float + attr_accessor cost_per_completed_registration: Float? + + attr_accessor cost_per_contact: Float? + attr_accessor cost_per_lead: Float? attr_accessor cost_per_mille: Float @@ -55,100 +107,208 @@ module WhopSDK attr_accessor cost_per_result: Float? - attr_accessor created_at: Time + attr_accessor cost_per_schedule: Float? + + attr_accessor cost_per_submitted_application: Float? + + attr_accessor cost_per_viewed_content: Float? + + attr_accessor created_at: String + + attr_accessor custom_conversions: Float + + attr_accessor delivery_status: WhopSDK::Models::AdGroup::delivery_status + + attr_accessor demographics: top + + attr_accessor desired_cost_per_result: Float? + + attr_accessor devices: top + + attr_accessor dynamic_creative: bool + + attr_accessor ends_at: String? attr_accessor frequency: Float? - attr_accessor impressions: Integer + attr_accessor frequency_cap: top? + + attr_accessor impressions: Float attr_accessor issues: ::Array[WhopSDK::AdGroup::Issue] - attr_accessor leads: Integer + attr_accessor languages: ::Array[String] - attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor leads: Float + + attr_accessor message_apps: ::Array[String] + + attr_accessor minimum_daily_spend: Float? + + attr_accessor optimization_goal: String? + + attr_accessor placements: ::Array[top] attr_accessor purchase_value: Float - attr_accessor purchases: Integer + attr_accessor purchases: Float + + attr_accessor reach: Float + + attr_accessor regions: top + + attr_accessor result_event: WhopSDK::Models::AdGroup::result_event? - attr_accessor reach: Integer + attr_accessor result_event_name: String? attr_accessor return_on_ad_spend: Float + attr_accessor schedules: Float + attr_accessor spend: Float - attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor spend_currency: String? + + attr_accessor starts_at: String? - attr_accessor status: WhopSDK::Models::ad_group_status + attr_accessor status: WhopSDK::Models::AdGroup::status + + attr_accessor submitted_applications: Float attr_accessor title: String? attr_accessor unique_click_through_rate: Float? - attr_accessor unique_clicks: Integer + attr_accessor unique_clicks: Float + + attr_accessor updated_at: String - attr_accessor updated_at: Time + attr_accessor viewed_contents: Float def initialize: ( id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign, - budget: Float?, - budget_type: WhopSDK::Models::ad_budget_type?, + added_to_carts: Float, + audiences: top, + bid_type: WhopSDK::Models::AdGroup::bid_type?, + budget_amount: Float?, + budget_type: WhopSDK::Models::AdGroup::budget_type?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::Models::AdGroup::conversion_event?, + conversion_location: WhopSDK::Models::AdGroup::conversion_location?, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::Models::AdGroup::delivery_status, + demographics: top, + desired_cost_per_result: Float?, + devices: top, + dynamic_creative: bool, + ends_at: String?, frequency: Float?, - impressions: Integer, + frequency_cap: top?, + impressions: Float, issues: ::Array[WhopSDK::AdGroup::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + languages: ::Array[String], + leads: Float, + message_apps: ::Array[String], + minimum_daily_spend: Float?, + optimization_goal: String?, + placements: ::Array[top], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: top, + result_event: WhopSDK::Models::AdGroup::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::ad_group_status, + spend_currency: String?, + starts_at: String?, + status: WhopSDK::Models::AdGroup::status, + submitted_applications: Float, title: String?, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float ) -> void def to_hash: -> { id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign, - budget: Float?, - budget_type: WhopSDK::Models::ad_budget_type?, + added_to_carts: Float, + audiences: top, + bid_type: WhopSDK::Models::AdGroup::bid_type?, + budget_amount: Float?, + budget_type: WhopSDK::Models::AdGroup::budget_type?, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::Models::AdGroup::conversion_event?, + conversion_location: WhopSDK::Models::AdGroup::conversion_location?, + cost_per_added_to_cart: Float?, cost_per_click: Float, + cost_per_completed_registration: Float?, + cost_per_contact: Float?, cost_per_lead: Float?, cost_per_mille: Float, cost_per_purchase: Float?, cost_per_result: Float?, - created_at: Time, + cost_per_schedule: Float?, + cost_per_submitted_application: Float?, + cost_per_viewed_content: Float?, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::Models::AdGroup::delivery_status, + demographics: top, + desired_cost_per_result: Float?, + devices: top, + dynamic_creative: bool, + ends_at: String?, frequency: Float?, - impressions: Integer, + frequency_cap: top?, + impressions: Float, issues: ::Array[WhopSDK::AdGroup::Issue], - leads: Integer, - platform: WhopSDK::Models::ad_campaign_platform, + languages: ::Array[String], + leads: Float, + message_apps: ::Array[String], + minimum_daily_spend: Float?, + optimization_goal: String?, + placements: ::Array[top], purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: top, + result_event: WhopSDK::Models::AdGroup::result_event?, + result_event_name: String?, return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: WhopSDK::Models::currency?, - status: WhopSDK::Models::ad_group_status, + spend_currency: String?, + starts_at: String?, + status: WhopSDK::Models::AdGroup::status, + submitted_applications: Float, title: String?, unique_click_through_rate: Float?, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } type ad_campaign = { id: String } @@ -161,75 +321,212 @@ module WhopSDK def to_hash: -> { id: String } end + type bid_type = :minimum_cost | :average_target | :maximum_target + + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST: :minimum_cost + AVERAGE_TARGET: :average_target + MAXIMUM_TARGET: :maximum_target + + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::bid_type] + end + + type budget_type = :daily | :lifetime + + module BudgetType + extend WhopSDK::Internal::Type::Enum + + DAILY: :daily + LIFETIME: :lifetime + + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::budget_type] + end + + type conversion_event = + :purchase + | :add_to_cart + | :initiated_checkout + | :add_payment_info + | :complete_registration + | :lead + | :content_view + | :search + | :contact + | :customize_product + | :donate + | :find_location + | :schedule + | :start_trial + | :submit_application + | :subscribe + | String + + module ConversionEvent + extend WhopSDK::Internal::Type::Union + + def self?.variants: -> ::Array[WhopSDK::Models::AdGroup::conversion_event] + + PURCHASE: :purchase + ADD_TO_CART: :add_to_cart + INITIATED_CHECKOUT: :initiated_checkout + ADD_PAYMENT_INFO: :add_payment_info + COMPLETE_REGISTRATION: :complete_registration + LEAD: :lead + CONTENT_VIEW: :content_view + SEARCH: :search + CONTACT: :contact + CUSTOMIZE_PRODUCT: :customize_product + DONATE: :donate + FIND_LOCATION: :find_location + SCHEDULE: :schedule + START_TRIAL: :start_trial + SUBMIT_APPLICATION: :submit_application + SUBSCRIBE: :subscribe + end + + type conversion_location = + :website + | :profile + | :messaging + | :on_ad + | :instant_forms + | :instant_forms_and_messenger + | :website_and_instant_forms + + module ConversionLocation + extend WhopSDK::Internal::Type::Enum + + WEBSITE: :website + PROFILE: :profile + MESSAGING: :messaging + ON_AD: :on_ad + INSTANT_FORMS: :instant_forms + INSTANT_FORMS_AND_MESSENGER: :instant_forms_and_messenger + WEBSITE_AND_INSTANT_FORMS: :website_and_instant_forms + + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::conversion_location] + end + + type delivery_status = + :all_ads_rejected + | :rejected + | :draft + | :no_ads + | :campaign_paused + | :paused + | :processing + | :issues + | :scheduled + | :completed + | :ads_off + | :learning_limited + | :learning + | :active + + module DeliveryStatus + extend WhopSDK::Internal::Type::Enum + + ALL_ADS_REJECTED: :all_ads_rejected + REJECTED: :rejected + DRAFT: :draft + NO_ADS: :no_ads + CAMPAIGN_PAUSED: :campaign_paused + PAUSED: :paused + PROCESSING: :processing + ISSUES: :issues + SCHEDULED: :scheduled + COMPLETED: :completed + ADS_OFF: :ads_off + LEARNING_LIMITED: :learning_limited + LEARNING: :learning + ACTIVE: :active + + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::delivery_status] + end + type issue = { - category: WhopSDK::Models::AdGroup::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::AdGroup::Issue::resource_type } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::AdGroup::Issue::category? - - attr_accessor created_at: Time + attr_accessor id: String - attr_accessor resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status + attr_accessor message: String attr_accessor resource_id: String? - attr_accessor resource_type: String - - attr_accessor subtype: String? + attr_accessor resource_type: WhopSDK::Models::AdGroup::Issue::resource_type def initialize: ( - category: WhopSDK::Models::AdGroup::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::AdGroup::Issue::resource_type ) -> void def to_hash: -> { - category: WhopSDK::Models::AdGroup::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, + id: String, + message: String, resource_id: String?, - resource_type: String, - subtype: String? + resource_type: WhopSDK::Models::AdGroup::Issue::resource_type } - type category = - :policy_rejection - | :creative_media - | :audience_targeting - | :ad_volume_limit + type resource_type = :ad_campaign | :ad_group | :ad - module Category + module ResourceType extend WhopSDK::Internal::Type::Enum - POLICY_REJECTION: :policy_rejection - CREATIVE_MEDIA: :creative_media - AUDIENCE_TARGETING: :audience_targeting - AD_VOLUME_LIMIT: :ad_volume_limit + AD_CAMPAIGN: :ad_campaign + AD_GROUP: :ad_group + AD: :ad - def self?.values: -> ::Array[WhopSDK::Models::AdGroup::Issue::category] + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::Issue::resource_type] end + end - type resolution_status = :open | :resolved | :acknowledged + type result_event = + :purchase + | :lead + | :schedule + | :submit_application + | :contact + | :complete_registration + | :view_content + | :add_to_cart + | :custom + + module ResultEvent + extend WhopSDK::Internal::Type::Enum + + PURCHASE: :purchase + LEAD: :lead + SCHEDULE: :schedule + SUBMIT_APPLICATION: :submit_application + CONTACT: :contact + COMPLETE_REGISTRATION: :complete_registration + VIEW_CONTENT: :view_content + ADD_TO_CART: :add_to_cart + CUSTOM: :custom + + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::result_event] + end - module ResolutionStatus - extend WhopSDK::Internal::Type::Enum + type status = :active | :paused | :rejected - OPEN: :open - RESOLVED: :resolved - ACKNOWLEDGED: :acknowledged + module Status + extend WhopSDK::Internal::Type::Enum - def self?.values: -> ::Array[WhopSDK::Models::AdGroup::Issue::resolution_status] - end + ACTIVE: :active + PAUSED: :paused + REJECTED: :rejected + + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::status] end end end diff --git a/sig/whop_sdk/models/ad_group_create_params.rbs b/sig/whop_sdk/models/ad_group_create_params.rbs new file mode 100644 index 00000000..743aa521 --- /dev/null +++ b/sig/whop_sdk/models/ad_group_create_params.rbs @@ -0,0 +1,292 @@ +module WhopSDK + module Models + type ad_group_create_params = + { + ad_campaign_id: String, + audiences: top, + bid_type: WhopSDK::Models::AdGroupCreateParams::bid_type, + budget_amount: Float, + budget_type: WhopSDK::Models::AdGroupCreateParams::budget_type, + conversion_event: WhopSDK::Models::AdGroupCreateParams::conversion_event?, + conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location, + demographics: top, + desired_cost_per_result: Float, + devices: top, + dynamic_creative: bool, + ends_at: String, + frequency_cap: top, + languages: ::Array[String], + message_apps: ::Array[WhopSDK::Models::AdGroupCreateParams::message_app], + minimum_daily_spend: Float, + optimization_goal: String, + placements: top, + regions: top, + starts_at: String, + status: WhopSDK::Models::AdGroupCreateParams::status, + title: String + } + & WhopSDK::Internal::Type::request_parameters + + class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor ad_campaign_id: String + + attr_reader audiences: top? + + def audiences=: (top) -> top + + attr_reader bid_type: WhopSDK::Models::AdGroupCreateParams::bid_type? + + def bid_type=: ( + WhopSDK::Models::AdGroupCreateParams::bid_type + ) -> WhopSDK::Models::AdGroupCreateParams::bid_type + + attr_reader budget_amount: Float? + + def budget_amount=: (Float) -> Float + + attr_reader budget_type: WhopSDK::Models::AdGroupCreateParams::budget_type? + + def budget_type=: ( + WhopSDK::Models::AdGroupCreateParams::budget_type + ) -> WhopSDK::Models::AdGroupCreateParams::budget_type + + attr_accessor conversion_event: WhopSDK::Models::AdGroupCreateParams::conversion_event? + + attr_reader conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location? + + def conversion_location=: ( + WhopSDK::Models::AdGroupCreateParams::conversion_location + ) -> WhopSDK::Models::AdGroupCreateParams::conversion_location + + attr_reader demographics: top? + + def demographics=: (top) -> top + + attr_reader desired_cost_per_result: Float? + + def desired_cost_per_result=: (Float) -> Float + + attr_reader devices: top? + + def devices=: (top) -> top + + attr_reader dynamic_creative: bool? + + def dynamic_creative=: (bool) -> bool + + attr_reader ends_at: String? + + def ends_at=: (String) -> String + + attr_reader frequency_cap: top? + + def frequency_cap=: (top) -> top + + attr_reader languages: ::Array[String]? + + def languages=: (::Array[String]) -> ::Array[String] + + attr_reader message_apps: ::Array[WhopSDK::Models::AdGroupCreateParams::message_app]? + + def message_apps=: ( + ::Array[WhopSDK::Models::AdGroupCreateParams::message_app] + ) -> ::Array[WhopSDK::Models::AdGroupCreateParams::message_app] + + attr_reader minimum_daily_spend: Float? + + def minimum_daily_spend=: (Float) -> Float + + attr_reader optimization_goal: String? + + def optimization_goal=: (String) -> String + + attr_reader placements: top? + + def placements=: (top) -> top + + attr_reader regions: top? + + def regions=: (top) -> top + + attr_reader starts_at: String? + + def starts_at=: (String) -> String + + attr_reader status: WhopSDK::Models::AdGroupCreateParams::status? + + def status=: ( + WhopSDK::Models::AdGroupCreateParams::status + ) -> WhopSDK::Models::AdGroupCreateParams::status + + attr_reader title: String? + + def title=: (String) -> String + + def initialize: ( + ad_campaign_id: String, + ?audiences: top, + ?bid_type: WhopSDK::Models::AdGroupCreateParams::bid_type, + ?budget_amount: Float, + ?budget_type: WhopSDK::Models::AdGroupCreateParams::budget_type, + ?conversion_event: WhopSDK::Models::AdGroupCreateParams::conversion_event?, + ?conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location, + ?demographics: top, + ?desired_cost_per_result: Float, + ?devices: top, + ?dynamic_creative: bool, + ?ends_at: String, + ?frequency_cap: top, + ?languages: ::Array[String], + ?message_apps: ::Array[WhopSDK::Models::AdGroupCreateParams::message_app], + ?minimum_daily_spend: Float, + ?optimization_goal: String, + ?placements: top, + ?regions: top, + ?starts_at: String, + ?status: WhopSDK::Models::AdGroupCreateParams::status, + ?title: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + ad_campaign_id: String, + audiences: top, + bid_type: WhopSDK::Models::AdGroupCreateParams::bid_type, + budget_amount: Float, + budget_type: WhopSDK::Models::AdGroupCreateParams::budget_type, + conversion_event: WhopSDK::Models::AdGroupCreateParams::conversion_event?, + conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location, + demographics: top, + desired_cost_per_result: Float, + devices: top, + dynamic_creative: bool, + ends_at: String, + frequency_cap: top, + languages: ::Array[String], + message_apps: ::Array[WhopSDK::Models::AdGroupCreateParams::message_app], + minimum_daily_spend: Float, + optimization_goal: String, + placements: top, + regions: top, + starts_at: String, + status: WhopSDK::Models::AdGroupCreateParams::status, + title: String, + request_options: WhopSDK::RequestOptions + } + + type bid_type = :minimum_cost | :average_target | :maximum_target + + module BidType + extend WhopSDK::Internal::Type::Enum + + MINIMUM_COST: :minimum_cost + AVERAGE_TARGET: :average_target + MAXIMUM_TARGET: :maximum_target + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupCreateParams::bid_type] + end + + type budget_type = :daily | :lifetime + + module BudgetType + extend WhopSDK::Internal::Type::Enum + + DAILY: :daily + LIFETIME: :lifetime + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupCreateParams::budget_type] + end + + type conversion_event = + :purchase + | :add_to_cart + | :initiated_checkout + | :add_payment_info + | :complete_registration + | :lead + | :content_view + | :search + | :contact + | :customize_product + | :donate + | :find_location + | :schedule + | :start_trial + | :submit_application + | :subscribe + | String + + module ConversionEvent + extend WhopSDK::Internal::Type::Union + + def self?.variants: -> ::Array[WhopSDK::Models::AdGroupCreateParams::conversion_event] + + PURCHASE: :purchase + ADD_TO_CART: :add_to_cart + INITIATED_CHECKOUT: :initiated_checkout + ADD_PAYMENT_INFO: :add_payment_info + COMPLETE_REGISTRATION: :complete_registration + LEAD: :lead + CONTENT_VIEW: :content_view + SEARCH: :search + CONTACT: :contact + CUSTOMIZE_PRODUCT: :customize_product + DONATE: :donate + FIND_LOCATION: :find_location + SCHEDULE: :schedule + START_TRIAL: :start_trial + SUBMIT_APPLICATION: :submit_application + SUBSCRIBE: :subscribe + end + + type conversion_location = + :website + | :profile + | :messaging + | :on_ad + | :instant_forms + | :instant_forms_and_messenger + | :website_and_instant_forms + + module ConversionLocation + extend WhopSDK::Internal::Type::Enum + + WEBSITE: :website + PROFILE: :profile + MESSAGING: :messaging + ON_AD: :on_ad + INSTANT_FORMS: :instant_forms + INSTANT_FORMS_AND_MESSENGER: :instant_forms_and_messenger + WEBSITE_AND_INSTANT_FORMS: :website_and_instant_forms + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupCreateParams::conversion_location] + end + + type message_app = :messenger | :instagram | :whatsapp + + module MessageApp + extend WhopSDK::Internal::Type::Enum + + MESSENGER: :messenger + INSTAGRAM: :instagram + WHATSAPP: :whatsapp + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupCreateParams::message_app] + end + + type status = :active | :paused + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + PAUSED: :paused + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupCreateParams::status] + 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 e3204bb6..b4dba5d6 100644 --- a/sig/whop_sdk/models/ad_group_list_params.rbs +++ b/sig/whop_sdk/models/ad_group_list_params.rbs @@ -2,20 +2,21 @@ 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?, - company_id: String?, - created_after: Time?, - created_before: Time?, - first: Integer?, - last: Integer?, - query: String?, - stats_from: Time?, - stats_to: Time?, - status: WhopSDK::Models::ad_group_status? + account_id: String, + ad_campaign_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::AdGroupListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::AdGroupListParams::order, + query: String, + stats_from: String, + stats_to: String, + status: String, + time_zone: String } & WhopSDK::Internal::Type::request_parameters @@ -23,69 +24,155 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor ad_campaign_id: String? + attr_reader account_id: String? - attr_accessor ad_campaign_ids: ::Array[String]? + def account_id=: (String) -> String - attr_accessor after: String? + attr_reader ad_campaign_id: String? - attr_accessor before: String? + def ad_campaign_id=: (String) -> String - attr_accessor campaign_id: String? + attr_reader after: String? - attr_accessor company_id: 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 first: Integer? + attr_reader created_after: String? - attr_accessor last: Integer? + def created_after=: (String) -> String - attr_accessor query: String? + attr_reader created_before: String? - attr_accessor stats_from: Time? + def created_before=: (String) -> String - attr_accessor stats_to: Time? + attr_reader direction: WhopSDK::Models::AdGroupListParams::direction? - attr_accessor status: WhopSDK::Models::ad_group_status? + def direction=: ( + WhopSDK::Models::AdGroupListParams::direction + ) -> WhopSDK::Models::AdGroupListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::AdGroupListParams::order? + + def order=: ( + WhopSDK::Models::AdGroupListParams::order + ) -> WhopSDK::Models::AdGroupListParams::order + + attr_reader query: String? + + def query=: (String) -> String + + attr_reader stats_from: String? + + def stats_from=: (String) -> String + + attr_reader stats_to: String? + + def stats_to=: (String) -> String + + attr_reader status: String? + + def status=: (String) -> String + + attr_reader time_zone: String? + + def time_zone=: (String) -> String def initialize: ( - ?ad_campaign_id: String?, - ?ad_campaign_ids: ::Array[String]?, - ?after: String?, - ?before: String?, - ?campaign_id: String?, - ?company_id: String?, - ?created_after: Time?, - ?created_before: Time?, - ?first: Integer?, - ?last: Integer?, - ?query: String?, - ?stats_from: Time?, - ?stats_to: Time?, - ?status: WhopSDK::Models::ad_group_status?, + ?account_id: String, + ?ad_campaign_id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::AdGroupListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::AdGroupListParams::order, + ?query: String, + ?stats_from: String, + ?stats_to: String, + ?status: String, + ?time_zone: String, ?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?, - company_id: String?, - created_after: Time?, - created_before: Time?, - first: Integer?, - last: Integer?, - query: String?, - stats_from: Time?, - stats_to: Time?, - status: WhopSDK::Models::ad_group_status?, + account_id: String, + ad_campaign_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::AdGroupListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::AdGroupListParams::order, + query: String, + stats_from: String, + stats_to: String, + status: String, + time_zone: 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::AdGroupListParams::direction] + end + + type order = + :created_at + | :updated_at + | :spend + | :impressions + | :reach + | :clicks + | :unique_clicks + | :frequency + | :click_through_rate + | :results + | :cost_per_mille + | :cost_per_click + | :cost_per_result + | :return_on_ad_spend + + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT: :created_at + UPDATED_AT: :updated_at + SPEND: :spend + IMPRESSIONS: :impressions + REACH: :reach + CLICKS: :clicks + UNIQUE_CLICKS: :unique_clicks + FREQUENCY: :frequency + CLICK_THROUGH_RATE: :click_through_rate + RESULTS: :results + COST_PER_MILLE: :cost_per_mille + COST_PER_CLICK: :cost_per_click + COST_PER_RESULT: :cost_per_result + RETURN_ON_AD_SPEND: :return_on_ad_spend + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupListParams::order] + end end end end diff --git a/sig/whop_sdk/models/ad_group_list_response.rbs b/sig/whop_sdk/models/ad_group_list_response.rbs deleted file mode 100644 index 107142a3..00000000 --- a/sig/whop_sdk/models/ad_group_list_response.rbs +++ /dev/null @@ -1,236 +0,0 @@ -module WhopSDK - module Models - type ad_group_list_response = - { - id: String, - 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 - } - - class AdGroupListResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign - - attr_accessor budget: Float? - - 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: ( - id: String, - 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 - - def to_hash: -> { - id: String, - 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 - } - - type ad_campaign = { id: String } - - class AdCampaign < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - - type issue = - { - category: WhopSDK::Models::AdGroupListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, - resource_id: String?, - resource_type: String, - subtype: String? - } - - class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::AdGroupListResponse::Issue::category? - - attr_accessor created_at: Time - - attr_accessor resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status - - attr_accessor resource_id: String? - - attr_accessor resource_type: String - - attr_accessor subtype: String? - - def initialize: ( - category: WhopSDK::Models::AdGroupListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, - resource_id: String?, - resource_type: String, - subtype: String? - ) -> void - - def to_hash: -> { - category: WhopSDK::Models::AdGroupListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, - resource_id: 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 - 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 c3439d81..316d2c4d 100644 --- a/sig/whop_sdk/models/ad_group_retrieve_params.rbs +++ b/sig/whop_sdk/models/ad_group_retrieve_params.rbs @@ -1,7 +1,7 @@ module WhopSDK module Models type ad_group_retrieve_params = - { id: String, stats_from: Time?, stats_to: Time? } + { id: String, stats_from: String, stats_to: String, time_zone: String } & WhopSDK::Internal::Type::request_parameters class AdGroupRetrieveParams < WhopSDK::Internal::Type::BaseModel @@ -10,21 +10,31 @@ module WhopSDK attr_accessor id: String - attr_accessor stats_from: Time? + attr_reader stats_from: String? - attr_accessor stats_to: Time? + def stats_from=: (String) -> String + + attr_reader stats_to: String? + + def stats_to=: (String) -> String + + attr_reader time_zone: String? + + def time_zone=: (String) -> String def initialize: ( id: String, - ?stats_from: Time?, - ?stats_to: Time?, + ?stats_from: String, + ?stats_to: String, + ?time_zone: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { id: String, - stats_from: Time?, - stats_to: Time?, + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/ad_group_status.rbs b/sig/whop_sdk/models/ad_group_status.rbs deleted file mode 100644 index d3a90300..00000000 --- a/sig/whop_sdk/models/ad_group_status.rbs +++ /dev/null @@ -1,19 +0,0 @@ -module WhopSDK - module Models - type ad_group_status = - :active | :paused | :inactive | :in_review | :rejected | :flagged - - module AdGroupStatus - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - PAUSED: :paused - INACTIVE: :inactive - IN_REVIEW: :in_review - REJECTED: :rejected - FLAGGED: :flagged - - def self?.values: -> ::Array[WhopSDK::Models::ad_group_status] - end - end -end diff --git a/sig/whop_sdk/models/ad_group_update_params.rbs b/sig/whop_sdk/models/ad_group_update_params.rbs index dcc094ff..3723d9f2 100644 --- a/sig/whop_sdk/models/ad_group_update_params.rbs +++ b/sig/whop_sdk/models/ad_group_update_params.rbs @@ -3,14 +3,26 @@ module WhopSDK type ad_group_update_params = { id: String, - budget: Float?, - budget_type: WhopSDK::Models::ad_budget_type?, - config: WhopSDK::AdGroupUpdateParams::Config?, - daily_budget: Float?, - name: String?, - platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, - status: WhopSDK::Models::ad_group_status?, - title: String? + audiences: top, + bid_type: WhopSDK::Models::AdGroupUpdateParams::bid_type, + budget_amount: Float, + budget_type: WhopSDK::Models::AdGroupUpdateParams::budget_type, + conversion_event: WhopSDK::Models::AdGroupUpdateParams::conversion_event?, + conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location, + demographics: top, + desired_cost_per_result: Float, + devices: top, + ends_at: String, + frequency_cap: top, + languages: ::Array[String], + message_apps: ::Array[WhopSDK::Models::AdGroupUpdateParams::message_app], + minimum_daily_spend: Float, + optimization_goal: String, + placements: top, + regions: top, + starts_at: String, + status: WhopSDK::Models::AdGroupUpdateParams::status, + title: String } & WhopSDK::Internal::Type::request_parameters @@ -20,2406 +32,253 @@ module WhopSDK attr_accessor id: String - attr_accessor budget: Float? + attr_reader audiences: top? - attr_accessor budget_type: WhopSDK::Models::ad_budget_type? + def audiences=: (top) -> top - attr_accessor config: WhopSDK::AdGroupUpdateParams::Config? + attr_reader bid_type: WhopSDK::Models::AdGroupUpdateParams::bid_type? - attr_accessor daily_budget: Float? + def bid_type=: ( + WhopSDK::Models::AdGroupUpdateParams::bid_type + ) -> WhopSDK::Models::AdGroupUpdateParams::bid_type - attr_accessor name: String? + attr_reader budget_amount: Float? - attr_accessor platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig? + def budget_amount=: (Float) -> Float - attr_accessor status: WhopSDK::Models::ad_group_status? + attr_reader budget_type: WhopSDK::Models::AdGroupUpdateParams::budget_type? - attr_accessor title: String? + def budget_type=: ( + WhopSDK::Models::AdGroupUpdateParams::budget_type + ) -> WhopSDK::Models::AdGroupUpdateParams::budget_type - def initialize: ( - id: String, - ?budget: Float?, - ?budget_type: WhopSDK::Models::ad_budget_type?, - ?config: WhopSDK::AdGroupUpdateParams::Config?, - ?daily_budget: Float?, - ?name: String?, - ?platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, - ?status: WhopSDK::Models::ad_group_status?, - ?title: String?, - ?request_options: WhopSDK::request_opts - ) -> void - - def to_hash: -> { - id: String, - budget: Float?, - budget_type: WhopSDK::Models::ad_budget_type?, - config: WhopSDK::AdGroupUpdateParams::Config?, - daily_budget: Float?, - name: String?, - platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, - status: WhopSDK::Models::ad_group_status?, - title: String?, - request_options: WhopSDK::RequestOptions - } - - type config = - { - bid_amount: Integer?, - bid_strategy: WhopSDK::Models::AdGroupUpdateParams::Config::bid_strategy?, - billing_event: WhopSDK::Models::AdGroupUpdateParams::Config::billing_event?, - end_time: String?, - frequency_cap: Integer?, - frequency_cap_interval_days: Integer?, - optimization_goal: WhopSDK::Models::AdGroupUpdateParams::Config::optimization_goal?, - pacing: WhopSDK::Models::AdGroupUpdateParams::Config::pacing?, - start_time: String?, - targeting: WhopSDK::AdGroupUpdateParams::Config::Targeting? - } - - class Config < WhopSDK::Internal::Type::BaseModel - attr_accessor bid_amount: Integer? - - attr_accessor bid_strategy: WhopSDK::Models::AdGroupUpdateParams::Config::bid_strategy? - - attr_accessor billing_event: WhopSDK::Models::AdGroupUpdateParams::Config::billing_event? - - attr_accessor end_time: String? - - attr_accessor frequency_cap: Integer? - - attr_accessor frequency_cap_interval_days: Integer? - - attr_accessor optimization_goal: WhopSDK::Models::AdGroupUpdateParams::Config::optimization_goal? - - attr_accessor pacing: WhopSDK::Models::AdGroupUpdateParams::Config::pacing? - - attr_accessor start_time: String? - - attr_accessor targeting: WhopSDK::AdGroupUpdateParams::Config::Targeting? - - def initialize: ( - ?bid_amount: Integer?, - ?bid_strategy: WhopSDK::Models::AdGroupUpdateParams::Config::bid_strategy?, - ?billing_event: WhopSDK::Models::AdGroupUpdateParams::Config::billing_event?, - ?end_time: String?, - ?frequency_cap: Integer?, - ?frequency_cap_interval_days: Integer?, - ?optimization_goal: WhopSDK::Models::AdGroupUpdateParams::Config::optimization_goal?, - ?pacing: WhopSDK::Models::AdGroupUpdateParams::Config::pacing?, - ?start_time: String?, - ?targeting: WhopSDK::AdGroupUpdateParams::Config::Targeting? - ) -> void - - def to_hash: -> { - bid_amount: Integer?, - bid_strategy: WhopSDK::Models::AdGroupUpdateParams::Config::bid_strategy?, - billing_event: WhopSDK::Models::AdGroupUpdateParams::Config::billing_event?, - end_time: String?, - frequency_cap: Integer?, - frequency_cap_interval_days: Integer?, - optimization_goal: WhopSDK::Models::AdGroupUpdateParams::Config::optimization_goal?, - pacing: WhopSDK::Models::AdGroupUpdateParams::Config::pacing?, - start_time: String?, - targeting: WhopSDK::AdGroupUpdateParams::Config::Targeting? - } - - 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::AdGroupUpdateParams::Config::bid_strategy] - end - - type billing_event = - :impressions | :clicks | :optimized_cpm | :video_views - - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - IMPRESSIONS: :impressions - CLICKS: :clicks - OPTIMIZED_CPM: :optimized_cpm - VIDEO_VIEWS: :video_views - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::billing_event] - end - - type optimization_goal = - :conversions - | :link_clicks - | :landing_page_views - | :reach - | :impressions - | :app_installs - | :video_views - | :lead_generation - | :value - | :page_likes - | :conversations - | :ad_recall_lift - | :two_second_continuous_video_views - | :post_engagement - | :event_responses - | :reminders_set - | :quality_lead - - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum - - CONVERSIONS: :conversions - LINK_CLICKS: :link_clicks - LANDING_PAGE_VIEWS: :landing_page_views - REACH: :reach - IMPRESSIONS: :impressions - APP_INSTALLS: :app_installs - VIDEO_VIEWS: :video_views - LEAD_GENERATION: :lead_generation - VALUE: :value - PAGE_LIKES: :page_likes - CONVERSATIONS: :conversations - AD_RECALL_LIFT: :ad_recall_lift - TWO_SECOND_CONTINUOUS_VIDEO_VIEWS: :two_second_continuous_video_views - POST_ENGAGEMENT: :post_engagement - EVENT_RESPONSES: :event_responses - REMINDERS_SET: :reminders_set - QUALITY_LEAD: :quality_lead - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::optimization_goal] - end - - type pacing = :standard | :accelerated - - module Pacing - extend WhopSDK::Internal::Type::Enum - - STANDARD: :standard - ACCELERATED: :accelerated - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::pacing] - end - - type targeting = - { - age_max: Integer?, - age_min: Integer?, - countries: ::Array[String]?, - device_platforms: ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::device_platform]?, - exclude_audience_ids: ::Array[String]?, - genders: ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::gender]?, - include_audience_ids: ::Array[String]?, - interest_ids: ::Array[String]?, - languages: ::Array[String]?, - placement_type: WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::placement_type? - } - - class Targeting < WhopSDK::Internal::Type::BaseModel - attr_accessor age_max: Integer? - - attr_accessor age_min: Integer? - - attr_accessor countries: ::Array[String]? - - attr_accessor device_platforms: ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::device_platform]? - - attr_accessor exclude_audience_ids: ::Array[String]? - - attr_accessor genders: ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::gender]? - - attr_accessor include_audience_ids: ::Array[String]? - - attr_accessor interest_ids: ::Array[String]? - - attr_accessor languages: ::Array[String]? - - attr_accessor placement_type: WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::placement_type? - - def initialize: ( - ?age_max: Integer?, - ?age_min: Integer?, - ?countries: ::Array[String]?, - ?device_platforms: ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::device_platform]?, - ?exclude_audience_ids: ::Array[String]?, - ?genders: ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::gender]?, - ?include_audience_ids: ::Array[String]?, - ?interest_ids: ::Array[String]?, - ?languages: ::Array[String]?, - ?placement_type: WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::placement_type? - ) -> void - - def to_hash: -> { - age_max: Integer?, - age_min: Integer?, - countries: ::Array[String]?, - device_platforms: ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::device_platform]?, - exclude_audience_ids: ::Array[String]?, - genders: ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::gender]?, - include_audience_ids: ::Array[String]?, - interest_ids: ::Array[String]?, - languages: ::Array[String]?, - placement_type: WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::placement_type? - } - - type device_platform = :mobile | :desktop - - module DevicePlatform - extend WhopSDK::Internal::Type::Enum - - MOBILE: :mobile - DESKTOP: :desktop - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::device_platform] - end - - type gender = :male | :female | :all - - module Gender - extend WhopSDK::Internal::Type::Enum - - MALE: :male - FEMALE: :female - ALL: :all - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::gender] - end - - type placement_type = :automatic | :manual - - module PlacementType - extend WhopSDK::Internal::Type::Enum - - AUTOMATIC: :automatic - MANUAL: :manual - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::Config::Targeting::placement_type] - end - end - end - - type platform_config = - { - meta: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta?, - tiktok: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok? - } - - class PlatformConfig < WhopSDK::Internal::Type::BaseModel - attr_accessor meta: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta? - - attr_accessor tiktok: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok? - - def initialize: ( - ?meta: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta?, - ?tiktok: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok? - ) -> void - - def to_hash: -> { - meta: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta?, - tiktok: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok? - } - - type meta = - { - android_devices: ::Array[String]?, - attribution_setting: String?, - attribution_spec: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec]?, - audience_network_positions: ::Array[String]?, - audience_type: String?, - bid_amount: Integer?, - bid_strategy: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::bid_strategy?, - billing_event: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::billing_event?, - brand_safety_content_filter_levels: ::Array[String]?, - budget_remaining: String?, - cost_per_result_goal: Float?, - created_time: String?, - daily_budget: Integer?, - daily_min_spend_target: String?, - daily_spend_cap: String?, - destination_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::destination_type?, - dsa_beneficiary: String?, - dsa_payor: String?, - end_time: String?, - excluded_geo_locations: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations?, - facebook_positions: ::Array[String]?, - frequency_control_count: Integer?, - frequency_control_days: Integer?, - frequency_control_type: String?, - geo_cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity]?, - geo_locations: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations?, - geo_regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion]?, - geo_zips: ::Array[String]?, - instagram_actor_id: String?, - instagram_positions: ::Array[String]?, - ios_devices: ::Array[String]?, - is_dynamic_creative: bool?, - lead_conversion_location: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::lead_conversion_location?, - lead_form_config: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig?, - lead_gen_form_id: String?, - lifetime_budget: Integer?, - lifetime_min_spend_target: String?, - lifetime_spend_cap: String?, - location_types: ::Array[String]?, - messenger_positions: ::Array[String]?, - optimization_goal: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::optimization_goal?, - page_id: String?, - pixel_id: String?, - promoted_object: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject?, - publisher_platforms: ::Array[String]?, - source_adset_id: String?, - start_time: String?, - status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::status?, - targeting_automation: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation?, - threads_positions: ::Array[String]?, - updated_time: String?, - user_device: ::Array[String]?, - user_os: ::Array[String]?, - whatsapp_phone_number: String?, - whatsapp_positions: ::Array[String]? - } - - class Meta < WhopSDK::Internal::Type::BaseModel - attr_accessor android_devices: ::Array[String]? - - attr_accessor attribution_setting: String? - - attr_accessor attribution_spec: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec]? - - attr_accessor audience_network_positions: ::Array[String]? - - attr_accessor audience_type: String? - - attr_accessor bid_amount: Integer? - - attr_accessor bid_strategy: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::bid_strategy? - - attr_accessor billing_event: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::billing_event? - - attr_accessor brand_safety_content_filter_levels: ::Array[String]? - - attr_accessor budget_remaining: String? - - attr_accessor cost_per_result_goal: Float? - - attr_accessor created_time: String? - - attr_accessor daily_budget: Integer? - - attr_accessor daily_min_spend_target: String? - - attr_accessor daily_spend_cap: String? - - attr_accessor destination_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::destination_type? - - attr_accessor dsa_beneficiary: String? - - attr_accessor dsa_payor: String? - - attr_accessor end_time: String? - - attr_accessor excluded_geo_locations: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations? - - attr_accessor facebook_positions: ::Array[String]? - - attr_accessor frequency_control_count: Integer? - - attr_accessor frequency_control_days: Integer? - - attr_accessor frequency_control_type: String? - - attr_accessor geo_cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity]? - - attr_accessor geo_locations: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations? - - attr_accessor geo_regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion]? - - attr_accessor geo_zips: ::Array[String]? - - attr_accessor instagram_actor_id: String? - - attr_accessor instagram_positions: ::Array[String]? - - attr_accessor ios_devices: ::Array[String]? - - attr_accessor is_dynamic_creative: bool? - - attr_accessor lead_conversion_location: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::lead_conversion_location? - - attr_accessor lead_form_config: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig? - - attr_accessor lead_gen_form_id: String? - - attr_accessor lifetime_budget: Integer? - - attr_accessor lifetime_min_spend_target: String? - - attr_accessor lifetime_spend_cap: String? - - attr_accessor location_types: ::Array[String]? - - attr_accessor messenger_positions: ::Array[String]? - - attr_accessor optimization_goal: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::optimization_goal? - - attr_accessor page_id: String? - - attr_accessor pixel_id: String? - - attr_accessor promoted_object: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject? - - attr_accessor publisher_platforms: ::Array[String]? - - attr_accessor source_adset_id: String? - - attr_accessor start_time: String? - - attr_accessor status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::status? - - attr_accessor targeting_automation: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation? - - attr_accessor threads_positions: ::Array[String]? - - attr_accessor updated_time: String? - - attr_accessor user_device: ::Array[String]? - - attr_accessor user_os: ::Array[String]? - - attr_accessor whatsapp_phone_number: String? - - attr_accessor whatsapp_positions: ::Array[String]? - - def initialize: ( - ?android_devices: ::Array[String]?, - ?attribution_setting: String?, - ?attribution_spec: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec]?, - ?audience_network_positions: ::Array[String]?, - ?audience_type: String?, - ?bid_amount: Integer?, - ?bid_strategy: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::bid_strategy?, - ?billing_event: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::billing_event?, - ?brand_safety_content_filter_levels: ::Array[String]?, - ?budget_remaining: String?, - ?cost_per_result_goal: Float?, - ?created_time: String?, - ?daily_budget: Integer?, - ?daily_min_spend_target: String?, - ?daily_spend_cap: String?, - ?destination_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::destination_type?, - ?dsa_beneficiary: String?, - ?dsa_payor: String?, - ?end_time: String?, - ?excluded_geo_locations: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations?, - ?facebook_positions: ::Array[String]?, - ?frequency_control_count: Integer?, - ?frequency_control_days: Integer?, - ?frequency_control_type: String?, - ?geo_cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity]?, - ?geo_locations: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations?, - ?geo_regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion]?, - ?geo_zips: ::Array[String]?, - ?instagram_actor_id: String?, - ?instagram_positions: ::Array[String]?, - ?ios_devices: ::Array[String]?, - ?is_dynamic_creative: bool?, - ?lead_conversion_location: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::lead_conversion_location?, - ?lead_form_config: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig?, - ?lead_gen_form_id: String?, - ?lifetime_budget: Integer?, - ?lifetime_min_spend_target: String?, - ?lifetime_spend_cap: String?, - ?location_types: ::Array[String]?, - ?messenger_positions: ::Array[String]?, - ?optimization_goal: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::optimization_goal?, - ?page_id: String?, - ?pixel_id: String?, - ?promoted_object: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject?, - ?publisher_platforms: ::Array[String]?, - ?source_adset_id: String?, - ?start_time: String?, - ?status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::status?, - ?targeting_automation: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation?, - ?threads_positions: ::Array[String]?, - ?updated_time: String?, - ?user_device: ::Array[String]?, - ?user_os: ::Array[String]?, - ?whatsapp_phone_number: String?, - ?whatsapp_positions: ::Array[String]? - ) -> void - - def to_hash: -> { - android_devices: ::Array[String]?, - attribution_setting: String?, - attribution_spec: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::AttributionSpec]?, - audience_network_positions: ::Array[String]?, - audience_type: String?, - bid_amount: Integer?, - bid_strategy: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::bid_strategy?, - billing_event: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::billing_event?, - brand_safety_content_filter_levels: ::Array[String]?, - budget_remaining: String?, - cost_per_result_goal: Float?, - created_time: String?, - daily_budget: Integer?, - daily_min_spend_target: String?, - daily_spend_cap: String?, - destination_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::destination_type?, - dsa_beneficiary: String?, - dsa_payor: String?, - end_time: String?, - excluded_geo_locations: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations?, - facebook_positions: ::Array[String]?, - frequency_control_count: Integer?, - frequency_control_days: Integer?, - frequency_control_type: String?, - geo_cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoCity]?, - geo_locations: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations?, - geo_regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoRegion]?, - geo_zips: ::Array[String]?, - instagram_actor_id: String?, - instagram_positions: ::Array[String]?, - ios_devices: ::Array[String]?, - is_dynamic_creative: bool?, - lead_conversion_location: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::lead_conversion_location?, - lead_form_config: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig?, - lead_gen_form_id: String?, - lifetime_budget: Integer?, - lifetime_min_spend_target: String?, - lifetime_spend_cap: String?, - location_types: ::Array[String]?, - messenger_positions: ::Array[String]?, - optimization_goal: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::optimization_goal?, - page_id: String?, - pixel_id: String?, - promoted_object: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::PromotedObject?, - publisher_platforms: ::Array[String]?, - source_adset_id: String?, - start_time: String?, - status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::status?, - targeting_automation: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::TargetingAutomation?, - threads_positions: ::Array[String]?, - updated_time: String?, - user_device: ::Array[String]?, - user_os: ::Array[String]?, - whatsapp_phone_number: String?, - whatsapp_positions: ::Array[String]? - } - - type attribution_spec = { event_type: String, window_days: Integer } - - class AttributionSpec < WhopSDK::Internal::Type::BaseModel - attr_accessor event_type: String - - attr_accessor window_days: Integer - - def initialize: (event_type: String, window_days: Integer) -> void - - def to_hash: -> { event_type: String, window_days: Integer } - end - - type bid_strategy = - :LOWEST_COST_WITHOUT_CAP - | :LOWEST_COST_WITH_BID_CAP - | :COST_CAP - | :LOWEST_COST_WITH_MIN_ROAS - - module BidStrategy - extend WhopSDK::Internal::Type::Enum - - LOWEST_COST_WITHOUT_CAP: :LOWEST_COST_WITHOUT_CAP - LOWEST_COST_WITH_BID_CAP: :LOWEST_COST_WITH_BID_CAP - COST_CAP: :COST_CAP - LOWEST_COST_WITH_MIN_ROAS: :LOWEST_COST_WITH_MIN_ROAS - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::bid_strategy] - end - - type billing_event = - :APP_INSTALLS - | :CLICKS - | :IMPRESSIONS - | :LINK_CLICKS - | :NONE - | :OFFER_CLAIMS - | :PAGE_LIKES - | :POST_ENGAGEMENT - | :THRUPLAY - | :PURCHASE - | :LISTING_INTERACTION - - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - APP_INSTALLS: :APP_INSTALLS - CLICKS: :CLICKS - IMPRESSIONS: :IMPRESSIONS - LINK_CLICKS: :LINK_CLICKS - NONE: :NONE - OFFER_CLAIMS: :OFFER_CLAIMS - PAGE_LIKES: :PAGE_LIKES - POST_ENGAGEMENT: :POST_ENGAGEMENT - THRUPLAY: :THRUPLAY - PURCHASE: :PURCHASE - LISTING_INTERACTION: :LISTING_INTERACTION - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::billing_event] - end - - type destination_type = - :UNDEFINED - | :WEBSITE - | :APP - | :FACEBOOK - | :MESSENGER - | :WHATSAPP - | :INSTAGRAM_DIRECT - | :INSTAGRAM_PROFILE - | :PHONE_CALL - | :SHOP_AUTOMATIC - | :APPLINKS_AUTOMATIC - | :ON_AD - | :ON_POST - | :ON_VIDEO - | :ON_PAGE - | :ON_EVENT - | :MESSAGING_MESSENGER_WHATSAPP - | :MESSAGING_INSTAGRAM_DIRECT_MESSENGER - | :MESSAGING_INSTAGRAM_DIRECT_WHATSAPP - | :MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP - | :INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE - | :FACEBOOK_PAGE - | :INSTAGRAM_LIVE - | :FACEBOOK_LIVE - | :IMAGINE - | :LEAD_FROM_IG_DIRECT - | :LEAD_FROM_MESSENGER - | :LEAD_FORM_MESSENGER - | :WEBSITE_AND_LEAD_FORM - | :WEBSITE_AND_PHONE_CALL - | :BROADCAST_CHANNEL - - module DestinationType - extend WhopSDK::Internal::Type::Enum - - UNDEFINED: :UNDEFINED - WEBSITE: :WEBSITE - APP: :APP - FACEBOOK: :FACEBOOK - MESSENGER: :MESSENGER - WHATSAPP: :WHATSAPP - INSTAGRAM_DIRECT: :INSTAGRAM_DIRECT - INSTAGRAM_PROFILE: :INSTAGRAM_PROFILE - PHONE_CALL: :PHONE_CALL - SHOP_AUTOMATIC: :SHOP_AUTOMATIC - APPLINKS_AUTOMATIC: :APPLINKS_AUTOMATIC - ON_AD: :ON_AD - ON_POST: :ON_POST - ON_VIDEO: :ON_VIDEO - ON_PAGE: :ON_PAGE - ON_EVENT: :ON_EVENT - MESSAGING_MESSENGER_WHATSAPP: :MESSAGING_MESSENGER_WHATSAPP - MESSAGING_INSTAGRAM_DIRECT_MESSENGER: :MESSAGING_INSTAGRAM_DIRECT_MESSENGER - MESSAGING_INSTAGRAM_DIRECT_WHATSAPP: :MESSAGING_INSTAGRAM_DIRECT_WHATSAPP - MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP: :MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP - INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE: :INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE - FACEBOOK_PAGE: :FACEBOOK_PAGE - INSTAGRAM_LIVE: :INSTAGRAM_LIVE - FACEBOOK_LIVE: :FACEBOOK_LIVE - IMAGINE: :IMAGINE - LEAD_FROM_IG_DIRECT: :LEAD_FROM_IG_DIRECT - LEAD_FROM_MESSENGER: :LEAD_FROM_MESSENGER - LEAD_FORM_MESSENGER: :LEAD_FORM_MESSENGER - WEBSITE_AND_LEAD_FORM: :WEBSITE_AND_LEAD_FORM - WEBSITE_AND_PHONE_CALL: :WEBSITE_AND_PHONE_CALL - BROADCAST_CHANNEL: :BROADCAST_CHANNEL - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::destination_type] - end - - type excluded_geo_locations = - { - cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City]?, - countries: ::Array[String]?, - location_types: ::Array[String]?, - regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region]?, - zips: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip]? - } - - class ExcludedGeoLocations < WhopSDK::Internal::Type::BaseModel - attr_accessor cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City]? - - attr_accessor countries: ::Array[String]? - - attr_accessor location_types: ::Array[String]? - - attr_accessor regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region]? - - attr_accessor zips: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip]? - - def initialize: ( - ?cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City]?, - ?countries: ::Array[String]?, - ?location_types: ::Array[String]?, - ?regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region]?, - ?zips: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip]? - ) -> void - - def to_hash: -> { - cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::City]?, - countries: ::Array[String]?, - location_types: ::Array[String]?, - regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Region]?, - zips: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::ExcludedGeoLocations::Zip]? - } - - type city = - { key: String, country: String?, name: String?, radius: Integer? } - - class City < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor country: String? - - attr_accessor name: String? - - attr_accessor radius: Integer? - - def initialize: ( - key: String, - ?country: String?, - ?name: String?, - ?radius: Integer? - ) -> void - - def to_hash: -> { - key: String, - country: String?, - name: String?, - radius: Integer? - } - end - - type region = - { key: String, country: String?, name: String?, radius: Integer? } - - class Region < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor country: String? - - attr_accessor name: String? - - attr_accessor radius: Integer? - - def initialize: ( - key: String, - ?country: String?, - ?name: String?, - ?radius: Integer? - ) -> void - - def to_hash: -> { - key: String, - country: String?, - name: String?, - radius: Integer? - } - end - - type zip = - { key: String, country: String?, name: String?, radius: Integer? } - - class Zip < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor country: String? - - attr_accessor name: String? - - attr_accessor radius: Integer? - - def initialize: ( - key: String, - ?country: String?, - ?name: String?, - ?radius: Integer? - ) -> void - - def to_hash: -> { - key: String, - country: String?, - name: String?, - radius: Integer? - } - end - end - - type geo_city = - { key: String, country: String?, name: String?, radius: Integer? } - - class GeoCity < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor country: String? - - attr_accessor name: String? - - attr_accessor radius: Integer? - - def initialize: ( - key: String, - ?country: String?, - ?name: String?, - ?radius: Integer? - ) -> void - - def to_hash: -> { - key: String, - country: String?, - name: String?, - radius: Integer? - } - end - - type geo_locations = - { - cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City]?, - countries: ::Array[String]?, - location_types: ::Array[String]?, - regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region]?, - zips: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip]? - } - - class GeoLocations < WhopSDK::Internal::Type::BaseModel - attr_accessor cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City]? - - attr_accessor countries: ::Array[String]? - - attr_accessor location_types: ::Array[String]? - - attr_accessor regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region]? - - attr_accessor zips: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip]? - - def initialize: ( - ?cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City]?, - ?countries: ::Array[String]?, - ?location_types: ::Array[String]?, - ?regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region]?, - ?zips: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip]? - ) -> void - - def to_hash: -> { - cities: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::City]?, - countries: ::Array[String]?, - location_types: ::Array[String]?, - regions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Region]?, - zips: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::GeoLocations::Zip]? - } - - type city = - { key: String, country: String?, name: String?, radius: Integer? } - - class City < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor country: String? - - attr_accessor name: String? - - attr_accessor radius: Integer? - - def initialize: ( - key: String, - ?country: String?, - ?name: String?, - ?radius: Integer? - ) -> void - - def to_hash: -> { - key: String, - country: String?, - name: String?, - radius: Integer? - } - end - - type region = - { key: String, country: String?, name: String?, radius: Integer? } - - class Region < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor country: String? - - attr_accessor name: String? - - attr_accessor radius: Integer? - - def initialize: ( - key: String, - ?country: String?, - ?name: String?, - ?radius: Integer? - ) -> void - - def to_hash: -> { - key: String, - country: String?, - name: String?, - radius: Integer? - } - end - - type zip = - { key: String, country: String?, name: String?, radius: Integer? } - - class Zip < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor country: String? - - attr_accessor name: String? - - attr_accessor radius: Integer? - - def initialize: ( - key: String, - ?country: String?, - ?name: String?, - ?radius: Integer? - ) -> void - - def to_hash: -> { - key: String, - country: String?, - name: String?, - radius: Integer? - } - end - end - - type geo_region = - { key: String, country: String?, name: String?, radius: Integer? } - - class GeoRegion < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor country: String? - - attr_accessor name: String? - - attr_accessor radius: Integer? - - def initialize: ( - key: String, - ?country: String?, - ?name: String?, - ?radius: Integer? - ) -> void - - def to_hash: -> { - key: String, - country: String?, - name: String?, - radius: Integer? - } - end - - type lead_conversion_location = - :website - | :instant_forms - | :website_and_instant_forms - | :messenger - | :instagram - | :calls - | :app - - module LeadConversionLocation - extend WhopSDK::Internal::Type::Enum - - WEBSITE: :website - INSTANT_FORMS: :instant_forms - WEBSITE_AND_INSTANT_FORMS: :website_and_instant_forms - MESSENGER: :messenger - INSTAGRAM: :instagram - CALLS: :calls - APP: :app - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::lead_conversion_location] - end - - type lead_form_config = - { - name: String, - privacy_policy_url: String, - questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question], - background_image_source: String?, - background_image_url: String?, - conditional_logic_enabled: bool?, - context_card_button_text: String?, - context_card_content: ::Array[String]?, - context_card_style: String?, - context_card_title: String?, - custom_disclaimer_body: String?, - custom_disclaimer_checkboxes: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox]?, - custom_disclaimer_title: String?, - form_type: String?, - messenger_enabled: bool?, - phone_verification_enabled: bool?, - privacy_policy_link_text: String?, - question_page_custom_headline: String?, - rich_creative_headline: String?, - rich_creative_overview: String?, - rich_creative_url: String?, - thank_you_pages: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage]? - } - - class LeadFormConfig < WhopSDK::Internal::Type::BaseModel - attr_accessor name: String - - attr_accessor privacy_policy_url: String - - attr_accessor questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question] - - attr_accessor background_image_source: String? - - attr_accessor background_image_url: String? - - attr_accessor conditional_logic_enabled: bool? - - attr_accessor context_card_button_text: String? - - attr_accessor context_card_content: ::Array[String]? - - attr_accessor context_card_style: String? - - attr_accessor context_card_title: String? - - attr_accessor custom_disclaimer_body: String? - - attr_accessor custom_disclaimer_checkboxes: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox]? - - attr_accessor custom_disclaimer_title: String? - - attr_accessor form_type: String? - - attr_accessor messenger_enabled: bool? - - attr_accessor phone_verification_enabled: bool? - - attr_accessor privacy_policy_link_text: String? - - attr_accessor question_page_custom_headline: String? - - attr_accessor rich_creative_headline: String? - - attr_accessor rich_creative_overview: String? - - attr_accessor rich_creative_url: String? - - attr_accessor thank_you_pages: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage]? - - def initialize: ( - name: String, - privacy_policy_url: String, - questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question], - ?background_image_source: String?, - ?background_image_url: String?, - ?conditional_logic_enabled: bool?, - ?context_card_button_text: String?, - ?context_card_content: ::Array[String]?, - ?context_card_style: String?, - ?context_card_title: String?, - ?custom_disclaimer_body: String?, - ?custom_disclaimer_checkboxes: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox]?, - ?custom_disclaimer_title: String?, - ?form_type: String?, - ?messenger_enabled: bool?, - ?phone_verification_enabled: bool?, - ?privacy_policy_link_text: String?, - ?question_page_custom_headline: String?, - ?rich_creative_headline: String?, - ?rich_creative_overview: String?, - ?rich_creative_url: String?, - ?thank_you_pages: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage]? - ) -> void - - def to_hash: -> { - name: String, - privacy_policy_url: String, - questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question], - background_image_source: String?, - background_image_url: String?, - conditional_logic_enabled: bool?, - context_card_button_text: String?, - context_card_content: ::Array[String]?, - context_card_style: String?, - context_card_title: String?, - custom_disclaimer_body: String?, - custom_disclaimer_checkboxes: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::CustomDisclaimerCheckbox]?, - custom_disclaimer_title: String?, - form_type: String?, - messenger_enabled: bool?, - phone_verification_enabled: bool?, - privacy_policy_link_text: String?, - question_page_custom_headline: String?, - rich_creative_headline: String?, - rich_creative_overview: String?, - rich_creative_url: String?, - thank_you_pages: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::ThankYouPage]? - } - - type question = - { - type: String, - conditional_questions_group_id: String?, - dependent_conditional_questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion]?, - inline_context: String?, - key: String?, - label: String?, - options: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option]?, - question_format: String? - } - - class Question < WhopSDK::Internal::Type::BaseModel - attr_accessor type: String - - attr_accessor conditional_questions_group_id: String? - - attr_accessor dependent_conditional_questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion]? - - attr_accessor inline_context: String? - - attr_accessor key: String? - - attr_accessor label: String? - - attr_accessor options: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option]? - - attr_accessor question_format: String? - - def initialize: ( - type: String, - ?conditional_questions_group_id: String?, - ?dependent_conditional_questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion]?, - ?inline_context: String?, - ?key: String?, - ?label: String?, - ?options: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option]?, - ?question_format: String? - ) -> void - - def to_hash: -> { - type: String, - conditional_questions_group_id: String?, - dependent_conditional_questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion]?, - inline_context: String?, - key: String?, - label: String?, - options: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option]?, - question_format: String? - } - - type dependent_conditional_question = - { - type: String, - inline_context: String?, - key: String?, - label: String?, - options: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option]? - } - - class DependentConditionalQuestion < WhopSDK::Internal::Type::BaseModel - attr_accessor type: String - - attr_accessor inline_context: String? - - attr_accessor key: String? - - attr_accessor label: String? - - attr_accessor options: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option]? - - def initialize: ( - type: String, - ?inline_context: String?, - ?key: String?, - ?label: String?, - ?options: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option]? - ) -> void - - def to_hash: -> { - type: String, - inline_context: String?, - key: String?, - label: String?, - options: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option]? - } - - type option = - { - key: String, - value: String, - logic: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic? - } - - class Option < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor value: String - - attr_accessor logic: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic? - - def initialize: ( - key: String, - value: String, - ?logic: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic? - ) -> void - - def to_hash: -> { - key: String, - value: String, - logic: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::DependentConditionalQuestion::Option::Logic? - } - - type logic = - { - type: String, - target_end_page_index: Integer?, - target_question_index: Integer? - } - - class Logic < WhopSDK::Internal::Type::BaseModel - attr_accessor type: String - - attr_accessor target_end_page_index: Integer? - - attr_accessor target_question_index: Integer? - - def initialize: ( - type: String, - ?target_end_page_index: Integer?, - ?target_question_index: Integer? - ) -> void - - def to_hash: -> { - type: String, - target_end_page_index: Integer?, - target_question_index: Integer? - } - end - end - end - - type option = - { - key: String, - value: String, - logic: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic? - } - - class Option < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor value: String - - attr_accessor logic: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic? - - def initialize: ( - key: String, - value: String, - ?logic: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic? - ) -> void - - def to_hash: -> { - key: String, - value: String, - logic: WhopSDK::AdGroupUpdateParams::PlatformConfig::Meta::LeadFormConfig::Question::Option::Logic? - } - - type logic = - { - type: String, - target_end_page_index: Integer?, - target_question_index: Integer? - } - - class Logic < WhopSDK::Internal::Type::BaseModel - attr_accessor type: String - - attr_accessor target_end_page_index: Integer? - - attr_accessor target_question_index: Integer? - - def initialize: ( - type: String, - ?target_end_page_index: Integer?, - ?target_question_index: Integer? - ) -> void - - def to_hash: -> { - type: String, - target_end_page_index: Integer?, - target_question_index: Integer? - } - end - end - end - - type custom_disclaimer_checkbox = - { - key: String, - text: String, - is_checked_by_default: bool?, - is_required: bool? - } - - class CustomDisclaimerCheckbox < WhopSDK::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor text: String - - attr_accessor is_checked_by_default: bool? - - attr_accessor is_required: bool? - - def initialize: ( - key: String, - text: String, - ?is_checked_by_default: bool?, - ?is_required: bool? - ) -> void - - def to_hash: -> { - key: String, - text: String, - is_checked_by_default: bool?, - is_required: bool? - } - end - - type thank_you_page = - { - body: String?, - business_phone: String?, - button_text: String?, - button_type: String?, - conditional_question_group_id: String?, - enable_messenger: bool?, - gated_file_url: String?, - link: String?, - name: String?, - title: String? - } - - class ThankYouPage < WhopSDK::Internal::Type::BaseModel - attr_accessor body: String? - - attr_accessor business_phone: String? - - attr_accessor button_text: String? - - attr_accessor button_type: String? - - attr_accessor conditional_question_group_id: String? - - attr_accessor enable_messenger: bool? - - attr_accessor gated_file_url: String? - - attr_accessor link: String? - - attr_accessor name: String? - - attr_accessor title: String? - - def initialize: ( - ?body: String?, - ?business_phone: String?, - ?button_text: String?, - ?button_type: String?, - ?conditional_question_group_id: String?, - ?enable_messenger: bool?, - ?gated_file_url: String?, - ?link: String?, - ?name: String?, - ?title: String? - ) -> void - - def to_hash: -> { - body: String?, - business_phone: String?, - button_text: String?, - button_type: String?, - conditional_question_group_id: String?, - enable_messenger: bool?, - gated_file_url: String?, - link: String?, - name: String?, - title: String? - } - end - end - - type optimization_goal = - :NONE - | :APP_INSTALLS - | :AD_RECALL_LIFT - | :ENGAGED_USERS - | :EVENT_RESPONSES - | :IMPRESSIONS - | :LEAD_GENERATION - | :QUALITY_LEAD - | :LINK_CLICKS - | :OFFSITE_CONVERSIONS - | :PAGE_LIKES - | :POST_ENGAGEMENT - | :QUALITY_CALL - | :REACH - | :LANDING_PAGE_VIEWS - | :VISIT_INSTAGRAM_PROFILE - | :VALUE - | :THRUPLAY - | :DERIVED_EVENTS - | :APP_INSTALLS_AND_OFFSITE_CONVERSIONS - | :CONVERSATIONS - | :IN_APP_VALUE - | :MESSAGING_PURCHASE_CONVERSION - | :SUBSCRIBERS - | :REMINDERS_SET - | :MEANINGFUL_CALL_ATTEMPT - | :PROFILE_VISIT - | :PROFILE_AND_PAGE_ENGAGEMENT - | :TWO_SECOND_CONTINUOUS_VIDEO_VIEWS - | :ENGAGED_REACH - | :ENGAGED_PAGE_VIEWS - | :MESSAGING_DEEP_CONVERSATION_AND_FOLLOW - | :ADVERTISER_SILOED_VALUE - | :AUTOMATIC_OBJECTIVE - | :MESSAGING_APPOINTMENT_CONVERSION - - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum - - NONE: :NONE - APP_INSTALLS: :APP_INSTALLS - AD_RECALL_LIFT: :AD_RECALL_LIFT - ENGAGED_USERS: :ENGAGED_USERS - EVENT_RESPONSES: :EVENT_RESPONSES - IMPRESSIONS: :IMPRESSIONS - LEAD_GENERATION: :LEAD_GENERATION - QUALITY_LEAD: :QUALITY_LEAD - LINK_CLICKS: :LINK_CLICKS - OFFSITE_CONVERSIONS: :OFFSITE_CONVERSIONS - PAGE_LIKES: :PAGE_LIKES - POST_ENGAGEMENT: :POST_ENGAGEMENT - QUALITY_CALL: :QUALITY_CALL - REACH: :REACH - LANDING_PAGE_VIEWS: :LANDING_PAGE_VIEWS - VISIT_INSTAGRAM_PROFILE: :VISIT_INSTAGRAM_PROFILE - VALUE: :VALUE - THRUPLAY: :THRUPLAY - DERIVED_EVENTS: :DERIVED_EVENTS - APP_INSTALLS_AND_OFFSITE_CONVERSIONS: :APP_INSTALLS_AND_OFFSITE_CONVERSIONS - CONVERSATIONS: :CONVERSATIONS - IN_APP_VALUE: :IN_APP_VALUE - MESSAGING_PURCHASE_CONVERSION: :MESSAGING_PURCHASE_CONVERSION - SUBSCRIBERS: :SUBSCRIBERS - REMINDERS_SET: :REMINDERS_SET - MEANINGFUL_CALL_ATTEMPT: :MEANINGFUL_CALL_ATTEMPT - PROFILE_VISIT: :PROFILE_VISIT - PROFILE_AND_PAGE_ENGAGEMENT: :PROFILE_AND_PAGE_ENGAGEMENT - TWO_SECOND_CONTINUOUS_VIDEO_VIEWS: :TWO_SECOND_CONTINUOUS_VIDEO_VIEWS - ENGAGED_REACH: :ENGAGED_REACH - ENGAGED_PAGE_VIEWS: :ENGAGED_PAGE_VIEWS - MESSAGING_DEEP_CONVERSATION_AND_FOLLOW: :MESSAGING_DEEP_CONVERSATION_AND_FOLLOW - ADVERTISER_SILOED_VALUE: :ADVERTISER_SILOED_VALUE - AUTOMATIC_OBJECTIVE: :AUTOMATIC_OBJECTIVE - MESSAGING_APPOINTMENT_CONVERSION: :MESSAGING_APPOINTMENT_CONVERSION - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::optimization_goal] - end - - type promoted_object = - { - custom_conversion_id: String?, - custom_event_str: String?, - custom_event_type: String?, - page_id: String?, - pixel_id: String?, - whatsapp_phone_number: String? - } - - class PromotedObject < WhopSDK::Internal::Type::BaseModel - attr_accessor custom_conversion_id: String? - - attr_accessor custom_event_str: String? - - attr_accessor custom_event_type: String? - - attr_accessor page_id: String? - - attr_accessor pixel_id: String? - - attr_accessor whatsapp_phone_number: String? - - def initialize: ( - ?custom_conversion_id: String?, - ?custom_event_str: String?, - ?custom_event_type: String?, - ?page_id: String?, - ?pixel_id: String?, - ?whatsapp_phone_number: String? - ) -> void - - def to_hash: -> { - custom_conversion_id: String?, - custom_event_str: String?, - custom_event_type: String?, - page_id: String?, - pixel_id: String?, - whatsapp_phone_number: String? - } - end - - type status = :ACTIVE | :PAUSED - - module Status - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :ACTIVE - PAUSED: :PAUSED - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Meta::status] - end - - type targeting_automation = { advantage_audience: Integer? } - - class TargetingAutomation < WhopSDK::Internal::Type::BaseModel - attr_accessor advantage_audience: Integer? - - def initialize: (?advantage_audience: Integer?) -> void - - def to_hash: -> { advantage_audience: Integer? } - end - end - - type tiktok = - { - actions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action]?, - age_groups: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::age_group]?, - app_id: String?, - attribution_event_count: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::attribution_event_count?, - audience_ids: ::Array[String]?, - audience_rule: ::Hash[Symbol, top]?, - audience_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::audience_type?, - bid_price: Float?, - bid_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::bid_type?, - billing_event: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::billing_event?, - brand_safety_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::brand_safety_type?, - budget_mode: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::budget_mode?, - carrier_ids: ::Array[String]?, - category_exclusion_ids: ::Array[String]?, - click_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::click_attribution_window?, - comment_disabled: bool?, - contextual_tag_ids: ::Array[String]?, - conversion_bid_price: Float?, - creative_material_mode: String?, - dayparting: String?, - deep_funnel_event_source: String?, - deep_funnel_event_source_id: String?, - deep_funnel_optimization_status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::deep_funnel_optimization_status?, - device_model_ids: ::Array[String]?, - device_price_ranges: ::Array[String]?, - engaged_view_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::engaged_view_attribution_window?, - excluded_audience_ids: ::Array[String]?, - excluded_location_ids: ::Array[String]?, - frequency: Integer?, - frequency_schedule: Integer?, - gender: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::gender?, - identity_authorized_bc_id: String?, - identity_id: String?, - identity_type: String?, - instant_form_config: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig?, - instant_form_id: String?, - interest_category_ids: ::Array[String]?, - interest_keyword_ids: ::Array[String]?, - inventory_filter_enabled: bool?, - :ios14_targeting => WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ios14_targeting?, - isp_ids: ::Array[String]?, - languages: ::Array[String]?, - location_ids: ::Array[String]?, - min_android_version: String?, - min_ios_version: String?, - network_types: ::Array[String]?, - operating_systems: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operating_system]?, - operation_status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operation_status?, - optimization_event: String?, - optimization_goal: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::optimization_goal?, - pacing: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::pacing?, - pangle_audience_package_exclude_ids: ::Array[String]?, - pangle_audience_package_include_ids: ::Array[String]?, - pangle_block_app_ids: ::Array[String]?, - pixel_id: String?, - placement_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::placement_type?, - placements: ::Array[String]?, - product_set_id: String?, - product_source: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::product_source?, - promotion_type: String?, - schedule_end_time: String?, - schedule_start_time: String?, - schedule_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::schedule_type?, - secondary_optimization_event: String?, - shopping_ads_retargeting_actions_days: Integer?, - shopping_ads_retargeting_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::shopping_ads_retargeting_type?, - spending_power: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::spending_power?, - tiktok_subplacements: ::Array[String]?, - vertical_sensitivity_id: String?, - video_download_disabled: bool?, - video_user_actions: ::Array[String]?, - view_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::view_attribution_window? - } - - class Tiktok < WhopSDK::Internal::Type::BaseModel - attr_accessor actions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action]? - - attr_accessor age_groups: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::age_group]? - - attr_accessor app_id: String? - - attr_accessor attribution_event_count: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::attribution_event_count? - - attr_accessor audience_ids: ::Array[String]? - - attr_accessor audience_rule: ::Hash[Symbol, top]? - - attr_accessor audience_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::audience_type? - - attr_accessor bid_price: Float? + attr_accessor conversion_event: WhopSDK::Models::AdGroupUpdateParams::conversion_event? - attr_accessor bid_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::bid_type? + attr_reader conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location? - attr_accessor billing_event: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::billing_event? + def conversion_location=: ( + WhopSDK::Models::AdGroupUpdateParams::conversion_location + ) -> WhopSDK::Models::AdGroupUpdateParams::conversion_location - attr_accessor brand_safety_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::brand_safety_type? + attr_reader demographics: top? - attr_accessor budget_mode: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::budget_mode? + def demographics=: (top) -> top - attr_accessor carrier_ids: ::Array[String]? + attr_reader desired_cost_per_result: Float? - attr_accessor category_exclusion_ids: ::Array[String]? + def desired_cost_per_result=: (Float) -> Float - attr_accessor click_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::click_attribution_window? + attr_reader devices: top? - attr_accessor comment_disabled: bool? + def devices=: (top) -> top - attr_accessor contextual_tag_ids: ::Array[String]? + attr_reader ends_at: String? - attr_accessor conversion_bid_price: Float? + def ends_at=: (String) -> String - attr_accessor creative_material_mode: String? + attr_reader frequency_cap: top? - attr_accessor dayparting: String? + def frequency_cap=: (top) -> top - attr_accessor deep_funnel_event_source: String? + attr_reader languages: ::Array[String]? - attr_accessor deep_funnel_event_source_id: String? + def languages=: (::Array[String]) -> ::Array[String] - attr_accessor deep_funnel_optimization_status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::deep_funnel_optimization_status? + attr_reader message_apps: ::Array[WhopSDK::Models::AdGroupUpdateParams::message_app]? - attr_accessor device_model_ids: ::Array[String]? + def message_apps=: ( + ::Array[WhopSDK::Models::AdGroupUpdateParams::message_app] + ) -> ::Array[WhopSDK::Models::AdGroupUpdateParams::message_app] - attr_accessor device_price_ranges: ::Array[String]? + attr_reader minimum_daily_spend: Float? - attr_accessor engaged_view_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::engaged_view_attribution_window? + def minimum_daily_spend=: (Float) -> Float - attr_accessor excluded_audience_ids: ::Array[String]? + attr_reader optimization_goal: String? - attr_accessor excluded_location_ids: ::Array[String]? + def optimization_goal=: (String) -> String - attr_accessor frequency: Integer? + attr_reader placements: top? - attr_accessor frequency_schedule: Integer? + def placements=: (top) -> top - attr_accessor gender: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::gender? + attr_reader regions: top? - attr_accessor identity_authorized_bc_id: String? + def regions=: (top) -> top - attr_accessor identity_id: String? + attr_reader starts_at: String? - attr_accessor identity_type: String? + def starts_at=: (String) -> String - attr_accessor instant_form_config: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig? + attr_reader status: WhopSDK::Models::AdGroupUpdateParams::status? - attr_accessor instant_form_id: String? + def status=: ( + WhopSDK::Models::AdGroupUpdateParams::status + ) -> WhopSDK::Models::AdGroupUpdateParams::status - attr_accessor interest_category_ids: ::Array[String]? + attr_reader title: String? - attr_accessor interest_keyword_ids: ::Array[String]? + def title=: (String) -> String - attr_accessor inventory_filter_enabled: bool? - - attr_accessor ios14_targeting: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ios14_targeting? - - attr_accessor isp_ids: ::Array[String]? - - attr_accessor languages: ::Array[String]? - - attr_accessor location_ids: ::Array[String]? - - attr_accessor min_android_version: String? - - attr_accessor min_ios_version: String? - - attr_accessor network_types: ::Array[String]? - - attr_accessor operating_systems: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operating_system]? - - attr_accessor operation_status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operation_status? - - attr_accessor optimization_event: String? - - attr_accessor optimization_goal: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::optimization_goal? - - attr_accessor pacing: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::pacing? - - attr_accessor pangle_audience_package_exclude_ids: ::Array[String]? - - attr_accessor pangle_audience_package_include_ids: ::Array[String]? - - attr_accessor pangle_block_app_ids: ::Array[String]? - - attr_accessor pixel_id: String? - - attr_accessor placement_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::placement_type? - - attr_accessor placements: ::Array[String]? - - attr_accessor product_set_id: String? - - attr_accessor product_source: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::product_source? - - attr_accessor promotion_type: String? - - attr_accessor schedule_end_time: String? - - attr_accessor schedule_start_time: String? - - attr_accessor schedule_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::schedule_type? - - attr_accessor secondary_optimization_event: String? - - attr_accessor shopping_ads_retargeting_actions_days: Integer? - - attr_accessor shopping_ads_retargeting_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::shopping_ads_retargeting_type? - - attr_accessor spending_power: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::spending_power? - - attr_accessor tiktok_subplacements: ::Array[String]? - - attr_accessor vertical_sensitivity_id: String? - - attr_accessor video_download_disabled: bool? - - attr_accessor video_user_actions: ::Array[String]? - - attr_accessor view_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::view_attribution_window? - - def initialize: ( - ?actions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action]?, - ?age_groups: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::age_group]?, - ?app_id: String?, - ?attribution_event_count: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::attribution_event_count?, - ?audience_ids: ::Array[String]?, - ?audience_rule: ::Hash[Symbol, top]?, - ?audience_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::audience_type?, - ?bid_price: Float?, - ?bid_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::bid_type?, - ?billing_event: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::billing_event?, - ?brand_safety_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::brand_safety_type?, - ?budget_mode: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::budget_mode?, - ?carrier_ids: ::Array[String]?, - ?category_exclusion_ids: ::Array[String]?, - ?click_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::click_attribution_window?, - ?comment_disabled: bool?, - ?contextual_tag_ids: ::Array[String]?, - ?conversion_bid_price: Float?, - ?creative_material_mode: String?, - ?dayparting: String?, - ?deep_funnel_event_source: String?, - ?deep_funnel_event_source_id: String?, - ?deep_funnel_optimization_status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::deep_funnel_optimization_status?, - ?device_model_ids: ::Array[String]?, - ?device_price_ranges: ::Array[String]?, - ?engaged_view_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::engaged_view_attribution_window?, - ?excluded_audience_ids: ::Array[String]?, - ?excluded_location_ids: ::Array[String]?, - ?frequency: Integer?, - ?frequency_schedule: Integer?, - ?gender: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::gender?, - ?identity_authorized_bc_id: String?, - ?identity_id: String?, - ?identity_type: String?, - ?instant_form_config: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig?, - ?instant_form_id: String?, - ?interest_category_ids: ::Array[String]?, - ?interest_keyword_ids: ::Array[String]?, - ?inventory_filter_enabled: bool?, - ?ios14_targeting: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ios14_targeting?, - ?isp_ids: ::Array[String]?, - ?languages: ::Array[String]?, - ?location_ids: ::Array[String]?, - ?min_android_version: String?, - ?min_ios_version: String?, - ?network_types: ::Array[String]?, - ?operating_systems: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operating_system]?, - ?operation_status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operation_status?, - ?optimization_event: String?, - ?optimization_goal: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::optimization_goal?, - ?pacing: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::pacing?, - ?pangle_audience_package_exclude_ids: ::Array[String]?, - ?pangle_audience_package_include_ids: ::Array[String]?, - ?pangle_block_app_ids: ::Array[String]?, - ?pixel_id: String?, - ?placement_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::placement_type?, - ?placements: ::Array[String]?, - ?product_set_id: String?, - ?product_source: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::product_source?, - ?promotion_type: String?, - ?schedule_end_time: String?, - ?schedule_start_time: String?, - ?schedule_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::schedule_type?, - ?secondary_optimization_event: String?, - ?shopping_ads_retargeting_actions_days: Integer?, - ?shopping_ads_retargeting_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::shopping_ads_retargeting_type?, - ?spending_power: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::spending_power?, - ?tiktok_subplacements: ::Array[String]?, - ?vertical_sensitivity_id: String?, - ?video_download_disabled: bool?, - ?video_user_actions: ::Array[String]?, - ?view_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::view_attribution_window? - ) -> void - - def to_hash: -> { - actions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::Action]?, - age_groups: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::age_group]?, - app_id: String?, - attribution_event_count: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::attribution_event_count?, - audience_ids: ::Array[String]?, - audience_rule: ::Hash[Symbol, top]?, - audience_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::audience_type?, - bid_price: Float?, - bid_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::bid_type?, - billing_event: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::billing_event?, - brand_safety_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::brand_safety_type?, - budget_mode: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::budget_mode?, - carrier_ids: ::Array[String]?, - category_exclusion_ids: ::Array[String]?, - click_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::click_attribution_window?, - comment_disabled: bool?, - contextual_tag_ids: ::Array[String]?, - conversion_bid_price: Float?, - creative_material_mode: String?, - dayparting: String?, - deep_funnel_event_source: String?, - deep_funnel_event_source_id: String?, - deep_funnel_optimization_status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::deep_funnel_optimization_status?, - device_model_ids: ::Array[String]?, - device_price_ranges: ::Array[String]?, - engaged_view_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::engaged_view_attribution_window?, - excluded_audience_ids: ::Array[String]?, - excluded_location_ids: ::Array[String]?, - frequency: Integer?, - frequency_schedule: Integer?, - gender: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::gender?, - identity_authorized_bc_id: String?, - identity_id: String?, - identity_type: String?, - instant_form_config: WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig?, - instant_form_id: String?, - interest_category_ids: ::Array[String]?, - interest_keyword_ids: ::Array[String]?, - inventory_filter_enabled: bool?, - :ios14_targeting => WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ios14_targeting?, - isp_ids: ::Array[String]?, - languages: ::Array[String]?, - location_ids: ::Array[String]?, - min_android_version: String?, - min_ios_version: String?, - network_types: ::Array[String]?, - operating_systems: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operating_system]?, - operation_status: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operation_status?, - optimization_event: String?, - optimization_goal: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::optimization_goal?, - pacing: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::pacing?, - pangle_audience_package_exclude_ids: ::Array[String]?, - pangle_audience_package_include_ids: ::Array[String]?, - pangle_block_app_ids: ::Array[String]?, - pixel_id: String?, - placement_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::placement_type?, - placements: ::Array[String]?, - product_set_id: String?, - product_source: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::product_source?, - promotion_type: String?, - schedule_end_time: String?, - schedule_start_time: String?, - schedule_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::schedule_type?, - secondary_optimization_event: String?, - shopping_ads_retargeting_actions_days: Integer?, - shopping_ads_retargeting_type: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::shopping_ads_retargeting_type?, - spending_power: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::spending_power?, - tiktok_subplacements: ::Array[String]?, - vertical_sensitivity_id: String?, - video_download_disabled: bool?, - video_user_actions: ::Array[String]?, - view_attribution_window: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::view_attribution_window? - } - - type action = - { - action_category_ids: ::Array[String]?, - action_period: Integer?, - action_scene: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::action_scene?, - video_user_actions: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::video_user_action]? - } - - class Action < WhopSDK::Internal::Type::BaseModel - attr_accessor action_category_ids: ::Array[String]? - - attr_accessor action_period: Integer? - - attr_accessor action_scene: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::action_scene? - - attr_accessor video_user_actions: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::video_user_action]? - - def initialize: ( - ?action_category_ids: ::Array[String]?, - ?action_period: Integer?, - ?action_scene: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::action_scene?, - ?video_user_actions: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::video_user_action]? - ) -> void - - def to_hash: -> { - action_category_ids: ::Array[String]?, - action_period: Integer?, - action_scene: WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::action_scene?, - video_user_actions: ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::video_user_action]? - } - - type action_scene = - :VIDEO_RELATED - | :CREATOR_RELATED - | :HASHTAG_RELATED - | :LIVE_RELATED - - module ActionScene - extend WhopSDK::Internal::Type::Enum - - VIDEO_RELATED: :VIDEO_RELATED - CREATOR_RELATED: :CREATOR_RELATED - HASHTAG_RELATED: :HASHTAG_RELATED - LIVE_RELATED: :LIVE_RELATED - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::action_scene] - end - - type video_user_action = - :WATCHED_TO_END - | :LIKED - | :COMMENTED - | :SHARED - | :FOLLOWED - | :PROFILE_VISITED - - module VideoUserAction - extend WhopSDK::Internal::Type::Enum - - WATCHED_TO_END: :WATCHED_TO_END - LIKED: :LIKED - COMMENTED: :COMMENTED - SHARED: :SHARED - FOLLOWED: :FOLLOWED - PROFILE_VISITED: :PROFILE_VISITED - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::Action::video_user_action] - end - end - - type age_group = - :AGE_13_17 - | :AGE_18_24 - | :AGE_25_34 - | :AGE_35_44 - | :AGE_45_54 - | :AGE_55_100 - - module AgeGroup - extend WhopSDK::Internal::Type::Enum - - AGE_13_17: :AGE_13_17 - AGE_18_24: :AGE_18_24 - AGE_25_34: :AGE_25_34 - AGE_35_44: :AGE_35_44 - AGE_45_54: :AGE_45_54 - AGE_55_100: :AGE_55_100 - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::age_group] - end - - type attribution_event_count = :UNSET | :EVERY | :ONCE - - module AttributionEventCount - extend WhopSDK::Internal::Type::Enum - - UNSET: :UNSET - EVERY: :EVERY - ONCE: :ONCE - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::attribution_event_count] - end - - type audience_type = :NORMAL | :SMART_INTERESTS_BEHAVIORS - - module AudienceType - extend WhopSDK::Internal::Type::Enum - - NORMAL: :NORMAL - SMART_INTERESTS_BEHAVIORS: :SMART_INTERESTS_BEHAVIORS - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::audience_type] - end - - type bid_type = :BID_TYPE_NO_BID | :BID_TYPE_CUSTOM - - module BidType - extend WhopSDK::Internal::Type::Enum - - BID_TYPE_NO_BID: :BID_TYPE_NO_BID - BID_TYPE_CUSTOM: :BID_TYPE_CUSTOM - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::bid_type] - end - - type billing_event = :CPC | :CPM | :OCPM | :CPV - - module BillingEvent - extend WhopSDK::Internal::Type::Enum - - CPC: :CPC - CPM: :CPM - OCPM: :OCPM - CPV: :CPV - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::billing_event] - end - - type brand_safety_type = - :NO_BRAND_SAFETY - | :STANDARD_INVENTORY - | :LIMITED_INVENTORY - | :FULL_INVENTORY - | :EXPANDED_INVENTORY - - module BrandSafetyType - extend WhopSDK::Internal::Type::Enum - - NO_BRAND_SAFETY: :NO_BRAND_SAFETY - STANDARD_INVENTORY: :STANDARD_INVENTORY - LIMITED_INVENTORY: :LIMITED_INVENTORY - FULL_INVENTORY: :FULL_INVENTORY - EXPANDED_INVENTORY: :EXPANDED_INVENTORY - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::brand_safety_type] - end - - type budget_mode = - :BUDGET_MODE_DAY - | :BUDGET_MODE_TOTAL - | :BUDGET_MODE_DYNAMIC_DAILY_BUDGET - - module BudgetMode - extend WhopSDK::Internal::Type::Enum - - BUDGET_MODE_DAY: :BUDGET_MODE_DAY - BUDGET_MODE_TOTAL: :BUDGET_MODE_TOTAL - BUDGET_MODE_DYNAMIC_DAILY_BUDGET: :BUDGET_MODE_DYNAMIC_DAILY_BUDGET - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::budget_mode] - end - - type click_attribution_window = - :OFF | :ONE_DAY | :SEVEN_DAYS | :FOURTEEN_DAYS | :TWENTY_EIGHT_DAYS - - module ClickAttributionWindow - extend WhopSDK::Internal::Type::Enum - - OFF: :OFF - ONE_DAY: :ONE_DAY - SEVEN_DAYS: :SEVEN_DAYS - FOURTEEN_DAYS: :FOURTEEN_DAYS - TWENTY_EIGHT_DAYS: :TWENTY_EIGHT_DAYS - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::click_attribution_window] - end - - type deep_funnel_optimization_status = :ON | :OFF - - module DeepFunnelOptimizationStatus - extend WhopSDK::Internal::Type::Enum - - ON: :ON - OFF: :OFF - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::deep_funnel_optimization_status] - end - - type engaged_view_attribution_window = :OFF | :ONE_DAY | :SEVEN_DAYS - - module EngagedViewAttributionWindow - extend WhopSDK::Internal::Type::Enum - - OFF: :OFF - ONE_DAY: :ONE_DAY - SEVEN_DAYS: :SEVEN_DAYS - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::engaged_view_attribution_window] - end - - type gender = :GENDER_UNLIMITED | :GENDER_MALE | :GENDER_FEMALE - - module Gender - extend WhopSDK::Internal::Type::Enum - - GENDER_UNLIMITED: :GENDER_UNLIMITED - GENDER_MALE: :GENDER_MALE - GENDER_FEMALE: :GENDER_FEMALE - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::gender] - end - - type instant_form_config = - { - privacy_policy_url: String, - questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question], - button_text: String?, - greeting: String?, - name: String? - } - - class InstantFormConfig < WhopSDK::Internal::Type::BaseModel - attr_accessor privacy_policy_url: String - - attr_accessor questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question] - - attr_accessor button_text: String? - - attr_accessor greeting: String? - - attr_accessor name: String? - - def initialize: ( - privacy_policy_url: String, - questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question], - ?button_text: String?, - ?greeting: String?, - ?name: String? - ) -> void - - def to_hash: -> { - privacy_policy_url: String, - questions: ::Array[WhopSDK::AdGroupUpdateParams::PlatformConfig::Tiktok::InstantFormConfig::Question], - button_text: String?, - greeting: String?, - name: String? - } - - type question = { field_type: String, label: String? } - - class Question < WhopSDK::Internal::Type::BaseModel - attr_accessor field_type: String - - attr_accessor label: String? - - def initialize: (field_type: String, ?label: String?) -> void - - def to_hash: -> { field_type: String, label: String? } - end - end - - type ios14_targeting = :UNSET | :IOS14_MINUS | :IOS14_PLUS | :ALL - - module Ios14Targeting - extend WhopSDK::Internal::Type::Enum - - UNSET: :UNSET - IOS14_MINUS: :IOS14_MINUS - IOS14_PLUS: :IOS14_PLUS - ALL: :ALL - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::ios14_targeting] - end - - type operating_system = :ANDROID | :IOS - - module OperatingSystem - extend WhopSDK::Internal::Type::Enum - - ANDROID: :ANDROID - IOS: :IOS - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operating_system] - end - - type operation_status = :ENABLE | :DISABLE - - module OperationStatus - extend WhopSDK::Internal::Type::Enum - - ENABLE: :ENABLE - DISABLE: :DISABLE - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::operation_status] - end - - type optimization_goal = - :CLICK - | :CONVERT - | :INSTALL - | :IN_APP_EVENT - | :REACH - | :SHOW - | :VIDEO_VIEW - | :ENGAGED_VIEW - | :ENGAGED_VIEW_FIFTEEN - | :LEAD_GENERATION - | :PREFERRED_LEAD - | :CONVERSATION - | :FOLLOWERS - | :PROFILE_VIEWS - | :PAGE_VISIT - | :VALUE - | :AUTOMATIC_VALUE_OPTIMIZATION - | :TRAFFIC_LANDING_PAGE_VIEW - | :DESTINATION_VISIT - | :MT_LIVE_ROOM - | :PRODUCT_CLICK_IN_LIVE - - module OptimizationGoal - extend WhopSDK::Internal::Type::Enum - - CLICK: :CLICK - CONVERT: :CONVERT - INSTALL: :INSTALL - IN_APP_EVENT: :IN_APP_EVENT - REACH: :REACH - SHOW: :SHOW - VIDEO_VIEW: :VIDEO_VIEW - ENGAGED_VIEW: :ENGAGED_VIEW - ENGAGED_VIEW_FIFTEEN: :ENGAGED_VIEW_FIFTEEN - LEAD_GENERATION: :LEAD_GENERATION - PREFERRED_LEAD: :PREFERRED_LEAD - CONVERSATION: :CONVERSATION - FOLLOWERS: :FOLLOWERS - PROFILE_VIEWS: :PROFILE_VIEWS - PAGE_VISIT: :PAGE_VISIT - VALUE: :VALUE - AUTOMATIC_VALUE_OPTIMIZATION: :AUTOMATIC_VALUE_OPTIMIZATION - TRAFFIC_LANDING_PAGE_VIEW: :TRAFFIC_LANDING_PAGE_VIEW - DESTINATION_VISIT: :DESTINATION_VISIT - MT_LIVE_ROOM: :MT_LIVE_ROOM - PRODUCT_CLICK_IN_LIVE: :PRODUCT_CLICK_IN_LIVE - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::optimization_goal] - end - - type pacing = :PACING_MODE_SMOOTH | :PACING_MODE_FAST - - module Pacing - extend WhopSDK::Internal::Type::Enum - - PACING_MODE_SMOOTH: :PACING_MODE_SMOOTH - PACING_MODE_FAST: :PACING_MODE_FAST + def initialize: ( + id: String, + ?audiences: top, + ?bid_type: WhopSDK::Models::AdGroupUpdateParams::bid_type, + ?budget_amount: Float, + ?budget_type: WhopSDK::Models::AdGroupUpdateParams::budget_type, + ?conversion_event: WhopSDK::Models::AdGroupUpdateParams::conversion_event?, + ?conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location, + ?demographics: top, + ?desired_cost_per_result: Float, + ?devices: top, + ?ends_at: String, + ?frequency_cap: top, + ?languages: ::Array[String], + ?message_apps: ::Array[WhopSDK::Models::AdGroupUpdateParams::message_app], + ?minimum_daily_spend: Float, + ?optimization_goal: String, + ?placements: top, + ?regions: top, + ?starts_at: String, + ?status: WhopSDK::Models::AdGroupUpdateParams::status, + ?title: String, + ?request_options: WhopSDK::request_opts + ) -> void - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::pacing] - end + def to_hash: -> { + id: String, + audiences: top, + bid_type: WhopSDK::Models::AdGroupUpdateParams::bid_type, + budget_amount: Float, + budget_type: WhopSDK::Models::AdGroupUpdateParams::budget_type, + conversion_event: WhopSDK::Models::AdGroupUpdateParams::conversion_event?, + conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location, + demographics: top, + desired_cost_per_result: Float, + devices: top, + ends_at: String, + frequency_cap: top, + languages: ::Array[String], + message_apps: ::Array[WhopSDK::Models::AdGroupUpdateParams::message_app], + minimum_daily_spend: Float, + optimization_goal: String, + placements: top, + regions: top, + starts_at: String, + status: WhopSDK::Models::AdGroupUpdateParams::status, + title: String, + request_options: WhopSDK::RequestOptions + } - type placement_type = - :PLACEMENT_TYPE_AUTOMATIC | :PLACEMENT_TYPE_NORMAL + type bid_type = :minimum_cost | :average_target | :maximum_target - module PlacementType - extend WhopSDK::Internal::Type::Enum + module BidType + extend WhopSDK::Internal::Type::Enum - PLACEMENT_TYPE_AUTOMATIC: :PLACEMENT_TYPE_AUTOMATIC - PLACEMENT_TYPE_NORMAL: :PLACEMENT_TYPE_NORMAL + MINIMUM_COST: :minimum_cost + AVERAGE_TARGET: :average_target + MAXIMUM_TARGET: :maximum_target - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::placement_type] - end + def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::bid_type] + end - type product_source = :CATALOG | :STORE | :SHOWCASE + type budget_type = :daily | :lifetime - module ProductSource - extend WhopSDK::Internal::Type::Enum + module BudgetType + extend WhopSDK::Internal::Type::Enum - CATALOG: :CATALOG - STORE: :STORE - SHOWCASE: :SHOWCASE + DAILY: :daily + LIFETIME: :lifetime - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::product_source] - end + def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::budget_type] + end - type schedule_type = :SCHEDULE_START_END | :SCHEDULE_FROM_NOW - - module ScheduleType - extend WhopSDK::Internal::Type::Enum - - SCHEDULE_START_END: :SCHEDULE_START_END - SCHEDULE_FROM_NOW: :SCHEDULE_FROM_NOW - - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::schedule_type] - end - - type shopping_ads_retargeting_type = - :OFF | :LAB1 | :LAB2 | :LAB3 | :LAB4 | :LAB5 - - module ShoppingAdsRetargetingType - extend WhopSDK::Internal::Type::Enum - - OFF: :OFF - LAB1: :LAB1 - LAB2: :LAB2 - LAB3: :LAB3 - LAB4: :LAB4 - LAB5: :LAB5 + type conversion_event = + :purchase + | :add_to_cart + | :initiated_checkout + | :add_payment_info + | :complete_registration + | :lead + | :content_view + | :search + | :contact + | :customize_product + | :donate + | :find_location + | :schedule + | :start_trial + | :submit_application + | :subscribe + | String + + module ConversionEvent + extend WhopSDK::Internal::Type::Union + + def self?.variants: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::conversion_event] + + PURCHASE: :purchase + ADD_TO_CART: :add_to_cart + INITIATED_CHECKOUT: :initiated_checkout + ADD_PAYMENT_INFO: :add_payment_info + COMPLETE_REGISTRATION: :complete_registration + LEAD: :lead + CONTENT_VIEW: :content_view + SEARCH: :search + CONTACT: :contact + CUSTOMIZE_PRODUCT: :customize_product + DONATE: :donate + FIND_LOCATION: :find_location + SCHEDULE: :schedule + START_TRIAL: :start_trial + SUBMIT_APPLICATION: :submit_application + SUBSCRIBE: :subscribe + end - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::shopping_ads_retargeting_type] - end + type conversion_location = + :website + | :profile + | :messaging + | :on_ad + | :instant_forms + | :instant_forms_and_messenger + | :website_and_instant_forms + + module ConversionLocation + extend WhopSDK::Internal::Type::Enum + + WEBSITE: :website + PROFILE: :profile + MESSAGING: :messaging + ON_AD: :on_ad + INSTANT_FORMS: :instant_forms + INSTANT_FORMS_AND_MESSENGER: :instant_forms_and_messenger + WEBSITE_AND_INSTANT_FORMS: :website_and_instant_forms + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::conversion_location] + end - type spending_power = :ALL | :HIGH + type message_app = :messenger | :instagram | :whatsapp - module SpendingPower - extend WhopSDK::Internal::Type::Enum + module MessageApp + extend WhopSDK::Internal::Type::Enum - ALL: :ALL - HIGH: :HIGH + MESSENGER: :messenger + INSTAGRAM: :instagram + WHATSAPP: :whatsapp - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::spending_power] - end + def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::message_app] + end - type view_attribution_window = :OFF | :ONE_DAY | :SEVEN_DAYS + type status = :active | :paused - module ViewAttributionWindow - extend WhopSDK::Internal::Type::Enum + module Status + extend WhopSDK::Internal::Type::Enum - OFF: :OFF - ONE_DAY: :ONE_DAY - SEVEN_DAYS: :SEVEN_DAYS + ACTIVE: :active + PAUSED: :paused - def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::PlatformConfig::Tiktok::view_attribution_window] - end - end + def self?.values: -> ::Array[WhopSDK::Models::AdGroupUpdateParams::status] end end end diff --git a/sig/whop_sdk/models/ad_list_params.rbs b/sig/whop_sdk/models/ad_list_params.rbs index de38b533..7cfba30c 100644 --- a/sig/whop_sdk/models/ad_list_params.rbs +++ b/sig/whop_sdk/models/ad_list_params.rbs @@ -2,26 +2,22 @@ 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?, - last: Integer?, - order: WhopSDK::Models::AdListParams::order?, - order_by: WhopSDK::Models::AdListParams::order_by?, - order_direction: WhopSDK::Models::direction?, - query: String?, - stats_from: Time?, - stats_to: Time?, - status: WhopSDK::Models::external_ad_status? + account_id: String, + ad_campaign_id: String, + ad_group_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::AdListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::AdListParams::order, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::Models::AdListParams::status, + time_zone: String } & WhopSDK::Internal::Type::request_parameters @@ -29,116 +25,175 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor ad_campaign_id: String? + attr_reader account_id: String? - attr_accessor ad_campaign_ids: ::Array[String]? + def account_id=: (String) -> String - attr_accessor ad_group_id: String? + attr_reader ad_campaign_id: String? - attr_accessor ad_group_ids: ::Array[String]? + def ad_campaign_id=: (String) -> String - attr_accessor after: String? + attr_reader ad_group_id: String? - attr_accessor before: String? + def ad_group_id=: (String) -> String - attr_accessor campaign_id: String? + attr_reader after: String? - attr_accessor company_id: 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::AdListParams::order? + def created_before=: (String) -> String - attr_accessor order_by: WhopSDK::Models::AdListParams::order_by? + attr_reader direction: WhopSDK::Models::AdListParams::direction? - attr_accessor order_direction: WhopSDK::Models::direction? + def direction=: ( + WhopSDK::Models::AdListParams::direction + ) -> WhopSDK::Models::AdListParams::direction - attr_accessor query: String? + attr_reader first: Integer? - attr_accessor stats_from: Time? + def first=: (Integer) -> Integer - attr_accessor stats_to: Time? + attr_reader last: Integer? - attr_accessor status: WhopSDK::Models::external_ad_status? + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::AdListParams::order? + + def order=: ( + WhopSDK::Models::AdListParams::order + ) -> WhopSDK::Models::AdListParams::order + + attr_reader query: String? + + def query=: (String) -> String + + attr_reader stats_from: String? + + def stats_from=: (String) -> String + + attr_reader stats_to: String? + + def stats_to=: (String) -> String + + attr_reader status: WhopSDK::Models::AdListParams::status? + + def status=: ( + WhopSDK::Models::AdListParams::status + ) -> WhopSDK::Models::AdListParams::status + + attr_reader time_zone: String? + + def time_zone=: (String) -> String 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?, - ?last: Integer?, - ?order: WhopSDK::Models::AdListParams::order?, - ?order_by: WhopSDK::Models::AdListParams::order_by?, - ?order_direction: WhopSDK::Models::direction?, - ?query: String?, - ?stats_from: Time?, - ?stats_to: Time?, - ?status: WhopSDK::Models::external_ad_status?, + ?account_id: String, + ?ad_campaign_id: String, + ?ad_group_id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::AdListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::AdListParams::order, + ?query: String, + ?stats_from: String, + ?stats_to: String, + ?status: WhopSDK::Models::AdListParams::status, + ?time_zone: String, ?request_options: WhopSDK::request_opts ) -> 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?, - last: Integer?, - order: WhopSDK::Models::AdListParams::order?, - order_by: WhopSDK::Models::AdListParams::order_by?, - order_direction: WhopSDK::Models::direction?, - query: String?, - stats_from: Time?, - stats_to: Time?, - status: WhopSDK::Models::external_ad_status?, + account_id: String, + ad_campaign_id: String, + ad_group_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::AdListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::AdListParams::order, + query: String, + stats_from: String, + stats_to: String, + status: WhopSDK::Models::AdListParams::status, + time_zone: String, request_options: WhopSDK::RequestOptions } - type order = :created_at | :spend | :return_on_ad_spend + type direction = :asc | :desc + + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC: :asc + DESC: :desc + + def self?.values: -> ::Array[WhopSDK::Models::AdListParams::direction] + end + + type order = + :created_at + | :updated_at + | :spend + | :impressions + | :reach + | :clicks + | :unique_clicks + | :frequency + | :click_through_rate + | :results + | :cost_per_mille + | :cost_per_click + | :cost_per_result + | :return_on_ad_spend module Order extend WhopSDK::Internal::Type::Enum CREATED_AT: :created_at + UPDATED_AT: :updated_at SPEND: :spend + IMPRESSIONS: :impressions + REACH: :reach + CLICKS: :clicks + UNIQUE_CLICKS: :unique_clicks + FREQUENCY: :frequency + CLICK_THROUGH_RATE: :click_through_rate + RESULTS: :results + COST_PER_MILLE: :cost_per_mille + COST_PER_CLICK: :cost_per_click + COST_PER_RESULT: :cost_per_result 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 + type status = :active | :paused | :in_review | :rejected - module OrderBy + module Status extend WhopSDK::Internal::Type::Enum - SPEND: :spend - RETURN_ON_AD_SPEND: :return_on_ad_spend - ROAS: :roas + ACTIVE: :active + PAUSED: :paused + IN_REVIEW: :in_review + REJECTED: :rejected - def self?.values: -> ::Array[WhopSDK::Models::AdListParams::order_by] + def self?.values: -> ::Array[WhopSDK::Models::AdListParams::status] end end end diff --git a/sig/whop_sdk/models/ad_list_response.rbs b/sig/whop_sdk/models/ad_list_response.rbs deleted file mode 100644 index f2d2706a..00000000 --- a/sig/whop_sdk/models/ad_list_response.rbs +++ /dev/null @@ -1,241 +0,0 @@ -module WhopSDK - module Models - type ad_list_response = - { - 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 - } - - class AdListResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign - - 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 - - def to_hash: -> { - 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 - } - - type ad_campaign = { id: String } - - class AdCampaign < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - - type ad_group = { id: String } - - class AdGroup < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - - type issue = - { - category: WhopSDK::Models::AdListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, - resource_id: String?, - resource_type: String, - subtype: String? - } - - class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::AdListResponse::Issue::category? - - attr_accessor created_at: Time - - attr_accessor resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status - - attr_accessor resource_id: String? - - attr_accessor resource_type: String - - attr_accessor subtype: String? - - def initialize: ( - category: WhopSDK::Models::AdListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, - resource_id: String?, - resource_type: String, - subtype: String? - ) -> void - - def to_hash: -> { - category: WhopSDK::Models::AdListResponse::Issue::category?, - created_at: Time, - resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, - resource_id: 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 - 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_retrieve_params.rbs b/sig/whop_sdk/models/ad_retrieve_params.rbs index 5f9059d9..0efdb605 100644 --- a/sig/whop_sdk/models/ad_retrieve_params.rbs +++ b/sig/whop_sdk/models/ad_retrieve_params.rbs @@ -1,7 +1,7 @@ module WhopSDK module Models type ad_retrieve_params = - { id: String, stats_from: Time?, stats_to: Time? } + { id: String, stats_from: String, stats_to: String, time_zone: String } & WhopSDK::Internal::Type::request_parameters class AdRetrieveParams < WhopSDK::Internal::Type::BaseModel @@ -10,21 +10,31 @@ module WhopSDK attr_accessor id: String - attr_accessor stats_from: Time? + attr_reader stats_from: String? - attr_accessor stats_to: Time? + def stats_from=: (String) -> String + + attr_reader stats_to: String? + + def stats_to=: (String) -> String + + attr_reader time_zone: String? + + def time_zone=: (String) -> String def initialize: ( id: String, - ?stats_from: Time?, - ?stats_to: Time?, + ?stats_from: String, + ?stats_to: String, + ?time_zone: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { id: String, - stats_from: Time?, - stats_to: Time?, + stats_from: String, + stats_to: String, + time_zone: String, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/ad_update_params.rbs b/sig/whop_sdk/models/ad_update_params.rbs new file mode 100644 index 00000000..a3d68339 --- /dev/null +++ b/sig/whop_sdk/models/ad_update_params.rbs @@ -0,0 +1,742 @@ +module WhopSDK + module Models + type ad_update_params = + { + id: String, + call_to_action: WhopSDK::Models::AdUpdateParams::call_to_action, + creatives: ::Array[WhopSDK::AdUpdateParams::Creative], + descriptions: ::Array[String], + headlines: ::Array[String], + lead_form: WhopSDK::AdUpdateParams::LeadForm, + lead_form_id: String, + messaging_config: WhopSDK::AdUpdateParams::MessagingConfig, + multi_advertiser_ads: bool, + post_id: String, + post_source: WhopSDK::Models::AdUpdateParams::post_source, + primary_texts: ::Array[String], + social_accounts: ::Array[WhopSDK::AdUpdateParams::SocialAccount], + title: String, + url: String, + url_parameters: top + } + & WhopSDK::Internal::Type::request_parameters + + class AdUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_reader call_to_action: WhopSDK::Models::AdUpdateParams::call_to_action? + + def call_to_action=: ( + WhopSDK::Models::AdUpdateParams::call_to_action + ) -> WhopSDK::Models::AdUpdateParams::call_to_action + + attr_reader creatives: ::Array[WhopSDK::AdUpdateParams::Creative]? + + def creatives=: ( + ::Array[WhopSDK::AdUpdateParams::Creative] + ) -> ::Array[WhopSDK::AdUpdateParams::Creative] + + attr_reader descriptions: ::Array[String]? + + def descriptions=: (::Array[String]) -> ::Array[String] + + attr_reader headlines: ::Array[String]? + + def headlines=: (::Array[String]) -> ::Array[String] + + attr_reader lead_form: WhopSDK::AdUpdateParams::LeadForm? + + def lead_form=: ( + WhopSDK::AdUpdateParams::LeadForm + ) -> WhopSDK::AdUpdateParams::LeadForm + + attr_reader lead_form_id: String? + + def lead_form_id=: (String) -> String + + attr_reader messaging_config: WhopSDK::AdUpdateParams::MessagingConfig? + + def messaging_config=: ( + WhopSDK::AdUpdateParams::MessagingConfig + ) -> WhopSDK::AdUpdateParams::MessagingConfig + + attr_reader multi_advertiser_ads: bool? + + def multi_advertiser_ads=: (bool) -> bool + + attr_reader post_id: String? + + def post_id=: (String) -> String + + attr_reader post_source: WhopSDK::Models::AdUpdateParams::post_source? + + def post_source=: ( + WhopSDK::Models::AdUpdateParams::post_source + ) -> WhopSDK::Models::AdUpdateParams::post_source + + attr_reader primary_texts: ::Array[String]? + + def primary_texts=: (::Array[String]) -> ::Array[String] + + attr_reader social_accounts: ::Array[WhopSDK::AdUpdateParams::SocialAccount]? + + def social_accounts=: ( + ::Array[WhopSDK::AdUpdateParams::SocialAccount] + ) -> ::Array[WhopSDK::AdUpdateParams::SocialAccount] + + attr_reader title: String? + + def title=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader url_parameters: top? + + def url_parameters=: (top) -> top + + def initialize: ( + id: String, + ?call_to_action: WhopSDK::Models::AdUpdateParams::call_to_action, + ?creatives: ::Array[WhopSDK::AdUpdateParams::Creative], + ?descriptions: ::Array[String], + ?headlines: ::Array[String], + ?lead_form: WhopSDK::AdUpdateParams::LeadForm, + ?lead_form_id: String, + ?messaging_config: WhopSDK::AdUpdateParams::MessagingConfig, + ?multi_advertiser_ads: bool, + ?post_id: String, + ?post_source: WhopSDK::Models::AdUpdateParams::post_source, + ?primary_texts: ::Array[String], + ?social_accounts: ::Array[WhopSDK::AdUpdateParams::SocialAccount], + ?title: String, + ?url: String, + ?url_parameters: top, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + id: String, + call_to_action: WhopSDK::Models::AdUpdateParams::call_to_action, + creatives: ::Array[WhopSDK::AdUpdateParams::Creative], + descriptions: ::Array[String], + headlines: ::Array[String], + lead_form: WhopSDK::AdUpdateParams::LeadForm, + lead_form_id: String, + messaging_config: WhopSDK::AdUpdateParams::MessagingConfig, + multi_advertiser_ads: bool, + post_id: String, + post_source: WhopSDK::Models::AdUpdateParams::post_source, + primary_texts: ::Array[String], + social_accounts: ::Array[WhopSDK::AdUpdateParams::SocialAccount], + title: String, + url: String, + url_parameters: top, + request_options: WhopSDK::RequestOptions + } + + type call_to_action = + :apply_now + | :book_now + | :call_now + | :contact_us + | :download + | :get_directions + | :get_offer + | :get_quote + | :learn_more + | :listen_now + | :message_page + | :no_button + | :open_link + | :order_now + | :request_time + | :see_details + | :see_menu + | :send_updates + | :shop_now + | :sign_up + | :subscribe + | :watch_more + + module CallToAction + extend WhopSDK::Internal::Type::Enum + + APPLY_NOW: :apply_now + BOOK_NOW: :book_now + CALL_NOW: :call_now + CONTACT_US: :contact_us + DOWNLOAD: :download + GET_DIRECTIONS: :get_directions + GET_OFFER: :get_offer + GET_QUOTE: :get_quote + LEARN_MORE: :learn_more + LISTEN_NOW: :listen_now + MESSAGE_PAGE: :message_page + NO_BUTTON: :no_button + OPEN_LINK: :open_link + ORDER_NOW: :order_now + REQUEST_TIME: :request_time + SEE_DETAILS: :see_details + SEE_MENU: :see_menu + SEND_UPDATES: :send_updates + SHOP_NOW: :shop_now + SIGN_UP: :sign_up + SUBSCRIBE: :subscribe + WATCH_MORE: :watch_more + + def self?.values: -> ::Array[WhopSDK::Models::AdUpdateParams::call_to_action] + end + + type creative = + { + id: String, + crop: WhopSDK::AdUpdateParams::Creative::Crop, + format_: WhopSDK::Models::AdUpdateParams::Creative::format_ + } + + class Creative < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader crop: WhopSDK::AdUpdateParams::Creative::Crop? + + def crop=: ( + WhopSDK::AdUpdateParams::Creative::Crop + ) -> WhopSDK::AdUpdateParams::Creative::Crop + + attr_reader format_: WhopSDK::Models::AdUpdateParams::Creative::format_? + + def format_=: ( + WhopSDK::Models::AdUpdateParams::Creative::format_ + ) -> WhopSDK::Models::AdUpdateParams::Creative::format_ + + def initialize: ( + ?id: String, + ?crop: WhopSDK::AdUpdateParams::Creative::Crop, + ?format_: WhopSDK::Models::AdUpdateParams::Creative::format_ + ) -> void + + def to_hash: -> { + id: String, + crop: WhopSDK::AdUpdateParams::Creative::Crop, + format_: WhopSDK::Models::AdUpdateParams::Creative::format_ + } + + type crop = { height: Float, width: Float, x: Float, y_: Float } + + class Crop < WhopSDK::Internal::Type::BaseModel + attr_reader height: Float? + + def height=: (Float) -> Float + + attr_reader width: Float? + + def width=: (Float) -> Float + + attr_reader x: Float? + + def x=: (Float) -> Float + + attr_reader y_: Float? + + def y_=: (Float) -> Float + + def initialize: ( + ?height: Float, + ?width: Float, + ?x: Float, + ?y_: Float + ) -> void + + def to_hash: -> { height: Float, width: Float, x: Float, y_: Float } + end + + type format_ = :square | :vertical | :horizontal + + module Format + extend WhopSDK::Internal::Type::Enum + + SQUARE: :square + VERTICAL: :vertical + HORIZONTAL: :horizontal + + def self?.values: -> ::Array[WhopSDK::Models::AdUpdateParams::Creative::format_] + end + end + + type lead_form = + { + completion: WhopSDK::AdUpdateParams::LeadForm::Completion, + disclaimer: WhopSDK::AdUpdateParams::LeadForm::Disclaimer, + form_type: WhopSDK::Models::AdUpdateParams::LeadForm::form_type, + intro: WhopSDK::AdUpdateParams::LeadForm::Intro, + name: String, + phone_verification: bool, + privacy_policy: WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy, + questions: ::Array[WhopSDK::AdUpdateParams::LeadForm::Question] + } + + class LeadForm < WhopSDK::Internal::Type::BaseModel + attr_reader completion: WhopSDK::AdUpdateParams::LeadForm::Completion? + + def completion=: ( + WhopSDK::AdUpdateParams::LeadForm::Completion + ) -> WhopSDK::AdUpdateParams::LeadForm::Completion + + attr_reader disclaimer: WhopSDK::AdUpdateParams::LeadForm::Disclaimer? + + def disclaimer=: ( + WhopSDK::AdUpdateParams::LeadForm::Disclaimer + ) -> WhopSDK::AdUpdateParams::LeadForm::Disclaimer + + attr_reader form_type: WhopSDK::Models::AdUpdateParams::LeadForm::form_type? + + def form_type=: ( + WhopSDK::Models::AdUpdateParams::LeadForm::form_type + ) -> WhopSDK::Models::AdUpdateParams::LeadForm::form_type + + attr_reader intro: WhopSDK::AdUpdateParams::LeadForm::Intro? + + def intro=: ( + WhopSDK::AdUpdateParams::LeadForm::Intro + ) -> WhopSDK::AdUpdateParams::LeadForm::Intro + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader phone_verification: bool? + + def phone_verification=: (bool) -> bool + + attr_reader privacy_policy: WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy? + + def privacy_policy=: ( + WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy + ) -> WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy + + attr_reader questions: ::Array[WhopSDK::AdUpdateParams::LeadForm::Question]? + + def questions=: ( + ::Array[WhopSDK::AdUpdateParams::LeadForm::Question] + ) -> ::Array[WhopSDK::AdUpdateParams::LeadForm::Question] + + def initialize: ( + ?completion: WhopSDK::AdUpdateParams::LeadForm::Completion, + ?disclaimer: WhopSDK::AdUpdateParams::LeadForm::Disclaimer, + ?form_type: WhopSDK::Models::AdUpdateParams::LeadForm::form_type, + ?intro: WhopSDK::AdUpdateParams::LeadForm::Intro, + ?name: String, + ?phone_verification: bool, + ?privacy_policy: WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy, + ?questions: ::Array[WhopSDK::AdUpdateParams::LeadForm::Question] + ) -> void + + def to_hash: -> { + completion: WhopSDK::AdUpdateParams::LeadForm::Completion, + disclaimer: WhopSDK::AdUpdateParams::LeadForm::Disclaimer, + form_type: WhopSDK::Models::AdUpdateParams::LeadForm::form_type, + intro: WhopSDK::AdUpdateParams::LeadForm::Intro, + name: String, + phone_verification: bool, + privacy_policy: WhopSDK::AdUpdateParams::LeadForm::PrivacyPolicy, + questions: ::Array[WhopSDK::AdUpdateParams::LeadForm::Question] + } + + type completion = + { + button_text: String, + description: String, + headline: String, + url: String + } + + class Completion < WhopSDK::Internal::Type::BaseModel + attr_reader button_text: String? + + def button_text=: (String) -> String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader headline: String? + + def headline=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?button_text: String, + ?description: String, + ?headline: String, + ?url: String + ) -> void + + def to_hash: -> { + button_text: String, + description: String, + headline: String, + url: String + } + end + + type disclaimer = + { + body: String, + checkboxes: ::Array[WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox], + title: String + } + + class Disclaimer < WhopSDK::Internal::Type::BaseModel + attr_reader body: String? + + def body=: (String) -> String + + attr_reader checkboxes: ::Array[WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox]? + + def checkboxes=: ( + ::Array[WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox] + ) -> ::Array[WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox] + + attr_reader title: String? + + def title=: (String) -> String + + def initialize: ( + ?body: String, + ?checkboxes: ::Array[WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox], + ?title: String + ) -> void + + def to_hash: -> { + body: String, + checkboxes: ::Array[WhopSDK::AdUpdateParams::LeadForm::Disclaimer::Checkbox], + title: String + } + + type checkbox = + { + checked_by_default: bool, + key: String, + required: bool, + text: String + } + + class Checkbox < WhopSDK::Internal::Type::BaseModel + attr_reader checked_by_default: bool? + + def checked_by_default=: (bool) -> bool + + attr_reader key: String? + + def key=: (String) -> String + + attr_reader required: bool? + + def required=: (bool) -> bool + + attr_reader text: String? + + def text=: (String) -> String + + def initialize: ( + ?checked_by_default: bool, + ?key: String, + ?required: bool, + ?text: String + ) -> void + + def to_hash: -> { + checked_by_default: bool, + key: String, + required: bool, + text: String + } + end + end + + type form_type = :more_volume | :higher_intent + + module FormType + extend WhopSDK::Internal::Type::Enum + + MORE_VOLUME: :more_volume + HIGHER_INTENT: :higher_intent + + def self?.values: -> ::Array[WhopSDK::Models::AdUpdateParams::LeadForm::form_type] + end + + type intro = { description: String, headline: String } + + class Intro < WhopSDK::Internal::Type::BaseModel + attr_reader description: String? + + def description=: (String) -> String + + attr_reader headline: String? + + def headline=: (String) -> String + + def initialize: (?description: String, ?headline: String) -> void + + def to_hash: -> { description: String, headline: String } + end + + type privacy_policy = { link_text: String, url: String } + + class PrivacyPolicy < WhopSDK::Internal::Type::BaseModel + attr_reader link_text: String? + + def link_text=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: (?link_text: String, ?url: String) -> void + + def to_hash: -> { link_text: String, url: String } + end + + type question = + { + format_: WhopSDK::Models::AdUpdateParams::LeadForm::Question::format_, + label: String, + options: ::Array[WhopSDK::AdUpdateParams::LeadForm::Question::Option], + type: WhopSDK::Models::AdUpdateParams::LeadForm::Question::type_ + } + + class Question < WhopSDK::Internal::Type::BaseModel + attr_reader format_: WhopSDK::Models::AdUpdateParams::LeadForm::Question::format_? + + def format_=: ( + WhopSDK::Models::AdUpdateParams::LeadForm::Question::format_ + ) -> WhopSDK::Models::AdUpdateParams::LeadForm::Question::format_ + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader options: ::Array[WhopSDK::AdUpdateParams::LeadForm::Question::Option]? + + def options=: ( + ::Array[WhopSDK::AdUpdateParams::LeadForm::Question::Option] + ) -> ::Array[WhopSDK::AdUpdateParams::LeadForm::Question::Option] + + attr_reader type: WhopSDK::Models::AdUpdateParams::LeadForm::Question::type_? + + def type=: ( + WhopSDK::Models::AdUpdateParams::LeadForm::Question::type_ + ) -> WhopSDK::Models::AdUpdateParams::LeadForm::Question::type_ + + def initialize: ( + ?format_: WhopSDK::Models::AdUpdateParams::LeadForm::Question::format_, + ?label: String, + ?options: ::Array[WhopSDK::AdUpdateParams::LeadForm::Question::Option], + ?type: WhopSDK::Models::AdUpdateParams::LeadForm::Question::type_ + ) -> void + + def to_hash: -> { + format_: WhopSDK::Models::AdUpdateParams::LeadForm::Question::format_, + label: String, + options: ::Array[WhopSDK::AdUpdateParams::LeadForm::Question::Option], + type: WhopSDK::Models::AdUpdateParams::LeadForm::Question::type_ + } + + type format_ = :short_answer | :multiple_choice | :appointment + + module Format + extend WhopSDK::Internal::Type::Enum + + SHORT_ANSWER: :short_answer + MULTIPLE_CHOICE: :multiple_choice + APPOINTMENT: :appointment + + def self?.values: -> ::Array[WhopSDK::Models::AdUpdateParams::LeadForm::Question::format_] + end + + type option = + { + key: String, + logic: WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic, + value: String + } + + class Option < WhopSDK::Internal::Type::BaseModel + attr_reader key: String? + + def key=: (String) -> String + + attr_reader logic: WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic? + + def logic=: ( + WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic + ) -> WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?key: String, + ?logic: WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic, + ?value: String + ) -> void + + def to_hash: -> { + key: String, + logic: WhopSDK::AdUpdateParams::LeadForm::Question::Option::Logic, + value: String + } + + type logic = + { + action: WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::action, + target_end_page_index: Integer, + target_question_index: Integer + } + + class Logic < WhopSDK::Internal::Type::BaseModel + attr_reader action: WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::action? + + def action=: ( + WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::action + ) -> WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::action + + attr_reader target_end_page_index: Integer? + + def target_end_page_index=: (Integer) -> Integer + + attr_reader target_question_index: Integer? + + def target_question_index=: (Integer) -> Integer + + def initialize: ( + ?action: WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::action, + ?target_end_page_index: Integer, + ?target_question_index: Integer + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::action, + target_end_page_index: Integer, + target_question_index: Integer + } + + type action = :go_to_question | :submit_form | :close_form + + module Action + extend WhopSDK::Internal::Type::Enum + + GO_TO_QUESTION: :go_to_question + SUBMIT_FORM: :submit_form + CLOSE_FORM: :close_form + + def self?.values: -> ::Array[WhopSDK::Models::AdUpdateParams::LeadForm::Question::Option::Logic::action] + end + end + end + + type type_ = + :email + | :phone + | :full_name + | :first_name + | :last_name + | :city + | :state + | :zip + | :country + | :street_address + | :job_title + | :company_name + | :work_email + | :work_phone_number + | :dob + | :gender + | :marital_status + | :relationship_status + | :military_status + | :date_time + | :custom + + module Type + extend WhopSDK::Internal::Type::Enum + + EMAIL: :email + PHONE: :phone + FULL_NAME: :full_name + FIRST_NAME: :first_name + LAST_NAME: :last_name + CITY: :city + STATE: :state + ZIP: :zip + COUNTRY: :country + STREET_ADDRESS: :street_address + JOB_TITLE: :job_title + COMPANY_NAME: :company_name + WORK_EMAIL: :work_email + WORK_PHONE_NUMBER: :work_phone_number + DOB: :dob + GENDER: :gender + MARITAL_STATUS: :marital_status + RELATIONSHIP_STATUS: :relationship_status + MILITARY_STATUS: :military_status + DATE_TIME: :date_time + CUSTOM: :custom + + def self?.values: -> ::Array[WhopSDK::Models::AdUpdateParams::LeadForm::Question::type_] + end + end + end + + type messaging_config = { keyword: String, message: String } + + class MessagingConfig < WhopSDK::Internal::Type::BaseModel + attr_reader keyword: String? + + def keyword=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + def initialize: (?keyword: String, ?message: String) -> void + + def to_hash: -> { keyword: String, message: String } + end + + type post_source = :facebook | :instagram + + module PostSource + extend WhopSDK::Internal::Type::Enum + + FACEBOOK: :facebook + INSTAGRAM: :instagram + + def self?.values: -> ::Array[WhopSDK::Models::AdUpdateParams::post_source] + end + + type social_account = { id: String } + + class SocialAccount < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + def initialize: (?id: String) -> void + + def to_hash: -> { id: String } + end + end + end +end diff --git a/sig/whop_sdk/models/app.rbs b/sig/whop_sdk/models/app.rbs index c4c61c1b..1ae76e1a 100644 --- a/sig/whop_sdk/models/app.rbs +++ b/sig/whop_sdk/models/app.rbs @@ -13,12 +13,16 @@ module WhopSDK discover_path: String?, domain_id: String, experience_path: String?, + hosted_url: String?, icon: WhopSDK::App::Icon?, name: String, openapi_path: String?, origin: String?, + production_web_build: WhopSDK::App::ProductionWebBuild?, redirect_uris: ::Array[String], requested_permissions: ::Array[WhopSDK::App::RequestedPermission], + route: String?, + secrets: ::Hash[Symbol, top]?, skills_path: String?, stats: WhopSDK::App::Stats?, status: WhopSDK::Models::app_statuses, @@ -48,6 +52,8 @@ module WhopSDK attr_accessor experience_path: String? + attr_accessor hosted_url: String? + attr_accessor icon: WhopSDK::App::Icon? attr_accessor name: String @@ -56,10 +62,16 @@ module WhopSDK attr_accessor origin: String? + attr_accessor production_web_build: WhopSDK::App::ProductionWebBuild? + attr_accessor redirect_uris: ::Array[String] attr_accessor requested_permissions: ::Array[WhopSDK::App::RequestedPermission] + attr_accessor route: String? + + attr_accessor secrets: ::Hash[Symbol, top]? + attr_accessor skills_path: String? attr_accessor stats: WhopSDK::App::Stats? @@ -80,12 +92,16 @@ module WhopSDK discover_path: String?, domain_id: String, experience_path: String?, + hosted_url: String?, icon: WhopSDK::App::Icon?, name: String, openapi_path: String?, origin: String?, + production_web_build: WhopSDK::App::ProductionWebBuild?, redirect_uris: ::Array[String], requested_permissions: ::Array[WhopSDK::App::RequestedPermission], + route: String?, + secrets: ::Hash[Symbol, top]?, skills_path: String?, stats: WhopSDK::App::Stats?, status: WhopSDK::Models::app_statuses, @@ -104,12 +120,16 @@ module WhopSDK discover_path: String?, domain_id: String, experience_path: String?, + hosted_url: String?, icon: WhopSDK::App::Icon?, name: String, openapi_path: String?, origin: String?, + production_web_build: WhopSDK::App::ProductionWebBuild?, redirect_uris: ::Array[String], requested_permissions: ::Array[WhopSDK::App::RequestedPermission], + route: String?, + secrets: ::Hash[Symbol, top]?, skills_path: String?, stats: WhopSDK::App::Stats?, status: WhopSDK::Models::app_statuses, @@ -166,6 +186,38 @@ module WhopSDK def to_hash: -> { url: String? } end + type production_web_build = + { + id: String, + checksum: String, + file_url: String, + status: WhopSDK::Models::app_build_statuses + } + + class ProductionWebBuild < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor checksum: String + + attr_accessor file_url: String + + attr_accessor status: WhopSDK::Models::app_build_statuses + + def initialize: ( + id: String, + checksum: String, + file_url: String, + status: WhopSDK::Models::app_build_statuses + ) -> void + + def to_hash: -> { + id: String, + checksum: String, + file_url: String, + status: WhopSDK::Models::app_build_statuses + } + end + type requested_permission = { is_required: bool, diff --git a/sig/whop_sdk/models/app_create_params.rbs b/sig/whop_sdk/models/app_create_params.rbs index cf375542..4ceae2ef 100644 --- a/sig/whop_sdk/models/app_create_params.rbs +++ b/sig/whop_sdk/models/app_create_params.rbs @@ -6,7 +6,8 @@ module WhopSDK name: String, base_url: String?, icon: WhopSDK::AppCreateParams::Icon?, - redirect_uris: ::Array[String]? + redirect_uris: ::Array[String]?, + route: String? } & WhopSDK::Internal::Type::request_parameters @@ -24,12 +25,15 @@ module WhopSDK attr_accessor redirect_uris: ::Array[String]? + attr_accessor route: String? + def initialize: ( company_id: String, name: String, ?base_url: String?, ?icon: WhopSDK::AppCreateParams::Icon?, ?redirect_uris: ::Array[String]?, + ?route: String?, ?request_options: WhopSDK::request_opts ) -> void @@ -39,6 +43,7 @@ module WhopSDK base_url: String?, icon: WhopSDK::AppCreateParams::Icon?, redirect_uris: ::Array[String]?, + route: String?, request_options: WhopSDK::RequestOptions } diff --git a/sig/whop_sdk/models/app_list_response.rbs b/sig/whop_sdk/models/app_list_response.rbs index ebc23355..249232fc 100644 --- a/sig/whop_sdk/models/app_list_response.rbs +++ b/sig/whop_sdk/models/app_list_response.rbs @@ -12,10 +12,12 @@ module WhopSDK discover_path: String?, domain_id: String, experience_path: String?, + hosted_url: String?, icon: WhopSDK::Models::AppListResponse::Icon?, name: String, openapi_path: String?, origin: String?, + route: String?, skills_path: String?, status: WhopSDK::Models::app_statuses, verified: bool @@ -42,6 +44,8 @@ module WhopSDK attr_accessor experience_path: String? + attr_accessor hosted_url: String? + attr_accessor icon: WhopSDK::Models::AppListResponse::Icon? attr_accessor name: String @@ -50,6 +54,8 @@ module WhopSDK attr_accessor origin: String? + attr_accessor route: String? + attr_accessor skills_path: String? attr_accessor status: WhopSDK::Models::app_statuses @@ -67,10 +73,12 @@ module WhopSDK discover_path: String?, domain_id: String, experience_path: String?, + hosted_url: String?, icon: WhopSDK::Models::AppListResponse::Icon?, name: String, openapi_path: String?, origin: String?, + route: String?, skills_path: String?, status: WhopSDK::Models::app_statuses, verified: bool @@ -87,10 +95,12 @@ module WhopSDK discover_path: String?, domain_id: String, experience_path: String?, + hosted_url: String?, icon: WhopSDK::Models::AppListResponse::Icon?, name: String, openapi_path: String?, origin: String?, + route: String?, skills_path: String?, status: WhopSDK::Models::app_statuses, verified: bool diff --git a/sig/whop_sdk/models/app_logs_params.rbs b/sig/whop_sdk/models/app_logs_params.rbs new file mode 100644 index 00000000..32e7de82 --- /dev/null +++ b/sig/whop_sdk/models/app_logs_params.rbs @@ -0,0 +1,98 @@ +module WhopSDK + module Models + type app_logs_params = + { + id: String, + after: String, + app_build_id: String, + before: String, + created_after: Time, + created_before: Time, + first: Integer, + level: WhopSDK::Models::AppLogsParams::level, + query: String + } + & WhopSDK::Internal::Type::request_parameters + + class AppLogsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader app_build_id: String? + + def app_build_id=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader created_after: Time? + + def created_after=: (Time) -> Time + + attr_reader created_before: Time? + + def created_before=: (Time) -> Time + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader level: WhopSDK::Models::AppLogsParams::level? + + def level=: ( + WhopSDK::Models::AppLogsParams::level + ) -> WhopSDK::Models::AppLogsParams::level + + attr_reader query: String? + + def query=: (String) -> String + + def initialize: ( + id: String, + ?after: String, + ?app_build_id: String, + ?before: String, + ?created_after: Time, + ?created_before: Time, + ?first: Integer, + ?level: WhopSDK::Models::AppLogsParams::level, + ?query: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + id: String, + after: String, + app_build_id: String, + before: String, + created_after: Time, + created_before: Time, + first: Integer, + level: WhopSDK::Models::AppLogsParams::level, + query: String, + request_options: WhopSDK::RequestOptions + } + + type level = :log | :debug | :info | :warn | :error + + module Level + extend WhopSDK::Internal::Type::Enum + + LOG: :log + DEBUG: :debug + INFO: :info + WARN: :warn + ERROR: :error + + def self?.values: -> ::Array[WhopSDK::Models::AppLogsParams::level] + end + end + end +end diff --git a/sig/whop_sdk/models/app_logs_response.rbs b/sig/whop_sdk/models/app_logs_response.rbs new file mode 100644 index 00000000..628f4b71 --- /dev/null +++ b/sig/whop_sdk/models/app_logs_response.rbs @@ -0,0 +1,162 @@ +module WhopSDK + module Models + type app_logs_response = + { + data: ::Array[WhopSDK::Models::AppLogsResponse::Data], + page_info: WhopSDK::Models::AppLogsResponse::PageInfo + } + + class AppLogsResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::AppLogsResponse::Data] + + attr_accessor page_info: WhopSDK::Models::AppLogsResponse::PageInfo + + def initialize: ( + data: ::Array[WhopSDK::Models::AppLogsResponse::Data], + page_info: WhopSDK::Models::AppLogsResponse::PageInfo + ) -> void + + def to_hash: -> { + data: ::Array[WhopSDK::Models::AppLogsResponse::Data], + page_info: WhopSDK::Models::AppLogsResponse::PageInfo + } + + type data = + { + app_build_id: String, + app_id: String, + created_at: Time, + level: String, + message: String, + request_id: String, + source: WhopSDK::Models::AppLogsResponse::Data::source, + cpu_time_ms: Integer, + outcome: String?, + request_method: String?, + request_path: String?, + response_status: Integer?, + stack: String?, + truncated: bool, + wall_time_ms: Integer + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor app_build_id: String + + attr_accessor app_id: String + + attr_accessor created_at: Time + + attr_accessor level: String + + attr_accessor message: String + + attr_accessor request_id: String + + attr_accessor source: WhopSDK::Models::AppLogsResponse::Data::source + + attr_reader cpu_time_ms: Integer? + + def cpu_time_ms=: (Integer) -> Integer + + attr_accessor outcome: String? + + attr_accessor request_method: String? + + attr_accessor request_path: String? + + attr_accessor response_status: Integer? + + attr_accessor stack: String? + + attr_reader truncated: bool? + + def truncated=: (bool) -> bool + + attr_reader wall_time_ms: Integer? + + def wall_time_ms=: (Integer) -> Integer + + def initialize: ( + app_build_id: String, + app_id: String, + created_at: Time, + level: String, + message: String, + request_id: String, + source: WhopSDK::Models::AppLogsResponse::Data::source, + ?cpu_time_ms: Integer, + ?outcome: String?, + ?request_method: String?, + ?request_path: String?, + ?response_status: Integer?, + ?stack: String?, + ?truncated: bool, + ?wall_time_ms: Integer + ) -> void + + def to_hash: -> { + app_build_id: String, + app_id: String, + created_at: Time, + level: String, + message: String, + request_id: String, + source: WhopSDK::Models::AppLogsResponse::Data::source, + cpu_time_ms: Integer, + outcome: String?, + request_method: String?, + request_path: String?, + response_status: Integer?, + stack: String?, + truncated: bool, + wall_time_ms: Integer + } + + type source = :console | :exception | :request + + module Source + extend WhopSDK::Internal::Type::Enum + + CONSOLE: :console + EXCEPTION: :exception + REQUEST: :request + + def self?.values: -> ::Array[WhopSDK::Models::AppLogsResponse::Data::source] + end + end + + type page_info = + { + has_next_page: bool, + has_previous_page: bool, + end_cursor: String?, + start_cursor: String? + } + + class PageInfo < WhopSDK::Internal::Type::BaseModel + attr_accessor has_next_page: bool + + attr_accessor has_previous_page: bool + + attr_accessor end_cursor: String? + + attr_accessor start_cursor: String? + + def initialize: ( + has_next_page: bool, + has_previous_page: bool, + ?end_cursor: String?, + ?start_cursor: String? + ) -> void + + def to_hash: -> { + has_next_page: bool, + has_previous_page: bool, + end_cursor: String?, + start_cursor: String? + } + end + end + end +end diff --git a/sig/whop_sdk/models/app_update_params.rbs b/sig/whop_sdk/models/app_update_params.rbs index 8161ef01..4bde388b 100644 --- a/sig/whop_sdk/models/app_update_params.rbs +++ b/sig/whop_sdk/models/app_update_params.rbs @@ -16,6 +16,8 @@ module WhopSDK openapi_path: String?, redirect_uris: ::Array[String]?, required_scopes: ::Array[WhopSDK::Models::AppUpdateParams::required_scope]?, + route: String?, + secrets: ::Hash[Symbol, top]?, skills_path: String?, status: WhopSDK::Models::app_statuses? } @@ -53,6 +55,10 @@ module WhopSDK attr_accessor required_scopes: ::Array[WhopSDK::Models::AppUpdateParams::required_scope]? + attr_accessor route: String? + + attr_accessor secrets: ::Hash[Symbol, top]? + attr_accessor skills_path: String? attr_accessor status: WhopSDK::Models::app_statuses? @@ -72,6 +78,8 @@ module WhopSDK ?openapi_path: String?, ?redirect_uris: ::Array[String]?, ?required_scopes: ::Array[WhopSDK::Models::AppUpdateParams::required_scope]?, + ?route: String?, + ?secrets: ::Hash[Symbol, top]?, ?skills_path: String?, ?status: WhopSDK::Models::app_statuses?, ?request_options: WhopSDK::request_opts @@ -92,6 +100,8 @@ module WhopSDK openapi_path: String?, redirect_uris: ::Array[String]?, required_scopes: ::Array[WhopSDK::Models::AppUpdateParams::required_scope]?, + route: String?, + secrets: ::Hash[Symbol, top]?, skills_path: String?, status: WhopSDK::Models::app_statuses?, request_options: WhopSDK::RequestOptions diff --git a/sig/whop_sdk/models/audience.rbs b/sig/whop_sdk/models/audience.rbs new file mode 100644 index 00000000..557659a1 --- /dev/null +++ b/sig/whop_sdk/models/audience.rbs @@ -0,0 +1,86 @@ +module WhopSDK + module Models + type audience = + { + id: String, + created_at: Float, + error_message: String?, + matched_rows: Float, + name: String, + platform_audience_ids: ::Array[String], + processed_rows: Float, + progress_percent: Float, + status: WhopSDK::Models::Audience::status, + total_rows: Float, + updated_at: Float + } + + class Audience < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Float + + attr_accessor error_message: String? + + attr_accessor matched_rows: Float + + attr_accessor name: String + + attr_accessor platform_audience_ids: ::Array[String] + + attr_accessor processed_rows: Float + + attr_accessor progress_percent: Float + + attr_accessor status: WhopSDK::Models::Audience::status + + attr_accessor total_rows: Float + + attr_accessor updated_at: Float + + def initialize: ( + id: String, + created_at: Float, + error_message: String?, + matched_rows: Float, + name: String, + platform_audience_ids: ::Array[String], + processed_rows: Float, + progress_percent: Float, + status: WhopSDK::Models::Audience::status, + total_rows: Float, + updated_at: Float + ) -> void + + def to_hash: -> { + id: String, + created_at: Float, + error_message: String?, + matched_rows: Float, + name: String, + platform_audience_ids: ::Array[String], + processed_rows: Float, + progress_percent: Float, + status: WhopSDK::Models::Audience::status, + total_rows: Float, + updated_at: Float + } + + type status = + :pending | :processing | :syncing | :ready | :partial | :failed + + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING: :pending + PROCESSING: :processing + SYNCING: :syncing + READY: :ready + PARTIAL: :partial + FAILED: :failed + + def self?.values: -> ::Array[WhopSDK::Models::Audience::status] + end + end + end +end diff --git a/sig/whop_sdk/models/audience_create_params.rbs b/sig/whop_sdk/models/audience_create_params.rbs new file mode 100644 index 00000000..d8af23ae --- /dev/null +++ b/sig/whop_sdk/models/audience_create_params.rbs @@ -0,0 +1,88 @@ +module WhopSDK + module Models + type audience_create_params = + { + account_id: String, + column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping, + file_id: String, + name: String + } + & WhopSDK::Internal::Type::request_parameters + + class AudienceCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_accessor column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping + + attr_accessor file_id: String + + attr_accessor name: String + + def initialize: ( + account_id: String, + column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping, + file_id: String, + name: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping, + file_id: String, + name: String, + request_options: WhopSDK::RequestOptions + } + + type column_mapping = + { + country: String, + email: String, + first_name: String, + last_name: String, + phone: String + } + + class ColumnMapping < WhopSDK::Internal::Type::BaseModel + attr_reader country: String? + + def country=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone: String? + + def phone=: (String) -> String + + def initialize: ( + ?country: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone: String + ) -> void + + def to_hash: -> { + country: String, + email: String, + first_name: String, + last_name: String, + phone: String + } + end + end + end +end diff --git a/sig/whop_sdk/models/audience_delete_params.rbs b/sig/whop_sdk/models/audience_delete_params.rbs new file mode 100644 index 00000000..66677ece --- /dev/null +++ b/sig/whop_sdk/models/audience_delete_params.rbs @@ -0,0 +1,23 @@ +module WhopSDK + module Models + type audience_delete_params = + { audience_id: String } & WhopSDK::Internal::Type::request_parameters + + class AudienceDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor audience_id: String + + def initialize: ( + audience_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + audience_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/audience_delete_response.rbs b/sig/whop_sdk/models/audience_delete_response.rbs new file mode 100644 index 00000000..95dd6c6b --- /dev/null +++ b/sig/whop_sdk/models/audience_delete_response.rbs @@ -0,0 +1,13 @@ +module WhopSDK + module Models + type audience_delete_response = { success: bool } + + class AudienceDeleteResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor success: bool + + def initialize: (success: bool) -> void + + def to_hash: -> { success: bool } + end + end +end diff --git a/sig/whop_sdk/models/audience_list_params.rbs b/sig/whop_sdk/models/audience_list_params.rbs new file mode 100644 index 00000000..b6ec7676 --- /dev/null +++ b/sig/whop_sdk/models/audience_list_params.rbs @@ -0,0 +1,42 @@ +module WhopSDK + module Models + type audience_list_params = + { account_id: String, after: String, audience_id: String, first: Integer } + & WhopSDK::Internal::Type::request_parameters + + class AudienceListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader audience_id: String? + + def audience_id=: (String) -> String + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + def initialize: ( + account_id: String, + ?after: String, + ?audience_id: String, + ?first: Integer, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + after: String, + audience_id: String, + first: Integer, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/authorized_user_create_params.rbs b/sig/whop_sdk/models/authorized_user_create_params.rbs index 9f4cf7c6..2026a7cb 100644 --- a/sig/whop_sdk/models/authorized_user_create_params.rbs +++ b/sig/whop_sdk/models/authorized_user_create_params.rbs @@ -5,6 +5,7 @@ module WhopSDK company_id: String, role: WhopSDK::Models::authorized_user_roles, user_id: String, + elevation: WhopSDK::AuthorizedUserCreateParams::Elevation?, send_emails: bool? } & WhopSDK::Internal::Type::request_parameters @@ -19,12 +20,15 @@ module WhopSDK attr_accessor user_id: String + attr_accessor elevation: WhopSDK::AuthorizedUserCreateParams::Elevation? + attr_accessor send_emails: bool? def initialize: ( company_id: String, role: WhopSDK::Models::authorized_user_roles, user_id: String, + ?elevation: WhopSDK::AuthorizedUserCreateParams::Elevation?, ?send_emails: bool?, ?request_options: WhopSDK::request_opts ) -> void @@ -33,9 +37,57 @@ module WhopSDK company_id: String, role: WhopSDK::Models::authorized_user_roles, user_id: String, + elevation: WhopSDK::AuthorizedUserCreateParams::Elevation?, send_emails: bool?, request_options: WhopSDK::RequestOptions } + + type elevation = + { + authenticator_data: String?, + client_data_json: String?, + credential_id: String?, + email_code: String?, + signature: String?, + totp_code: String?, + use_finance_session: bool? + } + + class Elevation < WhopSDK::Internal::Type::BaseModel + attr_accessor authenticator_data: String? + + attr_accessor client_data_json: String? + + attr_accessor credential_id: String? + + attr_accessor email_code: String? + + attr_accessor signature: String? + + attr_accessor totp_code: String? + + attr_accessor use_finance_session: bool? + + def initialize: ( + ?authenticator_data: String?, + ?client_data_json: String?, + ?credential_id: String?, + ?email_code: String?, + ?signature: String?, + ?totp_code: String?, + ?use_finance_session: bool? + ) -> void + + def to_hash: -> { + authenticator_data: String?, + client_data_json: String?, + credential_id: String?, + email_code: String?, + signature: String?, + totp_code: String?, + use_finance_session: bool? + } + end end end end diff --git a/sig/whop_sdk/models/bounty_create_params.rbs b/sig/whop_sdk/models/bounty_create_params.rbs index 48af968e..afa7ef6d 100644 --- a/sig/whop_sdk/models/bounty_create_params.rbs +++ b/sig/whop_sdk/models/bounty_create_params.rbs @@ -8,10 +8,14 @@ module WhopSDK title: String, accepted_submissions_limit: Integer?, allowed_country_codes: ::Array[String]?, + business_goal_type: WhopSDK::Models::BountyCreateParams::business_goal_type?, experience_id: String?, origin_account_id: String?, post_markdown_content: String?, - post_title: String? + post_title: String?, + scheduled_frequency: WhopSDK::Models::BountyCreateParams::scheduled_frequency?, + scheduled_publish_at: Time?, + scheduled_timezone: String? } & WhopSDK::Internal::Type::request_parameters @@ -31,6 +35,8 @@ module WhopSDK attr_accessor allowed_country_codes: ::Array[String]? + attr_accessor business_goal_type: WhopSDK::Models::BountyCreateParams::business_goal_type? + attr_accessor experience_id: String? attr_accessor origin_account_id: String? @@ -39,6 +45,12 @@ module WhopSDK attr_accessor post_title: String? + attr_accessor scheduled_frequency: WhopSDK::Models::BountyCreateParams::scheduled_frequency? + + attr_accessor scheduled_publish_at: Time? + + attr_accessor scheduled_timezone: String? + def initialize: ( base_unit_amount: Float, currency: WhopSDK::Models::currency, @@ -46,10 +58,14 @@ module WhopSDK title: String, ?accepted_submissions_limit: Integer?, ?allowed_country_codes: ::Array[String]?, + ?business_goal_type: WhopSDK::Models::BountyCreateParams::business_goal_type?, ?experience_id: String?, ?origin_account_id: String?, ?post_markdown_content: String?, ?post_title: String?, + ?scheduled_frequency: WhopSDK::Models::BountyCreateParams::scheduled_frequency?, + ?scheduled_publish_at: Time?, + ?scheduled_timezone: String?, ?request_options: WhopSDK::request_opts ) -> void @@ -60,12 +76,51 @@ module WhopSDK title: String, accepted_submissions_limit: Integer?, allowed_country_codes: ::Array[String]?, + business_goal_type: WhopSDK::Models::BountyCreateParams::business_goal_type?, experience_id: String?, origin_account_id: String?, post_markdown_content: String?, post_title: String?, + scheduled_frequency: WhopSDK::Models::BountyCreateParams::scheduled_frequency?, + scheduled_publish_at: Time?, + scheduled_timezone: String?, request_options: WhopSDK::RequestOptions } + + type business_goal_type = + :clipping + | :post_engagement + | :owned_account_growth + | :ugc_content + | :local_activation + | :other + + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + CLIPPING: :clipping + POST_ENGAGEMENT: :post_engagement + OWNED_ACCOUNT_GROWTH: :owned_account_growth + UGC_CONTENT: :ugc_content + LOCAL_ACTIVATION: :local_activation + OTHER: :other + + def self?.values: -> ::Array[WhopSDK::Models::BountyCreateParams::business_goal_type] + end + + type scheduled_frequency = :once | :hourly | :daily | :weekly | :monthly + + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + ONCE: :once + HOURLY: :hourly + DAILY: :daily + WEEKLY: :weekly + MONTHLY: :monthly + + def self?.values: -> ::Array[WhopSDK::Models::BountyCreateParams::scheduled_frequency] + end end end end diff --git a/sig/whop_sdk/models/bounty_create_response.rbs b/sig/whop_sdk/models/bounty_create_response.rbs index 4fbd7f35..d24218dc 100644 --- a/sig/whop_sdk/models/bounty_create_response.rbs +++ b/sig/whop_sdk/models/bounty_create_response.rbs @@ -78,13 +78,14 @@ module WhopSDK def self?.values: -> ::Array[WhopSDK::Models::BountyCreateResponse::bounty_type] end - type status = :published | :archived + type status = :published | :archived | :scheduled module Status extend WhopSDK::Internal::Type::Enum PUBLISHED: :published ARCHIVED: :archived + SCHEDULED: :scheduled def self?.values: -> ::Array[WhopSDK::Models::BountyCreateResponse::status] end diff --git a/sig/whop_sdk/models/bounty_list_params.rbs b/sig/whop_sdk/models/bounty_list_params.rbs index 7c4d0f4b..f388ca22 100644 --- a/sig/whop_sdk/models/bounty_list_params.rbs +++ b/sig/whop_sdk/models/bounty_list_params.rbs @@ -52,13 +52,14 @@ module WhopSDK request_options: WhopSDK::RequestOptions } - type status = :published | :archived + type status = :published | :archived | :scheduled module Status extend WhopSDK::Internal::Type::Enum PUBLISHED: :published ARCHIVED: :archived + SCHEDULED: :scheduled def self?.values: -> ::Array[WhopSDK::Models::BountyListParams::status] end diff --git a/sig/whop_sdk/models/bounty_list_response.rbs b/sig/whop_sdk/models/bounty_list_response.rbs index a3a5d017..42c58cc9 100644 --- a/sig/whop_sdk/models/bounty_list_response.rbs +++ b/sig/whop_sdk/models/bounty_list_response.rbs @@ -78,13 +78,14 @@ module WhopSDK def self?.values: -> ::Array[WhopSDK::Models::BountyListResponse::bounty_type] end - type status = :published | :archived + type status = :published | :archived | :scheduled module Status extend WhopSDK::Internal::Type::Enum PUBLISHED: :published ARCHIVED: :archived + SCHEDULED: :scheduled def self?.values: -> ::Array[WhopSDK::Models::BountyListResponse::status] end diff --git a/sig/whop_sdk/models/bounty_retrieve_response.rbs b/sig/whop_sdk/models/bounty_retrieve_response.rbs index 70b63671..538b0d46 100644 --- a/sig/whop_sdk/models/bounty_retrieve_response.rbs +++ b/sig/whop_sdk/models/bounty_retrieve_response.rbs @@ -78,13 +78,14 @@ module WhopSDK def self?.values: -> ::Array[WhopSDK::Models::BountyRetrieveResponse::bounty_type] end - type status = :published | :archived + type status = :published | :archived | :scheduled module Status extend WhopSDK::Internal::Type::Enum PUBLISHED: :published ARCHIVED: :archived + SCHEDULED: :scheduled def self?.values: -> ::Array[WhopSDK::Models::BountyRetrieveResponse::status] end diff --git a/sig/whop_sdk/models/card_brands.rbs b/sig/whop_sdk/models/card_brands.rbs index cc213261..6740b488 100644 --- a/sig/whop_sdk/models/card_brands.rbs +++ b/sig/whop_sdk/models/card_brands.rbs @@ -40,6 +40,7 @@ module WhopSDK | :hipercard | :jcblankapay | :cmi + | :aura | :unknown module CardBrands @@ -84,6 +85,7 @@ module WhopSDK HIPERCARD: :hipercard JCBLANKAPAY: :jcblankapay CMI: :cmi + AURA: :aura UNKNOWN: :unknown def self?.values: -> ::Array[WhopSDK::Models::card_brands] diff --git a/sig/whop_sdk/models/card_create_params.rbs b/sig/whop_sdk/models/card_create_params.rbs new file mode 100644 index 00000000..67fc1731 --- /dev/null +++ b/sig/whop_sdk/models/card_create_params.rbs @@ -0,0 +1,85 @@ +module WhopSDK + module Models + type card_create_params = + { + account_id: String, + assigned_user_id: String, + name: String, + spend_limit: Float, + spend_limit_frequency: WhopSDK::Models::CardCreateParams::spend_limit_frequency, + transaction_limit: Float, + user_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class CardCreateParams < 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 assigned_user_id: String? + + def assigned_user_id=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader spend_limit: Float? + + def spend_limit=: (Float) -> Float + + attr_reader spend_limit_frequency: WhopSDK::Models::CardCreateParams::spend_limit_frequency? + + def spend_limit_frequency=: ( + WhopSDK::Models::CardCreateParams::spend_limit_frequency + ) -> WhopSDK::Models::CardCreateParams::spend_limit_frequency + + attr_reader transaction_limit: Float? + + def transaction_limit=: (Float) -> Float + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + ?account_id: String, + ?assigned_user_id: String, + ?name: String, + ?spend_limit: Float, + ?spend_limit_frequency: WhopSDK::Models::CardCreateParams::spend_limit_frequency, + ?transaction_limit: Float, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + assigned_user_id: String, + name: String, + spend_limit: Float, + spend_limit_frequency: WhopSDK::Models::CardCreateParams::spend_limit_frequency, + transaction_limit: Float, + user_id: String, + request_options: WhopSDK::RequestOptions + } + + type spend_limit_frequency = :daily | :weekly | :monthly | :one_time + + module SpendLimitFrequency + extend WhopSDK::Internal::Type::Enum + + DAILY: :daily + WEEKLY: :weekly + MONTHLY: :monthly + ONE_TIME: :one_time + + def self?.values: -> ::Array[WhopSDK::Models::CardCreateParams::spend_limit_frequency] + end + end + end +end diff --git a/sig/whop_sdk/models/card_create_response.rbs b/sig/whop_sdk/models/card_create_response.rbs new file mode 100644 index 00000000..c117bcf1 --- /dev/null +++ b/sig/whop_sdk/models/card_create_response.rbs @@ -0,0 +1,200 @@ +module WhopSDK + module Models + type card_create_response = + { + id: String, + billing: WhopSDK::Models::CardCreateResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + :last4 => String?, + limit: WhopSDK::Models::CardCreateResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardCreateResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardCreateResponse::status?, + type: WhopSDK::Models::CardCreateResponse::type_?, + user_id: String?, + secrets: WhopSDK::Models::CardCreateResponse::Secrets? + } + + class CardCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor billing: WhopSDK::Models::CardCreateResponse::Billing? + + attr_accessor canceled_at: Time? + + attr_accessor created_at: Time? + + attr_accessor expiration_month: String? + + attr_accessor expiration_year: String? + + attr_accessor last4: String? + + attr_accessor limit: WhopSDK::Models::CardCreateResponse::Limit? + + attr_accessor name: String? + + attr_accessor object: WhopSDK::Models::CardCreateResponse::object + + attr_accessor spent_last_month: Integer? + + attr_accessor status: WhopSDK::Models::CardCreateResponse::status? + + attr_accessor type: WhopSDK::Models::CardCreateResponse::type_? + + attr_accessor user_id: String? + + attr_accessor secrets: WhopSDK::Models::CardCreateResponse::Secrets? + + def initialize: ( + id: String, + billing: WhopSDK::Models::CardCreateResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + last4: String?, + limit: WhopSDK::Models::CardCreateResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardCreateResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardCreateResponse::status?, + type: WhopSDK::Models::CardCreateResponse::type_?, + user_id: String?, + ?secrets: WhopSDK::Models::CardCreateResponse::Secrets? + ) -> void + + def to_hash: -> { + id: String, + billing: WhopSDK::Models::CardCreateResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + :last4 => String?, + limit: WhopSDK::Models::CardCreateResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardCreateResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardCreateResponse::status?, + type: WhopSDK::Models::CardCreateResponse::type_?, + user_id: String?, + secrets: WhopSDK::Models::CardCreateResponse::Secrets? + } + + type billing = + { + city: String?, + country_code: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + region: String? + } + + class Billing < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country_code: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor region: String? + + def initialize: ( + city: String?, + country_code: String?, + line1: String?, + line2: String?, + postal_code: String?, + region: String? + ) -> void + + def to_hash: -> { + city: String?, + country_code: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + region: String? + } + end + + type limit = { amount: Float, frequency: String } + + class Limit < WhopSDK::Internal::Type::BaseModel + attr_accessor amount: Float + + attr_accessor frequency: String + + def initialize: (amount: Float, frequency: String) -> void + + def to_hash: -> { amount: Float, frequency: String } + end + + type object = :card + + module Object + extend WhopSDK::Internal::Type::Enum + + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::CardCreateResponse::object] + end + + type status = :active | :frozen | :canceled | :invited + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + FROZEN: :frozen + CANCELED: :canceled + INVITED: :invited + + def self?.values: -> ::Array[WhopSDK::Models::CardCreateResponse::status] + end + + type type_ = :virtual | :physical + + module Type + extend WhopSDK::Internal::Type::Enum + + VIRTUAL: :virtual + PHYSICAL: :physical + + def self?.values: -> ::Array[WhopSDK::Models::CardCreateResponse::type_] + end + + type secrets = { card_number: String, cvc: String, name_on_card: String? } + + class Secrets < WhopSDK::Internal::Type::BaseModel + attr_accessor card_number: String + + attr_accessor cvc: String + + attr_accessor name_on_card: String? + + def initialize: ( + card_number: String, + cvc: String, + name_on_card: String? + ) -> void + + def to_hash: -> { + card_number: String, + cvc: String, + name_on_card: String? + } + end + end + end +end diff --git a/sig/whop_sdk/models/card_list_params.rbs b/sig/whop_sdk/models/card_list_params.rbs new file mode 100644 index 00000000..911e13bd --- /dev/null +++ b/sig/whop_sdk/models/card_list_params.rbs @@ -0,0 +1,32 @@ +module WhopSDK + module Models + type card_list_params = + { account_id: String, user_id: String } + & WhopSDK::Internal::Type::request_parameters + + class CardListParams < 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 user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + ?account_id: String, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/card_list_response.rbs b/sig/whop_sdk/models/card_list_response.rbs new file mode 100644 index 00000000..4e543a76 --- /dev/null +++ b/sig/whop_sdk/models/card_list_response.rbs @@ -0,0 +1,214 @@ +module WhopSDK + module Models + type card_list_response = + { data: ::Array[WhopSDK::Models::CardListResponse::Data] } + + class CardListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::CardListResponse::Data] + + def initialize: ( + data: ::Array[WhopSDK::Models::CardListResponse::Data] + ) -> void + + def to_hash: -> { data: ::Array[WhopSDK::Models::CardListResponse::Data] } + + type data = + { + id: String, + billing: WhopSDK::Models::CardListResponse::Data::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + :last4 => String?, + limit: WhopSDK::Models::CardListResponse::Data::Limit?, + name: String?, + object: WhopSDK::Models::CardListResponse::Data::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardListResponse::Data::status?, + type: WhopSDK::Models::CardListResponse::Data::type_?, + user_id: String?, + secrets: WhopSDK::Models::CardListResponse::Data::Secrets? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor billing: WhopSDK::Models::CardListResponse::Data::Billing? + + attr_accessor canceled_at: Time? + + attr_accessor created_at: Time? + + attr_accessor expiration_month: String? + + attr_accessor expiration_year: String? + + attr_accessor last4: String? + + attr_accessor limit: WhopSDK::Models::CardListResponse::Data::Limit? + + attr_accessor name: String? + + attr_accessor object: WhopSDK::Models::CardListResponse::Data::object + + attr_accessor spent_last_month: Integer? + + attr_accessor status: WhopSDK::Models::CardListResponse::Data::status? + + attr_accessor type: WhopSDK::Models::CardListResponse::Data::type_? + + attr_accessor user_id: String? + + attr_accessor secrets: WhopSDK::Models::CardListResponse::Data::Secrets? + + def initialize: ( + id: String, + billing: WhopSDK::Models::CardListResponse::Data::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + last4: String?, + limit: WhopSDK::Models::CardListResponse::Data::Limit?, + name: String?, + object: WhopSDK::Models::CardListResponse::Data::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardListResponse::Data::status?, + type: WhopSDK::Models::CardListResponse::Data::type_?, + user_id: String?, + ?secrets: WhopSDK::Models::CardListResponse::Data::Secrets? + ) -> void + + def to_hash: -> { + id: String, + billing: WhopSDK::Models::CardListResponse::Data::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + :last4 => String?, + limit: WhopSDK::Models::CardListResponse::Data::Limit?, + name: String?, + object: WhopSDK::Models::CardListResponse::Data::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardListResponse::Data::status?, + type: WhopSDK::Models::CardListResponse::Data::type_?, + user_id: String?, + secrets: WhopSDK::Models::CardListResponse::Data::Secrets? + } + + type billing = + { + city: String?, + country_code: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + region: String? + } + + class Billing < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country_code: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor region: String? + + def initialize: ( + city: String?, + country_code: String?, + line1: String?, + line2: String?, + postal_code: String?, + region: String? + ) -> void + + def to_hash: -> { + city: String?, + country_code: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + region: String? + } + end + + type limit = { amount: Float, frequency: String } + + class Limit < WhopSDK::Internal::Type::BaseModel + attr_accessor amount: Float + + attr_accessor frequency: String + + def initialize: (amount: Float, frequency: String) -> void + + def to_hash: -> { amount: Float, frequency: String } + end + + type object = :card + + module Object + extend WhopSDK::Internal::Type::Enum + + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::CardListResponse::Data::object] + end + + type status = :active | :frozen | :canceled | :invited + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + FROZEN: :frozen + CANCELED: :canceled + INVITED: :invited + + def self?.values: -> ::Array[WhopSDK::Models::CardListResponse::Data::status] + end + + type type_ = :virtual | :physical + + module Type + extend WhopSDK::Internal::Type::Enum + + VIRTUAL: :virtual + PHYSICAL: :physical + + def self?.values: -> ::Array[WhopSDK::Models::CardListResponse::Data::type_] + end + + type secrets = + { card_number: String, cvc: String, name_on_card: String? } + + class Secrets < WhopSDK::Internal::Type::BaseModel + attr_accessor card_number: String + + attr_accessor cvc: String + + attr_accessor name_on_card: String? + + def initialize: ( + card_number: String, + cvc: String, + name_on_card: String? + ) -> void + + def to_hash: -> { + card_number: String, + cvc: String, + name_on_card: String? + } + end + end + end + end +end diff --git a/sig/whop_sdk/models/card_retrieve_params.rbs b/sig/whop_sdk/models/card_retrieve_params.rbs new file mode 100644 index 00000000..812b19f1 --- /dev/null +++ b/sig/whop_sdk/models/card_retrieve_params.rbs @@ -0,0 +1,36 @@ +module WhopSDK + module Models + type card_retrieve_params = + { card_id: String, account_id: String, user_id: String } + & WhopSDK::Internal::Type::request_parameters + + class CardRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor card_id: String + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + card_id: String, + ?account_id: String, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + card_id: String, + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/card_retrieve_response.rbs b/sig/whop_sdk/models/card_retrieve_response.rbs new file mode 100644 index 00000000..5257dcb0 --- /dev/null +++ b/sig/whop_sdk/models/card_retrieve_response.rbs @@ -0,0 +1,200 @@ +module WhopSDK + module Models + type card_retrieve_response = + { + id: String, + billing: WhopSDK::Models::CardRetrieveResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + :last4 => String?, + limit: WhopSDK::Models::CardRetrieveResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardRetrieveResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardRetrieveResponse::status?, + type: WhopSDK::Models::CardRetrieveResponse::type_?, + user_id: String?, + secrets: WhopSDK::Models::CardRetrieveResponse::Secrets? + } + + class CardRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor billing: WhopSDK::Models::CardRetrieveResponse::Billing? + + attr_accessor canceled_at: Time? + + attr_accessor created_at: Time? + + attr_accessor expiration_month: String? + + attr_accessor expiration_year: String? + + attr_accessor last4: String? + + attr_accessor limit: WhopSDK::Models::CardRetrieveResponse::Limit? + + attr_accessor name: String? + + attr_accessor object: WhopSDK::Models::CardRetrieveResponse::object + + attr_accessor spent_last_month: Integer? + + attr_accessor status: WhopSDK::Models::CardRetrieveResponse::status? + + attr_accessor type: WhopSDK::Models::CardRetrieveResponse::type_? + + attr_accessor user_id: String? + + attr_accessor secrets: WhopSDK::Models::CardRetrieveResponse::Secrets? + + def initialize: ( + id: String, + billing: WhopSDK::Models::CardRetrieveResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + last4: String?, + limit: WhopSDK::Models::CardRetrieveResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardRetrieveResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardRetrieveResponse::status?, + type: WhopSDK::Models::CardRetrieveResponse::type_?, + user_id: String?, + ?secrets: WhopSDK::Models::CardRetrieveResponse::Secrets? + ) -> void + + def to_hash: -> { + id: String, + billing: WhopSDK::Models::CardRetrieveResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + :last4 => String?, + limit: WhopSDK::Models::CardRetrieveResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardRetrieveResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardRetrieveResponse::status?, + type: WhopSDK::Models::CardRetrieveResponse::type_?, + user_id: String?, + secrets: WhopSDK::Models::CardRetrieveResponse::Secrets? + } + + type billing = + { + city: String?, + country_code: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + region: String? + } + + class Billing < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country_code: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor region: String? + + def initialize: ( + city: String?, + country_code: String?, + line1: String?, + line2: String?, + postal_code: String?, + region: String? + ) -> void + + def to_hash: -> { + city: String?, + country_code: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + region: String? + } + end + + type limit = { amount: Float, frequency: String } + + class Limit < WhopSDK::Internal::Type::BaseModel + attr_accessor amount: Float + + attr_accessor frequency: String + + def initialize: (amount: Float, frequency: String) -> void + + def to_hash: -> { amount: Float, frequency: String } + end + + type object = :card + + module Object + extend WhopSDK::Internal::Type::Enum + + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::CardRetrieveResponse::object] + end + + type status = :active | :frozen | :canceled | :invited + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + FROZEN: :frozen + CANCELED: :canceled + INVITED: :invited + + def self?.values: -> ::Array[WhopSDK::Models::CardRetrieveResponse::status] + end + + type type_ = :virtual | :physical + + module Type + extend WhopSDK::Internal::Type::Enum + + VIRTUAL: :virtual + PHYSICAL: :physical + + def self?.values: -> ::Array[WhopSDK::Models::CardRetrieveResponse::type_] + end + + type secrets = { card_number: String, cvc: String, name_on_card: String? } + + class Secrets < WhopSDK::Internal::Type::BaseModel + attr_accessor card_number: String + + attr_accessor cvc: String + + attr_accessor name_on_card: String? + + def initialize: ( + card_number: String, + cvc: String, + name_on_card: String? + ) -> void + + def to_hash: -> { + card_number: String, + cvc: String, + name_on_card: String? + } + end + end + end +end diff --git a/sig/whop_sdk/models/card_update_params.rbs b/sig/whop_sdk/models/card_update_params.rbs new file mode 100644 index 00000000..01d0664d --- /dev/null +++ b/sig/whop_sdk/models/card_update_params.rbs @@ -0,0 +1,164 @@ +module WhopSDK + module Models + type card_update_params = + { + card_id: String, + account_id: String, + billing: WhopSDK::CardUpdateParams::Billing, + canceled: bool, + frozen: bool, + name: String, + pin: String, + remove_limit: bool, + spend_limit: Float, + spend_limit_frequency: WhopSDK::Models::CardUpdateParams::spend_limit_frequency, + transaction_limit: Float, + user_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class CardUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor card_id: String + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader billing: WhopSDK::CardUpdateParams::Billing? + + def billing=: ( + WhopSDK::CardUpdateParams::Billing + ) -> WhopSDK::CardUpdateParams::Billing + + attr_reader canceled: bool? + + def canceled=: (bool) -> bool + + attr_reader frozen: bool? + + def frozen=: (bool) -> bool + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader pin: String? + + def pin=: (String) -> String + + attr_reader remove_limit: bool? + + def remove_limit=: (bool) -> bool + + attr_reader spend_limit: Float? + + def spend_limit=: (Float) -> Float + + attr_reader spend_limit_frequency: WhopSDK::Models::CardUpdateParams::spend_limit_frequency? + + def spend_limit_frequency=: ( + WhopSDK::Models::CardUpdateParams::spend_limit_frequency + ) -> WhopSDK::Models::CardUpdateParams::spend_limit_frequency + + attr_reader transaction_limit: Float? + + def transaction_limit=: (Float) -> Float + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + card_id: String, + ?account_id: String, + ?billing: WhopSDK::CardUpdateParams::Billing, + ?canceled: bool, + ?frozen: bool, + ?name: String, + ?pin: String, + ?remove_limit: bool, + ?spend_limit: Float, + ?spend_limit_frequency: WhopSDK::Models::CardUpdateParams::spend_limit_frequency, + ?transaction_limit: Float, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + card_id: String, + account_id: String, + billing: WhopSDK::CardUpdateParams::Billing, + canceled: bool, + frozen: bool, + name: String, + pin: String, + remove_limit: bool, + spend_limit: Float, + spend_limit_frequency: WhopSDK::Models::CardUpdateParams::spend_limit_frequency, + transaction_limit: Float, + user_id: String, + request_options: WhopSDK::RequestOptions + } + + type billing = + { + city: String, + country_code: String, + :line1 => String, + postal_code: String, + region: String, + :line2 => String + } + + class Billing < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String + + attr_accessor country_code: String + + attr_accessor line1: String + + attr_accessor postal_code: String + + attr_accessor region: String + + attr_reader line2: String? + + def line2=: (String) -> String + + def initialize: ( + city: String, + country_code: String, + line1: String, + postal_code: String, + region: String, + ?line2: String + ) -> void + + def to_hash: -> { + city: String, + country_code: String, + :line1 => String, + postal_code: String, + region: String, + :line2 => String + } + end + + type spend_limit_frequency = :daily | :weekly | :monthly | :one_time + + module SpendLimitFrequency + extend WhopSDK::Internal::Type::Enum + + DAILY: :daily + WEEKLY: :weekly + MONTHLY: :monthly + ONE_TIME: :one_time + + def self?.values: -> ::Array[WhopSDK::Models::CardUpdateParams::spend_limit_frequency] + end + end + end +end diff --git a/sig/whop_sdk/models/card_update_response.rbs b/sig/whop_sdk/models/card_update_response.rbs new file mode 100644 index 00000000..8acef031 --- /dev/null +++ b/sig/whop_sdk/models/card_update_response.rbs @@ -0,0 +1,200 @@ +module WhopSDK + module Models + type card_update_response = + { + id: String, + billing: WhopSDK::Models::CardUpdateResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + :last4 => String?, + limit: WhopSDK::Models::CardUpdateResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardUpdateResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardUpdateResponse::status?, + type: WhopSDK::Models::CardUpdateResponse::type_?, + user_id: String?, + secrets: WhopSDK::Models::CardUpdateResponse::Secrets? + } + + class CardUpdateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor billing: WhopSDK::Models::CardUpdateResponse::Billing? + + attr_accessor canceled_at: Time? + + attr_accessor created_at: Time? + + attr_accessor expiration_month: String? + + attr_accessor expiration_year: String? + + attr_accessor last4: String? + + attr_accessor limit: WhopSDK::Models::CardUpdateResponse::Limit? + + attr_accessor name: String? + + attr_accessor object: WhopSDK::Models::CardUpdateResponse::object + + attr_accessor spent_last_month: Integer? + + attr_accessor status: WhopSDK::Models::CardUpdateResponse::status? + + attr_accessor type: WhopSDK::Models::CardUpdateResponse::type_? + + attr_accessor user_id: String? + + attr_accessor secrets: WhopSDK::Models::CardUpdateResponse::Secrets? + + def initialize: ( + id: String, + billing: WhopSDK::Models::CardUpdateResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + last4: String?, + limit: WhopSDK::Models::CardUpdateResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardUpdateResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardUpdateResponse::status?, + type: WhopSDK::Models::CardUpdateResponse::type_?, + user_id: String?, + ?secrets: WhopSDK::Models::CardUpdateResponse::Secrets? + ) -> void + + def to_hash: -> { + id: String, + billing: WhopSDK::Models::CardUpdateResponse::Billing?, + canceled_at: Time?, + created_at: Time?, + expiration_month: String?, + expiration_year: String?, + :last4 => String?, + limit: WhopSDK::Models::CardUpdateResponse::Limit?, + name: String?, + object: WhopSDK::Models::CardUpdateResponse::object, + spent_last_month: Integer?, + status: WhopSDK::Models::CardUpdateResponse::status?, + type: WhopSDK::Models::CardUpdateResponse::type_?, + user_id: String?, + secrets: WhopSDK::Models::CardUpdateResponse::Secrets? + } + + type billing = + { + city: String?, + country_code: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + region: String? + } + + class Billing < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country_code: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor region: String? + + def initialize: ( + city: String?, + country_code: String?, + line1: String?, + line2: String?, + postal_code: String?, + region: String? + ) -> void + + def to_hash: -> { + city: String?, + country_code: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + region: String? + } + end + + type limit = { amount: Float, frequency: String } + + class Limit < WhopSDK::Internal::Type::BaseModel + attr_accessor amount: Float + + attr_accessor frequency: String + + def initialize: (amount: Float, frequency: String) -> void + + def to_hash: -> { amount: Float, frequency: String } + end + + type object = :card + + module Object + extend WhopSDK::Internal::Type::Enum + + CARD: :card + + def self?.values: -> ::Array[WhopSDK::Models::CardUpdateResponse::object] + end + + type status = :active | :frozen | :canceled | :invited + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + FROZEN: :frozen + CANCELED: :canceled + INVITED: :invited + + def self?.values: -> ::Array[WhopSDK::Models::CardUpdateResponse::status] + end + + type type_ = :virtual | :physical + + module Type + extend WhopSDK::Internal::Type::Enum + + VIRTUAL: :virtual + PHYSICAL: :physical + + def self?.values: -> ::Array[WhopSDK::Models::CardUpdateResponse::type_] + end + + type secrets = { card_number: String, cvc: String, name_on_card: String? } + + class Secrets < WhopSDK::Internal::Type::BaseModel + attr_accessor card_number: String + + attr_accessor cvc: String + + attr_accessor name_on_card: String? + + def initialize: ( + card_number: String, + cvc: String, + name_on_card: String? + ) -> void + + def to_hash: -> { + card_number: String, + cvc: String, + name_on_card: String? + } + end + end + end +end diff --git a/sig/whop_sdk/models/chat_message_created_webhook_event.rbs b/sig/whop_sdk/models/chat_message_created_webhook_event.rbs new file mode 100644 index 00000000..81ac4f0c --- /dev/null +++ b/sig/whop_sdk/models/chat_message_created_webhook_event.rbs @@ -0,0 +1,149 @@ +module WhopSDK + module Models + type chat_message_created_webhook_event = + { + id: String, + api_version: :v1, + data: WhopSDK::ChatMessageCreatedWebhookEvent::Data, + timestamp: Time, + type: :"chat.message.created", + company_id: String? + } + + class ChatMessageCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor api_version: :v1 + + attr_accessor data: WhopSDK::ChatMessageCreatedWebhookEvent::Data + + attr_accessor timestamp: Time + + attr_accessor type: :"chat.message.created" + + attr_accessor company_id: String? + + def initialize: ( + id: String, + data: WhopSDK::ChatMessageCreatedWebhookEvent::Data, + timestamp: Time, + ?company_id: String?, + ?api_version: :v1, + ?type: :"chat.message.created" + ) -> void + + def to_hash: -> { + id: String, + api_version: :v1, + data: WhopSDK::ChatMessageCreatedWebhookEvent::Data, + timestamp: Time, + type: :"chat.message.created", + company_id: String? + } + + type data = + { + audience: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience, + channel: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel, + message: WhopSDK::Message, + reason: String + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor audience: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience + + attr_accessor channel: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel + + attr_accessor message: WhopSDK::Message + + attr_accessor reason: String + + def initialize: ( + audience: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience, + channel: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel, + message: WhopSDK::Message, + reason: String + ) -> void + + def to_hash: -> { + audience: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Audience, + channel: WhopSDK::ChatMessageCreatedWebhookEvent::Data::Channel, + message: WhopSDK::Message, + reason: String + } + + type audience = + { + type: WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience::type_, + user_ids: ::Array[String]? + } + + class Audience < WhopSDK::Internal::Type::BaseModel + attr_accessor type: WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience::type_ + + attr_accessor user_ids: ::Array[String]? + + def initialize: ( + type: WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience::type_, + ?user_ids: ::Array[String]? + ) -> void + + def to_hash: -> { + type: WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience::type_, + user_ids: ::Array[String]? + } + + type type_ = :channel | :users + + module Type + extend WhopSDK::Internal::Type::Enum + + CHANNEL: :channel + USERS: :users + + def self?.values: -> ::Array[WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Audience::type_] + end + end + + type channel = + { + id: String, + type: WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel::type_, + experience_id: String? + } + + class Channel < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel::type_ + + attr_accessor experience_id: String? + + def initialize: ( + id: String, + type: WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel::type_, + ?experience_id: String? + ) -> void + + def to_hash: -> { + id: String, + type: WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel::type_, + experience_id: String? + } + + type type_ = :chat | :direct_message | :support + + module Type + extend WhopSDK::Internal::Type::Enum + + CHAT: :chat + DIRECT_MESSAGE: :direct_message + SUPPORT: :support + + def self?.values: -> ::Array[WhopSDK::Models::ChatMessageCreatedWebhookEvent::Data::Channel::type_] + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/chat_reaction_created_webhook_event.rbs b/sig/whop_sdk/models/chat_reaction_created_webhook_event.rbs new file mode 100644 index 00000000..2d32e2fe --- /dev/null +++ b/sig/whop_sdk/models/chat_reaction_created_webhook_event.rbs @@ -0,0 +1,154 @@ +module WhopSDK + module Models + type chat_reaction_created_webhook_event = + { + id: String, + api_version: :v1, + data: WhopSDK::ChatReactionCreatedWebhookEvent::Data, + timestamp: Time, + type: :"chat.reaction.created", + company_id: String? + } + + class ChatReactionCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor api_version: :v1 + + attr_accessor data: WhopSDK::ChatReactionCreatedWebhookEvent::Data + + attr_accessor timestamp: Time + + attr_accessor type: :"chat.reaction.created" + + attr_accessor company_id: String? + + def initialize: ( + id: String, + data: WhopSDK::ChatReactionCreatedWebhookEvent::Data, + timestamp: Time, + ?company_id: String?, + ?api_version: :v1, + ?type: :"chat.reaction.created" + ) -> void + + def to_hash: -> { + id: String, + api_version: :v1, + data: WhopSDK::ChatReactionCreatedWebhookEvent::Data, + timestamp: Time, + type: :"chat.reaction.created", + company_id: String? + } + + type data = + { + audience: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience, + channel: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel, + message: WhopSDK::Message, + reaction: WhopSDK::Reaction, + reason: String + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor audience: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience + + attr_accessor channel: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel + + attr_accessor message: WhopSDK::Message + + attr_accessor reaction: WhopSDK::Reaction + + attr_accessor reason: String + + def initialize: ( + audience: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience, + channel: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel, + message: WhopSDK::Message, + reaction: WhopSDK::Reaction, + reason: String + ) -> void + + def to_hash: -> { + audience: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Audience, + channel: WhopSDK::ChatReactionCreatedWebhookEvent::Data::Channel, + message: WhopSDK::Message, + reaction: WhopSDK::Reaction, + reason: String + } + + type audience = + { + type: WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience::type_, + user_ids: ::Array[String]? + } + + class Audience < WhopSDK::Internal::Type::BaseModel + attr_accessor type: WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience::type_ + + attr_accessor user_ids: ::Array[String]? + + def initialize: ( + type: WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience::type_, + ?user_ids: ::Array[String]? + ) -> void + + def to_hash: -> { + type: WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience::type_, + user_ids: ::Array[String]? + } + + type type_ = :channel | :users + + module Type + extend WhopSDK::Internal::Type::Enum + + CHANNEL: :channel + USERS: :users + + def self?.values: -> ::Array[WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Audience::type_] + end + end + + type channel = + { + id: String, + type: WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel::type_, + experience_id: String? + } + + class Channel < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel::type_ + + attr_accessor experience_id: String? + + def initialize: ( + id: String, + type: WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel::type_, + ?experience_id: String? + ) -> void + + def to_hash: -> { + id: String, + type: WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel::type_, + experience_id: String? + } + + type type_ = :chat | :direct_message | :support + + module Type + extend WhopSDK::Internal::Type::Enum + + CHAT: :chat + DIRECT_MESSAGE: :direct_message + SUPPORT: :support + + def self?.values: -> ::Array[WhopSDK::Models::ChatReactionCreatedWebhookEvent::Data::Channel::type_] + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/checkout_configuration.rbs b/sig/whop_sdk/models/checkout_configuration.rbs index 87256a23..0bc0184b 100644 --- a/sig/whop_sdk/models/checkout_configuration.rbs +++ b/sig/whop_sdk/models/checkout_configuration.rbs @@ -4,7 +4,6 @@ module WhopSDK { id: String, affiliate_code: String?, - allow_promo_codes: bool, company_id: String, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, @@ -20,8 +19,6 @@ module WhopSDK attr_accessor affiliate_code: String? - attr_accessor allow_promo_codes: bool - attr_accessor company_id: String attr_accessor currency: WhopSDK::Models::currency? @@ -41,7 +38,6 @@ module WhopSDK def initialize: ( id: String, affiliate_code: String?, - allow_promo_codes: bool, company_id: String, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, @@ -55,7 +51,6 @@ module WhopSDK def to_hash: -> { id: String, affiliate_code: String?, - allow_promo_codes: bool, company_id: String, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, diff --git a/sig/whop_sdk/models/checkout_configuration_create_params.rbs b/sig/whop_sdk/models/checkout_configuration_create_params.rbs index 6421bfb0..18654991 100644 --- a/sig/whop_sdk/models/checkout_configuration_create_params.rbs +++ b/sig/whop_sdk/models/checkout_configuration_create_params.rbs @@ -1,719 +1,260 @@ module WhopSDK module Models type checkout_configuration_create_params = - { body: WhopSDK::Models::CheckoutConfigurationCreateParams::body } + { + affiliate_code: String?, + company_id: String, + currency: String?, + metadata: top?, + mode: WhopSDK::Models::CheckoutConfigurationCreateParams::mode, + payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration?, + plan: WhopSDK::CheckoutConfigurationCreateParams::Plan?, + plan_id: String?, + redirect_url: String?, + three_ds_level: String? + } & WhopSDK::Internal::Type::request_parameters class CheckoutConfigurationCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor body: WhopSDK::Models::CheckoutConfigurationCreateParams::body - - def initialize: ( - body: WhopSDK::Models::CheckoutConfigurationCreateParams::body, - ?request_options: WhopSDK::request_opts - ) -> void - - def to_hash: -> { - body: WhopSDK::Models::CheckoutConfigurationCreateParams::body, - request_options: WhopSDK::RequestOptions - } - - type body = - WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan - | WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID - | WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup - - module Body - extend WhopSDK::Internal::Type::Union - - type create_checkout_session_input_mode_payment_with_plan = - { - plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, - affiliate_code: String?, - allow_promo_codes: bool?, - checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling?, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode, - payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration?, - redirect_url: String?, - source_url: String? - } - - class CreateCheckoutSessionInputModePaymentWithPlan < WhopSDK::Internal::Type::BaseModel - attr_accessor plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan - - attr_accessor affiliate_code: String? - - attr_accessor allow_promo_codes: bool? - - attr_accessor checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling? - - attr_accessor currency: WhopSDK::Models::currency? - - attr_accessor metadata: ::Hash[Symbol, top]? - - attr_reader mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode? - - def mode=: ( - WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode - ) -> WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode - - attr_accessor payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration? - - attr_accessor redirect_url: String? - - attr_accessor source_url: String? - - def initialize: ( - plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, - ?affiliate_code: String?, - ?allow_promo_codes: bool?, - ?checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling?, - ?currency: WhopSDK::Models::currency?, - ?metadata: ::Hash[Symbol, top]?, - ?mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode, - ?payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration?, - ?redirect_url: String?, - ?source_url: String? - ) -> void - - def to_hash: -> { - plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, - affiliate_code: String?, - allow_promo_codes: bool?, - checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling?, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode, - payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::PaymentMethodConfiguration?, - redirect_url: String?, - source_url: String? - } - - type plan = - { - company_id: String, - currency: WhopSDK::Models::currency, - adaptive_pricing_enabled: bool?, - application_fee_amount: Float?, - billing_period: Integer?, - custom_fields: ::Array[WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField]?, - description: String?, - expiration_days: Integer?, - force_create_new_plan: bool?, - image: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image?, - initial_price: Float?, - internal_notes: String?, - override_tax_type: WhopSDK::Models::tax_type?, - payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type?, - product: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product?, - product_id: String?, - release_method: WhopSDK::Models::release_method?, - renewal_price: Float?, - split_pay_required_payments: Integer?, - stock: Integer?, - title: String?, - trial_period_days: Integer?, - visibility: WhopSDK::Models::visibility? - } - - class Plan < WhopSDK::Internal::Type::BaseModel - attr_accessor company_id: String - - attr_accessor currency: WhopSDK::Models::currency - - attr_accessor adaptive_pricing_enabled: bool? - - attr_accessor application_fee_amount: Float? - - attr_accessor billing_period: Integer? - - attr_accessor custom_fields: ::Array[WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField]? - - attr_accessor description: String? - - attr_accessor expiration_days: Integer? - - attr_accessor force_create_new_plan: bool? - - attr_accessor image: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image? - - attr_accessor initial_price: Float? - - attr_accessor internal_notes: String? - - attr_accessor override_tax_type: WhopSDK::Models::tax_type? - - attr_accessor payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration? - - attr_accessor plan_type: WhopSDK::Models::plan_type? - - attr_accessor product: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product? - - attr_accessor product_id: String? - - attr_accessor release_method: WhopSDK::Models::release_method? - - attr_accessor renewal_price: Float? - - attr_accessor split_pay_required_payments: Integer? - - attr_accessor stock: Integer? - - attr_accessor title: String? - - attr_accessor trial_period_days: Integer? - - attr_accessor visibility: WhopSDK::Models::visibility? - - def initialize: ( - company_id: String, - currency: WhopSDK::Models::currency, - ?adaptive_pricing_enabled: bool?, - ?application_fee_amount: Float?, - ?billing_period: Integer?, - ?custom_fields: ::Array[WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField]?, - ?description: String?, - ?expiration_days: Integer?, - ?force_create_new_plan: bool?, - ?image: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image?, - ?initial_price: Float?, - ?internal_notes: String?, - ?override_tax_type: WhopSDK::Models::tax_type?, - ?payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration?, - ?plan_type: WhopSDK::Models::plan_type?, - ?product: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product?, - ?product_id: String?, - ?release_method: WhopSDK::Models::release_method?, - ?renewal_price: Float?, - ?split_pay_required_payments: Integer?, - ?stock: Integer?, - ?title: String?, - ?trial_period_days: Integer?, - ?visibility: WhopSDK::Models::visibility? - ) -> void - - def to_hash: -> { - company_id: String, - currency: WhopSDK::Models::currency, - adaptive_pricing_enabled: bool?, - application_fee_amount: Float?, - billing_period: Integer?, - custom_fields: ::Array[WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::CustomField]?, - description: String?, - expiration_days: Integer?, - force_create_new_plan: bool?, - image: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Image?, - initial_price: Float?, - internal_notes: String?, - override_tax_type: WhopSDK::Models::tax_type?, - payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type?, - product: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::Product?, - product_id: String?, - release_method: WhopSDK::Models::release_method?, - renewal_price: Float?, - split_pay_required_payments: Integer?, - stock: Integer?, - title: String?, - trial_period_days: Integer?, - visibility: WhopSDK::Models::visibility? - } - - type custom_field = - { - field_type: :text, - name: String, - id: String?, - order: Integer?, - placeholder: String?, - required: bool? - } - - class CustomField < WhopSDK::Internal::Type::BaseModel - attr_accessor field_type: :text - - attr_accessor name: String - - attr_accessor id: String? - - attr_accessor order: Integer? - - attr_accessor placeholder: String? - - attr_accessor required: bool? - - def initialize: ( - name: String, - ?id: String?, - ?order: Integer?, - ?placeholder: String?, - ?required: bool?, - ?field_type: :text - ) -> void - - def to_hash: -> { - field_type: :text, - name: String, - id: String?, - order: Integer?, - placeholder: String?, - required: bool? - } - end - - type image = { id: String } - - class Image < 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 = - { - external_identifier: String, - title: String, - collect_shipping_address: bool?, - custom_statement_descriptor: String?, - description: String?, - global_affiliate_percentage: Float?, - global_affiliate_status: WhopSDK::Models::global_affiliate_status?, - headline: String?, - product_tax_code_id: String?, - redirect_purchase_url: String?, - route: String?, - visibility: WhopSDK::Models::visibility? - } - - class Product < WhopSDK::Internal::Type::BaseModel - attr_accessor external_identifier: String - - attr_accessor title: String - - attr_accessor collect_shipping_address: bool? - - attr_accessor custom_statement_descriptor: String? - - attr_accessor description: String? - - attr_accessor global_affiliate_percentage: Float? - - attr_accessor global_affiliate_status: WhopSDK::Models::global_affiliate_status? - - attr_accessor headline: String? - - attr_accessor product_tax_code_id: String? - - attr_accessor redirect_purchase_url: String? - - attr_accessor route: String? - - attr_accessor visibility: WhopSDK::Models::visibility? - - def initialize: ( - external_identifier: String, - title: String, - ?collect_shipping_address: bool?, - ?custom_statement_descriptor: String?, - ?description: String?, - ?global_affiliate_percentage: Float?, - ?global_affiliate_status: WhopSDK::Models::global_affiliate_status?, - ?headline: String?, - ?product_tax_code_id: String?, - ?redirect_purchase_url: String?, - ?route: String?, - ?visibility: WhopSDK::Models::visibility? - ) -> void - - def to_hash: -> { - external_identifier: String, - title: String, - collect_shipping_address: bool?, - custom_statement_descriptor: String?, - description: String?, - global_affiliate_percentage: Float?, - global_affiliate_status: WhopSDK::Models::global_affiliate_status?, - headline: String?, - product_tax_code_id: String?, - redirect_purchase_url: String?, - route: String?, - visibility: WhopSDK::Models::visibility? - } - end - end - - 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 mode = :payment - - module Mode - extend WhopSDK::Internal::Type::Enum - - PAYMENT: :payment - - def self?.values: -> ::Array[WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode] - 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 - end - - type create_checkout_session_input_mode_payment_with_plan_id = - { - plan_id: String, - affiliate_code: String?, - allow_promo_codes: bool?, - checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling?, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode, - payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration?, - redirect_url: String?, - source_url: String? - } - - class CreateCheckoutSessionInputModePaymentWithPlanID < WhopSDK::Internal::Type::BaseModel - attr_accessor plan_id: String + attr_accessor affiliate_code: String? - attr_accessor affiliate_code: String? + attr_reader company_id: String? - attr_accessor allow_promo_codes: bool? + def company_id=: (String) -> String - attr_accessor checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling? + attr_accessor currency: String? - attr_accessor currency: WhopSDK::Models::currency? + attr_accessor metadata: top? - attr_accessor metadata: ::Hash[Symbol, top]? + attr_reader mode: WhopSDK::Models::CheckoutConfigurationCreateParams::mode? - attr_reader mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode? + def mode=: ( + WhopSDK::Models::CheckoutConfigurationCreateParams::mode + ) -> WhopSDK::Models::CheckoutConfigurationCreateParams::mode - def mode=: ( - WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode - ) -> WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode + attr_accessor payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration? - attr_accessor payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration? + attr_accessor plan: WhopSDK::CheckoutConfigurationCreateParams::Plan? - attr_accessor redirect_url: String? + attr_accessor plan_id: String? - attr_accessor source_url: String? + attr_accessor redirect_url: String? - def initialize: ( - plan_id: String, - ?affiliate_code: String?, - ?allow_promo_codes: bool?, - ?checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling?, - ?currency: WhopSDK::Models::currency?, - ?metadata: ::Hash[Symbol, top]?, - ?mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode, - ?payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration?, - ?redirect_url: String?, - ?source_url: String? - ) -> void - - def to_hash: -> { - plan_id: String, - affiliate_code: String?, - allow_promo_codes: bool?, - checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling?, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode, - payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::PaymentMethodConfiguration?, - redirect_url: String?, - source_url: String? - } + attr_accessor three_ds_level: String? - 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? + def initialize: ( + ?affiliate_code: String?, + ?company_id: String, + ?currency: String?, + ?metadata: top?, + ?mode: WhopSDK::Models::CheckoutConfigurationCreateParams::mode, + ?payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration?, + ?plan: WhopSDK::CheckoutConfigurationCreateParams::Plan?, + ?plan_id: String?, + ?redirect_url: String?, + ?three_ds_level: String?, + ?request_options: WhopSDK::request_opts + ) -> void - attr_accessor button_color: String? + def to_hash: -> { + affiliate_code: String?, + company_id: String, + currency: String?, + metadata: top?, + mode: WhopSDK::Models::CheckoutConfigurationCreateParams::mode, + payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration?, + plan: WhopSDK::CheckoutConfigurationCreateParams::Plan?, + plan_id: String?, + redirect_url: String?, + three_ds_level: String?, + request_options: WhopSDK::RequestOptions + } - attr_accessor font_family: WhopSDK::Models::checkout_font? + type mode = :payment | :setup - def initialize: ( - ?background_color: String?, - ?border_style: WhopSDK::Models::checkout_shape?, - ?button_color: String?, - ?font_family: WhopSDK::Models::checkout_font? - ) -> void + module Mode + extend WhopSDK::Internal::Type::Enum - def to_hash: -> { - background_color: String?, - border_style: WhopSDK::Models::checkout_shape?, - button_color: String?, - font_family: WhopSDK::Models::checkout_font? - } - end + PAYMENT: :payment + SETUP: :setup - type mode = :payment + def self?.values: -> ::Array[WhopSDK::Models::CheckoutConfigurationCreateParams::mode] + end - module Mode - extend WhopSDK::Internal::Type::Enum + type payment_method_configuration = + { + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool + } - PAYMENT: :payment + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + attr_reader disabled: ::Array[String]? - def self?.values: -> ::Array[WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode] - end + def disabled=: (::Array[String]) -> ::Array[String] - type payment_method_configuration = - { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool? - } + attr_reader enabled: ::Array[String]? - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - attr_accessor disabled: ::Array[WhopSDK::Models::payment_method_types] + 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? - ) -> void + def initialize: ( + ?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? - } - end - end + def to_hash: -> { + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool + } + end - type create_checkout_session_input_mode_setup = + type plan = + { + billing_period: Integer?, + company_id: String?, + currency: String?, + description: String?, + expiration_days: Integer?, + force_create_new_plan: bool?, + initial_price: Float?, + metadata: top?, + override_tax_type: String?, + payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration?, + plan_type: String?, + product_id: String?, + release_method: String?, + renewal_price: Float?, + stock: Integer?, + title: String?, + trial_period_days: Integer?, + unlimited_stock: bool?, + visibility: String? + } + + class Plan < WhopSDK::Internal::Type::BaseModel + attr_accessor billing_period: Integer? + + attr_accessor company_id: String? + + attr_accessor currency: String? + + attr_accessor description: String? + + attr_accessor expiration_days: Integer? + + attr_accessor force_create_new_plan: bool? + + attr_accessor initial_price: Float? + + attr_accessor metadata: top? + + attr_accessor override_tax_type: String? + + attr_accessor payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration? + + attr_accessor plan_type: String? + + attr_accessor product_id: String? + + attr_accessor release_method: String? + + attr_accessor renewal_price: Float? + + attr_accessor stock: Integer? + + attr_accessor title: String? + + attr_accessor trial_period_days: Integer? + + attr_accessor unlimited_stock: bool? + + attr_accessor visibility: String? + + def initialize: ( + ?billing_period: Integer?, + ?company_id: String?, + ?currency: String?, + ?description: String?, + ?expiration_days: Integer?, + ?force_create_new_plan: bool?, + ?initial_price: Float?, + ?metadata: top?, + ?override_tax_type: String?, + ?payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration?, + ?plan_type: String?, + ?product_id: String?, + ?release_method: String?, + ?renewal_price: Float?, + ?stock: Integer?, + ?title: String?, + ?trial_period_days: Integer?, + ?unlimited_stock: bool?, + ?visibility: String? + ) -> void + + def to_hash: -> { + billing_period: Integer?, + company_id: String?, + currency: String?, + description: String?, + expiration_days: Integer?, + force_create_new_plan: bool?, + initial_price: Float?, + metadata: top?, + override_tax_type: String?, + payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration?, + plan_type: String?, + product_id: String?, + release_method: String?, + renewal_price: Float?, + stock: Integer?, + title: String?, + trial_period_days: Integer?, + unlimited_stock: bool?, + visibility: String? + } + + type payment_method_configuration = { - company_id: String, - mode: :setup, - allow_promo_codes: bool?, - checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling?, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration?, - redirect_url: String?, - source_url: String?, - three_ds_level: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::three_ds_level? + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool } - class CreateCheckoutSessionInputModeSetup < WhopSDK::Internal::Type::BaseModel - attr_accessor company_id: String - - attr_accessor mode: :setup - - attr_accessor allow_promo_codes: bool? - - attr_accessor checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling? + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + attr_reader disabled: ::Array[String]? - attr_accessor currency: WhopSDK::Models::currency? + def disabled=: (::Array[String]) -> ::Array[String] - attr_accessor metadata: ::Hash[Symbol, top]? + attr_reader enabled: ::Array[String]? - attr_accessor payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration? + def enabled=: (::Array[String]) -> ::Array[String] - attr_accessor redirect_url: String? + attr_reader include_platform_defaults: bool? - attr_accessor source_url: String? - - attr_accessor three_ds_level: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::three_ds_level? + def include_platform_defaults=: (bool) -> bool def initialize: ( - company_id: String, - ?allow_promo_codes: bool?, - ?checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling?, - ?currency: WhopSDK::Models::currency?, - ?metadata: ::Hash[Symbol, top]?, - ?payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration?, - ?redirect_url: String?, - ?source_url: String?, - ?three_ds_level: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::three_ds_level?, - ?mode: :setup + ?disabled: ::Array[String], + ?enabled: ::Array[String], + ?include_platform_defaults: bool ) -> void def to_hash: -> { - company_id: String, - mode: :setup, - allow_promo_codes: bool?, - checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling?, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration?, - redirect_url: String?, - source_url: String?, - three_ds_level: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::three_ds_level? + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool } - - 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 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 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::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::three_ds_level] - end end - - def self?.variants: -> ::Array[WhopSDK::Models::CheckoutConfigurationCreateParams::body] end end end diff --git a/sig/whop_sdk/models/checkout_configuration_create_response.rbs b/sig/whop_sdk/models/checkout_configuration_create_response.rbs new file mode 100644 index 00000000..233912f4 --- /dev/null +++ b/sig/whop_sdk/models/checkout_configuration_create_response.rbs @@ -0,0 +1,196 @@ +module WhopSDK + module Models + type checkout_configuration_create_response = + { + id: String, + company_id: String, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationCreateResponse::mode, + updated_at: String, + affiliate_code: String?, + currency: String?, + metadata: top?, + payment_method_configuration: WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration?, + plan: WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan?, + purchase_url: String?, + redirect_url: String?, + three_ds_level: String? + } + + class CheckoutConfigurationCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor company_id: String + + attr_accessor created_at: String + + attr_accessor mode: WhopSDK::Models::CheckoutConfigurationCreateResponse::mode + + attr_accessor updated_at: String + + attr_accessor affiliate_code: String? + + attr_accessor currency: String? + + attr_accessor metadata: top? + + attr_accessor payment_method_configuration: WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration? + + attr_accessor plan: WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan? + + attr_accessor purchase_url: String? + + attr_accessor redirect_url: String? + + attr_accessor three_ds_level: String? + + def initialize: ( + id: String, + company_id: String, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationCreateResponse::mode, + updated_at: String, + ?affiliate_code: String?, + ?currency: String?, + ?metadata: top?, + ?payment_method_configuration: WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration?, + ?plan: WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan?, + ?purchase_url: String?, + ?redirect_url: String?, + ?three_ds_level: String? + ) -> void + + def to_hash: -> { + id: String, + company_id: String, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationCreateResponse::mode, + updated_at: String, + affiliate_code: String?, + currency: String?, + metadata: top?, + payment_method_configuration: WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration?, + plan: WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan?, + purchase_url: String?, + redirect_url: String?, + three_ds_level: String? + } + + type mode = :payment | :setup + + module Mode + extend WhopSDK::Internal::Type::Enum + + PAYMENT: :payment + SETUP: :setup + + def self?.values: -> ::Array[WhopSDK::Models::CheckoutConfigurationCreateResponse::mode] + end + + type payment_method_configuration = + { + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool + } + + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + attr_reader disabled: ::Array[String]? + + def disabled=: (::Array[String]) -> ::Array[String] + + attr_reader enabled: ::Array[String]? + + def enabled=: (::Array[String]) -> ::Array[String] + + attr_reader include_platform_defaults: bool? + + def include_platform_defaults=: (bool) -> bool + + def initialize: ( + ?disabled: ::Array[String], + ?enabled: ::Array[String], + ?include_platform_defaults: bool + ) -> void + + def to_hash: -> { + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool + } + end + + type plan = + { + id: String, + adaptive_pricing_enabled: bool, + billing_period: Integer?, + currency: String, + expiration_days: Integer?, + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: String?, + trial_period_days: Integer?, + visibility: String + } + + class Plan < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor adaptive_pricing_enabled: bool + + attr_accessor billing_period: Integer? + + attr_accessor currency: String + + attr_accessor expiration_days: Integer? + + attr_accessor initial_price: Float + + attr_accessor plan_type: String + + attr_accessor release_method: String + + attr_accessor renewal_price: Float + + attr_accessor three_ds_level: String? + + attr_accessor trial_period_days: Integer? + + attr_accessor visibility: String + + def initialize: ( + id: String, + adaptive_pricing_enabled: bool, + billing_period: Integer?, + currency: String, + expiration_days: Integer?, + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: String?, + trial_period_days: Integer?, + visibility: String + ) -> void + + def to_hash: -> { + id: String, + adaptive_pricing_enabled: bool, + billing_period: Integer?, + currency: String, + expiration_days: Integer?, + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: String?, + trial_period_days: Integer?, + visibility: String + } + end + end + end +end diff --git a/sig/whop_sdk/models/checkout_configuration_delete_params.rbs b/sig/whop_sdk/models/checkout_configuration_delete_params.rbs new file mode 100644 index 00000000..580c0508 --- /dev/null +++ b/sig/whop_sdk/models/checkout_configuration_delete_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type checkout_configuration_delete_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class CheckoutConfigurationDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/checkout_configuration_list_params.rbs b/sig/whop_sdk/models/checkout_configuration_list_params.rbs index dcea6231..bf85872a 100644 --- a/sig/whop_sdk/models/checkout_configuration_list_params.rbs +++ b/sig/whop_sdk/models/checkout_configuration_list_params.rbs @@ -3,14 +3,13 @@ module WhopSDK type checkout_configuration_list_params = { company_id: String, - after: String?, - before: String?, - created_after: Time?, - created_before: Time?, - direction: WhopSDK::Models::direction?, - first: Integer?, - last: Integer?, - plan_id: String? + after: String, + created_after: Integer, + created_before: Integer, + direction: WhopSDK::Models::CheckoutConfigurationListParams::direction, + first: Integer, + order: WhopSDK::Models::CheckoutConfigurationListParams::order, + plan_id: String } & WhopSDK::Internal::Type::request_parameters @@ -20,47 +19,82 @@ 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 created_after: Integer? - attr_accessor created_before: Time? + def created_after=: (Integer) -> Integer - attr_accessor direction: WhopSDK::Models::direction? + attr_reader created_before: Integer? - attr_accessor first: Integer? + def created_before=: (Integer) -> Integer - attr_accessor last: Integer? + attr_reader direction: WhopSDK::Models::CheckoutConfigurationListParams::direction? - attr_accessor plan_id: String? + def direction=: ( + WhopSDK::Models::CheckoutConfigurationListParams::direction + ) -> WhopSDK::Models::CheckoutConfigurationListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::CheckoutConfigurationListParams::order? + + def order=: ( + WhopSDK::Models::CheckoutConfigurationListParams::order + ) -> WhopSDK::Models::CheckoutConfigurationListParams::order + + attr_reader plan_id: String? + + def plan_id=: (String) -> String def initialize: ( company_id: String, - ?after: String?, - ?before: String?, - ?created_after: Time?, - ?created_before: Time?, - ?direction: WhopSDK::Models::direction?, - ?first: Integer?, - ?last: Integer?, - ?plan_id: String?, + ?after: String, + ?created_after: Integer, + ?created_before: Integer, + ?direction: WhopSDK::Models::CheckoutConfigurationListParams::direction, + ?first: Integer, + ?order: WhopSDK::Models::CheckoutConfigurationListParams::order, + ?plan_id: 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?, - plan_id: String?, + after: String, + created_after: Integer, + created_before: Integer, + direction: WhopSDK::Models::CheckoutConfigurationListParams::direction, + first: Integer, + order: WhopSDK::Models::CheckoutConfigurationListParams::order, + plan_id: 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::CheckoutConfigurationListParams::direction] + end + + type order = :created_at + + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT: :created_at + + def self?.values: -> ::Array[WhopSDK::Models::CheckoutConfigurationListParams::order] + end end end end diff --git a/sig/whop_sdk/models/checkout_configuration_list_response.rbs b/sig/whop_sdk/models/checkout_configuration_list_response.rbs index 0189fb29..47c1c33e 100644 --- a/sig/whop_sdk/models/checkout_configuration_list_response.rbs +++ b/sig/whop_sdk/models/checkout_configuration_list_response.rbs @@ -3,92 +3,119 @@ module WhopSDK type checkout_configuration_list_response = { id: String, - affiliate_code: String?, - allow_promo_codes: bool, company_id: String, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - mode: WhopSDK::Models::checkout_modes, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationListResponse::mode, + updated_at: String, + affiliate_code: String?, + currency: String?, + metadata: top?, payment_method_configuration: WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration?, plan: WhopSDK::Models::CheckoutConfigurationListResponse::Plan?, - purchase_url: String, - redirect_url: String? + purchase_url: String?, + redirect_url: String?, + three_ds_level: String? } class CheckoutConfigurationListResponse < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor affiliate_code: String? + attr_accessor company_id: String - attr_accessor allow_promo_codes: bool + attr_accessor created_at: String - attr_accessor company_id: String + attr_accessor mode: WhopSDK::Models::CheckoutConfigurationListResponse::mode + + attr_accessor updated_at: String - attr_accessor currency: WhopSDK::Models::currency? + attr_accessor affiliate_code: String? - attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor currency: String? - attr_accessor mode: WhopSDK::Models::checkout_modes + attr_accessor metadata: top? attr_accessor payment_method_configuration: WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration? attr_accessor plan: WhopSDK::Models::CheckoutConfigurationListResponse::Plan? - attr_accessor purchase_url: String + attr_accessor purchase_url: String? attr_accessor redirect_url: String? + attr_accessor three_ds_level: String? + def initialize: ( id: String, - affiliate_code: String?, - allow_promo_codes: bool, company_id: String, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - mode: WhopSDK::Models::checkout_modes, - payment_method_configuration: WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration?, - plan: WhopSDK::Models::CheckoutConfigurationListResponse::Plan?, - purchase_url: String, - redirect_url: String? + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationListResponse::mode, + updated_at: String, + ?affiliate_code: String?, + ?currency: String?, + ?metadata: top?, + ?payment_method_configuration: WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration?, + ?plan: WhopSDK::Models::CheckoutConfigurationListResponse::Plan?, + ?purchase_url: String?, + ?redirect_url: String?, + ?three_ds_level: String? ) -> void def to_hash: -> { id: String, - affiliate_code: String?, - allow_promo_codes: bool, company_id: String, - currency: WhopSDK::Models::currency?, - metadata: ::Hash[Symbol, top]?, - mode: WhopSDK::Models::checkout_modes, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationListResponse::mode, + updated_at: String, + affiliate_code: String?, + currency: String?, + metadata: top?, payment_method_configuration: WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration?, plan: WhopSDK::Models::CheckoutConfigurationListResponse::Plan?, - purchase_url: String, - redirect_url: String? + purchase_url: String?, + redirect_url: String?, + three_ds_level: String? } + type mode = :payment | :setup + + module Mode + extend WhopSDK::Internal::Type::Enum + + PAYMENT: :payment + SETUP: :setup + + def self?.values: -> ::Array[WhopSDK::Models::CheckoutConfigurationListResponse::mode] + end + type payment_method_configuration = { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], + 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]? - attr_accessor enabled: ::Array[WhopSDK::Models::payment_method_types] + def enabled=: (::Array[String]) -> ::Array[String] - attr_accessor include_platform_defaults: bool + attr_reader 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], + disabled: ::Array[String], + enabled: ::Array[String], include_platform_defaults: bool } end @@ -98,15 +125,15 @@ module WhopSDK id: String, adaptive_pricing_enabled: bool, billing_period: Integer?, - currency: WhopSDK::Models::currency, + currency: String, expiration_days: Integer?, initial_price: Float, - plan_type: WhopSDK::Models::plan_type, - release_method: WhopSDK::Models::release_method, + plan_type: String, + release_method: String, renewal_price: Float, - three_ds_level: WhopSDK::Models::CheckoutConfigurationListResponse::Plan::three_ds_level?, + three_ds_level: String?, trial_period_days: Integer?, - visibility: WhopSDK::Models::visibility + visibility: String } class Plan < WhopSDK::Internal::Type::BaseModel @@ -116,64 +143,53 @@ module WhopSDK attr_accessor billing_period: Integer? - attr_accessor currency: WhopSDK::Models::currency + attr_accessor currency: String attr_accessor expiration_days: Integer? attr_accessor initial_price: Float - attr_accessor plan_type: WhopSDK::Models::plan_type + attr_accessor plan_type: String - attr_accessor release_method: WhopSDK::Models::release_method + attr_accessor release_method: String attr_accessor renewal_price: Float - attr_accessor three_ds_level: WhopSDK::Models::CheckoutConfigurationListResponse::Plan::three_ds_level? + attr_accessor three_ds_level: String? attr_accessor trial_period_days: Integer? - attr_accessor visibility: WhopSDK::Models::visibility + attr_accessor visibility: String def initialize: ( id: String, adaptive_pricing_enabled: bool, billing_period: Integer?, - currency: WhopSDK::Models::currency, + currency: String, expiration_days: Integer?, initial_price: Float, - plan_type: WhopSDK::Models::plan_type, - release_method: WhopSDK::Models::release_method, + plan_type: String, + release_method: String, renewal_price: Float, - three_ds_level: WhopSDK::Models::CheckoutConfigurationListResponse::Plan::three_ds_level?, + three_ds_level: String?, trial_period_days: Integer?, - visibility: WhopSDK::Models::visibility + visibility: String ) -> void def to_hash: -> { id: String, adaptive_pricing_enabled: bool, billing_period: Integer?, - currency: WhopSDK::Models::currency, + currency: String, expiration_days: Integer?, initial_price: Float, - plan_type: WhopSDK::Models::plan_type, - release_method: WhopSDK::Models::release_method, + plan_type: String, + release_method: String, renewal_price: Float, - three_ds_level: WhopSDK::Models::CheckoutConfigurationListResponse::Plan::three_ds_level?, + three_ds_level: String?, trial_period_days: Integer?, - visibility: WhopSDK::Models::visibility + visibility: String } - - 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::CheckoutConfigurationListResponse::Plan::three_ds_level] - end end end end diff --git a/sig/whop_sdk/models/checkout_configuration_retrieve_response.rbs b/sig/whop_sdk/models/checkout_configuration_retrieve_response.rbs new file mode 100644 index 00000000..1ccfdc6b --- /dev/null +++ b/sig/whop_sdk/models/checkout_configuration_retrieve_response.rbs @@ -0,0 +1,196 @@ +module WhopSDK + module Models + type checkout_configuration_retrieve_response = + { + id: String, + company_id: String, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::mode, + updated_at: String, + affiliate_code: String?, + currency: String?, + metadata: top?, + payment_method_configuration: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration?, + plan: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan?, + purchase_url: String?, + redirect_url: String?, + three_ds_level: String? + } + + class CheckoutConfigurationRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor company_id: String + + attr_accessor created_at: String + + attr_accessor mode: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::mode + + attr_accessor updated_at: String + + attr_accessor affiliate_code: String? + + attr_accessor currency: String? + + attr_accessor metadata: top? + + attr_accessor payment_method_configuration: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration? + + attr_accessor plan: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan? + + attr_accessor purchase_url: String? + + attr_accessor redirect_url: String? + + attr_accessor three_ds_level: String? + + def initialize: ( + id: String, + company_id: String, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::mode, + updated_at: String, + ?affiliate_code: String?, + ?currency: String?, + ?metadata: top?, + ?payment_method_configuration: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration?, + ?plan: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan?, + ?purchase_url: String?, + ?redirect_url: String?, + ?three_ds_level: String? + ) -> void + + def to_hash: -> { + id: String, + company_id: String, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::mode, + updated_at: String, + affiliate_code: String?, + currency: String?, + metadata: top?, + payment_method_configuration: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration?, + plan: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan?, + purchase_url: String?, + redirect_url: String?, + three_ds_level: String? + } + + type mode = :payment | :setup + + module Mode + extend WhopSDK::Internal::Type::Enum + + PAYMENT: :payment + SETUP: :setup + + def self?.values: -> ::Array[WhopSDK::Models::CheckoutConfigurationRetrieveResponse::mode] + end + + type payment_method_configuration = + { + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool + } + + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + attr_reader disabled: ::Array[String]? + + def disabled=: (::Array[String]) -> ::Array[String] + + attr_reader enabled: ::Array[String]? + + def enabled=: (::Array[String]) -> ::Array[String] + + attr_reader include_platform_defaults: bool? + + def include_platform_defaults=: (bool) -> bool + + def initialize: ( + ?disabled: ::Array[String], + ?enabled: ::Array[String], + ?include_platform_defaults: bool + ) -> void + + def to_hash: -> { + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool + } + end + + type plan = + { + id: String, + adaptive_pricing_enabled: bool, + billing_period: Integer?, + currency: String, + expiration_days: Integer?, + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: String?, + trial_period_days: Integer?, + visibility: String + } + + class Plan < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor adaptive_pricing_enabled: bool + + attr_accessor billing_period: Integer? + + attr_accessor currency: String + + attr_accessor expiration_days: Integer? + + attr_accessor initial_price: Float + + attr_accessor plan_type: String + + attr_accessor release_method: String + + attr_accessor renewal_price: Float + + attr_accessor three_ds_level: String? + + attr_accessor trial_period_days: Integer? + + attr_accessor visibility: String + + def initialize: ( + id: String, + adaptive_pricing_enabled: bool, + billing_period: Integer?, + currency: String, + expiration_days: Integer?, + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: String?, + trial_period_days: Integer?, + visibility: String + ) -> void + + def to_hash: -> { + id: String, + adaptive_pricing_enabled: bool, + billing_period: Integer?, + currency: String, + expiration_days: Integer?, + initial_price: Float, + plan_type: String, + release_method: String, + renewal_price: Float, + three_ds_level: String?, + trial_period_days: Integer?, + visibility: String + } + end + end + end +end diff --git a/sig/whop_sdk/models/deposit_create_params.rbs b/sig/whop_sdk/models/deposit_create_params.rbs index ed187423..0a8b54fc 100644 --- a/sig/whop_sdk/models/deposit_create_params.rbs +++ b/sig/whop_sdk/models/deposit_create_params.rbs @@ -2,8 +2,8 @@ module WhopSDK module Models type deposit_create_params = { - amount: Float, destination: WhopSDK::Models::DepositCreateParams::destination, + amount: Float, metadata: ::Hash[Symbol, top], network: String? } @@ -13,10 +13,12 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor amount: Float - attr_accessor destination: WhopSDK::Models::DepositCreateParams::destination + attr_reader amount: Float? + + def amount=: (Float) -> Float + attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -24,16 +26,16 @@ module WhopSDK attr_accessor network: String? def initialize: ( - amount: Float, destination: WhopSDK::Models::DepositCreateParams::destination, + ?amount: Float, ?metadata: ::Hash[Symbol, top], ?network: String?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - amount: Float, destination: WhopSDK::Models::DepositCreateParams::destination, + amount: Float, metadata: ::Hash[Symbol, top], network: String?, request_options: WhopSDK::RequestOptions diff --git a/sig/whop_sdk/models/deposit_create_response.rbs b/sig/whop_sdk/models/deposit_create_response.rbs index d6697a58..2f455fd8 100644 --- a/sig/whop_sdk/models/deposit_create_response.rbs +++ b/sig/whop_sdk/models/deposit_create_response.rbs @@ -2,87 +2,175 @@ module WhopSDK module Models type deposit_create_response = { - amount: String, - deposit_address: WhopSDK::Models::DepositCreateResponse::DepositAddress, - destination: WhopSDK::Models::DepositCreateResponse::Destination, + account_id: String?, hosted_url: String?, metadata: ::Hash[Symbol, top], - object: WhopSDK::Models::DepositCreateResponse::object + methods_: WhopSDK::Models::DepositCreateResponse::Methods, + object: WhopSDK::Models::DepositCreateResponse::object, + amount: String } class DepositCreateResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor amount: String - - attr_accessor deposit_address: WhopSDK::Models::DepositCreateResponse::DepositAddress - - attr_accessor destination: WhopSDK::Models::DepositCreateResponse::Destination + attr_accessor account_id: String? attr_accessor hosted_url: String? attr_accessor metadata: ::Hash[Symbol, top] + attr_accessor methods_: WhopSDK::Models::DepositCreateResponse::Methods + attr_accessor object: WhopSDK::Models::DepositCreateResponse::object + attr_reader amount: String? + + def amount=: (String) -> String + def initialize: ( - amount: String, - deposit_address: WhopSDK::Models::DepositCreateResponse::DepositAddress, - destination: WhopSDK::Models::DepositCreateResponse::Destination, + account_id: String?, hosted_url: String?, metadata: ::Hash[Symbol, top], - object: WhopSDK::Models::DepositCreateResponse::object + methods_: WhopSDK::Models::DepositCreateResponse::Methods, + object: WhopSDK::Models::DepositCreateResponse::object, + ?amount: String ) -> void def to_hash: -> { - amount: String, - deposit_address: WhopSDK::Models::DepositCreateResponse::DepositAddress, - destination: WhopSDK::Models::DepositCreateResponse::Destination, + account_id: String?, hosted_url: String?, metadata: ::Hash[Symbol, top], - object: WhopSDK::Models::DepositCreateResponse::object + methods_: WhopSDK::Models::DepositCreateResponse::Methods, + object: WhopSDK::Models::DepositCreateResponse::object, + amount: String } - type deposit_address = { evm: String, solana: String } - - class DepositAddress < WhopSDK::Internal::Type::BaseModel - attr_accessor evm: String - - attr_accessor solana: String - - def initialize: (evm: String, solana: String) -> void - - def to_hash: -> { evm: String, solana: String } - end - - type destination = + type methods_ = { - address: String, - currency: String, - network: String, - account_id: String? + bank: WhopSDK::Models::DepositCreateResponse::Methods::Bank?, + crypto: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto] } - class Destination < WhopSDK::Internal::Type::BaseModel - attr_accessor address: String - - attr_accessor currency: String + class Methods < WhopSDK::Internal::Type::BaseModel + attr_accessor bank: WhopSDK::Models::DepositCreateResponse::Methods::Bank? - attr_accessor network: String - - attr_accessor account_id: String? + attr_accessor crypto: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto] def initialize: ( - address: String, - currency: String, - network: String, - ?account_id: String? + bank: WhopSDK::Models::DepositCreateResponse::Methods::Bank?, + crypto: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto] ) -> void def to_hash: -> { - address: String, - currency: String, - network: String, - account_id: String? + bank: WhopSDK::Models::DepositCreateResponse::Methods::Bank?, + crypto: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto] } + + type bank = + { + currencies: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency] + } + + class Bank < WhopSDK::Internal::Type::BaseModel + attr_accessor currencies: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency] + + def initialize: ( + currencies: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency] + ) -> void + + def to_hash: -> { + currencies: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Bank::Currency] + } + + type currency = + { + account_number: String?, + currency: String, + deposit_bank_name: String?, + deposit_beneficiary_name: String?, + deposit_reference: String?, + rails: ::Array[String], + routing_number: String? + } + + class Currency < WhopSDK::Internal::Type::BaseModel + attr_accessor account_number: String? + + attr_accessor currency: String + + attr_accessor deposit_bank_name: String? + + attr_accessor deposit_beneficiary_name: String? + + attr_accessor deposit_reference: String? + + attr_accessor rails: ::Array[String] + + attr_accessor routing_number: String? + + def initialize: ( + account_number: String?, + currency: String, + deposit_bank_name: String?, + deposit_beneficiary_name: String?, + deposit_reference: String?, + rails: ::Array[String], + routing_number: String? + ) -> void + + def to_hash: -> { + account_number: String?, + currency: String, + deposit_bank_name: String?, + deposit_beneficiary_name: String?, + deposit_reference: String?, + rails: ::Array[String], + routing_number: String? + } + end + end + + type crypto = + { + deposit_address: String?, + icon_url: String?, + name: String, + supported_currencies: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency] + } + + class Crypto < WhopSDK::Internal::Type::BaseModel + attr_accessor deposit_address: String? + + attr_accessor icon_url: String? + + attr_accessor name: String + + attr_accessor supported_currencies: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency] + + def initialize: ( + deposit_address: String?, + icon_url: String?, + name: String, + supported_currencies: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency] + ) -> void + + def to_hash: -> { + deposit_address: String?, + icon_url: String?, + name: String, + supported_currencies: ::Array[WhopSDK::Models::DepositCreateResponse::Methods::Crypto::SupportedCurrency] + } + + type supported_currency = { icon_url: String?, name: String } + + class SupportedCurrency < WhopSDK::Internal::Type::BaseModel + attr_accessor icon_url: String? + + attr_accessor name: String + + def initialize: (icon_url: String?, name: String) -> void + + def to_hash: -> { icon_url: String?, name: String } + end + end end type object = :deposit diff --git a/sig/whop_sdk/models/wallet_balance_params.rbs b/sig/whop_sdk/models/deposit_list_params.rbs similarity index 83% rename from sig/whop_sdk/models/wallet_balance_params.rbs rename to sig/whop_sdk/models/deposit_list_params.rbs index a0529093..8c1b9b0d 100644 --- a/sig/whop_sdk/models/wallet_balance_params.rbs +++ b/sig/whop_sdk/models/deposit_list_params.rbs @@ -1,9 +1,9 @@ module WhopSDK module Models - type wallet_balance_params = + type deposit_list_params = { account_id: String } & WhopSDK::Internal::Type::request_parameters - class WalletBalanceParams < WhopSDK::Internal::Type::BaseModel + class DepositListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters diff --git a/sig/whop_sdk/models/deposit_list_response.rbs b/sig/whop_sdk/models/deposit_list_response.rbs new file mode 100644 index 00000000..b5c99991 --- /dev/null +++ b/sig/whop_sdk/models/deposit_list_response.rbs @@ -0,0 +1,87 @@ +module WhopSDK + module Models + type deposit_list_response = + { + account_id: String, + bank: ::Array[WhopSDK::Models::DepositListResponse::Bank], + object: WhopSDK::Models::DepositListResponse::object + } + + class DepositListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String + + attr_accessor bank: ::Array[WhopSDK::Models::DepositListResponse::Bank] + + attr_accessor object: WhopSDK::Models::DepositListResponse::object + + def initialize: ( + account_id: String, + bank: ::Array[WhopSDK::Models::DepositListResponse::Bank], + object: WhopSDK::Models::DepositListResponse::object + ) -> void + + def to_hash: -> { + account_id: String, + bank: ::Array[WhopSDK::Models::DepositListResponse::Bank], + object: WhopSDK::Models::DepositListResponse::object + } + + type bank = + { + id: String, + created_at: Time, + destination_amount: String?, + destination_currency: String?, + source_amount: String, + source_currency: String, + status: String + } + + class Bank < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor destination_amount: String? + + attr_accessor destination_currency: String? + + attr_accessor source_amount: String + + attr_accessor source_currency: String + + attr_accessor status: String + + def initialize: ( + id: String, + created_at: Time, + destination_amount: String?, + destination_currency: String?, + source_amount: String, + source_currency: String, + status: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + destination_amount: String?, + destination_currency: String?, + source_amount: String, + source_currency: String, + status: String + } + end + + type object = :deposits + + module Object + extend WhopSDK::Internal::Type::Enum + + DEPOSITS: :deposits + + def self?.values: -> ::Array[WhopSDK::Models::DepositListResponse::object] + end + end + end +end diff --git a/sig/whop_sdk/models/conversion_create_params.rbs b/sig/whop_sdk/models/event_create_params.rbs similarity index 65% rename from sig/whop_sdk/models/conversion_create_params.rbs rename to sig/whop_sdk/models/event_create_params.rbs index 0d0b0fab..809343bf 100644 --- a/sig/whop_sdk/models/conversion_create_params.rbs +++ b/sig/whop_sdk/models/event_create_params.rbs @@ -1,12 +1,12 @@ module WhopSDK module Models - type conversion_create_params = + type event_create_params = { - company_id: String, - event_name: WhopSDK::Models::ConversionCreateParams::event_name, - action_source: WhopSDK::Models::ConversionCreateParams::action_source?, - context: WhopSDK::ConversionCreateParams::Context?, - currency: WhopSDK::Models::currency?, + account_id: String, + event_name: WhopSDK::Models::EventCreateParams::event_name, + action_source: WhopSDK::Models::EventCreateParams::action_source?, + context: WhopSDK::EventCreateParams::Context?, + currency: WhopSDK::Models::EventCreateParams::currency?, custom_name: String?, duration: Integer?, event_id: String?, @@ -18,24 +18,24 @@ module WhopSDK source: String?, title: String?, url: String?, - user: WhopSDK::ConversionCreateParams::User?, + user: WhopSDK::EventCreateParams::User?, value: Float? } & WhopSDK::Internal::Type::request_parameters - class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel + class EventCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor company_id: String + attr_accessor account_id: String - attr_accessor event_name: WhopSDK::Models::ConversionCreateParams::event_name + attr_accessor event_name: WhopSDK::Models::EventCreateParams::event_name - attr_accessor action_source: WhopSDK::Models::ConversionCreateParams::action_source? + attr_accessor action_source: WhopSDK::Models::EventCreateParams::action_source? - attr_accessor context: WhopSDK::ConversionCreateParams::Context? + attr_accessor context: WhopSDK::EventCreateParams::Context? - attr_accessor currency: WhopSDK::Models::currency? + attr_accessor currency: WhopSDK::Models::EventCreateParams::currency? attr_accessor custom_name: String? @@ -59,16 +59,16 @@ module WhopSDK attr_accessor url: String? - attr_accessor user: WhopSDK::ConversionCreateParams::User? + attr_accessor user: WhopSDK::EventCreateParams::User? attr_accessor value: Float? def initialize: ( - company_id: String, - event_name: WhopSDK::Models::ConversionCreateParams::event_name, - ?action_source: WhopSDK::Models::ConversionCreateParams::action_source?, - ?context: WhopSDK::ConversionCreateParams::Context?, - ?currency: WhopSDK::Models::currency?, + account_id: String, + event_name: WhopSDK::Models::EventCreateParams::event_name, + ?action_source: WhopSDK::Models::EventCreateParams::action_source?, + ?context: WhopSDK::EventCreateParams::Context?, + ?currency: WhopSDK::Models::EventCreateParams::currency?, ?custom_name: String?, ?duration: Integer?, ?event_id: String?, @@ -80,17 +80,17 @@ module WhopSDK ?source: String?, ?title: String?, ?url: String?, - ?user: WhopSDK::ConversionCreateParams::User?, + ?user: WhopSDK::EventCreateParams::User?, ?value: Float?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - company_id: String, - event_name: WhopSDK::Models::ConversionCreateParams::event_name, - action_source: WhopSDK::Models::ConversionCreateParams::action_source?, - context: WhopSDK::ConversionCreateParams::Context?, - currency: WhopSDK::Models::currency?, + account_id: String, + event_name: WhopSDK::Models::EventCreateParams::event_name, + action_source: WhopSDK::Models::EventCreateParams::action_source?, + context: WhopSDK::EventCreateParams::Context?, + currency: WhopSDK::Models::EventCreateParams::currency?, custom_name: String?, duration: Integer?, event_id: String?, @@ -102,7 +102,7 @@ module WhopSDK source: String?, title: String?, url: String?, - user: WhopSDK::ConversionCreateParams::User?, + user: WhopSDK::EventCreateParams::User?, value: Float?, request_options: WhopSDK::RequestOptions } @@ -131,7 +131,7 @@ module WhopSDK CUSTOM: :custom PAGE: :page - def self?.values: -> ::Array[WhopSDK::Models::ConversionCreateParams::event_name] + def self?.values: -> ::Array[WhopSDK::Models::EventCreateParams::event_name] end type action_source = @@ -158,7 +158,7 @@ module WhopSDK BUSINESS_MESSAGING: :business_messaging OTHER: :other - def self?.values: -> ::Array[WhopSDK::Models::ConversionCreateParams::action_source] + def self?.values: -> ::Array[WhopSDK::Models::EventCreateParams::action_source] end type context = @@ -328,6 +328,195 @@ module WhopSDK } end + 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 + + 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::EventCreateParams::currency] + end + type user = { anonymous_id: String?, @@ -337,7 +526,7 @@ module WhopSDK email: String?, external_id: String?, first_name: String?, - gender: WhopSDK::Models::ConversionCreateParams::User::gender?, + gender: WhopSDK::Models::EventCreateParams::User::gender?, last_name: String?, linked_anonymous_id: String?, linked_wuid: String?, @@ -366,7 +555,7 @@ module WhopSDK attr_accessor first_name: String? - attr_accessor gender: WhopSDK::Models::ConversionCreateParams::User::gender? + attr_accessor gender: WhopSDK::Models::EventCreateParams::User::gender? attr_accessor last_name: String? @@ -398,7 +587,7 @@ module WhopSDK ?email: String?, ?external_id: String?, ?first_name: String?, - ?gender: WhopSDK::Models::ConversionCreateParams::User::gender?, + ?gender: WhopSDK::Models::EventCreateParams::User::gender?, ?last_name: String?, ?linked_anonymous_id: String?, ?linked_wuid: String?, @@ -420,7 +609,7 @@ module WhopSDK email: String?, external_id: String?, first_name: String?, - gender: WhopSDK::Models::ConversionCreateParams::User::gender?, + gender: WhopSDK::Models::EventCreateParams::User::gender?, last_name: String?, linked_anonymous_id: String?, linked_wuid: String?, @@ -442,7 +631,7 @@ module WhopSDK MALE: :male FEMALE: :female - def self?.values: -> ::Array[WhopSDK::Models::ConversionCreateParams::User::gender] + def self?.values: -> ::Array[WhopSDK::Models::EventCreateParams::User::gender] end end end diff --git a/sig/whop_sdk/models/conversion_create_response.rbs b/sig/whop_sdk/models/event_create_response.rbs similarity index 56% rename from sig/whop_sdk/models/conversion_create_response.rbs rename to sig/whop_sdk/models/event_create_response.rbs index 82fddff3..b13ae295 100644 --- a/sig/whop_sdk/models/conversion_create_response.rbs +++ b/sig/whop_sdk/models/event_create_response.rbs @@ -1,8 +1,8 @@ module WhopSDK module Models - type conversion_create_response = { id: String } + type event_create_response = { id: String } - class ConversionCreateResponse < WhopSDK::Internal::Type::BaseModel + class EventCreateResponse < WhopSDK::Internal::Type::BaseModel attr_accessor id: String def initialize: (id: String) -> void diff --git a/sig/whop_sdk/models/event_list_params.rbs b/sig/whop_sdk/models/event_list_params.rbs new file mode 100644 index 00000000..61b30f50 --- /dev/null +++ b/sig/whop_sdk/models/event_list_params.rbs @@ -0,0 +1,68 @@ +module WhopSDK + module Models + type event_list_params = + { + person_id: String, + account_id: String, + after: String, + before: String, + first: Integer, + from: Integer, + to: Integer + } + & WhopSDK::Internal::Type::request_parameters + + class EventListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor person_id: String + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader from: Integer? + + def from=: (Integer) -> Integer + + attr_reader to: Integer? + + def to=: (Integer) -> Integer + + def initialize: ( + person_id: String, + ?account_id: String, + ?after: String, + ?before: String, + ?first: Integer, + ?from: Integer, + ?to: Integer, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + person_id: String, + account_id: String, + after: String, + before: String, + first: Integer, + from: Integer, + to: Integer, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/event_list_response.rbs b/sig/whop_sdk/models/event_list_response.rbs new file mode 100644 index 00000000..c364d764 --- /dev/null +++ b/sig/whop_sdk/models/event_list_response.rbs @@ -0,0 +1,231 @@ +module WhopSDK + module Models + type event_list_response = + { + id: String, + event_id: String, + event_name: String, + event_time: Integer, + context: WhopSDK::Models::EventListResponse::Context?, + currency: String?, + custom_name: String?, + path: String?, + questions: ::Array[WhopSDK::Models::EventListResponse::Question]?, + referrer_url: String?, + total_usd_amount: Float?, + url: String?, + user: WhopSDK::Models::EventListResponse::User?, + value: Float? + } + + class EventListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor event_id: String + + attr_accessor event_name: String + + attr_accessor event_time: Integer + + attr_accessor context: WhopSDK::Models::EventListResponse::Context? + + attr_accessor currency: String? + + attr_accessor custom_name: String? + + attr_accessor path: String? + + attr_accessor questions: ::Array[WhopSDK::Models::EventListResponse::Question]? + + attr_accessor referrer_url: String? + + attr_accessor total_usd_amount: Float? + + attr_accessor url: String? + + attr_accessor user: WhopSDK::Models::EventListResponse::User? + + attr_accessor value: Float? + + def initialize: ( + id: String, + event_id: String, + event_name: String, + event_time: Integer, + ?context: WhopSDK::Models::EventListResponse::Context?, + ?currency: String?, + ?custom_name: String?, + ?path: String?, + ?questions: ::Array[WhopSDK::Models::EventListResponse::Question]?, + ?referrer_url: String?, + ?total_usd_amount: Float?, + ?url: String?, + ?user: WhopSDK::Models::EventListResponse::User?, + ?value: Float? + ) -> void + + def to_hash: -> { + id: String, + event_id: String, + event_name: String, + event_time: Integer, + context: WhopSDK::Models::EventListResponse::Context?, + currency: String?, + custom_name: String?, + path: String?, + questions: ::Array[WhopSDK::Models::EventListResponse::Question]?, + referrer_url: String?, + total_usd_amount: Float?, + url: String?, + user: WhopSDK::Models::EventListResponse::User?, + value: Float? + } + + type context = + { + ad_campaign_id: String?, + ad_id: String?, + ad_set_id: String?, + utm_campaign: String?, + utm_content: String?, + utm_medium: String?, + utm_source: String?, + utm_term: String? + } + + class Context < WhopSDK::Internal::Type::BaseModel + attr_accessor ad_campaign_id: String? + + attr_accessor ad_id: String? + + attr_accessor ad_set_id: String? + + attr_accessor utm_campaign: String? + + attr_accessor utm_content: String? + + attr_accessor utm_medium: String? + + attr_accessor utm_source: String? + + attr_accessor utm_term: String? + + def initialize: ( + ?ad_campaign_id: String?, + ?ad_id: String?, + ?ad_set_id: String?, + ?utm_campaign: String?, + ?utm_content: String?, + ?utm_medium: String?, + ?utm_source: String?, + ?utm_term: String? + ) -> void + + def to_hash: -> { + ad_campaign_id: String?, + ad_id: String?, + ad_set_id: String?, + utm_campaign: String?, + utm_content: String?, + utm_medium: String?, + utm_source: String?, + utm_term: String? + } + end + + type question = + { + id: String?, + answer: String?, + key: String?, + options: ::Array[String]?, + question: String?, + type: String? + } + + class Question < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String? + + attr_accessor answer: String? + + attr_accessor key: String? + + attr_accessor options: ::Array[String]? + + attr_accessor question: String? + + attr_accessor type: String? + + def initialize: ( + ?id: String?, + ?answer: String?, + ?key: String?, + ?options: ::Array[String]?, + ?question: String?, + ?type: String? + ) -> void + + def to_hash: -> { + id: String?, + answer: String?, + key: String?, + options: ::Array[String]?, + question: String?, + type: String? + } + end + + type user = + { + city: String?, + country: String?, + email: String?, + first_name: String?, + last_name: String?, + name: String?, + phone: String?, + state: String? + } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor email: String? + + attr_accessor first_name: String? + + attr_accessor last_name: String? + + attr_accessor name: String? + + attr_accessor phone: String? + + attr_accessor state: String? + + def initialize: ( + ?city: String?, + ?country: String?, + ?email: String?, + ?first_name: String?, + ?last_name: String?, + ?name: String?, + ?phone: String?, + ?state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + email: String?, + first_name: String?, + last_name: String?, + name: String?, + phone: String?, + state: String? + } + end + end + end +end diff --git a/sig/whop_sdk/models/external_ad_status.rbs b/sig/whop_sdk/models/external_ad_status.rbs deleted file mode 100644 index 97d1643e..00000000 --- a/sig/whop_sdk/models/external_ad_status.rbs +++ /dev/null @@ -1,19 +0,0 @@ -module WhopSDK - module Models - type external_ad_status = - :active | :paused | :inactive | :in_review | :rejected | :flagged - - module ExternalAdStatus - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - PAUSED: :paused - INACTIVE: :inactive - IN_REVIEW: :in_review - REJECTED: :rejected - FLAGGED: :flagged - - def self?.values: -> ::Array[WhopSDK::Models::external_ad_status] - end - end -end diff --git a/sig/whop_sdk/models/financial_activity_list_params.rbs b/sig/whop_sdk/models/financial_activity_list_params.rbs index 6503585f..ce794a1d 100644 --- a/sig/whop_sdk/models/financial_activity_list_params.rbs +++ b/sig/whop_sdk/models/financial_activity_list_params.rbs @@ -3,8 +3,11 @@ module WhopSDK type financial_activity_list_params = { account_id: String, + available_after: Date, + available_before: Date, currency: String, cursor: String, + include_owned_accounts: bool, limit: Integer, line_types: ::Array[String], posted_after: Time, @@ -21,6 +24,14 @@ module WhopSDK def account_id=: (String) -> String + attr_reader available_after: Date? + + def available_after=: (Date) -> Date + + attr_reader available_before: Date? + + def available_before=: (Date) -> Date + attr_reader currency: String? def currency=: (String) -> String @@ -29,6 +40,10 @@ module WhopSDK def cursor=: (String) -> String + attr_reader include_owned_accounts: bool? + + def include_owned_accounts=: (bool) -> bool + attr_reader limit: Integer? def limit=: (Integer) -> Integer @@ -51,8 +66,11 @@ module WhopSDK def initialize: ( ?account_id: String, + ?available_after: Date, + ?available_before: Date, ?currency: String, ?cursor: String, + ?include_owned_accounts: bool, ?limit: Integer, ?line_types: ::Array[String], ?posted_after: Time, @@ -63,8 +81,11 @@ module WhopSDK def to_hash: -> { account_id: String, + available_after: Date, + available_before: Date, currency: String, cursor: String, + include_owned_accounts: bool, limit: Integer, line_types: ::Array[String], posted_after: Time, diff --git a/sig/whop_sdk/models/financial_activity_list_response.rbs b/sig/whop_sdk/models/financial_activity_list_response.rbs index 67046bda..4c4f918a 100644 --- a/sig/whop_sdk/models/financial_activity_list_response.rbs +++ b/sig/whop_sdk/models/financial_activity_list_response.rbs @@ -25,13 +25,16 @@ module WhopSDK { id: String, amount: String, + available_at: Time?, created_at: Time?, 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? + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source?, + account: WhopSDK::Models::FinancialActivityListResponse::Data::account, + ledger_account_id: String? } class Data < WhopSDK::Internal::Type::BaseModel @@ -39,6 +42,8 @@ module WhopSDK attr_accessor amount: String + attr_accessor available_at: Time? + attr_accessor created_at: Time? attr_accessor currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency @@ -53,28 +58,42 @@ module WhopSDK attr_accessor source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + attr_reader account: WhopSDK::Models::FinancialActivityListResponse::Data::account? + + def account=: ( + WhopSDK::Models::FinancialActivityListResponse::Data::account + ) -> WhopSDK::Models::FinancialActivityListResponse::Data::account + + attr_accessor ledger_account_id: String? + def initialize: ( id: String, amount: String, + available_at: Time?, created_at: Time?, 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? + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source?, + ?account: WhopSDK::Models::FinancialActivityListResponse::Data::account, + ?ledger_account_id: String? ) -> void def to_hash: -> { id: String, amount: String, + available_at: Time?, created_at: Time?, 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? + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source?, + account: WhopSDK::Models::FinancialActivityListResponse::Data::account, + ledger_account_id: String? } type currency = { code: String, precision: String } @@ -105,6 +124,8 @@ module WhopSDK | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2 | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3 | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6 module Resource extend WhopSDK::Internal::Type::Union @@ -207,7 +228,8 @@ module WhopSDK { id: String, object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, - owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + status: String, + title: String } class UnionMember2 < WhopSDK::Internal::Type::BaseModel @@ -215,18 +237,59 @@ module WhopSDK attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object - attr_accessor owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + attr_accessor status: String + + attr_accessor title: String def initialize: ( id: String, object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, - owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + status: String, + title: String ) -> void def to_hash: -> { id: String, object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, - owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + status: String, + title: String + } + + type object = :bounty + + module Object + extend WhopSDK::Internal::Type::Enum + + BOUNTY: :bounty + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object] + end + end + + type union_member3 = + { + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::owner? + } + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object + + attr_accessor owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::owner? + + def initialize: ( + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::owner? + ) -> void + + def to_hash: -> { + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::owner? } type object = :ledger_account @@ -236,12 +299,12 @@ module WhopSDK LEDGER_ACCOUNT: :ledger_account - def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object] + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object] end type owner = - WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0 - | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1 module Owner extend WhopSDK::Internal::Type::Union @@ -250,7 +313,7 @@ module WhopSDK { id: String, logo_url: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::object, route: String?, title: String? } @@ -260,7 +323,7 @@ module WhopSDK attr_accessor logo_url: String? - attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::object attr_accessor route: String? @@ -269,7 +332,7 @@ module WhopSDK def initialize: ( id: String, logo_url: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::object, route: String?, title: String? ) -> void @@ -277,7 +340,7 @@ module WhopSDK def to_hash: -> { id: String, logo_url: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::object, route: String?, title: String? } @@ -289,7 +352,7 @@ module WhopSDK ACCOUNT: :account - def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object] + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember0::object] end end @@ -297,7 +360,7 @@ module WhopSDK { id: String, name: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::object, profile_picture_url: String?, username: String? } @@ -307,7 +370,7 @@ module WhopSDK attr_accessor name: String? - attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::object attr_accessor profile_picture_url: String? @@ -316,7 +379,7 @@ module WhopSDK def initialize: ( id: String, name: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::object, profile_picture_url: String?, username: String? ) -> void @@ -324,7 +387,7 @@ module WhopSDK def to_hash: -> { id: String, name: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::object, profile_picture_url: String?, username: String? } @@ -336,57 +399,57 @@ module WhopSDK USER: :user - def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object] + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Owner::UnionMember1::object] end end - def self?.variants: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner] + def self?.variants: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::owner] end end - type union_member3 = + type union_member4 = { id: String, - bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank?, - card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card?, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card?, email_identifier: String?, gateway_type: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, payment_method_type: String? } - class UnionMember3 < WhopSDK::Internal::Type::BaseModel + class UnionMember4 < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank? + attr_accessor bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank? - attr_accessor card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card? + attr_accessor card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card? attr_accessor email_identifier: String? attr_accessor gateway_type: String? - attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::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?, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card?, email_identifier: String?, gateway_type: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::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?, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Card?, email_identifier: String?, gateway_type: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, payment_method_type: String? } @@ -461,22 +524,22 @@ module WhopSDK PAYMENT_METHOD: :payment_method - def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object] + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object] end end - type union_member4 = + type union_member5 = { id: String, account_reference: String?, destination_currency_code: String?, institution_name: String?, nickname: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::object, provider: String? } - class UnionMember4 < WhopSDK::Internal::Type::BaseModel + class UnionMember5 < WhopSDK::Internal::Type::BaseModel attr_accessor id: String attr_accessor account_reference: String? @@ -487,7 +550,7 @@ module WhopSDK attr_accessor nickname: String? - attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::object attr_accessor provider: String? @@ -497,7 +560,7 @@ module WhopSDK destination_currency_code: String?, institution_name: String?, nickname: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::object, provider: String? ) -> void @@ -507,7 +570,7 @@ module WhopSDK destination_currency_code: String?, institution_name: String?, nickname: String?, - object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::object, provider: String? } @@ -518,7 +581,99 @@ module WhopSDK PAYOUT_METHOD: :payout_method - def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object] + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember5::object] + end + end + + type union_member6 = + { + id: String, + authorized_at: Time?, + card_id: String?, + cashback_usd: String?, + declined_reason: String?, + local_amount: String?, + local_currency: String?, + merchant_category: String?, + merchant_icon_url: String?, + merchant_name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::object, + posted_at: Time?, + status: String?, + usd_amount: String? + } + + class UnionMember6 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor authorized_at: Time? + + attr_accessor card_id: String? + + attr_accessor cashback_usd: String? + + attr_accessor declined_reason: String? + + attr_accessor local_amount: String? + + attr_accessor local_currency: String? + + attr_accessor merchant_category: String? + + attr_accessor merchant_icon_url: String? + + attr_accessor merchant_name: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::object + + attr_accessor posted_at: Time? + + attr_accessor status: String? + + attr_accessor usd_amount: String? + + def initialize: ( + id: String, + authorized_at: Time?, + card_id: String?, + cashback_usd: String?, + declined_reason: String?, + local_amount: String?, + local_currency: String?, + merchant_category: String?, + merchant_icon_url: String?, + merchant_name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::object, + posted_at: Time?, + status: String?, + usd_amount: String? + ) -> void + + def to_hash: -> { + id: String, + authorized_at: Time?, + card_id: String?, + cashback_usd: String?, + declined_reason: String?, + local_amount: String?, + local_currency: String?, + merchant_category: String?, + merchant_icon_url: String?, + merchant_name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::object, + posted_at: Time?, + status: String?, + usd_amount: String? + } + + type object = :card_transaction + + module Object + extend WhopSDK::Internal::Type::Enum + + CARD_TRANSACTION: :card_transaction + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember6::object] end end @@ -529,12 +684,22 @@ module WhopSDK { id: String, object: String, + amount_float: Float?, + chain: String?, + claim_url: String?, created_at: Time?, estimated_arrival: Time?, + from_amount: String?, + from_currency: String?, payer_name: String?, payout_destination: WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination?, payout_token_nickname: String?, - status: String? + reason: String?, + sender_address: String?, + status: String?, + to_amount: String?, + to_currency: String?, + tx_hash: String? } class Source < WhopSDK::Internal::Type::BaseModel @@ -542,38 +707,78 @@ module WhopSDK attr_accessor object: String + attr_accessor amount_float: Float? + + attr_accessor chain: String? + + attr_accessor claim_url: String? + attr_accessor created_at: Time? attr_accessor estimated_arrival: Time? + attr_accessor from_amount: String? + + attr_accessor from_currency: String? + attr_accessor payer_name: String? attr_accessor payout_destination: WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination? attr_accessor payout_token_nickname: String? + attr_accessor reason: String? + + attr_accessor sender_address: String? + attr_accessor status: String? + attr_accessor to_amount: String? + + attr_accessor to_currency: String? + + attr_accessor tx_hash: String? + def initialize: ( id: String, object: String, + ?amount_float: Float?, + ?chain: String?, + ?claim_url: String?, ?created_at: Time?, ?estimated_arrival: Time?, + ?from_amount: String?, + ?from_currency: String?, ?payer_name: String?, ?payout_destination: WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination?, ?payout_token_nickname: String?, - ?status: String? + ?reason: String?, + ?sender_address: String?, + ?status: String?, + ?to_amount: String?, + ?to_currency: String?, + ?tx_hash: String? ) -> void def to_hash: -> { id: String, object: String, + amount_float: Float?, + chain: String?, + claim_url: String?, created_at: Time?, estimated_arrival: Time?, + from_amount: String?, + from_currency: String?, payer_name: String?, payout_destination: WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination?, payout_token_nickname: String?, - status: String? + reason: String?, + sender_address: String?, + status: String?, + to_amount: String?, + to_currency: String?, + tx_hash: String? } type payout_destination = { icon_url: String?, payer_name: String? } @@ -588,6 +793,110 @@ module WhopSDK def to_hash: -> { icon_url: String?, payer_name: String? } end end + + type account = + WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0 + | WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1 + + module Account + extend WhopSDK::Internal::Type::Union + + type union_member0 = + { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Account::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::Account::UnionMember0::object + + attr_accessor route: String? + + attr_accessor title: String? + + def initialize: ( + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember0::object, + route: String?, + title: String? + ) -> void + + def to_hash: -> { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Account::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::Account::UnionMember0::object] + end + end + + type union_member1 = + { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Account::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::Account::UnionMember1::object + + attr_accessor profile_picture_url: String? + + attr_accessor username: String? + + def initialize: ( + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Account::UnionMember1::object, + profile_picture_url: String?, + username: String? + ) -> void + + def to_hash: -> { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Account::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::Account::UnionMember1::object] + end + end + + def self?.variants: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::account] + end end type page_info = diff --git a/sig/whop_sdk/models/invoice_create_params.rbs b/sig/whop_sdk/models/invoice_create_params.rbs index d869c018..ecffa949 100644 --- a/sig/whop_sdk/models/invoice_create_params.rbs +++ b/sig/whop_sdk/models/invoice_create_params.rbs @@ -125,6 +125,7 @@ module WhopSDK type plan = { + adaptive_pricing_enabled: bool?, billing_period: Integer?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, @@ -144,6 +145,8 @@ module WhopSDK } class Plan < WhopSDK::Internal::Type::BaseModel + attr_accessor adaptive_pricing_enabled: bool? + attr_accessor billing_period: Integer? attr_accessor currency: WhopSDK::Models::currency? @@ -177,6 +180,7 @@ module WhopSDK attr_accessor visibility: WhopSDK::Models::visibility? def initialize: ( + ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, @@ -196,6 +200,7 @@ module WhopSDK ) -> void def to_hash: -> { + adaptive_pricing_enabled: bool?, billing_period: Integer?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, @@ -483,6 +488,7 @@ module WhopSDK type plan = { + adaptive_pricing_enabled: bool?, billing_period: Integer?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, @@ -502,6 +508,8 @@ module WhopSDK } class Plan < WhopSDK::Internal::Type::BaseModel + attr_accessor adaptive_pricing_enabled: bool? + attr_accessor billing_period: Integer? attr_accessor currency: WhopSDK::Models::currency? @@ -535,6 +543,7 @@ module WhopSDK attr_accessor visibility: WhopSDK::Models::visibility? def initialize: ( + ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, @@ -554,6 +563,7 @@ module WhopSDK ) -> void def to_hash: -> { + adaptive_pricing_enabled: bool?, billing_period: Integer?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, diff --git a/sig/whop_sdk/models/invoice_update_params.rbs b/sig/whop_sdk/models/invoice_update_params.rbs index d6bf04d9..9eca8048 100644 --- a/sig/whop_sdk/models/invoice_update_params.rbs +++ b/sig/whop_sdk/models/invoice_update_params.rbs @@ -174,6 +174,7 @@ module WhopSDK type plan = { + adaptive_pricing_enabled: bool?, billing_period: Integer?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, @@ -193,6 +194,8 @@ module WhopSDK } class Plan < WhopSDK::Internal::Type::BaseModel + attr_accessor adaptive_pricing_enabled: bool? + attr_accessor billing_period: Integer? attr_accessor currency: WhopSDK::Models::currency? @@ -226,6 +229,7 @@ module WhopSDK attr_accessor visibility: WhopSDK::Models::visibility? def initialize: ( + ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, @@ -245,6 +249,7 @@ module WhopSDK ) -> void def to_hash: -> { + adaptive_pricing_enabled: bool?, billing_period: Integer?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, diff --git a/sig/whop_sdk/models/ledger_account_funds_available_webhook_event.rbs b/sig/whop_sdk/models/ledger_account_funds_available_webhook_event.rbs new file mode 100644 index 00000000..cb469a15 --- /dev/null +++ b/sig/whop_sdk/models/ledger_account_funds_available_webhook_event.rbs @@ -0,0 +1,418 @@ +module WhopSDK + module Models + type ledger_account_funds_available_webhook_event = + { + id: String, + api_version: :v1, + data: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data, + timestamp: Time, + type: :"ledger_account.funds_available", + company_id: String? + } + + class LedgerAccountFundsAvailableWebhookEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor api_version: :v1 + + attr_accessor data: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data + + attr_accessor timestamp: Time + + attr_accessor type: :"ledger_account.funds_available" + + attr_accessor company_id: String? + + def initialize: ( + id: String, + data: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data, + timestamp: Time, + ?company_id: String?, + ?api_version: :v1, + ?type: :"ledger_account.funds_available" + ) -> void + + def to_hash: -> { + id: String, + api_version: :v1, + data: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data, + timestamp: Time, + type: :"ledger_account.funds_available", + company_id: String? + } + + type data = + { + id: String, + balances: ::Array[WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance], + ledger_type: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::ledger_type, + owner: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::owner?, + payments_approval_status: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::payments_approval_status?, + payout_account_details: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails?, + transfer_fee: Float?, + treasury_balance: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor balances: ::Array[WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance] + + attr_accessor ledger_type: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::ledger_type + + attr_accessor owner: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::owner? + + attr_accessor payments_approval_status: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::payments_approval_status? + + attr_accessor payout_account_details: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails? + + attr_accessor transfer_fee: Float? + + attr_accessor treasury_balance: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance? + + def initialize: ( + id: String, + balances: ::Array[WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance], + ledger_type: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::ledger_type, + owner: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::owner?, + payments_approval_status: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::payments_approval_status?, + payout_account_details: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails?, + transfer_fee: Float?, + treasury_balance: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance? + ) -> void + + def to_hash: -> { + id: String, + balances: ::Array[WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Balance], + ledger_type: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::ledger_type, + owner: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::owner?, + payments_approval_status: WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::payments_approval_status?, + payout_account_details: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails?, + transfer_fee: Float?, + treasury_balance: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::TreasuryBalance? + } + + type balance = + { + balance: Float, + currency: WhopSDK::Models::currency, + pending_balance: Float, + reserve_balance: Float + } + + class Balance < WhopSDK::Internal::Type::BaseModel + attr_accessor balance: Float + + attr_accessor currency: WhopSDK::Models::currency + + attr_accessor pending_balance: Float + + attr_accessor reserve_balance: Float + + def initialize: ( + balance: Float, + currency: WhopSDK::Models::currency, + pending_balance: Float, + reserve_balance: Float + ) -> void + + def to_hash: -> { + balance: Float, + currency: WhopSDK::Models::currency, + pending_balance: Float, + reserve_balance: Float + } + end + + type ledger_type = :primary | :pool + + module LedgerType + extend WhopSDK::Internal::Type::Enum + + PRIMARY: :primary + POOL: :pool + + def self?.values: -> ::Array[WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::ledger_type] + end + + type owner = + (WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::User + | WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::Owner::Company)? + + module Owner + extend WhopSDK::Internal::Type::Union + + type user = + { id: String, name: String?, typename: :User, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor typename: :User + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + username: String, + ?typename: :User + ) -> void + + def to_hash: -> { + id: String, + name: String?, + typename: :User, + username: String + } + end + + type company = + { id: String, route: String, title: String, typename: :Company } + + class Company < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor route: String + + attr_accessor title: String + + attr_accessor typename: :Company + + def initialize: ( + id: String, + route: String, + title: String, + ?typename: :Company + ) -> void + + def to_hash: -> { + id: String, + route: String, + title: String, + typename: :Company + } + end + + def self?.variants: -> ::Array[WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::owner] + end + + type payments_approval_status = + :pending | :approved | :monitoring | :rejected + + module PaymentsApprovalStatus + extend WhopSDK::Internal::Type::Enum + + PENDING: :pending + APPROVED: :approved + MONITORING: :monitoring + REJECTED: :rejected + + def self?.values: -> ::Array[WhopSDK::Models::LedgerAccountFundsAvailableWebhookEvent::Data::payments_approval_status] + end + + type payout_account_details = + { + id: String, + address: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address?, + business_name: String?, + business_representative: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification?, + phone: String?, + status: WhopSDK::Models::payout_account_calculated_statuses? + } + + class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor address: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address? + + attr_accessor business_name: String? + + attr_accessor business_representative: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative? + + attr_accessor email: String? + + attr_accessor latest_verification: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification? + + attr_accessor phone: String? + + attr_accessor status: WhopSDK::Models::payout_account_calculated_statuses? + + def initialize: ( + id: String, + address: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address?, + business_name: String?, + business_representative: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification?, + phone: String?, + status: WhopSDK::Models::payout_account_calculated_statuses? + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::Address?, + business_name: String?, + business_representative: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::LedgerAccountFundsAvailableWebhookEvent::Data::PayoutAccountDetails::LatestVerification?, + phone: String?, + status: WhopSDK::Models::payout_account_calculated_statuses? + } + + type address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type business_representative = + { + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + } + + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + attr_accessor date_of_birth: String? + + attr_accessor first_name: String? + + attr_accessor last_name: String? + + attr_accessor middle_name: String? + + def initialize: ( + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + ) -> void + + def to_hash: -> { + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + } + end + + type latest_verification = + { + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + } + + class LatestVerification < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor last_error_code: WhopSDK::Models::verification_error_code? + + attr_accessor last_error_reason: String? + + attr_accessor status: WhopSDK::Models::verification_status + + def initialize: ( + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + ) -> void + + def to_hash: -> { + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + } + end + end + + type treasury_balance = + { + balance: Float, + balance_usd: Float, + currency: WhopSDK::Models::currency, + pending_balance: Float, + reserve_balance: Float, + total_withdrawable_balance: Float + } + + class TreasuryBalance < WhopSDK::Internal::Type::BaseModel + attr_accessor balance: Float + + attr_accessor balance_usd: Float + + attr_accessor currency: WhopSDK::Models::currency + + attr_accessor pending_balance: Float + + attr_accessor reserve_balance: Float + + attr_accessor total_withdrawable_balance: Float + + def initialize: ( + balance: Float, + balance_usd: Float, + currency: WhopSDK::Models::currency, + pending_balance: Float, + reserve_balance: Float, + total_withdrawable_balance: Float + ) -> void + + def to_hash: -> { + balance: Float, + balance_usd: Float, + currency: WhopSDK::Models::currency, + pending_balance: Float, + reserve_balance: Float, + total_withdrawable_balance: Float + } + end + end + end + end +end diff --git a/sig/whop_sdk/models/media_asset.rbs b/sig/whop_sdk/models/media_asset.rbs new file mode 100644 index 00000000..a8da5ecc --- /dev/null +++ b/sig/whop_sdk/models/media_asset.rbs @@ -0,0 +1,160 @@ +module WhopSDK + module Models + type media_asset = + { + id: String, + amount_charged: Float?, + completed_at: String?, + created_at: String, + currency: String, + error_message: String?, + file: WhopSDK::MediaAsset::File?, + generation: WhopSDK::MediaAsset::Generation, + media_type: WhopSDK::Models::MediaAsset::media_type, + source: WhopSDK::Models::MediaAsset::source, + status: WhopSDK::Models::MediaAsset::status + } + + class MediaAsset < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount_charged: Float? + + attr_accessor completed_at: String? + + attr_accessor created_at: String + + attr_accessor currency: String + + attr_accessor error_message: String? + + attr_accessor file: WhopSDK::MediaAsset::File? + + attr_accessor generation: WhopSDK::MediaAsset::Generation + + attr_accessor media_type: WhopSDK::Models::MediaAsset::media_type + + attr_accessor source: WhopSDK::Models::MediaAsset::source + + attr_accessor status: WhopSDK::Models::MediaAsset::status + + def initialize: ( + id: String, + amount_charged: Float?, + completed_at: String?, + created_at: String, + currency: String, + error_message: String?, + file: WhopSDK::MediaAsset::File?, + generation: WhopSDK::MediaAsset::Generation, + media_type: WhopSDK::Models::MediaAsset::media_type, + source: WhopSDK::Models::MediaAsset::source, + status: WhopSDK::Models::MediaAsset::status + ) -> void + + def to_hash: -> { + id: String, + amount_charged: Float?, + completed_at: String?, + created_at: String, + currency: String, + error_message: String?, + file: WhopSDK::MediaAsset::File?, + generation: WhopSDK::MediaAsset::Generation, + media_type: WhopSDK::Models::MediaAsset::media_type, + source: WhopSDK::Models::MediaAsset::source, + status: WhopSDK::Models::MediaAsset::status + } + + type file = { id: String, url: String } + + class File < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor url: String + + def initialize: (id: String, url: String) -> void + + def to_hash: -> { id: String, url: String } + end + + type generation = + { + duration_seconds: Float?, + prompt: String, + reference_media: ::Array[String], + resolution: WhopSDK::Models::MediaAsset::Generation::resolution? + } + + class Generation < WhopSDK::Internal::Type::BaseModel + attr_accessor duration_seconds: Float? + + attr_accessor prompt: String + + attr_accessor reference_media: ::Array[String] + + attr_accessor resolution: WhopSDK::Models::MediaAsset::Generation::resolution? + + def initialize: ( + duration_seconds: Float?, + prompt: String, + reference_media: ::Array[String], + resolution: WhopSDK::Models::MediaAsset::Generation::resolution? + ) -> void + + def to_hash: -> { + duration_seconds: Float?, + prompt: String, + reference_media: ::Array[String], + resolution: WhopSDK::Models::MediaAsset::Generation::resolution? + } + + type resolution = :"480p" | :"720p" | :"1080p" | :"4k" + + module Resolution + extend WhopSDK::Internal::Type::Enum + + RESOLUTION_480P: :"480p" + RESOLUTION_720P: :"720p" + RESOLUTION_1080P: :"1080p" + RESOLUTION_4K: :"4k" + + def self?.values: -> ::Array[WhopSDK::Models::MediaAsset::Generation::resolution] + end + end + + type media_type = :video | :image + + module MediaType + extend WhopSDK::Internal::Type::Enum + + VIDEO: :video + IMAGE: :image + + def self?.values: -> ::Array[WhopSDK::Models::MediaAsset::media_type] + end + + type source = :generated + + module Source + extend WhopSDK::Internal::Type::Enum + + GENERATED: :generated + + def self?.values: -> ::Array[WhopSDK::Models::MediaAsset::source] + end + + type status = :processing | :ready | :failed + + module Status + extend WhopSDK::Internal::Type::Enum + + PROCESSING: :processing + READY: :ready + FAILED: :failed + + def self?.values: -> ::Array[WhopSDK::Models::MediaAsset::status] + end + end + end +end diff --git a/sig/whop_sdk/models/media_generate_params.rbs b/sig/whop_sdk/models/media_generate_params.rbs new file mode 100644 index 00000000..794626e9 --- /dev/null +++ b/sig/whop_sdk/models/media_generate_params.rbs @@ -0,0 +1,99 @@ +module WhopSDK + module Models + type media_generate_params = + { + prompt: String, + type: WhopSDK::Models::MediaGenerateParams::type_, + account_id: String, + duration_seconds: WhopSDK::Models::MediaGenerateParams::duration_seconds, + reference_media: ::Array[String], + resolution: WhopSDK::Models::MediaGenerateParams::resolution + } + & WhopSDK::Internal::Type::request_parameters + + class MediaGenerateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor prompt: String + + attr_accessor type: WhopSDK::Models::MediaGenerateParams::type_ + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader duration_seconds: WhopSDK::Models::MediaGenerateParams::duration_seconds? + + def duration_seconds=: ( + WhopSDK::Models::MediaGenerateParams::duration_seconds + ) -> WhopSDK::Models::MediaGenerateParams::duration_seconds + + attr_reader reference_media: ::Array[String]? + + def reference_media=: (::Array[String]) -> ::Array[String] + + attr_reader resolution: WhopSDK::Models::MediaGenerateParams::resolution? + + def resolution=: ( + WhopSDK::Models::MediaGenerateParams::resolution + ) -> WhopSDK::Models::MediaGenerateParams::resolution + + def initialize: ( + prompt: String, + type: WhopSDK::Models::MediaGenerateParams::type_, + ?account_id: String, + ?duration_seconds: WhopSDK::Models::MediaGenerateParams::duration_seconds, + ?reference_media: ::Array[String], + ?resolution: WhopSDK::Models::MediaGenerateParams::resolution, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + prompt: String, + type: WhopSDK::Models::MediaGenerateParams::type_, + account_id: String, + duration_seconds: WhopSDK::Models::MediaGenerateParams::duration_seconds, + reference_media: ::Array[String], + resolution: WhopSDK::Models::MediaGenerateParams::resolution, + request_options: WhopSDK::RequestOptions + } + + type type_ = :video | :image + + module Type + extend WhopSDK::Internal::Type::Enum + + VIDEO: :video + IMAGE: :image + + def self?.values: -> ::Array[WhopSDK::Models::MediaGenerateParams::type_] + end + + type duration_seconds = 5 | 10 | 15 + + module DurationSeconds + extend WhopSDK::Internal::Type::Enum + + DURATION_SECONDS_5: 5 + DURATION_SECONDS_10: 10 + DURATION_SECONDS_15: 15 + + def self?.values: -> ::Array[WhopSDK::Models::MediaGenerateParams::duration_seconds] + end + + type resolution = :"480p" | :"720p" | :"1080p" | :"4k" + + module Resolution + extend WhopSDK::Internal::Type::Enum + + RESOLUTION_480P: :"480p" + RESOLUTION_720P: :"720p" + RESOLUTION_1080P: :"1080p" + RESOLUTION_4K: :"4k" + + def self?.values: -> ::Array[WhopSDK::Models::MediaGenerateParams::resolution] + end + end + end +end diff --git a/sig/whop_sdk/models/media_retrieve_params.rbs b/sig/whop_sdk/models/media_retrieve_params.rbs new file mode 100644 index 00000000..1b5232c9 --- /dev/null +++ b/sig/whop_sdk/models/media_retrieve_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type media_retrieve_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class MediaRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/membership_trial_ending_soon_webhook_event.rbs b/sig/whop_sdk/models/membership_trial_ending_soon_webhook_event.rbs new file mode 100644 index 00000000..24bd3aae --- /dev/null +++ b/sig/whop_sdk/models/membership_trial_ending_soon_webhook_event.rbs @@ -0,0 +1,45 @@ +module WhopSDK + module Models + type membership_trial_ending_soon_webhook_event = + { + id: String, + api_version: :v1, + data: WhopSDK::Membership, + timestamp: Time, + type: :"membership.trial_ending_soon", + company_id: String? + } + + class MembershipTrialEndingSoonWebhookEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor api_version: :v1 + + attr_accessor data: WhopSDK::Membership + + attr_accessor timestamp: Time + + attr_accessor type: :"membership.trial_ending_soon" + + attr_accessor company_id: String? + + def initialize: ( + id: String, + data: WhopSDK::Membership, + timestamp: Time, + ?company_id: String?, + ?api_version: :v1, + ?type: :"membership.trial_ending_soon" + ) -> void + + def to_hash: -> { + id: String, + api_version: :v1, + data: WhopSDK::Membership, + timestamp: Time, + type: :"membership.trial_ending_soon", + company_id: String? + } + end + end +end diff --git a/sig/whop_sdk/models/payment.rbs b/sig/whop_sdk/models/payment.rbs index b5612606..8ec29881 100644 --- a/sig/whop_sdk/models/payment.rbs +++ b/sig/whop_sdk/models/payment.rbs @@ -34,17 +34,22 @@ module WhopSDK refundable: bool, refunded_amount: Float?, refunded_at: Time?, + refunds: ::Array[WhopSDK::Payment::Refund], resolutions: ::Array[WhopSDK::Payment::Resolution]?, retryable: bool, + risk_score: Integer?, + risk_signals: ::Hash[Symbol, top]?, settlement_amount: Float, settlement_currency: WhopSDK::Models::currency, settlement_exchange_rate: Float?, + shipping_address: WhopSDK::Payment::ShippingAddress?, status: WhopSDK::Models::receipt_status?, substatus: WhopSDK::Models::friendly_receipt_status, subtotal: Float?, tax_amount: Float?, tax_behavior: WhopSDK::Models::receipt_tax_behavior?, tax_refunded_amount: Float?, + three_ds_verified: bool, total: Float?, updated_at: Time, usd_total: Float?, @@ -117,16 +122,24 @@ module WhopSDK attr_accessor refunded_at: Time? + attr_accessor refunds: ::Array[WhopSDK::Payment::Refund] + attr_accessor resolutions: ::Array[WhopSDK::Payment::Resolution]? attr_accessor retryable: bool + attr_accessor risk_score: Integer? + + attr_accessor risk_signals: ::Hash[Symbol, top]? + attr_accessor settlement_amount: Float attr_accessor settlement_currency: WhopSDK::Models::currency attr_accessor settlement_exchange_rate: Float? + attr_accessor shipping_address: WhopSDK::Payment::ShippingAddress? + attr_accessor status: WhopSDK::Models::receipt_status? attr_accessor substatus: WhopSDK::Models::friendly_receipt_status @@ -139,6 +152,8 @@ module WhopSDK attr_accessor tax_refunded_amount: Float? + attr_accessor three_ds_verified: bool + attr_accessor total: Float? attr_accessor updated_at: Time @@ -182,17 +197,22 @@ module WhopSDK refundable: bool, refunded_amount: Float?, refunded_at: Time?, + refunds: ::Array[WhopSDK::Payment::Refund], resolutions: ::Array[WhopSDK::Payment::Resolution]?, retryable: bool, + risk_score: Integer?, + risk_signals: ::Hash[Symbol, top]?, settlement_amount: Float, settlement_currency: WhopSDK::Models::currency, settlement_exchange_rate: Float?, + shipping_address: WhopSDK::Payment::ShippingAddress?, status: WhopSDK::Models::receipt_status?, substatus: WhopSDK::Models::friendly_receipt_status, subtotal: Float?, tax_amount: Float?, tax_behavior: WhopSDK::Models::receipt_tax_behavior?, tax_refunded_amount: Float?, + three_ds_verified: bool, total: Float?, updated_at: Time, usd_total: Float?, @@ -233,17 +253,22 @@ module WhopSDK refundable: bool, refunded_amount: Float?, refunded_at: Time?, + refunds: ::Array[WhopSDK::Payment::Refund], resolutions: ::Array[WhopSDK::Payment::Resolution]?, retryable: bool, + risk_score: Integer?, + risk_signals: ::Hash[Symbol, top]?, settlement_amount: Float, settlement_currency: WhopSDK::Models::currency, settlement_exchange_rate: Float?, + shipping_address: WhopSDK::Payment::ShippingAddress?, status: WhopSDK::Models::receipt_status?, substatus: WhopSDK::Models::friendly_receipt_status, subtotal: Float?, tax_amount: Float?, tax_behavior: WhopSDK::Models::receipt_tax_behavior?, tax_refunded_amount: Float?, + three_ds_verified: bool, total: Float?, updated_at: Time, usd_total: Float?, @@ -707,6 +732,43 @@ module WhopSDK } end + type refund = + { + id: String, + amount: Float, + created_at: Time, + currency: WhopSDK::Models::currency, + status: WhopSDK::Models::refund_status + } + + class Refund < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor currency: WhopSDK::Models::currency + + attr_accessor status: WhopSDK::Models::refund_status + + def initialize: ( + id: String, + amount: Float, + created_at: Time, + currency: WhopSDK::Models::currency, + status: WhopSDK::Models::refund_status + ) -> void + + def to_hash: -> { + id: String, + amount: Float, + created_at: Time, + currency: WhopSDK::Models::currency, + status: WhopSDK::Models::refund_status + } + end + type resolution = { id: String, @@ -764,6 +826,53 @@ module WhopSDK } end + type shipping_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + name: String?, + postal_code: String?, + state: String? + } + + class ShippingAddress < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor name: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + city: String?, + country: String?, + line1: String?, + line2: String?, + name: String?, + postal_code: String?, + state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + name: String?, + postal_code: String?, + state: String? + } + end + type user = { id: String, email: String?, name: String?, username: String } diff --git a/sig/whop_sdk/models/payment_create_params.rbs b/sig/whop_sdk/models/payment_create_params.rbs index 4fae1ba7..2055c821 100644 --- a/sig/whop_sdk/models/payment_create_params.rbs +++ b/sig/whop_sdk/models/payment_create_params.rbs @@ -33,7 +33,8 @@ module WhopSDK member_id: String, payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Body::CreatePaymentInputWithPlan::Plan, - metadata: ::Hash[Symbol, top]? + metadata: ::Hash[Symbol, top]?, + promo_code_id: String? } class CreatePaymentInputWithPlan < WhopSDK::Internal::Type::BaseModel @@ -47,12 +48,15 @@ module WhopSDK attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor promo_code_id: String? + def initialize: ( company_id: String, member_id: String, payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Body::CreatePaymentInputWithPlan::Plan, - ?metadata: ::Hash[Symbol, top]? + ?metadata: ::Hash[Symbol, top]?, + ?promo_code_id: String? ) -> void def to_hash: -> { @@ -60,7 +64,8 @@ module WhopSDK member_id: String, payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Body::CreatePaymentInputWithPlan::Plan, - metadata: ::Hash[Symbol, top]? + metadata: ::Hash[Symbol, top]?, + promo_code_id: String? } type plan = @@ -229,7 +234,8 @@ module WhopSDK member_id: String, payment_method_id: String, plan_id: String, - metadata: ::Hash[Symbol, top]? + metadata: ::Hash[Symbol, top]?, + promo_code_id: String? } class CreatePaymentInputWithPlanID < WhopSDK::Internal::Type::BaseModel @@ -243,12 +249,15 @@ module WhopSDK attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor promo_code_id: String? + def initialize: ( company_id: String, member_id: String, payment_method_id: String, plan_id: String, - ?metadata: ::Hash[Symbol, top]? + ?metadata: ::Hash[Symbol, top]?, + ?promo_code_id: String? ) -> void def to_hash: -> { @@ -256,7 +265,8 @@ module WhopSDK member_id: String, payment_method_id: String, plan_id: String, - metadata: ::Hash[Symbol, top]? + metadata: ::Hash[Symbol, top]?, + promo_code_id: String? } end diff --git a/sig/whop_sdk/models/payment_list_response.rbs b/sig/whop_sdk/models/payment_list_response.rbs index d23ce40f..b29b9020 100644 --- a/sig/whop_sdk/models/payment_list_response.rbs +++ b/sig/whop_sdk/models/payment_list_response.rbs @@ -33,6 +33,7 @@ module WhopSDK refunded_at: Time?, retryable: bool, settlement_currency: WhopSDK::Models::currency, + shipping_address: WhopSDK::Models::PaymentListResponse::ShippingAddress?, status: WhopSDK::Models::receipt_status?, substatus: WhopSDK::Models::friendly_receipt_status, subtotal: Float?, @@ -108,6 +109,8 @@ module WhopSDK attr_accessor settlement_currency: WhopSDK::Models::currency + attr_accessor shipping_address: WhopSDK::Models::PaymentListResponse::ShippingAddress? + attr_accessor status: WhopSDK::Models::receipt_status? attr_accessor substatus: WhopSDK::Models::friendly_receipt_status @@ -160,6 +163,7 @@ module WhopSDK refunded_at: Time?, retryable: bool, settlement_currency: WhopSDK::Models::currency, + shipping_address: WhopSDK::Models::PaymentListResponse::ShippingAddress?, status: WhopSDK::Models::receipt_status?, substatus: WhopSDK::Models::friendly_receipt_status, subtotal: Float?, @@ -204,6 +208,7 @@ module WhopSDK refunded_at: Time?, retryable: bool, settlement_currency: WhopSDK::Models::currency, + shipping_address: WhopSDK::Models::PaymentListResponse::ShippingAddress?, status: WhopSDK::Models::receipt_status?, substatus: WhopSDK::Models::friendly_receipt_status, subtotal: Float?, @@ -519,6 +524,53 @@ module WhopSDK } end + type shipping_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + name: String?, + postal_code: String?, + state: String? + } + + class ShippingAddress < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor name: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + city: String?, + country: String?, + line1: String?, + line2: String?, + name: String?, + postal_code: String?, + state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + name: String?, + postal_code: String?, + state: String? + } + end + type user = { id: String, email: String?, name: String?, username: String } diff --git a/sig/whop_sdk/models/payout_create_params.rbs b/sig/whop_sdk/models/payout_create_params.rbs new file mode 100644 index 00000000..1d9c2e16 --- /dev/null +++ b/sig/whop_sdk/models/payout_create_params.rbs @@ -0,0 +1,50 @@ +module WhopSDK + module Models + type payout_create_params = + { + account_id: String, + amount: Float, + payout_method_id: String, + currency: String, + idempotency_key: String + } + & WhopSDK::Internal::Type::request_parameters + + class PayoutCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_accessor amount: Float + + attr_accessor payout_method_id: String + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + + def initialize: ( + account_id: String, + amount: Float, + payout_method_id: String, + ?currency: String, + ?idempotency_key: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + amount: Float, + payout_method_id: String, + currency: String, + idempotency_key: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/payout_create_response.rbs b/sig/whop_sdk/models/payout_create_response.rbs new file mode 100644 index 00000000..35b11fb4 --- /dev/null +++ b/sig/whop_sdk/models/payout_create_response.rbs @@ -0,0 +1,139 @@ +module WhopSDK + module Models + type payout_create_response = + { + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: Time?, + fee_amount: Float, + object: WhopSDK::Models::PayoutCreateResponse::object, + payer_name: String?, + payout_token: WhopSDK::Models::PayoutCreateResponse::PayoutToken?, + speed: WhopSDK::Models::PayoutCreateResponse::speed, + status: WhopSDK::Models::PayoutCreateResponse::status + } + + class PayoutCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor currency: String + + attr_accessor estimated_arrival: Time? + + attr_accessor fee_amount: Float + + attr_accessor object: WhopSDK::Models::PayoutCreateResponse::object + + attr_accessor payer_name: String? + + attr_accessor payout_token: WhopSDK::Models::PayoutCreateResponse::PayoutToken? + + attr_accessor speed: WhopSDK::Models::PayoutCreateResponse::speed + + attr_accessor status: WhopSDK::Models::PayoutCreateResponse::status + + def initialize: ( + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: Time?, + fee_amount: Float, + object: WhopSDK::Models::PayoutCreateResponse::object, + payer_name: String?, + payout_token: WhopSDK::Models::PayoutCreateResponse::PayoutToken?, + speed: WhopSDK::Models::PayoutCreateResponse::speed, + status: WhopSDK::Models::PayoutCreateResponse::status + ) -> void + + def to_hash: -> { + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: Time?, + fee_amount: Float, + object: WhopSDK::Models::PayoutCreateResponse::object, + payer_name: String?, + payout_token: WhopSDK::Models::PayoutCreateResponse::PayoutToken?, + speed: WhopSDK::Models::PayoutCreateResponse::speed, + status: WhopSDK::Models::PayoutCreateResponse::status + } + + type object = :payout + + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT: :payout + + def self?.values: -> ::Array[WhopSDK::Models::PayoutCreateResponse::object] + end + + type payout_token = + { + nickname: String?, + payout_destination: WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination? + } + + class PayoutToken < WhopSDK::Internal::Type::BaseModel + attr_accessor nickname: String? + + attr_accessor payout_destination: WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination? + + def initialize: ( + nickname: String?, + payout_destination: WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination? + ) -> void + + def to_hash: -> { + nickname: String?, + payout_destination: WhopSDK::Models::PayoutCreateResponse::PayoutToken::PayoutDestination? + } + + 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 + + type speed = :standard | :instant + + module Speed + extend WhopSDK::Internal::Type::Enum + + STANDARD: :standard + INSTANT: :instant + + def self?.values: -> ::Array[WhopSDK::Models::PayoutCreateResponse::speed] + end + + type status = :requested | :in_transit | :completed | :failed | :canceled + + module Status + extend WhopSDK::Internal::Type::Enum + + REQUESTED: :requested + IN_TRANSIT: :in_transit + COMPLETED: :completed + FAILED: :failed + CANCELED: :canceled + + def self?.values: -> ::Array[WhopSDK::Models::PayoutCreateResponse::status] + end + end + end +end diff --git a/sig/whop_sdk/models/payout_destination_category.rbs b/sig/whop_sdk/models/payout_destination_category.rbs deleted file mode 100644 index 3c783c88..00000000 --- a/sig/whop_sdk/models/payout_destination_category.rbs +++ /dev/null @@ -1,19 +0,0 @@ -module WhopSDK - module Models - type payout_destination_category = - :crypto | :rtp | :next_day_bank | :bank_wire | :digital_wallet | :unknown - - module PayoutDestinationCategory - extend WhopSDK::Internal::Type::Enum - - CRYPTO: :crypto - RTP: :rtp - NEXT_DAY_BANK: :next_day_bank - BANK_WIRE: :bank_wire - DIGITAL_WALLET: :digital_wallet - UNKNOWN: :unknown - - def self?.values: -> ::Array[WhopSDK::Models::payout_destination_category] - end - end -end diff --git a/sig/whop_sdk/models/payout_list_params.rbs b/sig/whop_sdk/models/payout_list_params.rbs new file mode 100644 index 00000000..b5e0562b --- /dev/null +++ b/sig/whop_sdk/models/payout_list_params.rbs @@ -0,0 +1,70 @@ +module WhopSDK + module Models + type payout_list_params = + { + account_id: String, + after: String, + before: String, + currency: String, + first: Integer, + last: Integer, + user_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class PayoutListParams < 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 after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + ?account_id: String, + ?after: String, + ?before: String, + ?currency: String, + ?first: Integer, + ?last: Integer, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + after: String, + before: String, + currency: String, + first: Integer, + last: Integer, + user_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/payout_list_response.rbs b/sig/whop_sdk/models/payout_list_response.rbs new file mode 100644 index 00000000..7e1d106d --- /dev/null +++ b/sig/whop_sdk/models/payout_list_response.rbs @@ -0,0 +1,153 @@ +module WhopSDK + module Models + type payout_list_response = + { + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: Time?, + fee_amount: Float, + object: WhopSDK::Models::PayoutListResponse::object, + payer_name: String?, + payout_request_id: String?, + payout_token: WhopSDK::Models::PayoutListResponse::PayoutToken?, + speed: WhopSDK::Models::PayoutListResponse::speed, + status: WhopSDK::Models::PayoutListResponse::status + } + + class PayoutListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor currency: String + + attr_accessor estimated_arrival: Time? + + attr_accessor fee_amount: Float + + attr_accessor object: WhopSDK::Models::PayoutListResponse::object + + attr_accessor payer_name: String? + + attr_accessor payout_request_id: String? + + attr_accessor payout_token: WhopSDK::Models::PayoutListResponse::PayoutToken? + + attr_accessor speed: WhopSDK::Models::PayoutListResponse::speed + + attr_accessor status: WhopSDK::Models::PayoutListResponse::status + + def initialize: ( + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: Time?, + fee_amount: Float, + object: WhopSDK::Models::PayoutListResponse::object, + payer_name: String?, + payout_request_id: String?, + payout_token: WhopSDK::Models::PayoutListResponse::PayoutToken?, + speed: WhopSDK::Models::PayoutListResponse::speed, + status: WhopSDK::Models::PayoutListResponse::status + ) -> void + + def to_hash: -> { + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: Time?, + fee_amount: Float, + object: WhopSDK::Models::PayoutListResponse::object, + payer_name: String?, + payout_request_id: String?, + payout_token: WhopSDK::Models::PayoutListResponse::PayoutToken?, + speed: WhopSDK::Models::PayoutListResponse::speed, + status: WhopSDK::Models::PayoutListResponse::status + } + + type object = :payout + + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT: :payout + + def self?.values: -> ::Array[WhopSDK::Models::PayoutListResponse::object] + end + + type payout_token = + { + nickname: String?, + payout_destination: WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination? + } + + class PayoutToken < WhopSDK::Internal::Type::BaseModel + attr_accessor nickname: String? + + attr_accessor payout_destination: WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination? + + def initialize: ( + nickname: String?, + payout_destination: WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination? + ) -> void + + def to_hash: -> { + nickname: String?, + payout_destination: WhopSDK::Models::PayoutListResponse::PayoutToken::PayoutDestination? + } + + 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 + + type speed = :standard | :instant + + module Speed + extend WhopSDK::Internal::Type::Enum + + STANDARD: :standard + INSTANT: :instant + + def self?.values: -> ::Array[WhopSDK::Models::PayoutListResponse::speed] + end + + type status = + :requested + | :awaiting_payment + | :in_transit + | :completed + | :failed + | :canceled + | :denied + + module Status + extend WhopSDK::Internal::Type::Enum + + REQUESTED: :requested + AWAITING_PAYMENT: :awaiting_payment + IN_TRANSIT: :in_transit + COMPLETED: :completed + FAILED: :failed + CANCELED: :canceled + DENIED: :denied + + def self?.values: -> ::Array[WhopSDK::Models::PayoutListResponse::status] + end + end + end +end diff --git a/sig/whop_sdk/models/payout_method_created_webhook_event.rbs b/sig/whop_sdk/models/payout_method_created_webhook_event.rbs index b2f2609e..7425a7ae 100644 --- a/sig/whop_sdk/models/payout_method_created_webhook_event.rbs +++ b/sig/whop_sdk/models/payout_method_created_webhook_event.rbs @@ -109,29 +109,50 @@ module WhopSDK type destination = { - category: WhopSDK::Models::payout_destination_category, + category: WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category, country_code: String, name: String } class Destination < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::payout_destination_category + attr_accessor category: WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category attr_accessor country_code: String attr_accessor name: String def initialize: ( - category: WhopSDK::Models::payout_destination_category, + category: WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category, country_code: String, name: String ) -> void def to_hash: -> { - category: WhopSDK::Models::payout_destination_category, + category: WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category, country_code: String, name: String } + + type category = + :crypto + | :rtp + | :next_day_bank + | :bank_wire + | :digital_wallet + | :unknown + + module Category + extend WhopSDK::Internal::Type::Enum + + CRYPTO: :crypto + RTP: :rtp + NEXT_DAY_BANK: :next_day_bank + BANK_WIRE: :bank_wire + DIGITAL_WALLET: :digital_wallet + UNKNOWN: :unknown + + def self?.values: -> ::Array[WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category] + end end end end diff --git a/sig/whop_sdk/models/payout_method_list_params.rbs b/sig/whop_sdk/models/payout_method_list_params.rbs deleted file mode 100644 index ff042f12..00000000 --- a/sig/whop_sdk/models/payout_method_list_params.rbs +++ /dev/null @@ -1,46 +0,0 @@ -module WhopSDK - module Models - type payout_method_list_params = - { - company_id: String, - after: String?, - before: String?, - first: Integer?, - last: Integer? - } - & WhopSDK::Internal::Type::request_parameters - - class PayoutMethodListParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - attr_accessor company_id: String - - attr_accessor after: String? - - attr_accessor before: String? - - attr_accessor first: Integer? - - attr_accessor last: Integer? - - def initialize: ( - company_id: String, - ?after: String?, - ?before: String?, - ?first: Integer?, - ?last: Integer?, - ?request_options: WhopSDK::request_opts - ) -> void - - def to_hash: -> { - company_id: String, - after: String?, - before: String?, - first: Integer?, - last: Integer?, - request_options: WhopSDK::RequestOptions - } - end - end -end diff --git a/sig/whop_sdk/models/payout_method_list_response.rbs b/sig/whop_sdk/models/payout_method_list_response.rbs deleted file mode 100644 index 9c5efa64..00000000 --- a/sig/whop_sdk/models/payout_method_list_response.rbs +++ /dev/null @@ -1,97 +0,0 @@ -module WhopSDK - module Models - type payout_method_list_response = - { - id: String, - account_reference: String?, - company: WhopSDK::Models::PayoutMethodListResponse::Company?, - created_at: Time, - currency: String, - destination: WhopSDK::Models::PayoutMethodListResponse::Destination?, - institution_name: String?, - is_default: bool, - nickname: String? - } - - class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor account_reference: String? - - attr_accessor company: WhopSDK::Models::PayoutMethodListResponse::Company? - - attr_accessor created_at: Time - - attr_accessor currency: String - - attr_accessor destination: WhopSDK::Models::PayoutMethodListResponse::Destination? - - attr_accessor institution_name: String? - - attr_accessor is_default: bool - - attr_accessor nickname: String? - - def initialize: ( - id: String, - account_reference: String?, - company: WhopSDK::Models::PayoutMethodListResponse::Company?, - created_at: Time, - currency: String, - destination: WhopSDK::Models::PayoutMethodListResponse::Destination?, - institution_name: String?, - is_default: bool, - nickname: String? - ) -> void - - def to_hash: -> { - id: String, - account_reference: String?, - company: WhopSDK::Models::PayoutMethodListResponse::Company?, - created_at: Time, - currency: String, - destination: WhopSDK::Models::PayoutMethodListResponse::Destination?, - institution_name: String?, - is_default: bool, - nickname: String? - } - - type company = { id: String } - - class Company < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - - type destination = - { - category: WhopSDK::Models::payout_destination_category, - country_code: String, - name: String - } - - class Destination < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::payout_destination_category - - attr_accessor country_code: String - - attr_accessor name: String - - def initialize: ( - category: WhopSDK::Models::payout_destination_category, - country_code: String, - name: String - ) -> void - - def to_hash: -> { - category: WhopSDK::Models::payout_destination_category, - country_code: String, - name: String - } - end - end - end -end diff --git a/sig/whop_sdk/models/payout_method_retrieve_response.rbs b/sig/whop_sdk/models/payout_method_retrieve_response.rbs deleted file mode 100644 index 5dccd92a..00000000 --- a/sig/whop_sdk/models/payout_method_retrieve_response.rbs +++ /dev/null @@ -1,97 +0,0 @@ -module WhopSDK - module Models - type payout_method_retrieve_response = - { - id: String, - account_reference: String?, - company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company?, - created_at: Time, - currency: String, - destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination?, - institution_name: String?, - is_default: bool, - nickname: String? - } - - class PayoutMethodRetrieveResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor account_reference: String? - - attr_accessor company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company? - - attr_accessor created_at: Time - - attr_accessor currency: String - - attr_accessor destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination? - - attr_accessor institution_name: String? - - attr_accessor is_default: bool - - attr_accessor nickname: String? - - def initialize: ( - id: String, - account_reference: String?, - company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company?, - created_at: Time, - currency: String, - destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination?, - institution_name: String?, - is_default: bool, - nickname: String? - ) -> void - - def to_hash: -> { - id: String, - account_reference: String?, - company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company?, - created_at: Time, - currency: String, - destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination?, - institution_name: String?, - is_default: bool, - nickname: String? - } - - type company = { id: String } - - class Company < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - - type destination = - { - category: WhopSDK::Models::payout_destination_category, - country_code: String, - name: String - } - - class Destination < WhopSDK::Internal::Type::BaseModel - attr_accessor category: WhopSDK::Models::payout_destination_category - - attr_accessor country_code: String - - attr_accessor name: String - - def initialize: ( - category: WhopSDK::Models::payout_destination_category, - country_code: String, - name: String - ) -> void - - def to_hash: -> { - category: WhopSDK::Models::payout_destination_category, - country_code: String, - name: String - } - end - end - end -end diff --git a/sig/whop_sdk/models/payouts/method_list_params.rbs b/sig/whop_sdk/models/payouts/method_list_params.rbs new file mode 100644 index 00000000..841cb0ef --- /dev/null +++ b/sig/whop_sdk/models/payouts/method_list_params.rbs @@ -0,0 +1,107 @@ +module WhopSDK + module Models + module Payouts + type method_list_params = + { + account_id: String, + after: String, + amount: Float, + before: String, + currency: String, + first: Integer, + include_available: bool, + last: Integer, + status: WhopSDK::Models::Payouts::MethodListParams::status, + user_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class MethodListParams < 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 after: String? + + def after=: (String) -> String + + attr_reader amount: Float? + + def amount=: (Float) -> Float + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader include_available: bool? + + def include_available=: (bool) -> bool + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader status: WhopSDK::Models::Payouts::MethodListParams::status? + + def status=: ( + WhopSDK::Models::Payouts::MethodListParams::status + ) -> WhopSDK::Models::Payouts::MethodListParams::status + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + ?account_id: String, + ?after: String, + ?amount: Float, + ?before: String, + ?currency: String, + ?first: Integer, + ?include_available: bool, + ?last: Integer, + ?status: WhopSDK::Models::Payouts::MethodListParams::status, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + after: String, + amount: Float, + before: String, + currency: String, + first: Integer, + include_available: bool, + last: Integer, + status: WhopSDK::Models::Payouts::MethodListParams::status, + user_id: String, + request_options: WhopSDK::RequestOptions + } + + type status = :created | :active | :broken + + module Status + extend WhopSDK::Internal::Type::Enum + + CREATED: :created + ACTIVE: :active + BROKEN: :broken + + def self?.values: -> ::Array[WhopSDK::Models::Payouts::MethodListParams::status] + end + end + end + end +end diff --git a/sig/whop_sdk/models/payouts/method_list_response.rbs b/sig/whop_sdk/models/payouts/method_list_response.rbs new file mode 100644 index 00000000..931b5d45 --- /dev/null +++ b/sig/whop_sdk/models/payouts/method_list_response.rbs @@ -0,0 +1,229 @@ +module WhopSDK + module Models + module Payouts + type method_list_response = + { + id: String, + account_reference: String?, + created_at: Time, + destination_currency: String, + institution_name: String?, + is_default: bool, + nickname: String?, + object: WhopSDK::Models::Payouts::MethodListResponse::object, + payer_name: String?, + payout_destination: WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination?, + quote: WhopSDK::Models::Payouts::MethodListResponse::Quote?, + status: WhopSDK::Models::Payouts::MethodListResponse::status + } + + class MethodListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account_reference: String? + + attr_accessor created_at: Time + + attr_accessor destination_currency: String + + attr_accessor institution_name: String? + + attr_accessor is_default: bool + + attr_accessor nickname: String? + + attr_accessor object: WhopSDK::Models::Payouts::MethodListResponse::object + + attr_accessor payer_name: String? + + attr_accessor payout_destination: WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination? + + attr_accessor quote: WhopSDK::Models::Payouts::MethodListResponse::Quote? + + attr_accessor status: WhopSDK::Models::Payouts::MethodListResponse::status + + def initialize: ( + id: String, + account_reference: String?, + created_at: Time, + destination_currency: String, + institution_name: String?, + is_default: bool, + nickname: String?, + object: WhopSDK::Models::Payouts::MethodListResponse::object, + payer_name: String?, + payout_destination: WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination?, + quote: WhopSDK::Models::Payouts::MethodListResponse::Quote?, + status: WhopSDK::Models::Payouts::MethodListResponse::status + ) -> void + + def to_hash: -> { + id: String, + account_reference: String?, + created_at: Time, + destination_currency: String, + institution_name: String?, + is_default: bool, + nickname: String?, + object: WhopSDK::Models::Payouts::MethodListResponse::object, + payer_name: String?, + payout_destination: WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination?, + quote: WhopSDK::Models::Payouts::MethodListResponse::Quote?, + status: WhopSDK::Models::Payouts::MethodListResponse::status + } + + type object = :payout_method + + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT_METHOD: :payout_method + + def self?.values: -> ::Array[WhopSDK::Models::Payouts::MethodListResponse::object] + end + + type payout_destination = + { + delivery_type: String, + icon_url: String?, + name: String?, + supports_instant_delivery: bool, + supports_standard_delivery: bool + } + + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + attr_accessor delivery_type: String + + attr_accessor icon_url: String? + + attr_accessor name: String? + + attr_accessor supports_instant_delivery: bool + + attr_accessor supports_standard_delivery: bool + + def initialize: ( + delivery_type: String, + icon_url: String?, + name: String?, + supports_instant_delivery: bool, + supports_standard_delivery: bool + ) -> void + + def to_hash: -> { + delivery_type: String, + icon_url: String?, + name: String?, + supports_instant_delivery: bool, + supports_standard_delivery: bool + } + end + + type quote = + { + amount: Float, + currency: String, + exchange_rate: Float, + instant: WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant?, + max_limit: Float?, + min_limit: Float, + standard: WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard? + } + + class Quote < WhopSDK::Internal::Type::BaseModel + attr_accessor amount: Float + + attr_accessor currency: String + + attr_accessor exchange_rate: Float + + attr_accessor instant: WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant? + + attr_accessor max_limit: Float? + + attr_accessor min_limit: Float + + attr_accessor standard: WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard? + + def initialize: ( + amount: Float, + currency: String, + exchange_rate: Float, + instant: WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant?, + max_limit: Float?, + min_limit: Float, + standard: WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard? + ) -> void + + def to_hash: -> { + amount: Float, + currency: String, + exchange_rate: Float, + instant: WhopSDK::Models::Payouts::MethodListResponse::Quote::Instant?, + max_limit: Float?, + min_limit: Float, + standard: WhopSDK::Models::Payouts::MethodListResponse::Quote::Standard? + } + + type instant = + { estimated_arrival: Time, fee: Float, total_received: Float } + + class Instant < WhopSDK::Internal::Type::BaseModel + attr_accessor estimated_arrival: Time + + attr_accessor fee: Float + + attr_accessor total_received: Float + + def initialize: ( + estimated_arrival: Time, + fee: Float, + total_received: Float + ) -> void + + def to_hash: -> { + estimated_arrival: Time, + fee: Float, + total_received: Float + } + end + + type standard = + { estimated_arrival: Time, fee: Float, total_received: Float } + + class Standard < WhopSDK::Internal::Type::BaseModel + attr_accessor estimated_arrival: Time + + attr_accessor fee: Float + + attr_accessor total_received: Float + + def initialize: ( + estimated_arrival: Time, + fee: Float, + total_received: Float + ) -> void + + def to_hash: -> { + estimated_arrival: Time, + fee: Float, + total_received: Float + } + end + end + + type status = :created | :active | :broken + + module Status + extend WhopSDK::Internal::Type::Enum + + CREATED: :created + ACTIVE: :active + BROKEN: :broken + + def self?.values: -> ::Array[WhopSDK::Models::Payouts::MethodListResponse::status] + end + end + end + end +end diff --git a/sig/whop_sdk/models/person_list_params.rbs b/sig/whop_sdk/models/person_list_params.rbs new file mode 100644 index 00000000..8b527eda --- /dev/null +++ b/sig/whop_sdk/models/person_list_params.rbs @@ -0,0 +1,97 @@ +module WhopSDK + module Models + type person_list_params = + { + account_id: String, + after: String, + before: String, + direction: WhopSDK::Models::PersonListParams::direction, + filters: String, + first: Integer, + from: Integer, + sort: String, + to: Integer + } + & WhopSDK::Internal::Type::request_parameters + + class PersonListParams < 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 after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader direction: WhopSDK::Models::PersonListParams::direction? + + def direction=: ( + WhopSDK::Models::PersonListParams::direction + ) -> WhopSDK::Models::PersonListParams::direction + + attr_reader filters: String? + + def filters=: (String) -> String + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader from: Integer? + + def from=: (Integer) -> Integer + + attr_reader sort: String? + + def sort=: (String) -> String + + attr_reader to: Integer? + + def to=: (Integer) -> Integer + + def initialize: ( + ?account_id: String, + ?after: String, + ?before: String, + ?direction: WhopSDK::Models::PersonListParams::direction, + ?filters: String, + ?first: Integer, + ?from: Integer, + ?sort: String, + ?to: Integer, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + after: String, + before: String, + direction: WhopSDK::Models::PersonListParams::direction, + filters: String, + first: Integer, + from: Integer, + sort: String, + to: Integer, + 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::PersonListParams::direction] + end + end + end +end diff --git a/sig/whop_sdk/models/person_list_response.rbs b/sig/whop_sdk/models/person_list_response.rbs new file mode 100644 index 00000000..524a3576 --- /dev/null +++ b/sig/whop_sdk/models/person_list_response.rbs @@ -0,0 +1,162 @@ +module WhopSDK + module Models + type person_list_response = + { + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: ::Array[WhopSDK::Models::PersonListResponse::AdSet], + ads: ::Array[WhopSDK::Models::PersonListResponse::Ad], + aov: Float, + campaigns: ::Array[WhopSDK::Models::PersonListResponse::Campaign], + email: String?, + has_failed_payment: bool, + ltv: Float, + name: String?, + phone: String? + } + + class PersonListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account_id: String + + attr_accessor first_seen_at: Integer + + attr_accessor last_seen_at: Integer + + attr_accessor person_id: String + + attr_accessor purchase_count: Integer + + attr_reader ad_sets: ::Array[WhopSDK::Models::PersonListResponse::AdSet]? + + def ad_sets=: ( + ::Array[WhopSDK::Models::PersonListResponse::AdSet] + ) -> ::Array[WhopSDK::Models::PersonListResponse::AdSet] + + attr_reader ads: ::Array[WhopSDK::Models::PersonListResponse::Ad]? + + def ads=: ( + ::Array[WhopSDK::Models::PersonListResponse::Ad] + ) -> ::Array[WhopSDK::Models::PersonListResponse::Ad] + + attr_reader aov: Float? + + def aov=: (Float) -> Float + + attr_reader campaigns: ::Array[WhopSDK::Models::PersonListResponse::Campaign]? + + def campaigns=: ( + ::Array[WhopSDK::Models::PersonListResponse::Campaign] + ) -> ::Array[WhopSDK::Models::PersonListResponse::Campaign] + + attr_accessor email: String? + + attr_reader has_failed_payment: bool? + + def has_failed_payment=: (bool) -> bool + + attr_reader ltv: Float? + + def ltv=: (Float) -> Float + + attr_accessor name: String? + + attr_accessor phone: String? + + def initialize: ( + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ?ad_sets: ::Array[WhopSDK::Models::PersonListResponse::AdSet], + ?ads: ::Array[WhopSDK::Models::PersonListResponse::Ad], + ?aov: Float, + ?campaigns: ::Array[WhopSDK::Models::PersonListResponse::Campaign], + ?email: String?, + ?has_failed_payment: bool, + ?ltv: Float, + ?name: String?, + ?phone: String? + ) -> void + + def to_hash: -> { + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: ::Array[WhopSDK::Models::PersonListResponse::AdSet], + ads: ::Array[WhopSDK::Models::PersonListResponse::Ad], + aov: Float, + campaigns: ::Array[WhopSDK::Models::PersonListResponse::Campaign], + email: String?, + has_failed_payment: bool, + ltv: Float, + name: String?, + phone: String? + } + + type ad_set = { id: String, name: String?, thumbnail_url: String? } + + class AdSet < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor thumbnail_url: String? + + def initialize: ( + id: String, + ?name: String?, + ?thumbnail_url: String? + ) -> void + + def to_hash: -> { id: String, name: String?, thumbnail_url: String? } + end + + type ad = { id: String, name: String?, thumbnail_url: String? } + + class Ad < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor thumbnail_url: String? + + def initialize: ( + id: String, + ?name: String?, + ?thumbnail_url: String? + ) -> void + + def to_hash: -> { id: String, name: String?, thumbnail_url: String? } + end + + type campaign = { id: String, name: String?, thumbnail_url: String? } + + class Campaign < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor thumbnail_url: String? + + def initialize: ( + id: String, + ?name: String?, + ?thumbnail_url: String? + ) -> void + + def to_hash: -> { id: String, name: String?, thumbnail_url: String? } + end + end + end +end diff --git a/sig/whop_sdk/models/person_retrieve_params.rbs b/sig/whop_sdk/models/person_retrieve_params.rbs new file mode 100644 index 00000000..8adca578 --- /dev/null +++ b/sig/whop_sdk/models/person_retrieve_params.rbs @@ -0,0 +1,42 @@ +module WhopSDK + module Models + type person_retrieve_params = + { person_id: String, account_id: String, from: Integer, to: Integer } + & WhopSDK::Internal::Type::request_parameters + + class PersonRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor person_id: String + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader from: Integer? + + def from=: (Integer) -> Integer + + attr_reader to: Integer? + + def to=: (Integer) -> Integer + + def initialize: ( + person_id: String, + ?account_id: String, + ?from: Integer, + ?to: Integer, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + person_id: String, + account_id: String, + from: Integer, + to: Integer, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/person_retrieve_response.rbs b/sig/whop_sdk/models/person_retrieve_response.rbs new file mode 100644 index 00000000..d8c07abc --- /dev/null +++ b/sig/whop_sdk/models/person_retrieve_response.rbs @@ -0,0 +1,175 @@ +module WhopSDK + module Models + type person_retrieve_response = + { data: WhopSDK::Models::PersonRetrieveResponse::Data } + + class PersonRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: WhopSDK::Models::PersonRetrieveResponse::Data + + def initialize: ( + data: WhopSDK::Models::PersonRetrieveResponse::Data + ) -> void + + def to_hash: -> { data: WhopSDK::Models::PersonRetrieveResponse::Data } + + type data = + { + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet], + ads: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Ad], + aov: Float, + campaigns: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Campaign], + email: String?, + has_failed_payment: bool, + ltv: Float, + name: String?, + phone: String? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account_id: String + + attr_accessor first_seen_at: Integer + + attr_accessor last_seen_at: Integer + + attr_accessor person_id: String + + attr_accessor purchase_count: Integer + + attr_reader ad_sets: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet]? + + def ad_sets=: ( + ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet] + ) -> ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet] + + attr_reader ads: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Ad]? + + def ads=: ( + ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Ad] + ) -> ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Ad] + + attr_reader aov: Float? + + def aov=: (Float) -> Float + + attr_reader campaigns: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Campaign]? + + def campaigns=: ( + ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Campaign] + ) -> ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Campaign] + + attr_accessor email: String? + + attr_reader has_failed_payment: bool? + + def has_failed_payment=: (bool) -> bool + + attr_reader ltv: Float? + + def ltv=: (Float) -> Float + + attr_accessor name: String? + + attr_accessor phone: String? + + def initialize: ( + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ?ad_sets: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet], + ?ads: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Ad], + ?aov: Float, + ?campaigns: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Campaign], + ?email: String?, + ?has_failed_payment: bool, + ?ltv: Float, + ?name: String?, + ?phone: String? + ) -> void + + def to_hash: -> { + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::AdSet], + ads: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Ad], + aov: Float, + campaigns: ::Array[WhopSDK::Models::PersonRetrieveResponse::Data::Campaign], + email: String?, + has_failed_payment: bool, + ltv: Float, + name: String?, + phone: String? + } + + type ad_set = { id: String, name: String?, thumbnail_url: String? } + + class AdSet < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor thumbnail_url: String? + + def initialize: ( + id: String, + ?name: String?, + ?thumbnail_url: String? + ) -> void + + def to_hash: -> { id: String, name: String?, thumbnail_url: String? } + end + + type ad = { id: String, name: String?, thumbnail_url: String? } + + class Ad < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor thumbnail_url: String? + + def initialize: ( + id: String, + ?name: String?, + ?thumbnail_url: String? + ) -> void + + def to_hash: -> { id: String, name: String?, thumbnail_url: String? } + end + + type campaign = { id: String, name: String?, thumbnail_url: String? } + + class Campaign < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor thumbnail_url: String? + + def initialize: ( + id: String, + ?name: String?, + ?thumbnail_url: String? + ) -> void + + def to_hash: -> { id: String, name: String?, thumbnail_url: String? } + end + end + end + end +end diff --git a/sig/whop_sdk/models/plan.rbs b/sig/whop_sdk/models/plan.rbs index ef3e961f..7498dcd4 100644 --- a/sig/whop_sdk/models/plan.rbs +++ b/sig/whop_sdk/models/plan.rbs @@ -3,13 +3,13 @@ module WhopSDK type plan = { id: String, + account: top?, adaptive_pricing_enabled: bool, billing_period: Float?, collect_tax: bool, - company: top?, created_at: String, currency: WhopSDK::Models::Plan::currency, - custom_fields: ::Array[top], + custom_fields: ::Array[WhopSDK::Plan::CustomField], description: String?, expiration_days: Float?, initial_price: Float, @@ -25,7 +25,7 @@ module WhopSDK renewal_price: Float, split_pay_required_payments: Float?, stock: Float?, - tax_type: String, + tax_type: WhopSDK::Models::Plan::tax_type, three_ds_level: WhopSDK::Models::Plan::three_ds_level?, title: String?, trial_period_days: Float?, @@ -37,19 +37,19 @@ module WhopSDK class Plan < WhopSDK::Internal::Type::BaseModel attr_accessor id: String + attr_accessor account: top? + attr_accessor adaptive_pricing_enabled: bool attr_accessor billing_period: Float? attr_accessor collect_tax: bool - attr_accessor company: top? - attr_accessor created_at: String attr_accessor currency: WhopSDK::Models::Plan::currency - attr_accessor custom_fields: ::Array[top] + attr_accessor custom_fields: ::Array[WhopSDK::Plan::CustomField] attr_accessor description: String? @@ -81,7 +81,7 @@ module WhopSDK attr_accessor stock: Float? - attr_accessor tax_type: String + attr_accessor tax_type: WhopSDK::Models::Plan::tax_type attr_accessor three_ds_level: WhopSDK::Models::Plan::three_ds_level? @@ -97,13 +97,13 @@ module WhopSDK def initialize: ( id: String, + account: top?, adaptive_pricing_enabled: bool, billing_period: Float?, collect_tax: bool, - company: top?, created_at: String, currency: WhopSDK::Models::Plan::currency, - custom_fields: ::Array[top], + custom_fields: ::Array[WhopSDK::Plan::CustomField], description: String?, expiration_days: Float?, initial_price: Float, @@ -119,7 +119,7 @@ module WhopSDK renewal_price: Float, split_pay_required_payments: Float?, stock: Float?, - tax_type: String, + tax_type: WhopSDK::Models::Plan::tax_type, three_ds_level: WhopSDK::Models::Plan::three_ds_level?, title: String?, trial_period_days: Float?, @@ -130,13 +130,13 @@ module WhopSDK def to_hash: -> { id: String, + account: top?, adaptive_pricing_enabled: bool, billing_period: Float?, collect_tax: bool, - company: top?, created_at: String, currency: WhopSDK::Models::Plan::currency, - custom_fields: ::Array[top], + custom_fields: ::Array[WhopSDK::Plan::CustomField], description: String?, expiration_days: Float?, initial_price: Float, @@ -152,7 +152,7 @@ module WhopSDK renewal_price: Float, split_pay_required_payments: Float?, stock: Float?, - tax_type: String, + tax_type: WhopSDK::Models::Plan::tax_type, three_ds_level: WhopSDK::Models::Plan::three_ds_level?, title: String?, trial_period_days: Float?, @@ -350,6 +350,58 @@ module WhopSDK def self?.values: -> ::Array[WhopSDK::Models::Plan::currency] end + type custom_field = + { + id: String, + field_type: WhopSDK::Models::Plan::CustomField::field_type, + name: String, + order: Float, + placeholder: String?, + required: bool + } + + class CustomField < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor field_type: WhopSDK::Models::Plan::CustomField::field_type + + attr_accessor name: String + + attr_accessor order: Float + + attr_accessor placeholder: String? + + attr_accessor required: bool + + def initialize: ( + id: String, + field_type: WhopSDK::Models::Plan::CustomField::field_type, + name: String, + order: Float, + placeholder: String?, + required: bool + ) -> void + + def to_hash: -> { + id: String, + field_type: WhopSDK::Models::Plan::CustomField::field_type, + name: String, + order: Float, + placeholder: String?, + required: bool + } + + type field_type = :text + + module FieldType + extend WhopSDK::Internal::Type::Enum + + TEXT: :text + + def self?.values: -> ::Array[WhopSDK::Models::Plan::CustomField::field_type] + end + end + type plan_type = :renewal | :one_time module PlanType @@ -372,6 +424,18 @@ module WhopSDK def self?.values: -> ::Array[WhopSDK::Models::Plan::release_method] end + type tax_type = :inclusive | :exclusive | :unspecified + + module TaxType + extend WhopSDK::Internal::Type::Enum + + INCLUSIVE: :inclusive + EXCLUSIVE: :exclusive + UNSPECIFIED: :unspecified + + def self?.values: -> ::Array[WhopSDK::Models::Plan::tax_type] + end + type three_ds_level = :mandate_challenge | :frictionless module ThreeDSLevel diff --git a/sig/whop_sdk/models/plan_calculate_tax_params.rbs b/sig/whop_sdk/models/plan_calculate_tax_params.rbs new file mode 100644 index 00000000..a70f6c34 --- /dev/null +++ b/sig/whop_sdk/models/plan_calculate_tax_params.rbs @@ -0,0 +1,344 @@ +module WhopSDK + module Models + type plan_calculate_tax_params = + { + id: String, + address: WhopSDK::PlanCalculateTaxParams::Address?, + ip_address: String, + tax_ids: ::Array[WhopSDK::PlanCalculateTaxParams::TaxID]? + } + & WhopSDK::Internal::Type::request_parameters + + class PlanCalculateTaxParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_accessor address: WhopSDK::PlanCalculateTaxParams::Address? + + attr_reader ip_address: String? + + def ip_address=: (String) -> String + + attr_accessor tax_ids: ::Array[WhopSDK::PlanCalculateTaxParams::TaxID]? + + def initialize: ( + id: String, + ?address: WhopSDK::PlanCalculateTaxParams::Address?, + ?ip_address: String, + ?tax_ids: ::Array[WhopSDK::PlanCalculateTaxParams::TaxID]?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::PlanCalculateTaxParams::Address?, + ip_address: String, + tax_ids: ::Array[WhopSDK::PlanCalculateTaxParams::TaxID]?, + request_options: WhopSDK::RequestOptions + } + + type address = + { + country: String, + city: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_accessor country: String + + attr_accessor city: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + country: String, + ?city: String?, + ?line1: String?, + ?line2: String?, + ?postal_code: String?, + ?state: String? + ) -> void + + def to_hash: -> { + country: String, + city: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type tax_id = + { + type: WhopSDK::Models::PlanCalculateTaxParams::TaxID::type_, + value: String + } + + class TaxID < WhopSDK::Internal::Type::BaseModel + attr_reader type: WhopSDK::Models::PlanCalculateTaxParams::TaxID::type_? + + def type=: ( + WhopSDK::Models::PlanCalculateTaxParams::TaxID::type_ + ) -> WhopSDK::Models::PlanCalculateTaxParams::TaxID::type_ + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?type: WhopSDK::Models::PlanCalculateTaxParams::TaxID::type_, + ?value: String + ) -> void + + def to_hash: -> { + type: WhopSDK::Models::PlanCalculateTaxParams::TaxID::type_, + value: String + } + + type type_ = + :ad_nrt + | :ao_tin + | :ar_cuit + | :al_tin + | :am_tin + | :aw_tin + | :au_abn + | :au_arn + | :eu_vat + | :az_tin + | :bs_tin + | :bh_vat + | :bd_bin + | :bb_tin + | :by_tin + | :bj_ifu + | :bo_tin + | :ba_tin + | :br_cnpj + | :br_cpf + | :bg_uic + | :bf_ifu + | :kh_tin + | :cm_niu + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :cv_nif + | :cl_tin + | :cn_tin + | :co_nit + | :cd_nif + | :cr_tin + | :hr_oib + | :do_rcn + | :ec_ruc + | :eg_tin + | :sv_nit + | :et_tin + | :eu_oss_vat + | :ge_vat + | :gh_tin + | :de_stn + | :gb_vat + | :gn_nif + | :hk_br + | :hu_tin + | :is_vat + | :in_gst + | :id_npwp + | :il_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :kz_bin + | :ke_pin + | :kg_tin + | :la_tin + | :li_uid + | :li_vat + | :my_frp + | :my_itn + | :my_sst + | :mr_nif + | :mx_rfc + | :md_vat + | :me_pib + | :ma_vat + | :np_pan + | :nz_gst + | :ng_tin + | :mk_vat + | :no_vat + | :no_voec + | :om_vat + | :pe_ruc + | :ph_tin + | :ro_tin + | :ru_inn + | :ru_kpp + | :sa_vat + | :sn_ninea + | :rs_pib + | :sg_gst + | :sg_uen + | :si_tin + | :za_vat + | :kr_brn + | :es_cif + | :ch_uid + | :ch_vat + | :tw_vat + | :tj_tin + | :tz_vat + | :th_vat + | :tr_tin + | :ug_tin + | :ua_vat + | :ae_trn + | :us_ein + | :uy_ruc + | :uz_tin + | :uz_vat + | :ve_rif + | :vn_tin + | :zm_tin + | :zw_tin + | :sr_fin + + module Type + extend WhopSDK::Internal::Type::Enum + + AD_NRT: :ad_nrt + AO_TIN: :ao_tin + AR_CUIT: :ar_cuit + AL_TIN: :al_tin + AM_TIN: :am_tin + AW_TIN: :aw_tin + AU_ABN: :au_abn + AU_ARN: :au_arn + EU_VAT: :eu_vat + AZ_TIN: :az_tin + BS_TIN: :bs_tin + BH_VAT: :bh_vat + BD_BIN: :bd_bin + BB_TIN: :bb_tin + BY_TIN: :by_tin + BJ_IFU: :bj_ifu + BO_TIN: :bo_tin + BA_TIN: :ba_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + BG_UIC: :bg_uic + BF_IFU: :bf_ifu + KH_TIN: :kh_tin + CM_NIU: :cm_niu + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CV_NIF: :cv_nif + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CD_NIF: :cd_nif + CR_TIN: :cr_tin + HR_OIB: :hr_oib + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + SV_NIT: :sv_nit + ET_TIN: :et_tin + EU_OSS_VAT: :eu_oss_vat + GE_VAT: :ge_vat + GH_TIN: :gh_tin + DE_STN: :de_stn + GB_VAT: :gb_vat + GN_NIF: :gn_nif + HK_BR: :hk_br + HU_TIN: :hu_tin + IS_VAT: :is_vat + IN_GST: :in_gst + ID_NPWP: :id_npwp + IL_VAT: :il_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KZ_BIN: :kz_bin + KE_PIN: :ke_pin + KG_TIN: :kg_tin + LA_TIN: :la_tin + LI_UID: :li_uid + LI_VAT: :li_vat + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + MR_NIF: :mr_nif + MX_RFC: :mx_rfc + MD_VAT: :md_vat + ME_PIB: :me_pib + MA_VAT: :ma_vat + NP_PAN: :np_pan + NZ_GST: :nz_gst + NG_TIN: :ng_tin + MK_VAT: :mk_vat + NO_VAT: :no_vat + NO_VOEC: :no_voec + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + RO_TIN: :ro_tin + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SN_NINEA: :sn_ninea + RS_PIB: :rs_pib + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + ZA_VAT: :za_vat + KR_BRN: :kr_brn + ES_CIF: :es_cif + CH_UID: :ch_uid + CH_VAT: :ch_vat + TW_VAT: :tw_vat + TJ_TIN: :tj_tin + TZ_VAT: :tz_vat + TH_VAT: :th_vat + TR_TIN: :tr_tin + UG_TIN: :ug_tin + UA_VAT: :ua_vat + AE_TRN: :ae_trn + US_EIN: :us_ein + UY_RUC: :uy_ruc + UZ_TIN: :uz_tin + UZ_VAT: :uz_vat + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZM_TIN: :zm_tin + ZW_TIN: :zw_tin + SR_FIN: :sr_fin + + def self?.values: -> ::Array[WhopSDK::Models::PlanCalculateTaxParams::TaxID::type_] + end + end + end + end +end diff --git a/sig/whop_sdk/models/plan_calculate_tax_response.rbs b/sig/whop_sdk/models/plan_calculate_tax_response.rbs new file mode 100644 index 00000000..7290a9c6 --- /dev/null +++ b/sig/whop_sdk/models/plan_calculate_tax_response.rbs @@ -0,0 +1,67 @@ +module WhopSDK + module Models + type plan_calculate_tax_response = + { + currency: String, + status: WhopSDK::Models::PlanCalculateTaxResponse::status, + subtotal: Integer, + tax_amount: Integer, + tax_behavior: WhopSDK::Models::PlanCalculateTaxResponse::tax_behavior, + total: Integer + } + + class PlanCalculateTaxResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor currency: String + + attr_accessor status: WhopSDK::Models::PlanCalculateTaxResponse::status + + attr_accessor subtotal: Integer + + attr_accessor tax_amount: Integer + + attr_accessor tax_behavior: WhopSDK::Models::PlanCalculateTaxResponse::tax_behavior + + attr_accessor total: Integer + + def initialize: ( + currency: String, + status: WhopSDK::Models::PlanCalculateTaxResponse::status, + subtotal: Integer, + tax_amount: Integer, + tax_behavior: WhopSDK::Models::PlanCalculateTaxResponse::tax_behavior, + total: Integer + ) -> void + + def to_hash: -> { + currency: String, + status: WhopSDK::Models::PlanCalculateTaxResponse::status, + subtotal: Integer, + tax_amount: Integer, + tax_behavior: WhopSDK::Models::PlanCalculateTaxResponse::tax_behavior, + total: Integer + } + + type status = :calculated | :not_calculated + + module Status + extend WhopSDK::Internal::Type::Enum + + CALCULATED: :calculated + NOT_CALCULATED: :not_calculated + + def self?.values: -> ::Array[WhopSDK::Models::PlanCalculateTaxResponse::status] + end + + type tax_behavior = :exclusive | :inclusive + + module TaxBehavior + extend WhopSDK::Internal::Type::Enum + + EXCLUSIVE: :exclusive + INCLUSIVE: :inclusive + + def self?.values: -> ::Array[WhopSDK::Models::PlanCalculateTaxResponse::tax_behavior] + 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 be6a9f53..cfdc3d6e 100644 --- a/sig/whop_sdk/models/plan_create_params.rbs +++ b/sig/whop_sdk/models/plan_create_params.rbs @@ -2,11 +2,10 @@ module WhopSDK module Models type plan_create_params = { - product_id: String, + account_id: String, adaptive_pricing_enabled: bool?, billing_period: Integer?, checkout_styling: top?, - company_id: String, currency: String, custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, description: String?, @@ -19,6 +18,7 @@ module WhopSDK override_tax_type: String, payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration?, plan_type: String, + product_id: String, release_method: String, renewal_price: Float?, split_pay_required_payments: Integer?, @@ -35,7 +35,9 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor product_id: String + attr_reader account_id: String? + + def account_id=: (String) -> String attr_accessor adaptive_pricing_enabled: bool? @@ -43,10 +45,6 @@ module WhopSDK attr_accessor checkout_styling: top? - attr_reader company_id: String? - - def company_id=: (String) -> String - attr_reader currency: String? def currency=: (String) -> String @@ -77,6 +75,10 @@ module WhopSDK def plan_type=: (String) -> String + attr_reader product_id: String? + + def product_id=: (String) -> String + attr_reader release_method: String? def release_method=: (String) -> String @@ -104,11 +106,10 @@ module WhopSDK def visibility=: (String) -> String def initialize: ( - product_id: String, + ?account_id: String, ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, ?checkout_styling: top?, - ?company_id: String, ?currency: String, ?custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, ?description: String?, @@ -121,6 +122,7 @@ module WhopSDK ?override_tax_type: String, ?payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration?, ?plan_type: String, + ?product_id: String, ?release_method: String, ?renewal_price: Float?, ?split_pay_required_payments: Integer?, @@ -134,11 +136,10 @@ module WhopSDK ) -> void def to_hash: -> { - product_id: String, + account_id: String, adaptive_pricing_enabled: bool?, billing_period: Integer?, checkout_styling: top?, - company_id: String, currency: String, custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, description: String?, @@ -151,6 +152,7 @@ module WhopSDK override_tax_type: String, payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration?, plan_type: String, + product_id: String, release_method: String, renewal_price: Float?, split_pay_required_payments: Integer?, diff --git a/sig/whop_sdk/models/plan_list_params.rbs b/sig/whop_sdk/models/plan_list_params.rbs index 0cdabf16..4480fe90 100644 --- a/sig/whop_sdk/models/plan_list_params.rbs +++ b/sig/whop_sdk/models/plan_list_params.rbs @@ -2,7 +2,7 @@ module WhopSDK module Models type plan_list_params = { - company_id: String, + account_id: String, after: String, before: String, created_after: String, @@ -22,7 +22,7 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor company_id: String + attr_accessor account_id: String attr_reader after: String? @@ -77,7 +77,7 @@ module WhopSDK def visibilities=: (::Array[String]) -> ::Array[String] def initialize: ( - company_id: String, + account_id: String, ?after: String, ?before: String, ?created_after: String, @@ -94,7 +94,7 @@ module WhopSDK ) -> void def to_hash: -> { - company_id: String, + account_id: String, after: String, before: String, created_after: String, @@ -126,7 +126,7 @@ module WhopSDK | :active_members_count | :created_at | :internal_notes - | :expires_at + | :expiration_days module Order extend WhopSDK::Internal::Type::Enum @@ -135,7 +135,7 @@ module WhopSDK ACTIVE_MEMBERS_COUNT: :active_members_count CREATED_AT: :created_at INTERNAL_NOTES: :internal_notes - EXPIRES_AT: :expires_at + EXPIRATION_DAYS: :expiration_days def self?.values: -> ::Array[WhopSDK::Models::PlanListParams::order] end diff --git a/sig/whop_sdk/models/plan_list_response.rbs b/sig/whop_sdk/models/plan_list_response.rbs index 01324cd6..5aec2839 100644 --- a/sig/whop_sdk/models/plan_list_response.rbs +++ b/sig/whop_sdk/models/plan_list_response.rbs @@ -3,9 +3,9 @@ module WhopSDK type plan_list_response = { id: String, + account: top?, adaptive_pricing_enabled: bool, billing_period: Float?, - company: top?, created_at: String, currency: String, description: String?, @@ -34,12 +34,12 @@ module WhopSDK class PlanListResponse < WhopSDK::Internal::Type::BaseModel attr_accessor id: String + attr_accessor account: top? + attr_accessor adaptive_pricing_enabled: bool attr_accessor billing_period: Float? - attr_accessor company: top? - attr_accessor created_at: String attr_accessor currency: String @@ -88,9 +88,9 @@ module WhopSDK def initialize: ( id: String, + account: top?, adaptive_pricing_enabled: bool, billing_period: Float?, - company: top?, created_at: String, currency: String, description: String?, @@ -118,9 +118,9 @@ module WhopSDK def to_hash: -> { id: String, + account: top?, adaptive_pricing_enabled: bool, billing_period: Float?, - company: top?, created_at: String, currency: String, description: String?, diff --git a/sig/whop_sdk/models/product_create_params.rbs b/sig/whop_sdk/models/product_create_params.rbs index 6fea9ac4..5f2a4da0 100644 --- a/sig/whop_sdk/models/product_create_params.rbs +++ b/sig/whop_sdk/models/product_create_params.rbs @@ -2,26 +2,24 @@ module WhopSDK module Models type product_create_params = { - company_id: String, title: String, collect_shipping_address: bool?, - custom_cta: WhopSDK::Models::custom_cta?, + company_id: String, + custom_cta: String?, custom_cta_url: String?, custom_statement_descriptor: String?, description: String?, - experience_ids: ::Array[String]?, global_affiliate_percentage: Float?, - global_affiliate_status: WhopSDK::Models::global_affiliate_status?, + global_affiliate_status: String, headline: String?, member_affiliate_percentage: Float?, - member_affiliate_status: WhopSDK::Models::global_affiliate_status?, - metadata: ::Hash[Symbol, top]?, - plan_options: WhopSDK::ProductCreateParams::PlanOptions?, + member_affiliate_status: String, + metadata: top?, product_tax_code_id: String?, redirect_purchase_url: String?, route: String?, send_welcome_message: bool?, - visibility: WhopSDK::Models::visibility? + visibility: String } & WhopSDK::Internal::Type::request_parameters @@ -29,13 +27,15 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor company_id: String - attr_accessor title: String attr_accessor collect_shipping_address: bool? - attr_accessor custom_cta: WhopSDK::Models::custom_cta? + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_accessor custom_cta: String? attr_accessor custom_cta_url: String? @@ -43,21 +43,21 @@ module WhopSDK attr_accessor description: String? - attr_accessor experience_ids: ::Array[String]? - attr_accessor global_affiliate_percentage: Float? - attr_accessor global_affiliate_status: WhopSDK::Models::global_affiliate_status? + attr_reader global_affiliate_status: String? + + def global_affiliate_status=: (String) -> String attr_accessor headline: String? attr_accessor member_affiliate_percentage: Float? - attr_accessor member_affiliate_status: WhopSDK::Models::global_affiliate_status? + attr_reader member_affiliate_status: String? - attr_accessor metadata: ::Hash[Symbol, top]? + def member_affiliate_status=: (String) -> String - attr_accessor plan_options: WhopSDK::ProductCreateParams::PlanOptions? + attr_accessor metadata: top? attr_accessor product_tax_code_id: String? @@ -67,149 +67,53 @@ module WhopSDK attr_accessor send_welcome_message: bool? - attr_accessor visibility: WhopSDK::Models::visibility? + attr_reader visibility: String? + + def visibility=: (String) -> String def initialize: ( - company_id: String, title: String, ?collect_shipping_address: bool?, - ?custom_cta: WhopSDK::Models::custom_cta?, + ?company_id: String, + ?custom_cta: String?, ?custom_cta_url: String?, ?custom_statement_descriptor: String?, ?description: String?, - ?experience_ids: ::Array[String]?, ?global_affiliate_percentage: Float?, - ?global_affiliate_status: WhopSDK::Models::global_affiliate_status?, + ?global_affiliate_status: String, ?headline: String?, ?member_affiliate_percentage: Float?, - ?member_affiliate_status: WhopSDK::Models::global_affiliate_status?, - ?metadata: ::Hash[Symbol, top]?, - ?plan_options: WhopSDK::ProductCreateParams::PlanOptions?, + ?member_affiliate_status: String, + ?metadata: top?, ?product_tax_code_id: String?, ?redirect_purchase_url: String?, ?route: String?, ?send_welcome_message: bool?, - ?visibility: WhopSDK::Models::visibility?, + ?visibility: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - company_id: String, title: String, collect_shipping_address: bool?, - custom_cta: WhopSDK::Models::custom_cta?, + company_id: String, + custom_cta: String?, custom_cta_url: String?, custom_statement_descriptor: String?, description: String?, - experience_ids: ::Array[String]?, global_affiliate_percentage: Float?, - global_affiliate_status: WhopSDK::Models::global_affiliate_status?, + global_affiliate_status: String, headline: String?, member_affiliate_percentage: Float?, - member_affiliate_status: WhopSDK::Models::global_affiliate_status?, - metadata: ::Hash[Symbol, top]?, - plan_options: WhopSDK::ProductCreateParams::PlanOptions?, + member_affiliate_status: String, + metadata: top?, product_tax_code_id: String?, redirect_purchase_url: String?, route: String?, send_welcome_message: bool?, - visibility: WhopSDK::Models::visibility?, + visibility: String, request_options: WhopSDK::RequestOptions } - - type plan_options = - { - base_currency: WhopSDK::Models::currency?, - billing_period: Integer?, - custom_fields: ::Array[WhopSDK::ProductCreateParams::PlanOptions::CustomField]?, - initial_price: Float?, - plan_type: WhopSDK::Models::plan_type?, - release_method: WhopSDK::Models::release_method?, - renewal_price: Float?, - visibility: WhopSDK::Models::visibility? - } - - class PlanOptions < WhopSDK::Internal::Type::BaseModel - attr_accessor base_currency: WhopSDK::Models::currency? - - attr_accessor billing_period: Integer? - - attr_accessor custom_fields: ::Array[WhopSDK::ProductCreateParams::PlanOptions::CustomField]? - - attr_accessor initial_price: Float? - - attr_accessor plan_type: WhopSDK::Models::plan_type? - - attr_accessor release_method: WhopSDK::Models::release_method? - - attr_accessor renewal_price: Float? - - attr_accessor visibility: WhopSDK::Models::visibility? - - def initialize: ( - ?base_currency: WhopSDK::Models::currency?, - ?billing_period: Integer?, - ?custom_fields: ::Array[WhopSDK::ProductCreateParams::PlanOptions::CustomField]?, - ?initial_price: Float?, - ?plan_type: WhopSDK::Models::plan_type?, - ?release_method: WhopSDK::Models::release_method?, - ?renewal_price: Float?, - ?visibility: WhopSDK::Models::visibility? - ) -> void - - def to_hash: -> { - base_currency: WhopSDK::Models::currency?, - billing_period: Integer?, - custom_fields: ::Array[WhopSDK::ProductCreateParams::PlanOptions::CustomField]?, - initial_price: Float?, - plan_type: WhopSDK::Models::plan_type?, - release_method: WhopSDK::Models::release_method?, - renewal_price: Float?, - visibility: WhopSDK::Models::visibility? - } - - type custom_field = - { - field_type: :text, - name: String, - id: String?, - order: Integer?, - placeholder: String?, - required: bool? - } - - class CustomField < WhopSDK::Internal::Type::BaseModel - attr_accessor field_type: :text - - attr_accessor name: String - - attr_accessor id: String? - - attr_accessor order: Integer? - - attr_accessor placeholder: String? - - attr_accessor required: bool? - - def initialize: ( - name: String, - ?id: String?, - ?order: Integer?, - ?placeholder: String?, - ?required: bool?, - ?field_type: :text - ) -> void - - def to_hash: -> { - field_type: :text, - name: String, - id: String?, - order: Integer?, - placeholder: String?, - required: bool? - } - end - end end end end diff --git a/sig/whop_sdk/models/product_list_params.rbs b/sig/whop_sdk/models/product_list_params.rbs index f544b62c..04745abe 100644 --- a/sig/whop_sdk/models/product_list_params.rbs +++ b/sig/whop_sdk/models/product_list_params.rbs @@ -3,16 +3,14 @@ module WhopSDK type product_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::ProductListParams::order?, - product_types: ::Array[WhopSDK::Models::access_pass_type]?, - visibilities: ::Array[WhopSDK::Models::visibility_filter]? + access_pass_types: ::Array[String], + after: String, + before: String, + direction: WhopSDK::Models::ProductListParams::direction, + first: Integer, + last: Integer, + order: String, + visibilities: ::Array[String] } & WhopSDK::Internal::Type::request_parameters @@ -22,68 +20,75 @@ module WhopSDK attr_accessor company_id: String - attr_accessor after: String? + attr_reader access_pass_types: ::Array[String]? - attr_accessor before: String? + def access_pass_types=: (::Array[String]) -> ::Array[String] - attr_accessor created_after: Time? + attr_reader after: String? - attr_accessor created_before: Time? + def after=: (String) -> String - attr_accessor direction: WhopSDK::Models::direction? + attr_reader before: String? - attr_accessor first: Integer? + def before=: (String) -> String - attr_accessor last: Integer? + attr_reader direction: WhopSDK::Models::ProductListParams::direction? - attr_accessor order: WhopSDK::Models::ProductListParams::order? + def direction=: ( + WhopSDK::Models::ProductListParams::direction + ) -> WhopSDK::Models::ProductListParams::direction - attr_accessor product_types: ::Array[WhopSDK::Models::access_pass_type]? + 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: String? + + def order=: (String) -> 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::ProductListParams::order?, - ?product_types: ::Array[WhopSDK::Models::access_pass_type]?, - ?visibilities: ::Array[WhopSDK::Models::visibility_filter]?, + ?access_pass_types: ::Array[String], + ?after: String, + ?before: String, + ?direction: WhopSDK::Models::ProductListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: 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::ProductListParams::order?, - product_types: ::Array[WhopSDK::Models::access_pass_type]?, - visibilities: ::Array[WhopSDK::Models::visibility_filter]?, + access_pass_types: ::Array[String], + after: String, + before: String, + direction: WhopSDK::Models::ProductListParams::direction, + first: Integer, + last: Integer, + order: String, + visibilities: ::Array[String], request_options: WhopSDK::RequestOptions } - type order = - :active_memberships_count | :created_at | :usd_gmv | :usd_gmv_30_days + type direction = :asc | :desc - module Order + module Direction extend WhopSDK::Internal::Type::Enum - ACTIVE_MEMBERSHIPS_COUNT: :active_memberships_count - CREATED_AT: :created_at - USD_GMV: :usd_gmv - USD_GMV_30_DAYS: :usd_gmv_30_days + ASC: :asc + DESC: :desc - def self?.values: -> ::Array[WhopSDK::Models::ProductListParams::order] + def self?.values: -> ::Array[WhopSDK::Models::ProductListParams::direction] end end end diff --git a/sig/whop_sdk/models/product_update_params.rbs b/sig/whop_sdk/models/product_update_params.rbs index abc40201..fd66ef7b 100644 --- a/sig/whop_sdk/models/product_update_params.rbs +++ b/sig/whop_sdk/models/product_update_params.rbs @@ -3,25 +3,13 @@ module WhopSDK type product_update_params = { id: String, - collect_shipping_address: bool?, - custom_cta: WhopSDK::Models::custom_cta?, - custom_cta_url: String?, - custom_statement_descriptor: String?, description: String?, - gallery_images: ::Array[WhopSDK::ProductUpdateParams::GalleryImage]?, - global_affiliate_percentage: Float?, - global_affiliate_status: WhopSDK::Models::global_affiliate_status?, headline: String?, - member_affiliate_percentage: Float?, - member_affiliate_status: WhopSDK::Models::global_affiliate_status?, - metadata: ::Hash[Symbol, top]?, + metadata: top?, product_tax_code_id: String?, - redirect_purchase_url: String?, - route: String?, send_welcome_message: bool?, - store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig?, - title: String?, - visibility: WhopSDK::Models::visibility? + title: String, + visibility: String } & WhopSDK::Internal::Type::request_parameters @@ -31,113 +19,47 @@ module WhopSDK attr_accessor id: String - attr_accessor collect_shipping_address: bool? - - attr_accessor custom_cta: WhopSDK::Models::custom_cta? - - attr_accessor custom_cta_url: String? - - attr_accessor custom_statement_descriptor: String? - attr_accessor description: String? - attr_accessor gallery_images: ::Array[WhopSDK::ProductUpdateParams::GalleryImage]? - - attr_accessor global_affiliate_percentage: Float? - - attr_accessor global_affiliate_status: WhopSDK::Models::global_affiliate_status? - attr_accessor headline: String? - attr_accessor member_affiliate_percentage: Float? - - attr_accessor member_affiliate_status: WhopSDK::Models::global_affiliate_status? - - attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor metadata: top? attr_accessor product_tax_code_id: String? - attr_accessor redirect_purchase_url: String? - - attr_accessor route: String? - attr_accessor send_welcome_message: bool? - attr_accessor store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig? + attr_reader title: String? - attr_accessor title: String? + def title=: (String) -> String - attr_accessor visibility: WhopSDK::Models::visibility? + attr_reader visibility: String? + + def visibility=: (String) -> String def initialize: ( id: String, - ?collect_shipping_address: bool?, - ?custom_cta: WhopSDK::Models::custom_cta?, - ?custom_cta_url: String?, - ?custom_statement_descriptor: String?, ?description: String?, - ?gallery_images: ::Array[WhopSDK::ProductUpdateParams::GalleryImage]?, - ?global_affiliate_percentage: Float?, - ?global_affiliate_status: WhopSDK::Models::global_affiliate_status?, ?headline: String?, - ?member_affiliate_percentage: Float?, - ?member_affiliate_status: WhopSDK::Models::global_affiliate_status?, - ?metadata: ::Hash[Symbol, top]?, + ?metadata: top?, ?product_tax_code_id: String?, - ?redirect_purchase_url: String?, - ?route: String?, ?send_welcome_message: bool?, - ?store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig?, - ?title: String?, - ?visibility: WhopSDK::Models::visibility?, + ?title: String, + ?visibility: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { id: String, - collect_shipping_address: bool?, - custom_cta: WhopSDK::Models::custom_cta?, - custom_cta_url: String?, - custom_statement_descriptor: String?, description: String?, - gallery_images: ::Array[WhopSDK::ProductUpdateParams::GalleryImage]?, - global_affiliate_percentage: Float?, - global_affiliate_status: WhopSDK::Models::global_affiliate_status?, headline: String?, - member_affiliate_percentage: Float?, - member_affiliate_status: WhopSDK::Models::global_affiliate_status?, - metadata: ::Hash[Symbol, top]?, + metadata: top?, product_tax_code_id: String?, - redirect_purchase_url: String?, - route: String?, send_welcome_message: bool?, - store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig?, - title: String?, - visibility: WhopSDK::Models::visibility?, + title: String, + visibility: String, request_options: WhopSDK::RequestOptions } - - type gallery_image = { id: String } - - class GalleryImage < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - - type store_page_config = { custom_cta: String?, show_price: bool? } - - class StorePageConfig < WhopSDK::Internal::Type::BaseModel - attr_accessor custom_cta: String? - - attr_accessor show_price: bool? - - def initialize: (?custom_cta: String?, ?show_price: bool?) -> void - - def to_hash: -> { custom_cta: String?, show_price: bool? } - end end end end diff --git a/sig/whop_sdk/models/referral_referred_users_params.rbs b/sig/whop_sdk/models/referral_referred_users_params.rbs new file mode 100644 index 00000000..d0da687f --- /dev/null +++ b/sig/whop_sdk/models/referral_referred_users_params.rbs @@ -0,0 +1,63 @@ +module WhopSDK + module Models + type referral_referred_users_params = + { + after: String, + before: String, + first: Integer, + has_businesses: bool, + has_earning_businesses: bool, + last: Integer + } + & WhopSDK::Internal::Type::request_parameters + + class ReferralReferredUsersParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader has_businesses: bool? + + def has_businesses=: (bool) -> bool + + attr_reader has_earning_businesses: bool? + + def has_earning_businesses=: (bool) -> bool + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + def initialize: ( + ?after: String, + ?before: String, + ?first: Integer, + ?has_businesses: bool, + ?has_earning_businesses: bool, + ?last: Integer, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + after: String, + before: String, + first: Integer, + has_businesses: bool, + has_earning_businesses: bool, + last: Integer, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/referral_referred_users_response.rbs b/sig/whop_sdk/models/referral_referred_users_response.rbs new file mode 100644 index 00000000..b6fbfb1b --- /dev/null +++ b/sig/whop_sdk/models/referral_referred_users_response.rbs @@ -0,0 +1,140 @@ +module WhopSDK + module Models + type referral_referred_users_response = + { + data: ::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data], + page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + } + + class ReferralReferredUsersResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data] + + attr_accessor page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + + def initialize: ( + data: ::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data], + page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + ) -> void + + def to_hash: -> { + data: ::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data], + page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + } + + type data = + { + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor total_earnings_usd: String + + attr_accessor total_volume_usd: String + + attr_accessor user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + + def initialize: ( + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + ) -> void + + def to_hash: -> { + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + } + + type user = + { + id: String, + username: String, + city: String?, + country: String?, + name: String?, + profile_picture: WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor name: String? + + attr_reader profile_picture: WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture? + + def profile_picture=: ( + WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + ) -> WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + + def initialize: ( + id: String, + username: String, + ?city: String?, + ?country: String?, + ?name: String?, + ?profile_picture: WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + ) -> void + + def to_hash: -> { + id: String, + username: String, + city: String?, + country: String?, + name: String?, + profile_picture: WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + } + + 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 + + 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/referrals/business_leaderboard_params.rbs b/sig/whop_sdk/models/referrals/business_leaderboard_params.rbs new file mode 100644 index 00000000..c7089b47 --- /dev/null +++ b/sig/whop_sdk/models/referrals/business_leaderboard_params.rbs @@ -0,0 +1,46 @@ +module WhopSDK + module Models + module Referrals + type business_leaderboard_params = + { + period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period + } + & WhopSDK::Internal::Type::request_parameters + + class BusinessLeaderboardParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_reader period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period? + + def period=: ( + WhopSDK::Models::Referrals::BusinessLeaderboardParams::period + ) -> WhopSDK::Models::Referrals::BusinessLeaderboardParams::period + + def initialize: ( + ?period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period, + request_options: WhopSDK::RequestOptions + } + + type period = :day | :month | :year | :last_30_days | :all_time + + module Period + extend WhopSDK::Internal::Type::Enum + + DAY: :day + MONTH: :month + YEAR: :year + LAST_30_DAYS: :last_30_days + ALL_TIME: :all_time + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardParams::period] + end + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/business_leaderboard_response.rbs b/sig/whop_sdk/models/referrals/business_leaderboard_response.rbs new file mode 100644 index 00000000..00ff7df6 --- /dev/null +++ b/sig/whop_sdk/models/referrals/business_leaderboard_response.rbs @@ -0,0 +1,221 @@ +module WhopSDK + module Models + module Referrals + type business_leaderboard_response = + { + leaders: ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader], + me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me? + } + + class BusinessLeaderboardResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor leaders: ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader] + + attr_accessor me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me? + + def initialize: ( + leaders: ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader], + me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me? + ) -> void + + def to_hash: -> { + leaders: ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader], + me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me? + } + + type leader = + { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User? + } + + class Leader < WhopSDK::Internal::Type::BaseModel + attr_accessor first_referral_started_at: Time + + attr_accessor rank: Integer + + attr_accessor total_earnings_usd: String + + attr_accessor total_volume_usd: String + + attr_accessor user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User? + + def initialize: ( + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User? + ) -> void + + def to_hash: -> { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User? + } + + type user = + { + city: String?, + country: String?, + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, + username: String + } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor name: String? + + attr_reader profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture? + + def profile_picture=: ( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture + ) -> WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + city: String?, + country: String?, + ?id: String, + ?name: String?, + ?profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, + ?username: String + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::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 + + type me = + { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User? + } + + class Me < WhopSDK::Internal::Type::BaseModel + attr_accessor first_referral_started_at: Time + + attr_accessor rank: Integer + + attr_accessor total_earnings_usd: String + + attr_accessor total_volume_usd: String + + attr_accessor user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User? + + def initialize: ( + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User? + ) -> void + + def to_hash: -> { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User? + } + + type user = + { + city: String?, + country: String?, + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, + username: String + } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor name: String? + + attr_reader profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture? + + def profile_picture=: ( + WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture + ) -> WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + city: String?, + country: String?, + ?id: String, + ?name: String?, + ?profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, + ?username: String + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::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 + end + end +end diff --git a/sig/whop_sdk/models/referrals/business_list_params.rbs b/sig/whop_sdk/models/referrals/business_list_params.rbs new file mode 100644 index 00000000..9b8d3850 --- /dev/null +++ b/sig/whop_sdk/models/referrals/business_list_params.rbs @@ -0,0 +1,176 @@ +module WhopSDK + module Models + module Referrals + type business_list_params = + { + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::Referrals::BusinessListParams::direction, + first: Integer, + has_earnings: bool, + last: Integer, + order: WhopSDK::Models::Referrals::BusinessListParams::order, + referred_user_id: String, + referred_username: String, + status: WhopSDK::Models::Referrals::BusinessListParams::status, + tier: WhopSDK::Models::Referrals::BusinessListParams::tier + } + & WhopSDK::Internal::Type::request_parameters + + class BusinessListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader created_after: String? + + def created_after=: (String) -> String + + attr_reader created_before: String? + + def created_before=: (String) -> String + + attr_reader direction: WhopSDK::Models::Referrals::BusinessListParams::direction? + + def direction=: ( + WhopSDK::Models::Referrals::BusinessListParams::direction + ) -> WhopSDK::Models::Referrals::BusinessListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader has_earnings: bool? + + def has_earnings=: (bool) -> bool + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::Referrals::BusinessListParams::order? + + def order=: ( + WhopSDK::Models::Referrals::BusinessListParams::order + ) -> WhopSDK::Models::Referrals::BusinessListParams::order + + attr_reader referred_user_id: String? + + def referred_user_id=: (String) -> String + + attr_reader referred_username: String? + + def referred_username=: (String) -> String + + attr_reader status: WhopSDK::Models::Referrals::BusinessListParams::status? + + def status=: ( + WhopSDK::Models::Referrals::BusinessListParams::status + ) -> WhopSDK::Models::Referrals::BusinessListParams::status + + attr_reader tier: WhopSDK::Models::Referrals::BusinessListParams::tier? + + def tier=: ( + WhopSDK::Models::Referrals::BusinessListParams::tier + ) -> WhopSDK::Models::Referrals::BusinessListParams::tier + + def initialize: ( + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::Referrals::BusinessListParams::direction, + ?first: Integer, + ?has_earnings: bool, + ?last: Integer, + ?order: WhopSDK::Models::Referrals::BusinessListParams::order, + ?referred_user_id: String, + ?referred_username: String, + ?status: WhopSDK::Models::Referrals::BusinessListParams::status, + ?tier: WhopSDK::Models::Referrals::BusinessListParams::tier, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::Referrals::BusinessListParams::direction, + first: Integer, + has_earnings: bool, + last: Integer, + order: WhopSDK::Models::Referrals::BusinessListParams::order, + referred_user_id: String, + referred_username: String, + status: WhopSDK::Models::Referrals::BusinessListParams::status, + tier: WhopSDK::Models::Referrals::BusinessListParams::tier, + 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::Referrals::BusinessListParams::direction] + end + + type order = + :created_at + | :referral_started_at + | :referral_expires_at + | :payout_percentage + | :volume_usd + | :earnings_usd + + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT: :created_at + REFERRAL_STARTED_AT: :referral_started_at + REFERRAL_EXPIRES_AT: :referral_expires_at + PAYOUT_PERCENTAGE: :payout_percentage + VOLUME_USD: :volume_usd + EARNINGS_USD: :earnings_usd + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListParams::order] + end + + type status = :active | :removed + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + REMOVED: :removed + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListParams::status] + end + + type tier = :first | :second + + module Tier + extend WhopSDK::Internal::Type::Enum + + FIRST: :first + SECOND: :second + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListParams::tier] + end + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/business_list_response.rbs b/sig/whop_sdk/models/referrals/business_list_response.rbs new file mode 100644 index 00000000..6cbcf9c5 --- /dev/null +++ b/sig/whop_sdk/models/referrals/business_list_response.rbs @@ -0,0 +1,267 @@ +module WhopSDK + module Models + module Referrals + type business_list_response = + { + id: String, + account: WhopSDK::Models::Referrals::BusinessListResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier, + object: WhopSDK::Models::Referrals::BusinessListResponse::object, + owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Referrals::BusinessListResponse::status, + volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + } + + class BusinessListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account: WhopSDK::Models::Referrals::BusinessListResponse::Account? + + attr_accessor created_at: Time + + attr_accessor earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd + + attr_accessor first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner? + + attr_accessor my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier + + attr_accessor object: WhopSDK::Models::Referrals::BusinessListResponse::object + + attr_accessor owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner? + + attr_accessor payout_percentage: Float + + attr_accessor referral_expires_at: Time? + + attr_accessor referral_started_at: Time? + + attr_accessor status: WhopSDK::Models::Referrals::BusinessListResponse::status + + attr_accessor volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + + def initialize: ( + id: String, + account: WhopSDK::Models::Referrals::BusinessListResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier, + object: WhopSDK::Models::Referrals::BusinessListResponse::object, + owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Referrals::BusinessListResponse::status, + volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + ) -> void + + def to_hash: -> { + id: String, + account: WhopSDK::Models::Referrals::BusinessListResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier, + object: WhopSDK::Models::Referrals::BusinessListResponse::object, + owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Referrals::BusinessListResponse::status, + volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + } + + type account = + { id: String, logo_url: String?, route: String, title: String } + + class Account < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor logo_url: String? + + attr_accessor route: String + + attr_accessor title: String + + def initialize: ( + id: String, + logo_url: String?, + route: String, + title: String + ) -> void + + def to_hash: -> { + id: String, + logo_url: String?, + route: String, + title: String + } + end + + type earnings_usd = + { completed: String, pending: String, total: String } + + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + attr_accessor completed: String + + attr_accessor pending: String + + attr_accessor total: String + + def initialize: ( + completed: String, + pending: String, + total: String + ) -> void + + def to_hash: -> { completed: String, pending: String, total: String } + end + + type first_tier_partner = + { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + username: String + } + + class FirstTierPartner < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + username: String + ) -> void + + def to_hash: -> { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::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 + + type my_partner_tier = :first | :second + + module MyPartnerTier + extend WhopSDK::Internal::Type::Enum + + FIRST: :first + SECOND: :second + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier] + end + + type object = :business_referral + + module Object + extend WhopSDK::Internal::Type::Enum + + BUSINESS_REFERRAL: :business_referral + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListResponse::object] + end + + type owner = + { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + username: String + } + + class Owner < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + username: String + ) -> void + + def to_hash: -> { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::Owner::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 + + type status = :active | :removed + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + REMOVED: :removed + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListResponse::status] + end + + type volume_usd = + { attributed: String, awaiting_settlement: String, settled: String } + + class VolumeUsd < WhopSDK::Internal::Type::BaseModel + attr_accessor attributed: String + + attr_accessor awaiting_settlement: String + + attr_accessor settled: String + + def initialize: ( + attributed: String, + awaiting_settlement: String, + settled: String + ) -> void + + def to_hash: -> { + attributed: String, + awaiting_settlement: String, + settled: String + } + end + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/business_retrieve_params.rbs b/sig/whop_sdk/models/referrals/business_retrieve_params.rbs new file mode 100644 index 00000000..2e77fe58 --- /dev/null +++ b/sig/whop_sdk/models/referrals/business_retrieve_params.rbs @@ -0,0 +1,22 @@ +module WhopSDK + module Models + module Referrals + type business_retrieve_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class BusinessRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/business_retrieve_response.rbs b/sig/whop_sdk/models/referrals/business_retrieve_response.rbs new file mode 100644 index 00000000..a0950883 --- /dev/null +++ b/sig/whop_sdk/models/referrals/business_retrieve_response.rbs @@ -0,0 +1,677 @@ +module WhopSDK + module Models + module Referrals + type business_retrieve_response = + { + id: String, + account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier, + object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::object, + owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::status, + volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + } + + class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account? + + attr_accessor created_at: Time + + attr_accessor earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd + + attr_accessor first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner? + + attr_accessor my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier + + attr_accessor object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::object + + attr_accessor owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner? + + attr_accessor payout_percentage: Float + + attr_accessor referral_expires_at: Time? + + attr_accessor referral_started_at: Time? + + attr_accessor status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::status + + attr_accessor volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + + def initialize: ( + id: String, + account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier, + object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::object, + owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::status, + volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + ) -> void + + def to_hash: -> { + id: String, + account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier, + object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::object, + owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::status, + volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + } + + type account = + { + id: String, + capabilities: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities?, + logo_url: String?, + recommended_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction]?, + required_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction]?, + route: String, + title: String + } + + class Account < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor capabilities: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities? + + attr_accessor logo_url: String? + + attr_accessor recommended_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction]? + + attr_accessor required_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction]? + + attr_accessor route: String + + attr_accessor title: String + + def initialize: ( + id: String, + capabilities: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities?, + logo_url: String?, + recommended_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction]?, + required_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction]?, + route: String, + title: String + ) -> void + + def to_hash: -> { + id: String, + capabilities: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities?, + logo_url: String?, + recommended_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction]?, + required_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction]?, + route: String, + title: String + } + + type capabilities = + { + accept_bank_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer + } + + class Capabilities < WhopSDK::Internal::Type::BaseModel + attr_accessor accept_bank_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments + + attr_accessor accept_bnpl_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments + + attr_accessor accept_card_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments + + attr_accessor bank_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit + + attr_accessor card_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit + + attr_accessor card_issuing: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing + + attr_accessor crypto_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit + + attr_accessor crypto_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout + + attr_accessor instant_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout + + attr_accessor standard_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout + + attr_accessor transfer: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer + + def initialize: ( + accept_bank_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer + ) -> void + + def to_hash: -> { + accept_bank_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer + } + + type accept_bank_payments = :active | :inactive | :pending + + module AcceptBankPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments] + end + + type accept_bnpl_payments = :active | :inactive | :pending + + module AcceptBnplPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments] + end + + type accept_card_payments = :active | :inactive | :pending + + module AcceptCardPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments] + end + + type bank_deposit = :active | :inactive | :pending + + module BankDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit] + end + + type card_deposit = :active | :inactive | :pending + + module CardDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit] + end + + type card_issuing = :active | :inactive | :pending + + module CardIssuing + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing] + end + + type crypto_deposit = :active | :inactive | :pending + + module CryptoDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit] + end + + type crypto_payout = :active | :inactive | :pending + + module CryptoPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout] + end + + type instant_payout = :active | :inactive | :pending + + module InstantPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout] + end + + type standard_payout = :active | :inactive | :pending + + module StandardPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout] + end + + type transfer = :active | :inactive | :pending + + module Transfer + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer] + end + end + + type recommended_action = + { + action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status, + title: String + } + + class RecommendedAction < WhopSDK::Internal::Type::BaseModel + attr_accessor action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action + + attr_accessor blocked_capabilities: ::Array[String] + + attr_accessor cta: String + + attr_accessor cta_label: String + + attr_accessor description: String + + attr_accessor icon_url: String? + + attr_accessor impact_score: Integer? + + attr_accessor reasoning: String? + + attr_accessor status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status + + attr_accessor title: String + + def initialize: ( + action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status, + title: String + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status, + title: String + } + + type action = + :theme_business + | :create_product + | :create_plan + | :verify_identity + | :connect_affiliate_program + | :create_promotion + | :setup_tracking_pixel + | :migrate_from_stripe + | :accept_first_payment + | :launch_first_ad + | :invite_team_member + | :enable_tax_collection + | :create_card + | :join_whop_university + | :apply_for_financing + + module Action + extend WhopSDK::Internal::Type::Enum + + THEME_BUSINESS: :theme_business + CREATE_PRODUCT: :create_product + CREATE_PLAN: :create_plan + VERIFY_IDENTITY: :verify_identity + CONNECT_AFFILIATE_PROGRAM: :connect_affiliate_program + CREATE_PROMOTION: :create_promotion + SETUP_TRACKING_PIXEL: :setup_tracking_pixel + MIGRATE_FROM_STRIPE: :migrate_from_stripe + ACCEPT_FIRST_PAYMENT: :accept_first_payment + LAUNCH_FIRST_AD: :launch_first_ad + INVITE_TEAM_MEMBER: :invite_team_member + ENABLE_TAX_COLLECTION: :enable_tax_collection + CREATE_CARD: :create_card + JOIN_WHOP_UNIVERSITY: :join_whop_university + APPLY_FOR_FINANCING: :apply_for_financing + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action] + end + + type status = :optional + + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL: :optional + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status] + end + end + + type required_action = + { + action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status, + title: String + } + + class RequiredAction < WhopSDK::Internal::Type::BaseModel + attr_accessor action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action + + attr_accessor blocked_capabilities: ::Array[String] + + attr_accessor cta: String? + + attr_accessor cta_label: String + + attr_accessor description: String + + attr_accessor icon_url: String? + + attr_accessor status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status + + attr_accessor title: String + + def initialize: ( + action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status, + title: String + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status, + title: String + } + + type action = + :deposit_funds + | :submit_information_request + | :verify_identity + | :connect_fulfillment_tracker + + module Action + extend WhopSDK::Internal::Type::Enum + + DEPOSIT_FUNDS: :deposit_funds + SUBMIT_INFORMATION_REQUEST: :submit_information_request + VERIFY_IDENTITY: :verify_identity + CONNECT_FULFILLMENT_TRACKER: :connect_fulfillment_tracker + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action] + end + + type status = :required | :pending + + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRED: :required + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status] + end + end + end + + type earnings_usd = + { completed: String, pending: String, total: String } + + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + attr_accessor completed: String + + attr_accessor pending: String + + attr_accessor total: String + + def initialize: ( + completed: String, + pending: String, + total: String + ) -> void + + def to_hash: -> { completed: String, pending: String, total: String } + end + + type first_tier_partner = + { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, + username: String + } + + class FirstTierPartner < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, + username: String + ) -> void + + def to_hash: -> { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::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 + + type my_partner_tier = :first | :second + + module MyPartnerTier + extend WhopSDK::Internal::Type::Enum + + FIRST: :first + SECOND: :second + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier] + end + + type object = :business_referral + + module Object + extend WhopSDK::Internal::Type::Enum + + BUSINESS_REFERRAL: :business_referral + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::object] + end + + type owner = + { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture, + username: String + } + + class Owner < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture, + username: String + ) -> void + + def to_hash: -> { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::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 + + type status = :active | :removed + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + REMOVED: :removed + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::status] + end + + type volume_usd = + { attributed: String, awaiting_settlement: String, settled: String } + + class VolumeUsd < WhopSDK::Internal::Type::BaseModel + attr_accessor attributed: String + + attr_accessor awaiting_settlement: String + + attr_accessor settled: String + + def initialize: ( + attributed: String, + awaiting_settlement: String, + settled: String + ) -> void + + def to_hash: -> { + attributed: String, + awaiting_settlement: String, + settled: String + } + end + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/businesses/earning_list_params.rbs b/sig/whop_sdk/models/referrals/businesses/earning_list_params.rbs new file mode 100644 index 00000000..f5cd431d --- /dev/null +++ b/sig/whop_sdk/models/referrals/businesses/earning_list_params.rbs @@ -0,0 +1,139 @@ +module WhopSDK + module Models + module Referrals + module Businesses + type earning_list_params = + { + id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order, + status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status + } + & WhopSDK::Internal::Type::request_parameters + + class EarningListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader created_after: String? + + def created_after=: (String) -> String + + attr_reader created_before: String? + + def created_before=: (String) -> String + + attr_reader direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction? + + def direction=: ( + WhopSDK::Models::Referrals::Businesses::EarningListParams::direction + ) -> WhopSDK::Models::Referrals::Businesses::EarningListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order? + + def order=: ( + WhopSDK::Models::Referrals::Businesses::EarningListParams::order + ) -> WhopSDK::Models::Referrals::Businesses::EarningListParams::order + + attr_reader status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status? + + def status=: ( + WhopSDK::Models::Referrals::Businesses::EarningListParams::status + ) -> WhopSDK::Models::Referrals::Businesses::EarningListParams::status + + def initialize: ( + id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order, + ?status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order, + status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status, + 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::Referrals::Businesses::EarningListParams::direction] + end + + type order = + :created_at | :commission_amount | :transaction_amount | :payout_at + + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT: :created_at + COMMISSION_AMOUNT: :commission_amount + TRANSACTION_AMOUNT: :transaction_amount + PAYOUT_AT: :payout_at + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListParams::order] + end + + type status = + :awaiting_settlement | :pending | :completed | :canceled | :reversed + + module Status + extend WhopSDK::Internal::Type::Enum + + AWAITING_SETTLEMENT: :awaiting_settlement + PENDING: :pending + COMPLETED: :completed + CANCELED: :canceled + REVERSED: :reversed + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListParams::status] + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/businesses/earning_list_response.rbs b/sig/whop_sdk/models/referrals/businesses/earning_list_response.rbs new file mode 100644 index 00000000..03985c4e --- /dev/null +++ b/sig/whop_sdk/models/referrals/businesses/earning_list_response.rbs @@ -0,0 +1,288 @@ +module WhopSDK + module Models + module Referrals + module Businesses + type earning_list_response = + { + id: String?, + account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account?, + cancelation_reason: String?, + commission_amount_usd: String?, + created_at: Time, + financial_activity: ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]?, + object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::object, + payout_at: Time?, + payout_percentage: Float?, + product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product?, + resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource?, + second_tier: bool, + status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::status, + transaction_amount_usd: String + } + + class EarningListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String? + + attr_accessor account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account? + + attr_accessor cancelation_reason: String? + + attr_accessor commission_amount_usd: String? + + attr_accessor created_at: Time + + attr_accessor financial_activity: ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]? + + attr_accessor object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::object + + attr_accessor payout_at: Time? + + attr_accessor payout_percentage: Float? + + attr_accessor product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product? + + attr_accessor resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource? + + attr_accessor second_tier: bool + + attr_accessor status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::status + + attr_accessor transaction_amount_usd: String + + def initialize: ( + id: String?, + account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account?, + cancelation_reason: String?, + commission_amount_usd: String?, + created_at: Time, + financial_activity: ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]?, + object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::object, + payout_at: Time?, + payout_percentage: Float?, + product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product?, + resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource?, + second_tier: bool, + status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::status, + transaction_amount_usd: String + ) -> void + + def to_hash: -> { + id: String?, + account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account?, + cancelation_reason: String?, + commission_amount_usd: String?, + created_at: Time, + financial_activity: ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]?, + object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::object, + payout_at: Time?, + payout_percentage: Float?, + product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product?, + resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource?, + second_tier: bool, + status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::status, + transaction_amount_usd: String + } + + type account = + { id: String, logo_url: String?, route: String, title: String } + + class Account < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor logo_url: String? + + attr_accessor route: String + + attr_accessor title: String + + def initialize: ( + id: String, + logo_url: String?, + route: String, + title: String + ) -> void + + def to_hash: -> { + id: String, + logo_url: String?, + route: String, + title: String + } + end + + type financial_activity = + { + amount: String, + amount_usd: String, + category: String?, + created_at: Time?, + currency: String, + type: WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_ + } + + class FinancialActivity < WhopSDK::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor amount_usd: String + + attr_accessor category: String? + + attr_accessor created_at: Time? + + attr_accessor currency: String + + attr_accessor type: WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_ + + def initialize: ( + amount: String, + amount_usd: String, + category: String?, + created_at: Time?, + currency: String, + type: WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_ + ) -> void + + def to_hash: -> { + amount: String, + amount_usd: String, + category: String?, + created_at: Time?, + currency: String, + type: WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_ + } + + type type_ = :income | :expense + + module Type + extend WhopSDK::Internal::Type::Enum + + INCOME: :income + EXPENSE: :expense + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_] + end + end + + type object = :business_referral_earning + + module Object + extend WhopSDK::Internal::Type::Enum + + BUSINESS_REFERRAL_EARNING: :business_referral_earning + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::object] + end + + type product = { id: String, route: String, title: String } + + class Product < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor route: String + + attr_accessor title: String + + def initialize: (id: String, route: String, title: String) -> void + + def to_hash: -> { id: String, route: String, title: String } + end + + type resource = + { + id: String, + alternative_payment_method: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, + brand: String?, + created_at: Time, + currency: String, + :last4 => String?, + object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object, + payment_method_type: String?, + processor: String? + } + + class Resource < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor alternative_payment_method: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod? + + attr_accessor brand: String? + + attr_accessor created_at: Time + + attr_accessor currency: String + + attr_accessor last4: String? + + attr_accessor object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object + + attr_accessor payment_method_type: String? + + attr_accessor processor: String? + + def initialize: ( + id: String, + alternative_payment_method: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, + brand: String?, + created_at: Time, + currency: String, + last4: String?, + object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object, + payment_method_type: String?, + processor: String? + ) -> void + + def to_hash: -> { + id: String, + alternative_payment_method: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, + brand: String?, + created_at: Time, + currency: String, + :last4 => String?, + object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object, + payment_method_type: String?, + processor: String? + } + + type alternative_payment_method = + { image_url: String?, name: String } + + class AlternativePaymentMethod < WhopSDK::Internal::Type::BaseModel + attr_accessor image_url: String? + + attr_accessor name: String + + def initialize: (image_url: String?, name: String) -> void + + def to_hash: -> { image_url: String?, name: String } + end + + type object = :receipt + + module Object + extend WhopSDK::Internal::Type::Enum + + RECEIPT: :receipt + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object] + end + end + + type status = + :awaiting_settlement | :pending | :completed | :canceled | :reversed + + module Status + extend WhopSDK::Internal::Type::Enum + + AWAITING_SETTLEMENT: :awaiting_settlement + PENDING: :pending + COMPLETED: :completed + CANCELED: :canceled + REVERSED: :reversed + + def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::status] + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/partner_create_params.rbs b/sig/whop_sdk/models/referrals/partner_create_params.rbs new file mode 100644 index 00000000..56cf18f0 --- /dev/null +++ b/sig/whop_sdk/models/referrals/partner_create_params.rbs @@ -0,0 +1,17 @@ +module WhopSDK + module Models + module Referrals + type partner_create_params = + { } & WhopSDK::Internal::Type::request_parameters + + class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + def initialize: (?request_options: WhopSDK::request_opts) -> void + + def to_hash: -> { request_options: WhopSDK::RequestOptions } + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/partner_create_response.rbs b/sig/whop_sdk/models/referrals/partner_create_response.rbs new file mode 100644 index 00000000..73f93cad --- /dev/null +++ b/sig/whop_sdk/models/referrals/partner_create_response.rbs @@ -0,0 +1,21 @@ +module WhopSDK + module Models + module Referrals + type partner_create_response = + { referral_link: String, whop_partner_enabled_at: Time } + + class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor referral_link: String + + attr_accessor whop_partner_enabled_at: Time + + def initialize: ( + referral_link: String, + whop_partner_enabled_at: Time + ) -> void + + def to_hash: -> { referral_link: String, whop_partner_enabled_at: Time } + end + end + end +end diff --git a/sig/whop_sdk/models/result_label_keys.rbs b/sig/whop_sdk/models/result_label_keys.rbs index 2e8f00e3..afc072f8 100644 --- a/sig/whop_sdk/models/result_label_keys.rbs +++ b/sig/whop_sdk/models/result_label_keys.rbs @@ -22,8 +22,18 @@ module WhopSDK | :registrations | :content_views | :searches + | :adds_to_cart + | :adds_to_wishlist + | :adds_of_payment_info + | :checkouts_initiated | :website_schedules | :website_submit_applications + | :website_trials_started + | :website_subscriptions + | :website_contacts + | :website_donations + | :website_find_locations + | :website_product_customizations | :custom module ResultLabelKeys @@ -50,8 +60,18 @@ module WhopSDK REGISTRATIONS: :registrations CONTENT_VIEWS: :content_views SEARCHES: :searches + ADDS_TO_CART: :adds_to_cart + ADDS_TO_WISHLIST: :adds_to_wishlist + ADDS_OF_PAYMENT_INFO: :adds_of_payment_info + CHECKOUTS_INITIATED: :checkouts_initiated WEBSITE_SCHEDULES: :website_schedules WEBSITE_SUBMIT_APPLICATIONS: :website_submit_applications + WEBSITE_TRIALS_STARTED: :website_trials_started + WEBSITE_SUBSCRIPTIONS: :website_subscriptions + WEBSITE_CONTACTS: :website_contacts + WEBSITE_DONATIONS: :website_donations + WEBSITE_FIND_LOCATIONS: :website_find_locations + WEBSITE_PRODUCT_CUSTOMIZATIONS: :website_product_customizations CUSTOM: :custom def self?.values: -> ::Array[WhopSDK::Models::result_label_keys] diff --git a/sig/whop_sdk/models/setup_intent.rbs b/sig/whop_sdk/models/setup_intent.rbs index 2eb2fdc6..2876f766 100644 --- a/sig/whop_sdk/models/setup_intent.rbs +++ b/sig/whop_sdk/models/setup_intent.rbs @@ -10,7 +10,8 @@ module WhopSDK member: WhopSDK::SetupIntent::Member?, metadata: ::Hash[Symbol, top]?, payment_method: WhopSDK::SetupIntent::PaymentMethod?, - status: WhopSDK::Models::setup_intent_status + status: WhopSDK::Models::setup_intent_status, + three_ds_verified: bool } class SetupIntent < WhopSDK::Internal::Type::BaseModel @@ -32,6 +33,8 @@ module WhopSDK attr_accessor status: WhopSDK::Models::setup_intent_status + attr_accessor three_ds_verified: bool + def initialize: ( id: String, checkout_configuration: WhopSDK::SetupIntent::CheckoutConfiguration?, @@ -41,7 +44,8 @@ module WhopSDK member: WhopSDK::SetupIntent::Member?, metadata: ::Hash[Symbol, top]?, payment_method: WhopSDK::SetupIntent::PaymentMethod?, - status: WhopSDK::Models::setup_intent_status + status: WhopSDK::Models::setup_intent_status, + three_ds_verified: bool ) -> void def to_hash: -> { @@ -53,7 +57,8 @@ module WhopSDK member: WhopSDK::SetupIntent::Member?, metadata: ::Hash[Symbol, top]?, payment_method: WhopSDK::SetupIntent::PaymentMethod?, - status: WhopSDK::Models::setup_intent_status + status: WhopSDK::Models::setup_intent_status, + three_ds_verified: bool } type checkout_configuration = { id: String } diff --git a/sig/whop_sdk/models/social_account.rbs b/sig/whop_sdk/models/social_account.rbs new file mode 100644 index 00000000..e93c905a --- /dev/null +++ b/sig/whop_sdk/models/social_account.rbs @@ -0,0 +1,74 @@ +module WhopSDK + module Models + type social_account = + { + id: String, + external_id: String?, + name: String?, + platform: WhopSDK::Models::SocialAccount::platform, + profile_picture_url: String?, + scopes: ::Array[String], + url: String?, + username: String?, + verified: bool + } + + class SocialAccount < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor external_id: String? + + attr_accessor name: String? + + attr_accessor platform: WhopSDK::Models::SocialAccount::platform + + attr_accessor profile_picture_url: String? + + attr_accessor scopes: ::Array[String] + + attr_accessor url: String? + + attr_accessor username: String? + + attr_accessor verified: bool + + def initialize: ( + id: String, + external_id: String?, + name: String?, + platform: WhopSDK::Models::SocialAccount::platform, + profile_picture_url: String?, + scopes: ::Array[String], + url: String?, + username: String?, + verified: bool + ) -> void + + def to_hash: -> { + id: String, + external_id: String?, + name: String?, + platform: WhopSDK::Models::SocialAccount::platform, + profile_picture_url: String?, + scopes: ::Array[String], + url: String?, + username: String?, + verified: bool + } + + type platform = :x | :instagram | :youtube | :tiktok | :facebook + + module Platform + extend WhopSDK::Internal::Type::Enum + + X: :x + INSTAGRAM: :instagram + YOUTUBE: :youtube + TIKTOK: :tiktok + FACEBOOK: :facebook + + def self?.values: -> ::Array[WhopSDK::Models::SocialAccount::platform] + end + end + end +end diff --git a/sig/whop_sdk/models/social_account_connect_params.rbs b/sig/whop_sdk/models/social_account_connect_params.rbs new file mode 100644 index 00000000..6301bd1b --- /dev/null +++ b/sig/whop_sdk/models/social_account_connect_params.rbs @@ -0,0 +1,69 @@ +module WhopSDK + module Models + type social_account_connect_params = + { + platform: WhopSDK::Models::SocialAccountConnectParams::platform, + account_id: String, + redirect_url: String, + scopes: ::Array[WhopSDK::Models::SocialAccountConnectParams::scope] + } + & WhopSDK::Internal::Type::request_parameters + + class SocialAccountConnectParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor platform: WhopSDK::Models::SocialAccountConnectParams::platform + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader redirect_url: String? + + def redirect_url=: (String) -> String + + attr_reader scopes: ::Array[WhopSDK::Models::SocialAccountConnectParams::scope]? + + def scopes=: ( + ::Array[WhopSDK::Models::SocialAccountConnectParams::scope] + ) -> ::Array[WhopSDK::Models::SocialAccountConnectParams::scope] + + def initialize: ( + platform: WhopSDK::Models::SocialAccountConnectParams::platform, + ?account_id: String, + ?redirect_url: String, + ?scopes: ::Array[WhopSDK::Models::SocialAccountConnectParams::scope], + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + platform: WhopSDK::Models::SocialAccountConnectParams::platform, + account_id: String, + redirect_url: String, + scopes: ::Array[WhopSDK::Models::SocialAccountConnectParams::scope], + request_options: WhopSDK::RequestOptions + } + + type platform = :meta_business + + module Platform + extend WhopSDK::Internal::Type::Enum + + META_BUSINESS: :meta_business + + def self?.values: -> ::Array[WhopSDK::Models::SocialAccountConnectParams::platform] + end + + type scope = :advertise + + module Scope + extend WhopSDK::Internal::Type::Enum + + ADVERTISE: :advertise + + def self?.values: -> ::Array[WhopSDK::Models::SocialAccountConnectParams::scope] + end + end + end +end diff --git a/sig/whop_sdk/models/social_account_connect_response.rbs b/sig/whop_sdk/models/social_account_connect_response.rbs new file mode 100644 index 00000000..818946c4 --- /dev/null +++ b/sig/whop_sdk/models/social_account_connect_response.rbs @@ -0,0 +1,13 @@ +module WhopSDK + module Models + type social_account_connect_response = { authorize_url: String } + + class SocialAccountConnectResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor authorize_url: String + + def initialize: (authorize_url: String) -> void + + def to_hash: -> { authorize_url: String } + end + end +end diff --git a/sig/whop_sdk/models/social_account_create_params.rbs b/sig/whop_sdk/models/social_account_create_params.rbs new file mode 100644 index 00000000..4a4bd262 --- /dev/null +++ b/sig/whop_sdk/models/social_account_create_params.rbs @@ -0,0 +1,43 @@ +module WhopSDK + module Models + type social_account_create_params = + { + platform: WhopSDK::Models::SocialAccountCreateParams::platform, + account_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class SocialAccountCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor platform: WhopSDK::Models::SocialAccountCreateParams::platform + + attr_reader account_id: String? + + def account_id=: (String) -> String + + def initialize: ( + platform: WhopSDK::Models::SocialAccountCreateParams::platform, + ?account_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + platform: WhopSDK::Models::SocialAccountCreateParams::platform, + account_id: String, + request_options: WhopSDK::RequestOptions + } + + type platform = :facebook + + module Platform + extend WhopSDK::Internal::Type::Enum + + FACEBOOK: :facebook + + def self?.values: -> ::Array[WhopSDK::Models::SocialAccountCreateParams::platform] + end + end + end +end diff --git a/sig/whop_sdk/models/social_account_delete_params.rbs b/sig/whop_sdk/models/social_account_delete_params.rbs new file mode 100644 index 00000000..6ad26d36 --- /dev/null +++ b/sig/whop_sdk/models/social_account_delete_params.rbs @@ -0,0 +1,36 @@ +module WhopSDK + module Models + type social_account_delete_params = + { id: String, account_id: String, user_id: String } + & WhopSDK::Internal::Type::request_parameters + + class SocialAccountDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + id: String, + ?account_id: String, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + id: String, + account_id: String, + user_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/social_account_delete_response.rbs b/sig/whop_sdk/models/social_account_delete_response.rbs new file mode 100644 index 00000000..eefd7d97 --- /dev/null +++ b/sig/whop_sdk/models/social_account_delete_response.rbs @@ -0,0 +1,5 @@ +module WhopSDK + module Models + SocialAccountDeleteResponse: WhopSDK::Internal::Type::Converter + end +end diff --git a/sig/whop_sdk/models/social_account_list_params.rbs b/sig/whop_sdk/models/social_account_list_params.rbs new file mode 100644 index 00000000..de541e63 --- /dev/null +++ b/sig/whop_sdk/models/social_account_list_params.rbs @@ -0,0 +1,152 @@ +module WhopSDK + module Models + type social_account_list_params = + { + account_id: String, + after: String, + before: String, + direction: WhopSDK::Models::SocialAccountListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::SocialAccountListParams::order, + platform: WhopSDK::Models::SocialAccountListParams::platform, + scopes: ::Array[WhopSDK::Models::SocialAccountListParams::scope], + user_id: String, + verified: bool + } + & WhopSDK::Internal::Type::request_parameters + + class SocialAccountListParams < 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 after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader direction: WhopSDK::Models::SocialAccountListParams::direction? + + def direction=: ( + WhopSDK::Models::SocialAccountListParams::direction + ) -> WhopSDK::Models::SocialAccountListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::SocialAccountListParams::order? + + def order=: ( + WhopSDK::Models::SocialAccountListParams::order + ) -> WhopSDK::Models::SocialAccountListParams::order + + attr_reader platform: WhopSDK::Models::SocialAccountListParams::platform? + + def platform=: ( + WhopSDK::Models::SocialAccountListParams::platform + ) -> WhopSDK::Models::SocialAccountListParams::platform + + attr_reader scopes: ::Array[WhopSDK::Models::SocialAccountListParams::scope]? + + def scopes=: ( + ::Array[WhopSDK::Models::SocialAccountListParams::scope] + ) -> ::Array[WhopSDK::Models::SocialAccountListParams::scope] + + attr_reader user_id: String? + + def user_id=: (String) -> String + + attr_reader verified: bool? + + def verified=: (bool) -> bool + + def initialize: ( + ?account_id: String, + ?after: String, + ?before: String, + ?direction: WhopSDK::Models::SocialAccountListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::SocialAccountListParams::order, + ?platform: WhopSDK::Models::SocialAccountListParams::platform, + ?scopes: ::Array[WhopSDK::Models::SocialAccountListParams::scope], + ?user_id: String, + ?verified: bool, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + after: String, + before: String, + direction: WhopSDK::Models::SocialAccountListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::SocialAccountListParams::order, + platform: WhopSDK::Models::SocialAccountListParams::platform, + scopes: ::Array[WhopSDK::Models::SocialAccountListParams::scope], + user_id: String, + verified: bool, + 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::SocialAccountListParams::direction] + end + + type order = :display_order | :created_at + + module Order + extend WhopSDK::Internal::Type::Enum + + DISPLAY_ORDER: :display_order + CREATED_AT: :created_at + + def self?.values: -> ::Array[WhopSDK::Models::SocialAccountListParams::order] + end + + type platform = :x | :instagram | :youtube | :tiktok | :facebook + + module Platform + extend WhopSDK::Internal::Type::Enum + + X: :x + INSTAGRAM: :instagram + YOUTUBE: :youtube + TIKTOK: :tiktok + FACEBOOK: :facebook + + def self?.values: -> ::Array[WhopSDK::Models::SocialAccountListParams::platform] + end + + type scope = :advertise + + module Scope + extend WhopSDK::Internal::Type::Enum + + ADVERTISE: :advertise + + def self?.values: -> ::Array[WhopSDK::Models::SocialAccountListParams::scope] + end + end + end +end diff --git a/sig/whop_sdk/models/social_account_post.rbs b/sig/whop_sdk/models/social_account_post.rbs new file mode 100644 index 00000000..e4c88bd4 --- /dev/null +++ b/sig/whop_sdk/models/social_account_post.rbs @@ -0,0 +1,111 @@ +module WhopSDK + module Models + type social_account_post = + { + id: String, + call_to_action: WhopSDK::Models::SocialAccountPost::call_to_action?, + destination_url: String?, + media_url: String?, + thumbnail_url: String? + } + + class SocialAccountPost < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor call_to_action: WhopSDK::Models::SocialAccountPost::call_to_action? + + attr_accessor destination_url: String? + + attr_accessor media_url: String? + + attr_accessor thumbnail_url: String? + + def initialize: ( + id: String, + call_to_action: WhopSDK::Models::SocialAccountPost::call_to_action?, + destination_url: String?, + media_url: String?, + thumbnail_url: String? + ) -> void + + def to_hash: -> { + id: String, + call_to_action: WhopSDK::Models::SocialAccountPost::call_to_action?, + destination_url: String?, + media_url: String?, + thumbnail_url: String? + } + + type call_to_action = + :learn_more + | :shop_now + | :sign_up + | :subscribe + | :get_started + | :book_now + | :apply_now + | :contact_us + | :download + | :order_now + | :buy_now + | :get_quote + | :message_page + | :whatsapp_message + | :instagram_message + | :call_now + | :get_directions + | :send_updates + | :get_offer + | :watch_more + | :listen_now + | :play_game + | :open_link + | :no_button + | :get_offer_view + | :get_event_tickets + | :see_menu + | :request_time + | :event_rsvp + | :see_details + | :view_instagram_profile + + module CallToAction + extend WhopSDK::Internal::Type::Enum + + LEARN_MORE: :learn_more + SHOP_NOW: :shop_now + SIGN_UP: :sign_up + SUBSCRIBE: :subscribe + GET_STARTED: :get_started + BOOK_NOW: :book_now + APPLY_NOW: :apply_now + CONTACT_US: :contact_us + DOWNLOAD: :download + ORDER_NOW: :order_now + BUY_NOW: :buy_now + GET_QUOTE: :get_quote + MESSAGE_PAGE: :message_page + WHATSAPP_MESSAGE: :whatsapp_message + INSTAGRAM_MESSAGE: :instagram_message + CALL_NOW: :call_now + GET_DIRECTIONS: :get_directions + SEND_UPDATES: :send_updates + GET_OFFER: :get_offer + WATCH_MORE: :watch_more + LISTEN_NOW: :listen_now + PLAY_GAME: :play_game + OPEN_LINK: :open_link + NO_BUTTON: :no_button + GET_OFFER_VIEW: :get_offer_view + GET_EVENT_TICKETS: :get_event_tickets + SEE_MENU: :see_menu + REQUEST_TIME: :request_time + EVENT_RSVP: :event_rsvp + SEE_DETAILS: :see_details + VIEW_INSTAGRAM_PROFILE: :view_instagram_profile + + def self?.values: -> ::Array[WhopSDK::Models::SocialAccountPost::call_to_action] + end + end + end +end diff --git a/sig/whop_sdk/models/social_account_posts_params.rbs b/sig/whop_sdk/models/social_account_posts_params.rbs new file mode 100644 index 00000000..3a12d606 --- /dev/null +++ b/sig/whop_sdk/models/social_account_posts_params.rbs @@ -0,0 +1,52 @@ +module WhopSDK + module Models + type social_account_posts_params = + { + id: String, + account_id: String, + after: String, + first: Integer, + post_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class SocialAccountPostsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_accessor account_id: String + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader post_id: String? + + def post_id=: (String) -> String + + def initialize: ( + id: String, + account_id: String, + ?after: String, + ?first: Integer, + ?post_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + id: String, + account_id: String, + after: String, + first: Integer, + post_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/social_account_posts_response.rbs b/sig/whop_sdk/models/social_account_posts_response.rbs new file mode 100644 index 00000000..25ff1dc6 --- /dev/null +++ b/sig/whop_sdk/models/social_account_posts_response.rbs @@ -0,0 +1,37 @@ +module WhopSDK + module Models + type social_account_posts_response = + { + data: ::Array[WhopSDK::SocialAccountPost], + page_info: WhopSDK::Models::SocialAccountPostsResponse::PageInfo + } + + class SocialAccountPostsResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::SocialAccountPost] + + attr_accessor page_info: WhopSDK::Models::SocialAccountPostsResponse::PageInfo + + def initialize: ( + data: ::Array[WhopSDK::SocialAccountPost], + page_info: WhopSDK::Models::SocialAccountPostsResponse::PageInfo + ) -> void + + def to_hash: -> { + data: ::Array[WhopSDK::SocialAccountPost], + page_info: WhopSDK::Models::SocialAccountPostsResponse::PageInfo + } + + type page_info = { end_cursor: String?, has_next_page: bool } + + class PageInfo < WhopSDK::Internal::Type::BaseModel + attr_accessor end_cursor: String? + + attr_accessor has_next_page: bool + + def initialize: (end_cursor: String?, has_next_page: bool) -> void + + def to_hash: -> { end_cursor: String?, has_next_page: bool } + end + end + end +end diff --git a/sig/whop_sdk/models/wallet_list_params.rbs b/sig/whop_sdk/models/stat_list_params.rbs similarity index 68% rename from sig/whop_sdk/models/wallet_list_params.rbs rename to sig/whop_sdk/models/stat_list_params.rbs index 0d183939..cba410b8 100644 --- a/sig/whop_sdk/models/wallet_list_params.rbs +++ b/sig/whop_sdk/models/stat_list_params.rbs @@ -1,8 +1,8 @@ module WhopSDK module Models - type wallet_list_params = { } & WhopSDK::Internal::Type::request_parameters + type stat_list_params = { } & WhopSDK::Internal::Type::request_parameters - class WalletListParams < WhopSDK::Internal::Type::BaseModel + class StatListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters diff --git a/sig/whop_sdk/models/stat_list_response.rbs b/sig/whop_sdk/models/stat_list_response.rbs new file mode 100644 index 00000000..6bcf555d --- /dev/null +++ b/sig/whop_sdk/models/stat_list_response.rbs @@ -0,0 +1,72 @@ +module WhopSDK + module Models + type stat_list_response = + { data: ::Array[WhopSDK::Models::StatListResponse::Data] } + + class StatListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::StatListResponse::Data] + + def initialize: ( + data: ::Array[WhopSDK::Models::StatListResponse::Data] + ) -> void + + def to_hash: -> { data: ::Array[WhopSDK::Models::StatListResponse::Data] } + + type data = + { + description: String, + key: String, + name: String, + properties: ::Array[String], + unit: WhopSDK::Models::StatListResponse::Data::unit, + windows: ::Array[String] + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor description: String + + attr_accessor key: String + + attr_accessor name: String + + attr_accessor properties: ::Array[String] + + attr_accessor unit: WhopSDK::Models::StatListResponse::Data::unit + + attr_reader windows: ::Array[String]? + + def windows=: (::Array[String]) -> ::Array[String] + + def initialize: ( + description: String, + key: String, + name: String, + properties: ::Array[String], + unit: WhopSDK::Models::StatListResponse::Data::unit, + ?windows: ::Array[String] + ) -> void + + def to_hash: -> { + description: String, + key: String, + name: String, + properties: ::Array[String], + unit: WhopSDK::Models::StatListResponse::Data::unit, + windows: ::Array[String] + } + + type unit = :count | :currency | :percent + + module Unit + extend WhopSDK::Internal::Type::Enum + + COUNT: :count + CURRENCY: :currency + PERCENT: :percent + + def self?.values: -> ::Array[WhopSDK::Models::StatListResponse::Data::unit] + end + end + end + end +end diff --git a/sig/whop_sdk/models/stat_retrieve_params.rbs b/sig/whop_sdk/models/stat_retrieve_params.rbs new file mode 100644 index 00000000..02981895 --- /dev/null +++ b/sig/whop_sdk/models/stat_retrieve_params.rbs @@ -0,0 +1,211 @@ +module WhopSDK + module Models + type stat_retrieve_params = + { + metric: String, + from: Date, + to: Date, + access_level: String, + account_id: String, + ad_campaign_ids: ::Array[String], + ad_group_ids: ::Array[String], + ad_ids: ::Array[String], + breakdown_by: String, + card_network: String, + category: String, + convert_to: String, + currency: String, + fee_type: String, + interval: WhopSDK::Models::StatRetrieveParams::interval, + most_recent_action: String, + payment_method: String, + product: String, + referred_user_id: String, + segment: String, + snapshot_window: WhopSDK::Models::StatRetrieveParams::snapshot_window, + source: String, + status: String, + time_zone: String + } + & WhopSDK::Internal::Type::request_parameters + + class StatRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor metric: String + + attr_accessor from: Date + + attr_accessor to: Date + + attr_reader access_level: String? + + def access_level=: (String) -> String + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader ad_campaign_ids: ::Array[String]? + + def ad_campaign_ids=: (::Array[String]) -> ::Array[String] + + attr_reader ad_group_ids: ::Array[String]? + + def ad_group_ids=: (::Array[String]) -> ::Array[String] + + attr_reader ad_ids: ::Array[String]? + + def ad_ids=: (::Array[String]) -> ::Array[String] + + attr_reader breakdown_by: String? + + def breakdown_by=: (String) -> String + + attr_reader card_network: String? + + def card_network=: (String) -> String + + attr_reader category: String? + + def category=: (String) -> String + + attr_reader convert_to: String? + + def convert_to=: (String) -> String + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader fee_type: String? + + def fee_type=: (String) -> String + + attr_reader interval: WhopSDK::Models::StatRetrieveParams::interval? + + def interval=: ( + WhopSDK::Models::StatRetrieveParams::interval + ) -> WhopSDK::Models::StatRetrieveParams::interval + + attr_reader most_recent_action: String? + + def most_recent_action=: (String) -> String + + attr_reader payment_method: String? + + def payment_method=: (String) -> String + + attr_reader product: String? + + def product=: (String) -> String + + attr_reader referred_user_id: String? + + def referred_user_id=: (String) -> String + + attr_reader segment: String? + + def segment=: (String) -> String + + attr_reader snapshot_window: WhopSDK::Models::StatRetrieveParams::snapshot_window? + + def snapshot_window=: ( + WhopSDK::Models::StatRetrieveParams::snapshot_window + ) -> WhopSDK::Models::StatRetrieveParams::snapshot_window + + attr_reader source: String? + + def source=: (String) -> String + + attr_reader status: String? + + def status=: (String) -> String + + attr_reader time_zone: String? + + def time_zone=: (String) -> String + + def initialize: ( + metric: String, + from: Date, + to: Date, + ?access_level: String, + ?account_id: String, + ?ad_campaign_ids: ::Array[String], + ?ad_group_ids: ::Array[String], + ?ad_ids: ::Array[String], + ?breakdown_by: String, + ?card_network: String, + ?category: String, + ?convert_to: String, + ?currency: String, + ?fee_type: String, + ?interval: WhopSDK::Models::StatRetrieveParams::interval, + ?most_recent_action: String, + ?payment_method: String, + ?product: String, + ?referred_user_id: String, + ?segment: String, + ?snapshot_window: WhopSDK::Models::StatRetrieveParams::snapshot_window, + ?source: String, + ?status: String, + ?time_zone: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + metric: String, + from: Date, + to: Date, + access_level: String, + account_id: String, + ad_campaign_ids: ::Array[String], + ad_group_ids: ::Array[String], + ad_ids: ::Array[String], + breakdown_by: String, + card_network: String, + category: String, + convert_to: String, + currency: String, + fee_type: String, + interval: WhopSDK::Models::StatRetrieveParams::interval, + most_recent_action: String, + payment_method: String, + product: String, + referred_user_id: String, + segment: String, + snapshot_window: WhopSDK::Models::StatRetrieveParams::snapshot_window, + source: String, + status: String, + time_zone: String, + request_options: WhopSDK::RequestOptions + } + + type interval = :hour | :day | :week | :month | :year + + module Interval + extend WhopSDK::Internal::Type::Enum + + HOUR: :hour + DAY: :day + WEEK: :week + MONTH: :month + YEAR: :year + + def self?.values: -> ::Array[WhopSDK::Models::StatRetrieveParams::interval] + end + + type snapshot_window = :"30d" + + module SnapshotWindow + extend WhopSDK::Internal::Type::Enum + + SNAPSHOT_WINDOW_30D: :"30d" + + def self?.values: -> ::Array[WhopSDK::Models::StatRetrieveParams::snapshot_window] + end + end + end +end diff --git a/sig/whop_sdk/models/stat_retrieve_response.rbs b/sig/whop_sdk/models/stat_retrieve_response.rbs new file mode 100644 index 00000000..f8843cbf --- /dev/null +++ b/sig/whop_sdk/models/stat_retrieve_response.rbs @@ -0,0 +1,81 @@ +module WhopSDK + module Models + type stat_retrieve_response = + { data: WhopSDK::Models::StatRetrieveResponse::Data } + + class StatRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: WhopSDK::Models::StatRetrieveResponse::Data + + def initialize: ( + data: WhopSDK::Models::StatRetrieveResponse::Data + ) -> void + + def to_hash: -> { data: WhopSDK::Models::StatRetrieveResponse::Data } + + type data = + { + points: ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point], + currency: String? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor points: ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point] + + attr_accessor currency: String? + + def initialize: ( + points: ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point], + ?currency: String? + ) -> void + + def to_hash: -> { + points: ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point], + currency: String? + } + + type point = + { + timestamp: Integer, + value: Float?, + breakdown: ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown] + } + + class Point < WhopSDK::Internal::Type::BaseModel + attr_accessor timestamp: Integer + + attr_accessor value: Float? + + attr_reader breakdown: ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown]? + + def breakdown=: ( + ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown] + ) -> ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown] + + def initialize: ( + timestamp: Integer, + value: Float?, + ?breakdown: ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown] + ) -> void + + def to_hash: -> { + timestamp: Integer, + value: Float?, + breakdown: ::Array[WhopSDK::Models::StatRetrieveResponse::Data::Point::Breakdown] + } + + type breakdown = { name: String, value: Float? } + + class Breakdown < WhopSDK::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor value: Float? + + def initialize: (name: String, value: Float?) -> void + + def to_hash: -> { name: String, value: Float? } + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/swap_create_response.rbs b/sig/whop_sdk/models/swap_create_response.rbs index 9950edde..60739bef 100644 --- a/sig/whop_sdk/models/swap_create_response.rbs +++ b/sig/whop_sdk/models/swap_create_response.rbs @@ -2,6 +2,7 @@ module WhopSDK module Models type swap_create_response = { + id: String, account_id: String, object: WhopSDK::Models::SwapCreateResponse::object, status: String, @@ -12,6 +13,8 @@ module WhopSDK } class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + attr_accessor account_id: String attr_accessor object: WhopSDK::Models::SwapCreateResponse::object @@ -35,6 +38,7 @@ module WhopSDK def to_chain=: (String) -> String def initialize: ( + id: String, account_id: String, object: WhopSDK::Models::SwapCreateResponse::object, status: String, @@ -45,6 +49,7 @@ module WhopSDK ) -> void def to_hash: -> { + id: String, account_id: String, object: WhopSDK::Models::SwapCreateResponse::object, status: String, diff --git a/sig/whop_sdk/models/swap_list_params.rbs b/sig/whop_sdk/models/swap_list_params.rbs new file mode 100644 index 00000000..a8a6a948 --- /dev/null +++ b/sig/whop_sdk/models/swap_list_params.rbs @@ -0,0 +1,23 @@ +module WhopSDK + module Models + type swap_list_params = + { account_id: String } & WhopSDK::Internal::Type::request_parameters + + class SwapListParams < 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_list_response.rbs b/sig/whop_sdk/models/swap_list_response.rbs new file mode 100644 index 00000000..5bdaaf7f --- /dev/null +++ b/sig/whop_sdk/models/swap_list_response.rbs @@ -0,0 +1,68 @@ +module WhopSDK + module Models + type swap_list_response = + { data: ::Array[WhopSDK::Models::SwapListResponse::Data] } + + class SwapListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::SwapListResponse::Data] + + def initialize: ( + data: ::Array[WhopSDK::Models::SwapListResponse::Data] + ) -> void + + def to_hash: -> { data: ::Array[WhopSDK::Models::SwapListResponse::Data] } + + type data = + { + id: String, + account_id: String, + object: WhopSDK::Models::SwapListResponse::Data::object, + status: String, + tx_hashes: ::Array[String], + error: String? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account_id: String + + attr_accessor object: WhopSDK::Models::SwapListResponse::Data::object + + attr_accessor status: String + + attr_accessor tx_hashes: ::Array[String] + + attr_accessor error: String? + + def initialize: ( + id: String, + account_id: String, + object: WhopSDK::Models::SwapListResponse::Data::object, + status: String, + tx_hashes: ::Array[String], + ?error: String? + ) -> void + + def to_hash: -> { + id: String, + account_id: String, + object: WhopSDK::Models::SwapListResponse::Data::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::SwapListResponse::Data::object] + end + end + end + end +end diff --git a/sig/whop_sdk/models/swap_retrieve_params.rbs b/sig/whop_sdk/models/swap_retrieve_params.rbs index 4fdedbe8..88d450db 100644 --- a/sig/whop_sdk/models/swap_retrieve_params.rbs +++ b/sig/whop_sdk/models/swap_retrieve_params.rbs @@ -1,23 +1,20 @@ module WhopSDK module Models type swap_retrieve_params = - { account_id: String } & WhopSDK::Internal::Type::request_parameters + { 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 + attr_accessor id: String def initialize: ( - account_id: String, + id: String, ?request_options: WhopSDK::request_opts ) -> void - def to_hash: -> { - account_id: String, - request_options: WhopSDK::RequestOptions - } + def to_hash: -> { 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 index 3305507f..317f40fe 100644 --- a/sig/whop_sdk/models/swap_retrieve_response.rbs +++ b/sig/whop_sdk/models/swap_retrieve_response.rbs @@ -2,6 +2,7 @@ module WhopSDK module Models type swap_retrieve_response = { + id: String, account_id: String, object: WhopSDK::Models::SwapRetrieveResponse::object, status: String, @@ -10,6 +11,8 @@ module WhopSDK } class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + attr_accessor account_id: String attr_accessor object: WhopSDK::Models::SwapRetrieveResponse::object @@ -21,6 +24,7 @@ module WhopSDK attr_accessor error: String? def initialize: ( + id: String, account_id: String, object: WhopSDK::Models::SwapRetrieveResponse::object, status: String, @@ -29,6 +33,7 @@ module WhopSDK ) -> void def to_hash: -> { + id: String, account_id: String, object: WhopSDK::Models::SwapRetrieveResponse::object, status: String, diff --git a/sig/whop_sdk/models/tax_identifier_type.rbs b/sig/whop_sdk/models/tax_identifier_type.rbs index fd794af4..2258593d 100644 --- a/sig/whop_sdk/models/tax_identifier_type.rbs +++ b/sig/whop_sdk/models/tax_identifier_type.rbs @@ -4,6 +4,7 @@ module WhopSDK :ad_nrt | :ao_tin | :ar_cuit + | :al_tin | :am_tin | :aw_tin | :au_abn @@ -44,6 +45,7 @@ module WhopSDK | :et_tin | :eu_oss_vat | :ge_vat + | :gh_tin | :de_stn | :gb_vat | :gn_nif @@ -119,6 +121,7 @@ module WhopSDK AD_NRT: :ad_nrt AO_TIN: :ao_tin AR_CUIT: :ar_cuit + AL_TIN: :al_tin AM_TIN: :am_tin AW_TIN: :aw_tin AU_ABN: :au_abn @@ -159,6 +162,7 @@ module WhopSDK ET_TIN: :et_tin EU_OSS_VAT: :eu_oss_vat GE_VAT: :ge_vat + GH_TIN: :gh_tin DE_STN: :de_stn GB_VAT: :gb_vat GN_NIF: :gn_nif diff --git a/sig/whop_sdk/models/transfer_create_params.rbs b/sig/whop_sdk/models/transfer_create_params.rbs index a35b9a63..69f33f21 100644 --- a/sig/whop_sdk/models/transfer_create_params.rbs +++ b/sig/whop_sdk/models/transfer_create_params.rbs @@ -3,12 +3,15 @@ module WhopSDK type transfer_create_params = { amount: Float, - currency: WhopSDK::Models::currency, - destination_id: String, origin_id: String, + currency: String, + destination_id: String, + expires_at: Time?, idempotence_key: String?, metadata: ::Hash[Symbol, top]?, - notes: String? + notes: String?, + redeemable_count: Integer, + type: WhopSDK::Models::TransferCreateParams::type_ } & WhopSDK::Internal::Type::request_parameters @@ -18,11 +21,17 @@ module WhopSDK attr_accessor amount: Float - attr_accessor currency: WhopSDK::Models::currency + attr_accessor origin_id: String - attr_accessor destination_id: String + attr_reader currency: String? - attr_accessor origin_id: String + def currency=: (String) -> String + + attr_reader destination_id: String? + + def destination_id=: (String) -> String + + attr_accessor expires_at: Time? attr_accessor idempotence_key: String? @@ -30,27 +39,55 @@ module WhopSDK attr_accessor notes: String? + attr_reader redeemable_count: Integer? + + def redeemable_count=: (Integer) -> Integer + + attr_reader type: WhopSDK::Models::TransferCreateParams::type_? + + def type=: ( + WhopSDK::Models::TransferCreateParams::type_ + ) -> WhopSDK::Models::TransferCreateParams::type_ + def initialize: ( amount: Float, - currency: WhopSDK::Models::currency, - destination_id: String, origin_id: String, + ?currency: String, + ?destination_id: String, + ?expires_at: Time?, ?idempotence_key: String?, ?metadata: ::Hash[Symbol, top]?, ?notes: String?, + ?redeemable_count: Integer, + ?type: WhopSDK::Models::TransferCreateParams::type_, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { amount: Float, - currency: WhopSDK::Models::currency, - destination_id: String, origin_id: String, + currency: String, + destination_id: String, + expires_at: Time?, idempotence_key: String?, metadata: ::Hash[Symbol, top]?, notes: String?, + redeemable_count: Integer, + type: WhopSDK::Models::TransferCreateParams::type_, request_options: WhopSDK::RequestOptions } + + type type_ = :ledger | :wallet_send | :claim_link + + module Type + extend WhopSDK::Internal::Type::Enum + + LEDGER: :ledger + WALLET_SEND: :wallet_send + CLAIM_LINK: :claim_link + + def self?.values: -> ::Array[WhopSDK::Models::TransferCreateParams::type_] + end end end end diff --git a/sig/whop_sdk/models/transfer_create_response.rbs b/sig/whop_sdk/models/transfer_create_response.rbs new file mode 100644 index 00000000..607b2053 --- /dev/null +++ b/sig/whop_sdk/models/transfer_create_response.rbs @@ -0,0 +1,366 @@ +module WhopSDK + module Models + type transfer_create_response = + WhopSDK::Models::TransferCreateResponse::Transfer + | WhopSDK::Models::TransferCreateResponse::Send + | WhopSDK::Models::TransferCreateResponse::ClaimLink + + module TransferCreateResponse + extend WhopSDK::Internal::Type::Union + + type transfer = + { + id: String, + amount: Float, + created_at: Time, + currency: String, + destination: WhopSDK::Models::TransferCreateResponse::Transfer::destination, + destination_ledger_account_id: String, + origin: WhopSDK::Models::TransferCreateResponse::Transfer::origin, + origin_ledger_account_id: String, + fee_amount: Float?, + metadata: ::Hash[Symbol, top]?, + notes: String? + } + + class Transfer < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor currency: String + + attr_accessor destination: WhopSDK::Models::TransferCreateResponse::Transfer::destination + + attr_accessor destination_ledger_account_id: String + + attr_accessor origin: WhopSDK::Models::TransferCreateResponse::Transfer::origin + + attr_accessor origin_ledger_account_id: String + + attr_accessor fee_amount: Float? + + attr_accessor metadata: ::Hash[Symbol, top]? + + attr_accessor notes: String? + + def initialize: ( + id: String, + amount: Float, + created_at: Time, + currency: String, + destination: WhopSDK::Models::TransferCreateResponse::Transfer::destination, + destination_ledger_account_id: String, + origin: WhopSDK::Models::TransferCreateResponse::Transfer::origin, + origin_ledger_account_id: String, + ?fee_amount: Float?, + ?metadata: ::Hash[Symbol, top]?, + ?notes: String? + ) -> void + + def to_hash: -> { + id: String, + amount: Float, + created_at: Time, + currency: String, + destination: WhopSDK::Models::TransferCreateResponse::Transfer::destination, + destination_ledger_account_id: String, + origin: WhopSDK::Models::TransferCreateResponse::Transfer::origin, + origin_ledger_account_id: String, + fee_amount: Float?, + metadata: ::Hash[Symbol, top]?, + notes: String? + } + + type destination = + WhopSDK::Models::TransferCreateResponse::Transfer::Destination::Company + | WhopSDK::Models::TransferCreateResponse::Transfer::Destination::User + + module Destination + extend WhopSDK::Internal::Type::Union + + type company = + { id: String, typename: :Company, route: String?, title: String? } + + class Company < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor typename: :Company + + attr_accessor route: String? + + attr_accessor title: String? + + def initialize: ( + id: String, + ?route: String?, + ?title: String?, + ?typename: :Company + ) -> void + + def to_hash: -> { + id: String, + typename: :Company, + route: String?, + title: String? + } + end + + type user = + { id: String, typename: :User, name: String?, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor typename: :User + + attr_accessor name: String? + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + id: String, + ?name: String?, + ?username: String, + ?typename: :User + ) -> void + + def to_hash: -> { + id: String, + typename: :User, + name: String?, + username: String + } + end + + def self?.variants: -> ::Array[WhopSDK::Models::TransferCreateResponse::Transfer::destination] + end + + type origin = + WhopSDK::Models::TransferCreateResponse::Transfer::Origin::Company + | WhopSDK::Models::TransferCreateResponse::Transfer::Origin::User + + module Origin + extend WhopSDK::Internal::Type::Union + + type company = + { id: String, typename: :Company, route: String?, title: String? } + + class Company < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor typename: :Company + + attr_accessor route: String? + + attr_accessor title: String? + + def initialize: ( + id: String, + ?route: String?, + ?title: String?, + ?typename: :Company + ) -> void + + def to_hash: -> { + id: String, + typename: :Company, + route: String?, + title: String? + } + end + + type user = + { id: String, typename: :User, name: String?, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor typename: :User + + attr_accessor name: String? + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + id: String, + ?name: String?, + ?username: String, + ?typename: :User + ) -> void + + def to_hash: -> { + id: String, + typename: :User, + name: String?, + username: String + } + end + + def self?.variants: -> ::Array[WhopSDK::Models::TransferCreateResponse::Transfer::origin] + end + end + + type send_ = + { + amount: String, + currency: String, + destination: WhopSDK::Models::TransferCreateResponse::Send::Destination, + object: WhopSDK::Models::TransferCreateResponse::Send::object, + source: WhopSDK::Models::TransferCreateResponse::Send::Source, + tx_hash: String + } + + class Send < WhopSDK::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor currency: String + + attr_accessor destination: WhopSDK::Models::TransferCreateResponse::Send::Destination + + attr_accessor object: WhopSDK::Models::TransferCreateResponse::Send::object + + attr_accessor source: WhopSDK::Models::TransferCreateResponse::Send::Source + + attr_accessor tx_hash: String + + def initialize: ( + amount: String, + currency: String, + destination: WhopSDK::Models::TransferCreateResponse::Send::Destination, + object: WhopSDK::Models::TransferCreateResponse::Send::object, + source: WhopSDK::Models::TransferCreateResponse::Send::Source, + tx_hash: String + ) -> void + + def to_hash: -> { + amount: String, + currency: String, + destination: WhopSDK::Models::TransferCreateResponse::Send::Destination, + object: WhopSDK::Models::TransferCreateResponse::Send::object, + source: WhopSDK::Models::TransferCreateResponse::Send::Source, + tx_hash: String + } + + type destination = { account_id: String, address: String } + + class Destination < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String + + attr_accessor address: String + + def initialize: (account_id: String, address: String) -> void + + def to_hash: -> { account_id: String, address: String } + end + + type object = :send + + module Object + extend WhopSDK::Internal::Type::Enum + + SEND: :send + + def self?.values: -> ::Array[WhopSDK::Models::TransferCreateResponse::Send::object] + end + + type source = { account_id: String, address: String } + + class Source < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String + + attr_accessor address: String + + def initialize: (account_id: String, address: String) -> void + + def to_hash: -> { account_id: String, address: String } + end + end + + type claim_link = + { + id: String, + amount: String, + claim_url: String, + currency: String, + expires_at: Time?, + object: WhopSDK::Models::TransferCreateResponse::ClaimLink::object, + redeemable_count: Integer, + source: WhopSDK::Models::TransferCreateResponse::ClaimLink::Source, + status: String + } + + class ClaimLink < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor claim_url: String + + attr_accessor currency: String + + attr_accessor expires_at: Time? + + attr_accessor object: WhopSDK::Models::TransferCreateResponse::ClaimLink::object + + attr_accessor redeemable_count: Integer + + attr_accessor source: WhopSDK::Models::TransferCreateResponse::ClaimLink::Source + + attr_accessor status: String + + def initialize: ( + id: String, + amount: String, + claim_url: String, + currency: String, + expires_at: Time?, + object: WhopSDK::Models::TransferCreateResponse::ClaimLink::object, + redeemable_count: Integer, + source: WhopSDK::Models::TransferCreateResponse::ClaimLink::Source, + status: String + ) -> void + + def to_hash: -> { + id: String, + amount: String, + claim_url: String, + currency: String, + expires_at: Time?, + object: WhopSDK::Models::TransferCreateResponse::ClaimLink::object, + redeemable_count: Integer, + source: WhopSDK::Models::TransferCreateResponse::ClaimLink::Source, + status: String + } + + type object = :claim_link + + module Object + extend WhopSDK::Internal::Type::Enum + + CLAIM_LINK: :claim_link + + def self?.values: -> ::Array[WhopSDK::Models::TransferCreateResponse::ClaimLink::object] + end + + type source = { account_id: String } + + class Source < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String + + def initialize: (account_id: String) -> void + + def to_hash: -> { account_id: String } + end + end + + def self?.variants: -> ::Array[WhopSDK::Models::transfer_create_response] + end + end +end diff --git a/sig/whop_sdk/models/transfer_list_params.rbs b/sig/whop_sdk/models/transfer_list_params.rbs index a6013c4e..1cfe1efb 100644 --- a/sig/whop_sdk/models/transfer_list_params.rbs +++ b/sig/whop_sdk/models/transfer_list_params.rbs @@ -2,16 +2,16 @@ module WhopSDK module Models type transfer_list_params = { - after: String?, - before: String?, - created_after: Time?, - created_before: Time?, - destination_id: String?, - direction: WhopSDK::Models::direction?, - first: Integer?, - last: Integer?, - order: WhopSDK::Models::TransferListParams::order?, - origin_id: String? + after: String, + before: String, + created_after: String, + created_before: String, + destination_id: String, + direction: WhopSDK::Models::TransferListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::TransferListParams::order, + origin_id: String } & WhopSDK::Internal::Type::request_parameters @@ -19,61 +19,96 @@ 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 created_after: Time? + attr_reader before: String? - attr_accessor created_before: Time? + def before=: (String) -> String - attr_accessor destination_id: String? + attr_reader created_after: String? - attr_accessor direction: WhopSDK::Models::direction? + def created_after=: (String) -> String - attr_accessor first: Integer? + attr_reader created_before: String? - attr_accessor last: Integer? + def created_before=: (String) -> String - attr_accessor order: WhopSDK::Models::TransferListParams::order? + attr_reader destination_id: String? - attr_accessor origin_id: String? + def destination_id=: (String) -> String + + attr_reader direction: WhopSDK::Models::TransferListParams::direction? + + def direction=: ( + WhopSDK::Models::TransferListParams::direction + ) -> WhopSDK::Models::TransferListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::TransferListParams::order? + + def order=: ( + WhopSDK::Models::TransferListParams::order + ) -> WhopSDK::Models::TransferListParams::order + + attr_reader origin_id: String? + + def origin_id=: (String) -> String def initialize: ( - ?after: String?, - ?before: String?, - ?created_after: Time?, - ?created_before: Time?, - ?destination_id: String?, - ?direction: WhopSDK::Models::direction?, - ?first: Integer?, - ?last: Integer?, - ?order: WhopSDK::Models::TransferListParams::order?, - ?origin_id: String?, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?destination_id: String, + ?direction: WhopSDK::Models::TransferListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::TransferListParams::order, + ?origin_id: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - after: String?, - before: String?, - created_after: Time?, - created_before: Time?, - destination_id: String?, - direction: WhopSDK::Models::direction?, - first: Integer?, - last: Integer?, - order: WhopSDK::Models::TransferListParams::order?, - origin_id: String?, + after: String, + before: String, + created_after: String, + created_before: String, + destination_id: String, + direction: WhopSDK::Models::TransferListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::TransferListParams::order, + origin_id: String, request_options: WhopSDK::RequestOptions } - type order = :amount | :created_at + type direction = :asc | :desc + + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC: :asc + DESC: :desc + + def self?.values: -> ::Array[WhopSDK::Models::TransferListParams::direction] + end + + type order = :created_at | :amount module Order extend WhopSDK::Internal::Type::Enum - AMOUNT: :amount CREATED_AT: :created_at + AMOUNT: :amount def self?.values: -> ::Array[WhopSDK::Models::TransferListParams::order] end diff --git a/sig/whop_sdk/models/transfer_list_response.rbs b/sig/whop_sdk/models/transfer_list_response.rbs index 9507772e..25d25db8 100644 --- a/sig/whop_sdk/models/transfer_list_response.rbs +++ b/sig/whop_sdk/models/transfer_list_response.rbs @@ -5,12 +5,12 @@ module WhopSDK id: String, amount: Float, created_at: Time, - currency: WhopSDK::Models::currency, + currency: String, destination_ledger_account_id: String, + origin_ledger_account_id: String, fee_amount: Float?, metadata: ::Hash[Symbol, top]?, - notes: String?, - origin_ledger_account_id: String + notes: String? } class TransferListResponse < WhopSDK::Internal::Type::BaseModel @@ -20,40 +20,40 @@ module WhopSDK attr_accessor created_at: Time - attr_accessor currency: WhopSDK::Models::currency + attr_accessor currency: String attr_accessor destination_ledger_account_id: String + attr_accessor origin_ledger_account_id: String + attr_accessor fee_amount: Float? attr_accessor metadata: ::Hash[Symbol, top]? attr_accessor notes: String? - attr_accessor origin_ledger_account_id: String - def initialize: ( id: String, amount: Float, created_at: Time, - currency: WhopSDK::Models::currency, + currency: String, destination_ledger_account_id: String, - fee_amount: Float?, - metadata: ::Hash[Symbol, top]?, - notes: String?, - origin_ledger_account_id: String + origin_ledger_account_id: String, + ?fee_amount: Float?, + ?metadata: ::Hash[Symbol, top]?, + ?notes: String? ) -> void def to_hash: -> { id: String, amount: Float, created_at: Time, - currency: WhopSDK::Models::currency, + currency: String, destination_ledger_account_id: String, + origin_ledger_account_id: String, fee_amount: Float?, metadata: ::Hash[Symbol, top]?, - notes: String?, - origin_ledger_account_id: String + notes: String? } end end diff --git a/sig/whop_sdk/models/transfer.rbs b/sig/whop_sdk/models/transfer_retrieve_response.rbs similarity index 54% rename from sig/whop_sdk/models/transfer.rbs rename to sig/whop_sdk/models/transfer_retrieve_response.rbs index 1a4017d8..d57192d8 100644 --- a/sig/whop_sdk/models/transfer.rbs +++ b/sig/whop_sdk/models/transfer_retrieve_response.rbs @@ -1,196 +1,201 @@ module WhopSDK module Models - type transfer = + type transfer_retrieve_response = { id: String, amount: Float, created_at: Time, - currency: WhopSDK::Models::currency, - destination: WhopSDK::Models::Transfer::destination?, + currency: String, + destination: WhopSDK::Models::TransferRetrieveResponse::destination, destination_ledger_account_id: String, + origin: WhopSDK::Models::TransferRetrieveResponse::origin, + origin_ledger_account_id: String, fee_amount: Float?, metadata: ::Hash[Symbol, top]?, - notes: String?, - origin: WhopSDK::Models::Transfer::origin?, - origin_ledger_account_id: String + notes: String? } - class Transfer < WhopSDK::Internal::Type::BaseModel + class TransferRetrieveResponse < WhopSDK::Internal::Type::BaseModel attr_accessor id: String attr_accessor amount: Float attr_accessor created_at: Time - attr_accessor currency: WhopSDK::Models::currency + attr_accessor currency: String - attr_accessor destination: WhopSDK::Models::Transfer::destination? + attr_accessor destination: WhopSDK::Models::TransferRetrieveResponse::destination attr_accessor destination_ledger_account_id: String + attr_accessor origin: WhopSDK::Models::TransferRetrieveResponse::origin + + attr_accessor origin_ledger_account_id: String + attr_accessor fee_amount: Float? attr_accessor metadata: ::Hash[Symbol, top]? attr_accessor notes: String? - attr_accessor origin: WhopSDK::Models::Transfer::origin? - - attr_accessor origin_ledger_account_id: String - def initialize: ( id: String, amount: Float, created_at: Time, - currency: WhopSDK::Models::currency, - destination: WhopSDK::Models::Transfer::destination?, + currency: String, + destination: WhopSDK::Models::TransferRetrieveResponse::destination, destination_ledger_account_id: String, - fee_amount: Float?, - metadata: ::Hash[Symbol, top]?, - notes: String?, - origin: WhopSDK::Models::Transfer::origin?, - origin_ledger_account_id: String + origin: WhopSDK::Models::TransferRetrieveResponse::origin, + origin_ledger_account_id: String, + ?fee_amount: Float?, + ?metadata: ::Hash[Symbol, top]?, + ?notes: String? ) -> void def to_hash: -> { id: String, amount: Float, created_at: Time, - currency: WhopSDK::Models::currency, - destination: WhopSDK::Models::Transfer::destination?, + currency: String, + destination: WhopSDK::Models::TransferRetrieveResponse::destination, destination_ledger_account_id: String, + origin: WhopSDK::Models::TransferRetrieveResponse::origin, + origin_ledger_account_id: String, fee_amount: Float?, metadata: ::Hash[Symbol, top]?, - notes: String?, - origin: WhopSDK::Models::Transfer::origin?, - origin_ledger_account_id: String + notes: String? } type destination = - (WhopSDK::Transfer::Destination::User - | WhopSDK::Transfer::Destination::Company)? + WhopSDK::Models::TransferRetrieveResponse::Destination::Company + | WhopSDK::Models::TransferRetrieveResponse::Destination::User module Destination extend WhopSDK::Internal::Type::Union - type user = - { id: String, name: String?, typename: :User, username: String } + type company = + { id: String, typename: :Company, route: String?, title: String? } - class User < WhopSDK::Internal::Type::BaseModel + class Company < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor name: String? + attr_accessor typename: :Company - attr_accessor typename: :User + attr_accessor route: String? - attr_accessor username: String + attr_accessor title: String? def initialize: ( id: String, - name: String?, - username: String, - ?typename: :User + ?route: String?, + ?title: String?, + ?typename: :Company ) -> void def to_hash: -> { id: String, - name: String?, - typename: :User, - username: String + typename: :Company, + route: String?, + title: String? } end - type company = - { id: String, route: String, title: String, typename: :Company } + type user = + { id: String, typename: :User, name: String?, username: String } - class Company < WhopSDK::Internal::Type::BaseModel + class User < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor route: String + attr_accessor typename: :User - attr_accessor title: String + attr_accessor name: String? - attr_accessor typename: :Company + attr_reader username: String? + + def username=: (String) -> String def initialize: ( id: String, - route: String, - title: String, - ?typename: :Company + ?name: String?, + ?username: String, + ?typename: :User ) -> void def to_hash: -> { id: String, - route: String, - title: String, - typename: :Company + typename: :User, + name: String?, + username: String } end - def self?.variants: -> ::Array[WhopSDK::Models::Transfer::destination] + def self?.variants: -> ::Array[WhopSDK::Models::TransferRetrieveResponse::destination] end type origin = - (WhopSDK::Transfer::Origin::User | WhopSDK::Transfer::Origin::Company)? + WhopSDK::Models::TransferRetrieveResponse::Origin::Company + | WhopSDK::Models::TransferRetrieveResponse::Origin::User module Origin extend WhopSDK::Internal::Type::Union - type user = - { id: String, name: String?, typename: :User, username: String } + type company = + { id: String, typename: :Company, route: String?, title: String? } - class User < WhopSDK::Internal::Type::BaseModel + class Company < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor name: String? + attr_accessor typename: :Company - attr_accessor typename: :User + attr_accessor route: String? - attr_accessor username: String + attr_accessor title: String? def initialize: ( id: String, - name: String?, - username: String, - ?typename: :User + ?route: String?, + ?title: String?, + ?typename: :Company ) -> void def to_hash: -> { id: String, - name: String?, - typename: :User, - username: String + typename: :Company, + route: String?, + title: String? } end - type company = - { id: String, route: String, title: String, typename: :Company } + type user = + { id: String, typename: :User, name: String?, username: String } - class Company < WhopSDK::Internal::Type::BaseModel + class User < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor route: String + attr_accessor typename: :User - attr_accessor title: String + attr_accessor name: String? - attr_accessor typename: :Company + attr_reader username: String? + + def username=: (String) -> String def initialize: ( id: String, - route: String, - title: String, - ?typename: :Company + ?name: String?, + ?username: String, + ?typename: :User ) -> void def to_hash: -> { id: String, - route: String, - title: String, - typename: :Company + typename: :User, + name: String?, + username: String } end - def self?.variants: -> ::Array[WhopSDK::Models::Transfer::origin] + def self?.variants: -> ::Array[WhopSDK::Models::TransferRetrieveResponse::origin] end end end diff --git a/sig/whop_sdk/models/unwrap_webhook_event.rbs b/sig/whop_sdk/models/unwrap_webhook_event.rbs index 7d66d85d..b5afd060 100644 --- a/sig/whop_sdk/models/unwrap_webhook_event.rbs +++ b/sig/whop_sdk/models/unwrap_webhook_event.rbs @@ -1,7 +1,9 @@ module WhopSDK module Models type unwrap_webhook_event = - WhopSDK::CourseLessonInteractionCompletedWebhookEvent + WhopSDK::ChatMessageCreatedWebhookEvent + | WhopSDK::ChatReactionCreatedWebhookEvent + | WhopSDK::CourseLessonInteractionCompletedWebhookEvent | WhopSDK::DisputeCreatedWebhookEvent | WhopSDK::DisputeUpdatedWebhookEvent | WhopSDK::DisputeAlertCreatedWebhookEvent @@ -18,9 +20,11 @@ module WhopSDK | WhopSDK::InvoicePaidWebhookEvent | WhopSDK::InvoicePastDueWebhookEvent | WhopSDK::InvoiceVoidedWebhookEvent + | WhopSDK::LedgerAccountFundsAvailableWebhookEvent | WhopSDK::MembershipActivatedWebhookEvent | WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent | WhopSDK::MembershipDeactivatedWebhookEvent + | WhopSDK::MembershipTrialEndingSoonWebhookEvent | WhopSDK::PaymentCreatedWebhookEvent | WhopSDK::PaymentFailedWebhookEvent | WhopSDK::PaymentPendingWebhookEvent diff --git a/sig/whop_sdk/models/user.rbs b/sig/whop_sdk/models/user.rbs index e0b105a4..77b23eaf 100644 --- a/sig/whop_sdk/models/user.rbs +++ b/sig/whop_sdk/models/user.rbs @@ -3,43 +3,240 @@ module WhopSDK type user = { id: String, + balance: WhopSDK::UserBalance?, + balance_history: WhopSDK::User::BalanceHistory?, bio: String?, created_at: String, + earnings_usd: WhopSDK::User::EarningsUsd?, name: String?, profile_picture: top?, - username: String + username: String, + verification: top, + whop_partner_enabled_at: String? } class User < WhopSDK::Internal::Type::BaseModel attr_accessor id: String + attr_accessor balance: WhopSDK::UserBalance? + + attr_accessor balance_history: WhopSDK::User::BalanceHistory? + attr_accessor bio: String? attr_accessor created_at: String + attr_accessor earnings_usd: WhopSDK::User::EarningsUsd? + attr_accessor name: String? attr_accessor profile_picture: top? attr_accessor username: String + attr_accessor verification: top + + attr_accessor whop_partner_enabled_at: String? + def initialize: ( id: String, + balance: WhopSDK::UserBalance?, + balance_history: WhopSDK::User::BalanceHistory?, bio: String?, created_at: String, + earnings_usd: WhopSDK::User::EarningsUsd?, name: String?, profile_picture: top?, - username: String + username: String, + verification: top, + whop_partner_enabled_at: String? ) -> void def to_hash: -> { id: String, + balance: WhopSDK::UserBalance?, + balance_history: WhopSDK::User::BalanceHistory?, bio: String?, created_at: String, + earnings_usd: WhopSDK::User::EarningsUsd?, name: String?, profile_picture: top?, - username: String + username: String, + verification: top, + whop_partner_enabled_at: String? } + + type balance_history = + { + data: ::Array[WhopSDK::User::BalanceHistory::Data], + last: Float, + max: Float, + min: Float + } + + class BalanceHistory < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::User::BalanceHistory::Data] + + attr_accessor last: Float + + attr_accessor max: Float + + attr_accessor min: Float + + def initialize: ( + data: ::Array[WhopSDK::User::BalanceHistory::Data], + last: Float, + max: Float, + min: Float + ) -> void + + def to_hash: -> { + data: ::Array[WhopSDK::User::BalanceHistory::Data], + last: Float, + max: Float, + min: Float + } + + type data = { t: Integer, v: Float } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor t: Integer + + attr_accessor v: Float + + def initialize: (t: Integer, v: Float) -> void + + def to_hash: -> { t: Integer, v: Float } + end + end + + type earnings_usd = + { + first_earned_at: String?, + owned_accounts: WhopSDK::User::EarningsUsd::OwnedAccounts, + personal: WhopSDK::User::EarningsUsd::Personal, + total: WhopSDK::User::EarningsUsd::Total + } + + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + attr_accessor first_earned_at: String? + + attr_accessor owned_accounts: WhopSDK::User::EarningsUsd::OwnedAccounts + + attr_accessor personal: WhopSDK::User::EarningsUsd::Personal + + attr_accessor total: WhopSDK::User::EarningsUsd::Total + + def initialize: ( + first_earned_at: String?, + owned_accounts: WhopSDK::User::EarningsUsd::OwnedAccounts, + personal: WhopSDK::User::EarningsUsd::Personal, + total: WhopSDK::User::EarningsUsd::Total + ) -> void + + def to_hash: -> { + first_earned_at: String?, + owned_accounts: WhopSDK::User::EarningsUsd::OwnedAccounts, + personal: WhopSDK::User::EarningsUsd::Personal, + total: WhopSDK::User::EarningsUsd::Total + } + + type owned_accounts = + { + :last_24_hours => String, + :last_30_days => String, + :last_7_days => String, + lifetime: String + } + + class OwnedAccounts < WhopSDK::Internal::Type::BaseModel + attr_accessor last_24_hours: String + + attr_accessor last_30_days: String + + attr_accessor last_7_days: String + + attr_accessor lifetime: String + + def initialize: ( + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + ) -> void + + def to_hash: -> { + :last_24_hours => String, + :last_30_days => String, + :last_7_days => String, + lifetime: String + } + end + + type personal = + { + :last_24_hours => String, + :last_30_days => String, + :last_7_days => String, + lifetime: String + } + + class Personal < WhopSDK::Internal::Type::BaseModel + attr_accessor last_24_hours: String + + attr_accessor last_30_days: String + + attr_accessor last_7_days: String + + attr_accessor lifetime: String + + def initialize: ( + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + ) -> void + + def to_hash: -> { + :last_24_hours => String, + :last_30_days => String, + :last_7_days => String, + lifetime: String + } + end + + type total = + { + :last_24_hours => String, + :last_30_days => String, + :last_7_days => String, + lifetime: String + } + + class Total < WhopSDK::Internal::Type::BaseModel + attr_accessor last_24_hours: String + + attr_accessor last_30_days: String + + attr_accessor last_7_days: String + + attr_accessor lifetime: String + + def initialize: ( + last_24_hours: String, + last_30_days: String, + last_7_days: String, + lifetime: String + ) -> void + + def to_hash: -> { + :last_24_hours => String, + :last_30_days => String, + :last_7_days => String, + lifetime: String + } + end + end end end end diff --git a/sig/whop_sdk/models/user_balance.rbs b/sig/whop_sdk/models/user_balance.rbs new file mode 100644 index 00000000..eed0a093 --- /dev/null +++ b/sig/whop_sdk/models/user_balance.rbs @@ -0,0 +1,171 @@ +module WhopSDK + module Models + type user_balance = + { + businesses: ::Array[WhopSDK::UserBalance::Business], + businesses_total_usd: String, + cash: ::Array[WhopSDK::UserBalance::Cash], + cash_usd: String, + crypto: ::Array[WhopSDK::UserBalance::Crypto], + crypto_usd: String, + pending_usd: String, + total_usd: String, + treasury_pending_usd: String + } + + class UserBalance < WhopSDK::Internal::Type::BaseModel + attr_accessor businesses: ::Array[WhopSDK::UserBalance::Business] + + attr_accessor businesses_total_usd: String + + attr_accessor cash: ::Array[WhopSDK::UserBalance::Cash] + + attr_accessor cash_usd: String + + attr_accessor crypto: ::Array[WhopSDK::UserBalance::Crypto] + + attr_accessor crypto_usd: String + + attr_accessor pending_usd: String + + attr_accessor total_usd: String + + attr_accessor treasury_pending_usd: String + + def initialize: ( + businesses: ::Array[WhopSDK::UserBalance::Business], + businesses_total_usd: String, + cash: ::Array[WhopSDK::UserBalance::Cash], + cash_usd: String, + crypto: ::Array[WhopSDK::UserBalance::Crypto], + crypto_usd: String, + pending_usd: String, + total_usd: String, + treasury_pending_usd: String + ) -> void + + def to_hash: -> { + businesses: ::Array[WhopSDK::UserBalance::Business], + businesses_total_usd: String, + cash: ::Array[WhopSDK::UserBalance::Cash], + cash_usd: String, + crypto: ::Array[WhopSDK::UserBalance::Crypto], + crypto_usd: String, + pending_usd: String, + total_usd: String, + treasury_pending_usd: String + } + + type business = + { id: String, balance_usd: String, logo_url: String?, name: String? } + + class Business < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor balance_usd: String + + attr_accessor logo_url: String? + + attr_accessor name: String? + + def initialize: ( + id: String, + balance_usd: String, + logo_url: String?, + name: String? + ) -> void + + def to_hash: -> { + id: String, + balance_usd: String, + logo_url: String?, + name: String? + } + end + + type cash = + { + balance: Float, + balance_usd: Float, + currency: String, + pending_balance_usd: Float, + reserve_balance_usd: Float, + total_withdrawable_balance: Float + } + + class Cash < WhopSDK::Internal::Type::BaseModel + attr_accessor balance: Float + + attr_accessor balance_usd: Float + + attr_accessor currency: String + + attr_accessor pending_balance_usd: Float + + attr_accessor reserve_balance_usd: Float + + attr_accessor total_withdrawable_balance: Float + + def initialize: ( + balance: Float, + balance_usd: Float, + currency: String, + pending_balance_usd: Float, + reserve_balance_usd: Float, + total_withdrawable_balance: Float + ) -> void + + def to_hash: -> { + balance: Float, + balance_usd: Float, + currency: String, + pending_balance_usd: Float, + reserve_balance_usd: Float, + total_withdrawable_balance: Float + } + end + + type crypto = + { + balance: String, + icon_url: String?, + name: String?, + price_usd: Float?, + symbol: String, + value_usd: Float + } + + class Crypto < WhopSDK::Internal::Type::BaseModel + attr_accessor balance: String + + attr_accessor icon_url: String? + + attr_accessor name: String? + + attr_accessor price_usd: Float? + + attr_accessor symbol: String + + attr_accessor value_usd: Float + + def initialize: ( + balance: String, + icon_url: String?, + name: String?, + price_usd: Float?, + symbol: String, + value_usd: Float + ) -> void + + def to_hash: -> { + balance: String, + icon_url: String?, + name: String?, + price_usd: Float?, + symbol: String, + value_usd: Float + } + 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 ba6aefd8..57368335 100644 --- a/sig/whop_sdk/models/user_retrieve_params.rbs +++ b/sig/whop_sdk/models/user_retrieve_params.rbs @@ -1,7 +1,15 @@ module WhopSDK module Models type user_retrieve_params = - { id: String, account_id: String } + { + id: String, + account_id: String, + from: String, + include_balance_history: bool, + interval: WhopSDK::Models::UserRetrieveParams::interval, + time_zone: String, + to: String + } & WhopSDK::Internal::Type::request_parameters class UserRetrieveParams < WhopSDK::Internal::Type::BaseModel @@ -14,17 +22,62 @@ module WhopSDK def account_id=: (String) -> String + attr_reader from: String? + + def from=: (String) -> String + + attr_reader include_balance_history: bool? + + def include_balance_history=: (bool) -> bool + + attr_reader interval: WhopSDK::Models::UserRetrieveParams::interval? + + def interval=: ( + WhopSDK::Models::UserRetrieveParams::interval + ) -> WhopSDK::Models::UserRetrieveParams::interval + + attr_reader time_zone: String? + + def time_zone=: (String) -> String + + attr_reader to: String? + + def to=: (String) -> String + def initialize: ( id: String, ?account_id: String, + ?from: String, + ?include_balance_history: bool, + ?interval: WhopSDK::Models::UserRetrieveParams::interval, + ?time_zone: String, + ?to: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { id: String, account_id: String, + from: String, + include_balance_history: bool, + interval: WhopSDK::Models::UserRetrieveParams::interval, + time_zone: String, + to: String, request_options: WhopSDK::RequestOptions } + + type interval = :hour | :day | :week | :month + + module Interval + extend WhopSDK::Internal::Type::Enum + + HOUR: :hour + DAY: :day + WEEK: :week + MONTH: :month + + def self?.values: -> ::Array[WhopSDK::Models::UserRetrieveParams::interval] + end end end end diff --git a/sig/whop_sdk/models/verification_create_params.rbs b/sig/whop_sdk/models/verification_create_params.rbs new file mode 100644 index 00000000..7af93cd8 --- /dev/null +++ b/sig/whop_sdk/models/verification_create_params.rbs @@ -0,0 +1,364 @@ +module WhopSDK + module Models + type verification_create_params = + { + account_id: String, + body: WhopSDK::Models::VerificationCreateParams::body + } + & WhopSDK::Internal::Type::request_parameters + + class VerificationCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_accessor body: WhopSDK::Models::VerificationCreateParams::body + + def initialize: ( + account_id: String, + body: WhopSDK::Models::VerificationCreateParams::body, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + body: WhopSDK::Models::VerificationCreateParams::body, + request_options: WhopSDK::RequestOptions + } + + type body = + WhopSDK::VerificationCreateParams::Body::Individual + | WhopSDK::VerificationCreateParams::Body::Business + + module Body + extend WhopSDK::Internal::Type::Union + + type individual = + { + address: WhopSDK::VerificationCreateParams::Body::Individual::Address, + business_name: String, + business_structure: String, + business_website: String, + country: String, + date_of_birth: String, + document_type: WhopSDK::Models::VerificationCreateParams::Body::Individual::document_type, + documents: ::Hash[Symbol, String], + first_name: String, + kind: WhopSDK::Models::VerificationCreateParams::Body::Individual::kind, + last_name: String, + phone: String, + tax_identification_number: String + } + + class Individual < WhopSDK::Internal::Type::BaseModel + attr_reader address: WhopSDK::VerificationCreateParams::Body::Individual::Address? + + def address=: ( + WhopSDK::VerificationCreateParams::Body::Individual::Address + ) -> WhopSDK::VerificationCreateParams::Body::Individual::Address + + attr_reader business_name: String? + + def business_name=: (String) -> String + + attr_reader business_structure: String? + + def business_structure=: (String) -> String + + attr_reader business_website: String? + + def business_website=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader date_of_birth: String? + + def date_of_birth=: (String) -> String + + attr_reader document_type: WhopSDK::Models::VerificationCreateParams::Body::Individual::document_type? + + def document_type=: ( + WhopSDK::Models::VerificationCreateParams::Body::Individual::document_type + ) -> WhopSDK::Models::VerificationCreateParams::Body::Individual::document_type + + attr_reader documents: ::Hash[Symbol, String]? + + def documents=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader kind: WhopSDK::Models::VerificationCreateParams::Body::Individual::kind? + + def kind=: ( + WhopSDK::Models::VerificationCreateParams::Body::Individual::kind + ) -> WhopSDK::Models::VerificationCreateParams::Body::Individual::kind + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone: String? + + def phone=: (String) -> String + + attr_reader tax_identification_number: String? + + def tax_identification_number=: (String) -> String + + def initialize: ( + ?address: WhopSDK::VerificationCreateParams::Body::Individual::Address, + ?business_name: String, + ?business_structure: String, + ?business_website: String, + ?country: String, + ?date_of_birth: String, + ?document_type: WhopSDK::Models::VerificationCreateParams::Body::Individual::document_type, + ?documents: ::Hash[Symbol, String], + ?first_name: String, + ?kind: WhopSDK::Models::VerificationCreateParams::Body::Individual::kind, + ?last_name: String, + ?phone: String, + ?tax_identification_number: String + ) -> void + + def to_hash: -> { + address: WhopSDK::VerificationCreateParams::Body::Individual::Address, + business_name: String, + business_structure: String, + business_website: String, + country: String, + date_of_birth: String, + document_type: WhopSDK::Models::VerificationCreateParams::Body::Individual::document_type, + documents: ::Hash[Symbol, String], + first_name: String, + kind: WhopSDK::Models::VerificationCreateParams::Body::Individual::kind, + last_name: String, + phone: String, + tax_identification_number: String + } + + type address = + { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_reader line2: String? + + def line2=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?city: String, + ?country: String, + ?line1: String, + ?line2: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + end + + type document_type = + :ID_CARD | :PASSPORT | :DRIVERS | :RESIDENCE_PERMIT + + module DocumentType + extend WhopSDK::Internal::Type::Enum + + ID_CARD: :ID_CARD + PASSPORT: :PASSPORT + DRIVERS: :DRIVERS + RESIDENCE_PERMIT: :RESIDENCE_PERMIT + + def self?.values: -> ::Array[WhopSDK::Models::VerificationCreateParams::Body::Individual::document_type] + end + + type kind = :individual + + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL: :individual + + def self?.values: -> ::Array[WhopSDK::Models::VerificationCreateParams::Body::Individual::kind] + end + end + + type business = + { + address: WhopSDK::VerificationCreateParams::Body::Business::Address, + business_name: String, + business_structure: String, + business_website: String, + country: String, + kind: WhopSDK::Models::VerificationCreateParams::Body::Business::kind, + place_of_incorporation: String, + tax_identification_number: String + } + + class Business < WhopSDK::Internal::Type::BaseModel + attr_reader address: WhopSDK::VerificationCreateParams::Body::Business::Address? + + def address=: ( + WhopSDK::VerificationCreateParams::Body::Business::Address + ) -> WhopSDK::VerificationCreateParams::Body::Business::Address + + attr_reader business_name: String? + + def business_name=: (String) -> String + + attr_reader business_structure: String? + + def business_structure=: (String) -> String + + attr_reader business_website: String? + + def business_website=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader kind: WhopSDK::Models::VerificationCreateParams::Body::Business::kind? + + def kind=: ( + WhopSDK::Models::VerificationCreateParams::Body::Business::kind + ) -> WhopSDK::Models::VerificationCreateParams::Body::Business::kind + + attr_reader place_of_incorporation: String? + + def place_of_incorporation=: (String) -> String + + attr_reader tax_identification_number: String? + + def tax_identification_number=: (String) -> String + + def initialize: ( + ?address: WhopSDK::VerificationCreateParams::Body::Business::Address, + ?business_name: String, + ?business_structure: String, + ?business_website: String, + ?country: String, + ?kind: WhopSDK::Models::VerificationCreateParams::Body::Business::kind, + ?place_of_incorporation: String, + ?tax_identification_number: String + ) -> void + + def to_hash: -> { + address: WhopSDK::VerificationCreateParams::Body::Business::Address, + business_name: String, + business_structure: String, + business_website: String, + country: String, + kind: WhopSDK::Models::VerificationCreateParams::Body::Business::kind, + place_of_incorporation: String, + tax_identification_number: String + } + + type address = + { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_reader line2: String? + + def line2=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?city: String, + ?country: String, + ?line1: String, + ?line2: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + end + + type kind = :business + + module Kind + extend WhopSDK::Internal::Type::Enum + + BUSINESS: :business + + def self?.values: -> ::Array[WhopSDK::Models::VerificationCreateParams::Body::Business::kind] + end + end + + def self?.variants: -> ::Array[WhopSDK::Models::VerificationCreateParams::body] + end + end + end +end diff --git a/sig/whop_sdk/models/verification_create_response.rbs b/sig/whop_sdk/models/verification_create_response.rbs new file mode 100644 index 00000000..17aeeaf7 --- /dev/null +++ b/sig/whop_sdk/models/verification_create_response.rbs @@ -0,0 +1,333 @@ +module WhopSDK + module Models + type verification_create_response = + { + id: String, + address: WhopSDK::Models::VerificationCreateResponse::Address?, + business_name: String?, + business_structure: String?, + country: String?, + created_at: String, + date_of_birth: String?, + first_name: String?, + kind: WhopSDK::Models::VerificationCreateResponse::kind, + last_name: String?, + requested_information: ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation], + required_documents: ::Array[WhopSDK::Models::VerificationCreateResponse::RequiredDocument], + session_url: String?, + status: WhopSDK::Models::VerificationCreateResponse::status, + updated_at: String + } + + class VerificationCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor address: WhopSDK::Models::VerificationCreateResponse::Address? + + attr_accessor business_name: String? + + attr_accessor business_structure: String? + + attr_accessor country: String? + + attr_reader created_at: String? + + def created_at=: (String) -> String + + attr_accessor date_of_birth: String? + + attr_accessor first_name: String? + + attr_reader kind: WhopSDK::Models::VerificationCreateResponse::kind? + + def kind=: ( + WhopSDK::Models::VerificationCreateResponse::kind + ) -> WhopSDK::Models::VerificationCreateResponse::kind + + attr_accessor last_name: String? + + attr_reader requested_information: ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation]? + + def requested_information=: ( + ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation] + ) -> ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation] + + attr_reader required_documents: ::Array[WhopSDK::Models::VerificationCreateResponse::RequiredDocument]? + + def required_documents=: ( + ::Array[WhopSDK::Models::VerificationCreateResponse::RequiredDocument] + ) -> ::Array[WhopSDK::Models::VerificationCreateResponse::RequiredDocument] + + attr_accessor session_url: String? + + attr_reader status: WhopSDK::Models::VerificationCreateResponse::status? + + def status=: ( + WhopSDK::Models::VerificationCreateResponse::status + ) -> WhopSDK::Models::VerificationCreateResponse::status + + attr_reader updated_at: String? + + def updated_at=: (String) -> String + + def initialize: ( + ?id: String, + ?address: WhopSDK::Models::VerificationCreateResponse::Address?, + ?business_name: String?, + ?business_structure: String?, + ?country: String?, + ?created_at: String, + ?date_of_birth: String?, + ?first_name: String?, + ?kind: WhopSDK::Models::VerificationCreateResponse::kind, + ?last_name: String?, + ?requested_information: ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation], + ?required_documents: ::Array[WhopSDK::Models::VerificationCreateResponse::RequiredDocument], + ?session_url: String?, + ?status: WhopSDK::Models::VerificationCreateResponse::status, + ?updated_at: String + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::Models::VerificationCreateResponse::Address?, + business_name: String?, + business_structure: String?, + country: String?, + created_at: String, + date_of_birth: String?, + first_name: String?, + kind: WhopSDK::Models::VerificationCreateResponse::kind, + last_name: String?, + requested_information: ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation], + required_documents: ::Array[WhopSDK::Models::VerificationCreateResponse::RequiredDocument], + session_url: String?, + status: WhopSDK::Models::VerificationCreateResponse::status, + updated_at: String + } + + type address = + { + city: String?, + country: String?, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + ?city: String?, + ?country: String?, + ?line1: String, + ?line2: String?, + ?postal_code: String?, + ?state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type kind = :individual | :business + + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL: :individual + BUSINESS: :business + + def self?.values: -> ::Array[WhopSDK::Models::VerificationCreateResponse::kind] + end + + type requested_information = + { + id: String, + description: String?, + error_message: String?, + field: String, + label: String, + options: ::Array[String], + requested_files: ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile], + type: String? + } + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor description: String? + + attr_accessor error_message: String? + + attr_reader field: String? + + def field=: (String) -> String + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader options: ::Array[String]? + + def options=: (::Array[String]) -> ::Array[String] + + attr_reader requested_files: ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile]? + + def requested_files=: ( + ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile] + ) -> ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile] + + attr_accessor type: String? + + def initialize: ( + ?id: String, + ?description: String?, + ?error_message: String?, + ?field: String, + ?label: String, + ?options: ::Array[String], + ?requested_files: ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile], + ?type: String? + ) -> void + + def to_hash: -> { + id: String, + description: String?, + error_message: String?, + field: String, + label: String, + options: ::Array[String], + requested_files: ::Array[WhopSDK::Models::VerificationCreateResponse::RequestedInformation::RequestedFile], + type: String? + } + + type requested_file = + { + category: String?, + is_optional: bool, + kind: String?, + label: String, + multiple: bool + } + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + attr_accessor category: String? + + attr_reader is_optional: bool? + + def is_optional=: (bool) -> bool + + attr_accessor kind: String? + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader multiple: bool? + + def multiple=: (bool) -> bool + + def initialize: ( + ?category: String?, + ?is_optional: bool, + ?kind: String?, + ?label: String, + ?multiple: bool + ) -> void + + def to_hash: -> { + category: String?, + is_optional: bool, + kind: String?, + label: String, + multiple: bool + } + end + end + + type required_document = + { + document: String, + rejection_reason: String?, + status: WhopSDK::Models::VerificationCreateResponse::RequiredDocument::status + } + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + attr_reader document: String? + + def document=: (String) -> String + + attr_accessor rejection_reason: String? + + attr_reader status: WhopSDK::Models::VerificationCreateResponse::RequiredDocument::status? + + def status=: ( + WhopSDK::Models::VerificationCreateResponse::RequiredDocument::status + ) -> WhopSDK::Models::VerificationCreateResponse::RequiredDocument::status + + def initialize: ( + ?document: String, + ?rejection_reason: String?, + ?status: WhopSDK::Models::VerificationCreateResponse::RequiredDocument::status + ) -> void + + def to_hash: -> { + document: String, + rejection_reason: String?, + status: WhopSDK::Models::VerificationCreateResponse::RequiredDocument::status + } + + type status = :pending_upload | :submitted + + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING_UPLOAD: :pending_upload + SUBMITTED: :submitted + + def self?.values: -> ::Array[WhopSDK::Models::VerificationCreateResponse::RequiredDocument::status] + end + end + + type status = + :not_started | :pending | :approved | :rejected | :action_required + + module Status + extend WhopSDK::Internal::Type::Enum + + NOT_STARTED: :not_started + PENDING: :pending + APPROVED: :approved + REJECTED: :rejected + ACTION_REQUIRED: :action_required + + def self?.values: -> ::Array[WhopSDK::Models::VerificationCreateResponse::status] + end + end + end +end diff --git a/sig/whop_sdk/models/verification_list_params.rbs b/sig/whop_sdk/models/verification_list_params.rbs index 6a48e44c..013a7e84 100644 --- a/sig/whop_sdk/models/verification_list_params.rbs +++ b/sig/whop_sdk/models/verification_list_params.rbs @@ -2,11 +2,9 @@ module WhopSDK module Models type verification_list_params = { - payout_account_id: String, - after: String?, - before: String?, - first: Integer?, - last: Integer? + account_id: String, + direction: WhopSDK::Models::VerificationListParams::direction, + order: WhopSDK::Models::VerificationListParams::order } & WhopSDK::Internal::Type::request_parameters @@ -14,33 +12,55 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor payout_account_id: String + attr_accessor account_id: String - attr_accessor after: String? + attr_reader direction: WhopSDK::Models::VerificationListParams::direction? - attr_accessor before: String? + def direction=: ( + WhopSDK::Models::VerificationListParams::direction + ) -> WhopSDK::Models::VerificationListParams::direction - attr_accessor first: Integer? + attr_reader order: WhopSDK::Models::VerificationListParams::order? - attr_accessor last: Integer? + def order=: ( + WhopSDK::Models::VerificationListParams::order + ) -> WhopSDK::Models::VerificationListParams::order def initialize: ( - payout_account_id: String, - ?after: String?, - ?before: String?, - ?first: Integer?, - ?last: Integer?, + account_id: String, + ?direction: WhopSDK::Models::VerificationListParams::direction, + ?order: WhopSDK::Models::VerificationListParams::order, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - payout_account_id: String, - after: String?, - before: String?, - first: Integer?, - last: Integer?, + account_id: String, + direction: WhopSDK::Models::VerificationListParams::direction, + order: WhopSDK::Models::VerificationListParams::order, 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::VerificationListParams::direction] + end + + type order = :updated_at | :created_at + + module Order + extend WhopSDK::Internal::Type::Enum + + UPDATED_AT: :updated_at + CREATED_AT: :created_at + + def self?.values: -> ::Array[WhopSDK::Models::VerificationListParams::order] + end end end end diff --git a/sig/whop_sdk/models/verification_list_response.rbs b/sig/whop_sdk/models/verification_list_response.rbs index 91673921..a3eb2f90 100644 --- a/sig/whop_sdk/models/verification_list_response.rbs +++ b/sig/whop_sdk/models/verification_list_response.rbs @@ -1,35 +1,352 @@ module WhopSDK module Models type verification_list_response = - { - id: String, - last_error_code: WhopSDK::Models::verification_error_code?, - last_error_reason: String?, - status: WhopSDK::Models::verification_status - } + { data: ::Array[WhopSDK::Models::VerificationListResponse::Data] } class VerificationListResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor last_error_code: WhopSDK::Models::verification_error_code? - - attr_accessor last_error_reason: String? + attr_reader data: ::Array[WhopSDK::Models::VerificationListResponse::Data]? - attr_accessor status: WhopSDK::Models::verification_status + def data=: ( + ::Array[WhopSDK::Models::VerificationListResponse::Data] + ) -> ::Array[WhopSDK::Models::VerificationListResponse::Data] def initialize: ( - id: String, - last_error_code: WhopSDK::Models::verification_error_code?, - last_error_reason: String?, - status: WhopSDK::Models::verification_status + ?data: ::Array[WhopSDK::Models::VerificationListResponse::Data] ) -> void def to_hash: -> { - id: String, - last_error_code: WhopSDK::Models::verification_error_code?, - last_error_reason: String?, - status: WhopSDK::Models::verification_status + data: ::Array[WhopSDK::Models::VerificationListResponse::Data] } + + type data = + { + id: String, + address: WhopSDK::Models::VerificationListResponse::Data::Address?, + business_name: String?, + business_structure: String?, + country: String?, + created_at: String, + date_of_birth: String?, + first_name: String?, + kind: WhopSDK::Models::VerificationListResponse::Data::kind, + last_name: String?, + requested_information: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation], + required_documents: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequiredDocument], + session_url: String?, + status: WhopSDK::Models::VerificationListResponse::Data::status, + updated_at: String + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor address: WhopSDK::Models::VerificationListResponse::Data::Address? + + attr_accessor business_name: String? + + attr_accessor business_structure: String? + + attr_accessor country: String? + + attr_reader created_at: String? + + def created_at=: (String) -> String + + attr_accessor date_of_birth: String? + + attr_accessor first_name: String? + + attr_reader kind: WhopSDK::Models::VerificationListResponse::Data::kind? + + def kind=: ( + WhopSDK::Models::VerificationListResponse::Data::kind + ) -> WhopSDK::Models::VerificationListResponse::Data::kind + + attr_accessor last_name: String? + + attr_reader requested_information: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation]? + + def requested_information=: ( + ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation] + ) -> ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation] + + attr_reader required_documents: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequiredDocument]? + + def required_documents=: ( + ::Array[WhopSDK::Models::VerificationListResponse::Data::RequiredDocument] + ) -> ::Array[WhopSDK::Models::VerificationListResponse::Data::RequiredDocument] + + attr_accessor session_url: String? + + attr_reader status: WhopSDK::Models::VerificationListResponse::Data::status? + + def status=: ( + WhopSDK::Models::VerificationListResponse::Data::status + ) -> WhopSDK::Models::VerificationListResponse::Data::status + + attr_reader updated_at: String? + + def updated_at=: (String) -> String + + def initialize: ( + ?id: String, + ?address: WhopSDK::Models::VerificationListResponse::Data::Address?, + ?business_name: String?, + ?business_structure: String?, + ?country: String?, + ?created_at: String, + ?date_of_birth: String?, + ?first_name: String?, + ?kind: WhopSDK::Models::VerificationListResponse::Data::kind, + ?last_name: String?, + ?requested_information: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation], + ?required_documents: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequiredDocument], + ?session_url: String?, + ?status: WhopSDK::Models::VerificationListResponse::Data::status, + ?updated_at: String + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::Models::VerificationListResponse::Data::Address?, + business_name: String?, + business_structure: String?, + country: String?, + created_at: String, + date_of_birth: String?, + first_name: String?, + kind: WhopSDK::Models::VerificationListResponse::Data::kind, + last_name: String?, + requested_information: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation], + required_documents: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequiredDocument], + session_url: String?, + status: WhopSDK::Models::VerificationListResponse::Data::status, + updated_at: String + } + + type address = + { + city: String?, + country: String?, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + ?city: String?, + ?country: String?, + ?line1: String, + ?line2: String?, + ?postal_code: String?, + ?state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type kind = :individual | :business + + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL: :individual + BUSINESS: :business + + def self?.values: -> ::Array[WhopSDK::Models::VerificationListResponse::Data::kind] + end + + type requested_information = + { + id: String, + description: String?, + error_message: String?, + field: String, + label: String, + options: ::Array[String], + requested_files: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile], + type: String? + } + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor description: String? + + attr_accessor error_message: String? + + attr_reader field: String? + + def field=: (String) -> String + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader options: ::Array[String]? + + def options=: (::Array[String]) -> ::Array[String] + + attr_reader requested_files: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile]? + + def requested_files=: ( + ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile] + ) -> ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile] + + attr_accessor type: String? + + def initialize: ( + ?id: String, + ?description: String?, + ?error_message: String?, + ?field: String, + ?label: String, + ?options: ::Array[String], + ?requested_files: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile], + ?type: String? + ) -> void + + def to_hash: -> { + id: String, + description: String?, + error_message: String?, + field: String, + label: String, + options: ::Array[String], + requested_files: ::Array[WhopSDK::Models::VerificationListResponse::Data::RequestedInformation::RequestedFile], + type: String? + } + + type requested_file = + { + category: String?, + is_optional: bool, + kind: String?, + label: String, + multiple: bool + } + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + attr_accessor category: String? + + attr_reader is_optional: bool? + + def is_optional=: (bool) -> bool + + attr_accessor kind: String? + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader multiple: bool? + + def multiple=: (bool) -> bool + + def initialize: ( + ?category: String?, + ?is_optional: bool, + ?kind: String?, + ?label: String, + ?multiple: bool + ) -> void + + def to_hash: -> { + category: String?, + is_optional: bool, + kind: String?, + label: String, + multiple: bool + } + end + end + + type required_document = + { + document: String, + rejection_reason: String?, + status: WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::status + } + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + attr_reader document: String? + + def document=: (String) -> String + + attr_accessor rejection_reason: String? + + attr_reader status: WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::status? + + def status=: ( + WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::status + ) -> WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::status + + def initialize: ( + ?document: String, + ?rejection_reason: String?, + ?status: WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::status + ) -> void + + def to_hash: -> { + document: String, + rejection_reason: String?, + status: WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::status + } + + type status = :pending_upload | :submitted + + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING_UPLOAD: :pending_upload + SUBMITTED: :submitted + + def self?.values: -> ::Array[WhopSDK::Models::VerificationListResponse::Data::RequiredDocument::status] + end + end + + type status = + :not_started | :pending | :approved | :rejected | :action_required + + module Status + extend WhopSDK::Internal::Type::Enum + + NOT_STARTED: :not_started + PENDING: :pending + APPROVED: :approved + REJECTED: :rejected + ACTION_REQUIRED: :action_required + + def self?.values: -> ::Array[WhopSDK::Models::VerificationListResponse::Data::status] + end + end end end end diff --git a/sig/whop_sdk/models/verification_retrieve_params.rbs b/sig/whop_sdk/models/verification_retrieve_params.rbs index 49276436..754fd87f 100644 --- a/sig/whop_sdk/models/verification_retrieve_params.rbs +++ b/sig/whop_sdk/models/verification_retrieve_params.rbs @@ -1,20 +1,23 @@ module WhopSDK module Models type verification_retrieve_params = - { id: String } & WhopSDK::Internal::Type::request_parameters + { verification_id: String } & WhopSDK::Internal::Type::request_parameters class VerificationRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor id: String + attr_accessor verification_id: String def initialize: ( - id: String, + verification_id: String, ?request_options: WhopSDK::request_opts ) -> void - def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + def to_hash: -> { + verification_id: String, + request_options: WhopSDK::RequestOptions + } end end end diff --git a/sig/whop_sdk/models/verification_retrieve_response.rbs b/sig/whop_sdk/models/verification_retrieve_response.rbs index bcfebc00..c44602fa 100644 --- a/sig/whop_sdk/models/verification_retrieve_response.rbs +++ b/sig/whop_sdk/models/verification_retrieve_response.rbs @@ -3,33 +3,331 @@ module WhopSDK type verification_retrieve_response = { id: String, - last_error_code: WhopSDK::Models::verification_error_code?, - last_error_reason: String?, - status: WhopSDK::Models::verification_status + address: WhopSDK::Models::VerificationRetrieveResponse::Address?, + business_name: String?, + business_structure: String?, + country: String?, + created_at: String, + date_of_birth: String?, + first_name: String?, + kind: WhopSDK::Models::VerificationRetrieveResponse::kind, + last_name: String?, + requested_information: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation], + required_documents: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument], + session_url: String?, + status: WhopSDK::Models::VerificationRetrieveResponse::status, + updated_at: String } class VerificationRetrieveResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String + attr_reader id: String? - attr_accessor last_error_code: WhopSDK::Models::verification_error_code? + def id=: (String) -> String - attr_accessor last_error_reason: String? + attr_accessor address: WhopSDK::Models::VerificationRetrieveResponse::Address? - attr_accessor status: WhopSDK::Models::verification_status + attr_accessor business_name: String? + + attr_accessor business_structure: String? + + attr_accessor country: String? + + attr_reader created_at: String? + + def created_at=: (String) -> String + + attr_accessor date_of_birth: String? + + attr_accessor first_name: String? + + attr_reader kind: WhopSDK::Models::VerificationRetrieveResponse::kind? + + def kind=: ( + WhopSDK::Models::VerificationRetrieveResponse::kind + ) -> WhopSDK::Models::VerificationRetrieveResponse::kind + + attr_accessor last_name: String? + + attr_reader requested_information: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation]? + + def requested_information=: ( + ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation] + ) -> ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation] + + attr_reader required_documents: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument]? + + def required_documents=: ( + ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument] + ) -> ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument] + + attr_accessor session_url: String? + + attr_reader status: WhopSDK::Models::VerificationRetrieveResponse::status? + + def status=: ( + WhopSDK::Models::VerificationRetrieveResponse::status + ) -> WhopSDK::Models::VerificationRetrieveResponse::status + + attr_reader updated_at: String? + + def updated_at=: (String) -> String def initialize: ( - id: String, - last_error_code: WhopSDK::Models::verification_error_code?, - last_error_reason: String?, - status: WhopSDK::Models::verification_status + ?id: String, + ?address: WhopSDK::Models::VerificationRetrieveResponse::Address?, + ?business_name: String?, + ?business_structure: String?, + ?country: String?, + ?created_at: String, + ?date_of_birth: String?, + ?first_name: String?, + ?kind: WhopSDK::Models::VerificationRetrieveResponse::kind, + ?last_name: String?, + ?requested_information: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation], + ?required_documents: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument], + ?session_url: String?, + ?status: WhopSDK::Models::VerificationRetrieveResponse::status, + ?updated_at: String ) -> void def to_hash: -> { id: String, - last_error_code: WhopSDK::Models::verification_error_code?, - last_error_reason: String?, - status: WhopSDK::Models::verification_status + address: WhopSDK::Models::VerificationRetrieveResponse::Address?, + business_name: String?, + business_structure: String?, + country: String?, + created_at: String, + date_of_birth: String?, + first_name: String?, + kind: WhopSDK::Models::VerificationRetrieveResponse::kind, + last_name: String?, + requested_information: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation], + required_documents: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument], + session_url: String?, + status: WhopSDK::Models::VerificationRetrieveResponse::status, + updated_at: String } + + type address = + { + city: String?, + country: String?, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + ?city: String?, + ?country: String?, + ?line1: String, + ?line2: String?, + ?postal_code: String?, + ?state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type kind = :individual | :business + + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL: :individual + BUSINESS: :business + + def self?.values: -> ::Array[WhopSDK::Models::VerificationRetrieveResponse::kind] + end + + type requested_information = + { + id: String, + description: String?, + error_message: String?, + field: String, + label: String, + options: ::Array[String], + requested_files: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile], + type: String? + } + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor description: String? + + attr_accessor error_message: String? + + attr_reader field: String? + + def field=: (String) -> String + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader options: ::Array[String]? + + def options=: (::Array[String]) -> ::Array[String] + + attr_reader requested_files: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile]? + + def requested_files=: ( + ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile] + ) -> ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile] + + attr_accessor type: String? + + def initialize: ( + ?id: String, + ?description: String?, + ?error_message: String?, + ?field: String, + ?label: String, + ?options: ::Array[String], + ?requested_files: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile], + ?type: String? + ) -> void + + def to_hash: -> { + id: String, + description: String?, + error_message: String?, + field: String, + label: String, + options: ::Array[String], + requested_files: ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation::RequestedFile], + type: String? + } + + type requested_file = + { + category: String?, + is_optional: bool, + kind: String?, + label: String, + multiple: bool + } + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + attr_accessor category: String? + + attr_reader is_optional: bool? + + def is_optional=: (bool) -> bool + + attr_accessor kind: String? + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader multiple: bool? + + def multiple=: (bool) -> bool + + def initialize: ( + ?category: String?, + ?is_optional: bool, + ?kind: String?, + ?label: String, + ?multiple: bool + ) -> void + + def to_hash: -> { + category: String?, + is_optional: bool, + kind: String?, + label: String, + multiple: bool + } + end + end + + type required_document = + { + document: String, + rejection_reason: String?, + status: WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::status + } + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + attr_reader document: String? + + def document=: (String) -> String + + attr_accessor rejection_reason: String? + + attr_reader status: WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::status? + + def status=: ( + WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::status + ) -> WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::status + + def initialize: ( + ?document: String, + ?rejection_reason: String?, + ?status: WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::status + ) -> void + + def to_hash: -> { + document: String, + rejection_reason: String?, + status: WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::status + } + + type status = :pending_upload | :submitted + + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING_UPLOAD: :pending_upload + SUBMITTED: :submitted + + def self?.values: -> ::Array[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument::status] + end + end + + type status = + :not_started | :pending | :approved | :rejected | :action_required + + module Status + extend WhopSDK::Internal::Type::Enum + + NOT_STARTED: :not_started + PENDING: :pending + APPROVED: :approved + REJECTED: :rejected + ACTION_REQUIRED: :action_required + + def self?.values: -> ::Array[WhopSDK::Models::VerificationRetrieveResponse::status] + end end end end diff --git a/sig/whop_sdk/models/verification_update_params.rbs b/sig/whop_sdk/models/verification_update_params.rbs new file mode 100644 index 00000000..2a59da70 --- /dev/null +++ b/sig/whop_sdk/models/verification_update_params.rbs @@ -0,0 +1,570 @@ +module WhopSDK + module Models + type verification_update_params = + { + verification_id: String, + body: WhopSDK::Models::VerificationUpdateParams::body + } + & WhopSDK::Internal::Type::request_parameters + + class VerificationUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor verification_id: String + + attr_accessor body: WhopSDK::Models::VerificationUpdateParams::body + + def initialize: ( + verification_id: String, + body: WhopSDK::Models::VerificationUpdateParams::body, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + verification_id: String, + body: WhopSDK::Models::VerificationUpdateParams::body, + request_options: WhopSDK::RequestOptions + } + + type body = + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification + | WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification + + module Body + extend WhopSDK::Internal::Type::Union + + type update_individual_verification = + { + country: String, + date_of_birth: String, + first_name: String, + last_name: String, + personal_address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, + requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + } + + class UpdateIndividualVerification < WhopSDK::Internal::Type::BaseModel + attr_reader country: String? + + def country=: (String) -> String + + attr_reader date_of_birth: String? + + def date_of_birth=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader personal_address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress? + + def personal_address=: ( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress + ) -> WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress + + attr_reader requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation]? + + def requested_information=: ( + ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + ) -> ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + + def initialize: ( + ?country: String, + ?date_of_birth: String, + ?first_name: String, + ?last_name: String, + ?personal_address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, + ?requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + ) -> void + + def to_hash: -> { + country: String, + date_of_birth: String, + first_name: String, + last_name: String, + personal_address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, + requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + } + + type personal_address = + { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + + class PersonalAddress < WhopSDK::Internal::Type::BaseModel + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_reader line2: String? + + def line2=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?city: String, + ?country: String, + ?line1: String, + ?line2: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + end + + type requested_information = + { + id: String, + address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address, + files: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File], + value: String, + value_type: WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::value_type + } + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_reader address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address? + + def address=: ( + WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address + ) -> WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address + + attr_reader files: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File]? + + def files=: ( + ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File] + ) -> ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File] + + attr_reader value: String? + + def value=: (String) -> String + + attr_reader value_type: WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::value_type? + + def value_type=: ( + WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::value_type + ) -> WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::value_type + + def initialize: ( + id: String, + ?address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address, + ?files: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File], + ?value: String, + ?value_type: WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::value_type + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::Address, + files: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::File], + value: String, + value_type: WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::value_type + } + + type address = + { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_reader line2: String? + + def line2=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?city: String, + ?country: String, + ?line1: String, + ?line2: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + end + + type file = + { + attachment_id: String, + category: String, + direct_upload_id: String, + kind: String + } + + class File < WhopSDK::Internal::Type::BaseModel + attr_reader attachment_id: String? + + def attachment_id=: (String) -> String + + attr_reader category: String? + + def category=: (String) -> String + + attr_reader direct_upload_id: String? + + def direct_upload_id=: (String) -> String + + attr_reader kind: String? + + def kind=: (String) -> String + + def initialize: ( + ?attachment_id: String, + ?category: String, + ?direct_upload_id: String, + ?kind: String + ) -> void + + def to_hash: -> { + attachment_id: String, + category: String, + direct_upload_id: String, + kind: String + } + end + + type value_type = :raw | :vault_token + + module ValueType + extend WhopSDK::Internal::Type::Enum + + RAW: :raw + VAULT_TOKEN: :vault_token + + def self?.values: -> ::Array[WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::value_type] + end + end + end + + type update_business_verification = + { + business_address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, + business_name: String, + business_structure: String, + country: String, + requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + } + + class UpdateBusinessVerification < WhopSDK::Internal::Type::BaseModel + attr_reader business_address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress? + + def business_address=: ( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress + ) -> WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress + + attr_reader business_name: String? + + def business_name=: (String) -> String + + attr_reader business_structure: String? + + def business_structure=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation]? + + def requested_information=: ( + ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + ) -> ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + + def initialize: ( + ?business_address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, + ?business_name: String, + ?business_structure: String, + ?country: String, + ?requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + ) -> void + + def to_hash: -> { + business_address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, + business_name: String, + business_structure: String, + country: String, + requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + } + + type business_address = + { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + + class BusinessAddress < WhopSDK::Internal::Type::BaseModel + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_reader line2: String? + + def line2=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?city: String, + ?country: String, + ?line1: String, + ?line2: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + end + + type requested_information = + { + id: String, + address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address, + files: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File], + value: String, + value_type: WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::value_type + } + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_reader address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address? + + def address=: ( + WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address + ) -> WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address + + attr_reader files: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File]? + + def files=: ( + ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File] + ) -> ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File] + + attr_reader value: String? + + def value=: (String) -> String + + attr_reader value_type: WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::value_type? + + def value_type=: ( + WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::value_type + ) -> WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::value_type + + def initialize: ( + id: String, + ?address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address, + ?files: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File], + ?value: String, + ?value_type: WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::value_type + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::Address, + files: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::File], + value: String, + value_type: WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::value_type + } + + type address = + { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_reader line2: String? + + def line2=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?city: String, + ?country: String, + ?line1: String, + ?line2: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + end + + type file = + { + attachment_id: String, + category: String, + direct_upload_id: String, + kind: String + } + + class File < WhopSDK::Internal::Type::BaseModel + attr_reader attachment_id: String? + + def attachment_id=: (String) -> String + + attr_reader category: String? + + def category=: (String) -> String + + attr_reader direct_upload_id: String? + + def direct_upload_id=: (String) -> String + + attr_reader kind: String? + + def kind=: (String) -> String + + def initialize: ( + ?attachment_id: String, + ?category: String, + ?direct_upload_id: String, + ?kind: String + ) -> void + + def to_hash: -> { + attachment_id: String, + category: String, + direct_upload_id: String, + kind: String + } + end + + type value_type = :raw | :vault_token + + module ValueType + extend WhopSDK::Internal::Type::Enum + + RAW: :raw + VAULT_TOKEN: :vault_token + + def self?.values: -> ::Array[WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::value_type] + end + end + end + + def self?.variants: -> ::Array[WhopSDK::Models::VerificationUpdateParams::body] + end + end + end +end diff --git a/sig/whop_sdk/models/verification_update_response.rbs b/sig/whop_sdk/models/verification_update_response.rbs new file mode 100644 index 00000000..f0092948 --- /dev/null +++ b/sig/whop_sdk/models/verification_update_response.rbs @@ -0,0 +1,333 @@ +module WhopSDK + module Models + type verification_update_response = + { + id: String, + address: WhopSDK::Models::VerificationUpdateResponse::Address?, + business_name: String?, + business_structure: String?, + country: String?, + created_at: String, + date_of_birth: String?, + first_name: String?, + kind: WhopSDK::Models::VerificationUpdateResponse::kind, + last_name: String?, + requested_information: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation], + required_documents: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument], + session_url: String?, + status: WhopSDK::Models::VerificationUpdateResponse::status, + updated_at: String + } + + class VerificationUpdateResponse < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor address: WhopSDK::Models::VerificationUpdateResponse::Address? + + attr_accessor business_name: String? + + attr_accessor business_structure: String? + + attr_accessor country: String? + + attr_reader created_at: String? + + def created_at=: (String) -> String + + attr_accessor date_of_birth: String? + + attr_accessor first_name: String? + + attr_reader kind: WhopSDK::Models::VerificationUpdateResponse::kind? + + def kind=: ( + WhopSDK::Models::VerificationUpdateResponse::kind + ) -> WhopSDK::Models::VerificationUpdateResponse::kind + + attr_accessor last_name: String? + + attr_reader requested_information: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation]? + + def requested_information=: ( + ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation] + ) -> ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation] + + attr_reader required_documents: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument]? + + def required_documents=: ( + ::Array[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument] + ) -> ::Array[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument] + + attr_accessor session_url: String? + + attr_reader status: WhopSDK::Models::VerificationUpdateResponse::status? + + def status=: ( + WhopSDK::Models::VerificationUpdateResponse::status + ) -> WhopSDK::Models::VerificationUpdateResponse::status + + attr_reader updated_at: String? + + def updated_at=: (String) -> String + + def initialize: ( + ?id: String, + ?address: WhopSDK::Models::VerificationUpdateResponse::Address?, + ?business_name: String?, + ?business_structure: String?, + ?country: String?, + ?created_at: String, + ?date_of_birth: String?, + ?first_name: String?, + ?kind: WhopSDK::Models::VerificationUpdateResponse::kind, + ?last_name: String?, + ?requested_information: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation], + ?required_documents: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument], + ?session_url: String?, + ?status: WhopSDK::Models::VerificationUpdateResponse::status, + ?updated_at: String + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::Models::VerificationUpdateResponse::Address?, + business_name: String?, + business_structure: String?, + country: String?, + created_at: String, + date_of_birth: String?, + first_name: String?, + kind: WhopSDK::Models::VerificationUpdateResponse::kind, + last_name: String?, + requested_information: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation], + required_documents: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument], + session_url: String?, + status: WhopSDK::Models::VerificationUpdateResponse::status, + updated_at: String + } + + type address = + { + city: String?, + country: String?, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_reader line1: String? + + def line1=: (String) -> String + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + ?city: String?, + ?country: String?, + ?line1: String, + ?line2: String?, + ?postal_code: String?, + ?state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type kind = :individual | :business + + module Kind + extend WhopSDK::Internal::Type::Enum + + INDIVIDUAL: :individual + BUSINESS: :business + + def self?.values: -> ::Array[WhopSDK::Models::VerificationUpdateResponse::kind] + end + + type requested_information = + { + id: String, + description: String?, + error_message: String?, + field: String, + label: String, + options: ::Array[String], + requested_files: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile], + type: String? + } + + class RequestedInformation < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor description: String? + + attr_accessor error_message: String? + + attr_reader field: String? + + def field=: (String) -> String + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader options: ::Array[String]? + + def options=: (::Array[String]) -> ::Array[String] + + attr_reader requested_files: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile]? + + def requested_files=: ( + ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile] + ) -> ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile] + + attr_accessor type: String? + + def initialize: ( + ?id: String, + ?description: String?, + ?error_message: String?, + ?field: String, + ?label: String, + ?options: ::Array[String], + ?requested_files: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile], + ?type: String? + ) -> void + + def to_hash: -> { + id: String, + description: String?, + error_message: String?, + field: String, + label: String, + options: ::Array[String], + requested_files: ::Array[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation::RequestedFile], + type: String? + } + + type requested_file = + { + category: String?, + is_optional: bool, + kind: String?, + label: String, + multiple: bool + } + + class RequestedFile < WhopSDK::Internal::Type::BaseModel + attr_accessor category: String? + + attr_reader is_optional: bool? + + def is_optional=: (bool) -> bool + + attr_accessor kind: String? + + attr_reader label: String? + + def label=: (String) -> String + + attr_reader multiple: bool? + + def multiple=: (bool) -> bool + + def initialize: ( + ?category: String?, + ?is_optional: bool, + ?kind: String?, + ?label: String, + ?multiple: bool + ) -> void + + def to_hash: -> { + category: String?, + is_optional: bool, + kind: String?, + label: String, + multiple: bool + } + end + end + + type required_document = + { + document: String, + rejection_reason: String?, + status: WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::status + } + + class RequiredDocument < WhopSDK::Internal::Type::BaseModel + attr_reader document: String? + + def document=: (String) -> String + + attr_accessor rejection_reason: String? + + attr_reader status: WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::status? + + def status=: ( + WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::status + ) -> WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::status + + def initialize: ( + ?document: String, + ?rejection_reason: String?, + ?status: WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::status + ) -> void + + def to_hash: -> { + document: String, + rejection_reason: String?, + status: WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::status + } + + type status = :pending_upload | :submitted + + module Status + extend WhopSDK::Internal::Type::Enum + + PENDING_UPLOAD: :pending_upload + SUBMITTED: :submitted + + def self?.values: -> ::Array[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument::status] + end + end + + type status = + :not_started | :pending | :approved | :rejected | :action_required + + module Status + extend WhopSDK::Internal::Type::Enum + + NOT_STARTED: :not_started + PENDING: :pending + APPROVED: :approved + REJECTED: :rejected + ACTION_REQUIRED: :action_required + + def self?.values: -> ::Array[WhopSDK::Models::VerificationUpdateResponse::status] + end + end + end +end diff --git a/sig/whop_sdk/models/wallet_balance_response.rbs b/sig/whop_sdk/models/wallet_balance_response.rbs deleted file mode 100644 index 3201f1dc..00000000 --- a/sig/whop_sdk/models/wallet_balance_response.rbs +++ /dev/null @@ -1,87 +0,0 @@ -module WhopSDK - module Models - type wallet_balance_response = - { - object: WhopSDK::Models::WalletBalanceResponse::object, - tokens: ::Array[WhopSDK::Models::WalletBalanceResponse::Token], - total_usd: String - } - - class WalletBalanceResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor object: WhopSDK::Models::WalletBalanceResponse::object - - attr_accessor tokens: ::Array[WhopSDK::Models::WalletBalanceResponse::Token] - - attr_accessor total_usd: String - - def initialize: ( - object: WhopSDK::Models::WalletBalanceResponse::object, - tokens: ::Array[WhopSDK::Models::WalletBalanceResponse::Token], - total_usd: String - ) -> void - - def to_hash: -> { - object: WhopSDK::Models::WalletBalanceResponse::object, - tokens: ::Array[WhopSDK::Models::WalletBalanceResponse::Token], - total_usd: String - } - - type object = :balance - - module Object - extend WhopSDK::Internal::Type::Enum - - BALANCE: :balance - - def self?.values: -> ::Array[WhopSDK::Models::WalletBalanceResponse::object] - end - - type token = - { - balance: String, - icon_url: String?, - name: String, - price_usd: Float, - symbol: String, - token_address: String?, - value_usd: String - } - - class Token < WhopSDK::Internal::Type::BaseModel - attr_accessor balance: String - - attr_accessor icon_url: String? - - attr_accessor name: String - - attr_accessor price_usd: Float - - attr_accessor symbol: String - - attr_accessor token_address: String? - - attr_accessor value_usd: String - - def initialize: ( - balance: String, - icon_url: String?, - name: String, - price_usd: Float, - symbol: String, - token_address: String?, - value_usd: String - ) -> void - - def to_hash: -> { - balance: String, - icon_url: String?, - name: String, - price_usd: Float, - symbol: String, - token_address: String?, - value_usd: String - } - end - end - end -end diff --git a/sig/whop_sdk/models/wallet_list_response.rbs b/sig/whop_sdk/models/wallet_list_response.rbs deleted file mode 100644 index 2e2398f6..00000000 --- a/sig/whop_sdk/models/wallet_list_response.rbs +++ /dev/null @@ -1,40 +0,0 @@ -module WhopSDK - module Models - type wallet_list_response = - { wallets: ::Array[WhopSDK::Models::WalletListResponse::Wallet] } - - class WalletListResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor wallets: ::Array[WhopSDK::Models::WalletListResponse::Wallet] - - def initialize: ( - wallets: ::Array[WhopSDK::Models::WalletListResponse::Wallet] - ) -> void - - def to_hash: -> { - wallets: ::Array[WhopSDK::Models::WalletListResponse::Wallet] - } - - type wallet = { address: String, balance_usd: String, network: String } - - class Wallet < WhopSDK::Internal::Type::BaseModel - attr_accessor address: String - - attr_accessor balance_usd: String - - attr_accessor network: String - - def initialize: ( - address: String, - balance_usd: String, - network: String - ) -> void - - def to_hash: -> { - address: String, - balance_usd: String, - network: String - } - end - end - end -end diff --git a/sig/whop_sdk/models/wallet_send_response.rbs b/sig/whop_sdk/models/wallet_send_response.rbs deleted file mode 100644 index c6d2f7f5..00000000 --- a/sig/whop_sdk/models/wallet_send_response.rbs +++ /dev/null @@ -1,79 +0,0 @@ -module WhopSDK - module Models - type wallet_send_response = - { - amount: String, - currency: String, - destination: WhopSDK::Models::WalletSendResponse::Destination, - object: WhopSDK::Models::WalletSendResponse::object, - source: WhopSDK::Models::WalletSendResponse::Source, - tx_hash: String - } - - class WalletSendResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor amount: String - - attr_accessor currency: String - - attr_accessor destination: WhopSDK::Models::WalletSendResponse::Destination - - attr_accessor object: WhopSDK::Models::WalletSendResponse::object - - attr_accessor source: WhopSDK::Models::WalletSendResponse::Source - - attr_accessor tx_hash: String - - def initialize: ( - amount: String, - currency: String, - destination: WhopSDK::Models::WalletSendResponse::Destination, - object: WhopSDK::Models::WalletSendResponse::object, - source: WhopSDK::Models::WalletSendResponse::Source, - tx_hash: String - ) -> void - - def to_hash: -> { - amount: String, - currency: String, - destination: WhopSDK::Models::WalletSendResponse::Destination, - object: WhopSDK::Models::WalletSendResponse::object, - source: WhopSDK::Models::WalletSendResponse::Source, - tx_hash: String - } - - type destination = { account_id: String, address: String } - - class Destination < WhopSDK::Internal::Type::BaseModel - attr_accessor account_id: String - - attr_accessor address: String - - def initialize: (account_id: String, address: String) -> void - - def to_hash: -> { account_id: String, address: String } - end - - type object = :send - - module Object - extend WhopSDK::Internal::Type::Enum - - SEND: :send - - def self?.values: -> ::Array[WhopSDK::Models::WalletSendResponse::object] - end - - type source = { account_id: String, address: String } - - class Source < WhopSDK::Internal::Type::BaseModel - attr_accessor account_id: String - - attr_accessor address: String - - def initialize: (account_id: String, address: String) -> void - - def to_hash: -> { account_id: String, address: String } - end - end - end -end diff --git a/sig/whop_sdk/models/webhook_event.rbs b/sig/whop_sdk/models/webhook_event.rbs index 9e433495..a0f4d502 100644 --- a/sig/whop_sdk/models/webhook_event.rbs +++ b/sig/whop_sdk/models/webhook_event.rbs @@ -8,6 +8,7 @@ module WhopSDK | :"invoice.voided" | :"membership.activated" | :"membership.deactivated" + | :"membership.trial_ending_soon" | :"entry.created" | :"entry.approved" | :"entry.denied" @@ -15,6 +16,7 @@ module WhopSDK | :"setup_intent.requires_action" | :"setup_intent.succeeded" | :"setup_intent.canceled" + | :"ledger_account.funds_available" | :"withdrawal.created" | :"withdrawal.updated" | :"course_lesson_interaction.completed" @@ -28,6 +30,8 @@ module WhopSDK | :"resolution_center_case.created" | :"resolution_center_case.updated" | :"resolution_center_case.decided" + | :"chat.message.created" + | :"chat.reaction.created" | :"payment.created" | :"payment.succeeded" | :"payment.failed" @@ -49,6 +53,7 @@ module WhopSDK INVOICE_VOIDED: :"invoice.voided" MEMBERSHIP_ACTIVATED: :"membership.activated" MEMBERSHIP_DEACTIVATED: :"membership.deactivated" + MEMBERSHIP_TRIAL_ENDING_SOON: :"membership.trial_ending_soon" ENTRY_CREATED: :"entry.created" ENTRY_APPROVED: :"entry.approved" ENTRY_DENIED: :"entry.denied" @@ -56,6 +61,7 @@ module WhopSDK SETUP_INTENT_REQUIRES_ACTION: :"setup_intent.requires_action" SETUP_INTENT_SUCCEEDED: :"setup_intent.succeeded" SETUP_INTENT_CANCELED: :"setup_intent.canceled" + LEDGER_ACCOUNT_FUNDS_AVAILABLE: :"ledger_account.funds_available" WITHDRAWAL_CREATED: :"withdrawal.created" WITHDRAWAL_UPDATED: :"withdrawal.updated" COURSE_LESSON_INTERACTION_COMPLETED: :"course_lesson_interaction.completed" @@ -69,6 +75,8 @@ module WhopSDK RESOLUTION_CENTER_CASE_CREATED: :"resolution_center_case.created" RESOLUTION_CENTER_CASE_UPDATED: :"resolution_center_case.updated" RESOLUTION_CENTER_CASE_DECIDED: :"resolution_center_case.decided" + CHAT_MESSAGE_CREATED: :"chat.message.created" + CHAT_REACTION_CREATED: :"chat.reaction.created" PAYMENT_CREATED: :"payment.created" PAYMENT_SUCCEEDED: :"payment.succeeded" PAYMENT_FAILED: :"payment.failed" diff --git a/sig/whop_sdk/models/withdrawal.rbs b/sig/whop_sdk/models/withdrawal.rbs index 766c4540..c51e7378 100644 --- a/sig/whop_sdk/models/withdrawal.rbs +++ b/sig/whop_sdk/models/withdrawal.rbs @@ -125,6 +125,7 @@ module WhopSDK | :missing_phone_number | :missing_remittance_info | :payee_name_invalid + | :beneficiary_name_mismatch | :receiving_account_locked | :rejected_by_compliance | :rtp_not_supported @@ -176,6 +177,7 @@ module WhopSDK MISSING_PHONE_NUMBER: :missing_phone_number MISSING_REMITTANCE_INFO: :missing_remittance_info PAYEE_NAME_INVALID: :payee_name_invalid + BENEFICIARY_NAME_MISMATCH: :beneficiary_name_mismatch RECEIVING_ACCOUNT_LOCKED: :receiving_account_locked REJECTED_BY_COMPLIANCE: :rejected_by_compliance RTP_NOT_SUPPORTED: :rtp_not_supported diff --git a/sig/whop_sdk/models/workforce/bounty_list_params.rbs b/sig/whop_sdk/models/workforce/bounty_list_params.rbs new file mode 100644 index 00000000..e0b2fc2d --- /dev/null +++ b/sig/whop_sdk/models/workforce/bounty_list_params.rbs @@ -0,0 +1,149 @@ +module WhopSDK + module Models + module Workforce + type bounty_list_params = + { + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::Workforce::BountyListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::Workforce::BountyListParams::order, + query: String, + status: WhopSDK::Models::Workforce::BountyListParams::status, + user_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class BountyListParams < 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 after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader created_after: String? + + def created_after=: (String) -> String + + attr_reader created_before: String? + + def created_before=: (String) -> String + + attr_reader direction: WhopSDK::Models::Workforce::BountyListParams::direction? + + def direction=: ( + WhopSDK::Models::Workforce::BountyListParams::direction + ) -> WhopSDK::Models::Workforce::BountyListParams::direction + + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::Workforce::BountyListParams::order? + + def order=: ( + WhopSDK::Models::Workforce::BountyListParams::order + ) -> WhopSDK::Models::Workforce::BountyListParams::order + + attr_reader query: String? + + def query=: (String) -> String + + attr_reader status: WhopSDK::Models::Workforce::BountyListParams::status? + + def status=: ( + WhopSDK::Models::Workforce::BountyListParams::status + ) -> WhopSDK::Models::Workforce::BountyListParams::status + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + ?account_id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::Workforce::BountyListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::Workforce::BountyListParams::order, + ?query: String, + ?status: WhopSDK::Models::Workforce::BountyListParams::status, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::Workforce::BountyListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::Workforce::BountyListParams::order, + query: String, + status: WhopSDK::Models::Workforce::BountyListParams::status, + user_id: 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::Workforce::BountyListParams::direction] + end + + type order = :created_at | :gross_paid_out_amount + + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT: :created_at + GROSS_PAID_OUT_AMOUNT: :gross_paid_out_amount + + def self?.values: -> ::Array[WhopSDK::Models::Workforce::BountyListParams::order] + end + + type status = :scheduled | :open | :closed | :completed | :canceled + + module Status + extend WhopSDK::Internal::Type::Enum + + SCHEDULED: :scheduled + OPEN: :open + CLOSED: :closed + COMPLETED: :completed + CANCELED: :canceled + + def self?.values: -> ::Array[WhopSDK::Models::Workforce::BountyListParams::status] + end + end + end + end +end diff --git a/sig/whop_sdk/models/workforce/bounty_retrieve_params.rbs b/sig/whop_sdk/models/workforce/bounty_retrieve_params.rbs new file mode 100644 index 00000000..3502cb48 --- /dev/null +++ b/sig/whop_sdk/models/workforce/bounty_retrieve_params.rbs @@ -0,0 +1,22 @@ +module WhopSDK + module Models + module Workforce + type bounty_retrieve_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class BountyRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end + end +end diff --git a/sig/whop_sdk/models/workforce/workforce_bounty.rbs b/sig/whop_sdk/models/workforce/workforce_bounty.rbs new file mode 100644 index 00000000..210c8813 --- /dev/null +++ b/sig/whop_sdk/models/workforce/workforce_bounty.rbs @@ -0,0 +1,232 @@ +module WhopSDK + module Models + class WorkforceBounty = Workforce::WorkforceBounty + + module Workforce + type workforce_bounty = + { + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: ::Array[String], + budget_amount: Float, + business_goal_type: WhopSDK::Models::Workforce::WorkforceBounty::business_goal_type?, + created_at: String, + currency: String, + description: String, + experience_id: String?, + funding_account: WhopSDK::Workforce::WorkforceBounty::FundingAccount?, + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBounty::Poster, + scheduled_frequency: WhopSDK::Models::Workforce::WorkforceBounty::scheduled_frequency?, + scheduled_publish_at: String?, + spots_remaining: Integer, + status: WhopSDK::Models::Workforce::WorkforceBounty::status, + submissions_closed_at: String?, + title: String, + unresolved_submissions_count: Integer, + updated_at: String + } + + class WorkforceBounty < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor accepted_submissions_count: Integer + + attr_accessor accepted_submissions_limit: Integer + + attr_accessor allowed_country_codes: ::Array[String] + + attr_accessor budget_amount: Float + + attr_accessor business_goal_type: WhopSDK::Models::Workforce::WorkforceBounty::business_goal_type? + + attr_accessor created_at: String + + attr_accessor currency: String + + attr_accessor description: String + + attr_accessor experience_id: String? + + attr_accessor funding_account: WhopSDK::Workforce::WorkforceBounty::FundingAccount? + + attr_accessor gross_paid_out_amount: Float + + attr_accessor gross_reward_amount: Float + + attr_accessor poster: WhopSDK::Workforce::WorkforceBounty::Poster + + attr_accessor scheduled_frequency: WhopSDK::Models::Workforce::WorkforceBounty::scheduled_frequency? + + attr_accessor scheduled_publish_at: String? + + attr_accessor spots_remaining: Integer + + attr_accessor status: WhopSDK::Models::Workforce::WorkforceBounty::status + + attr_accessor submissions_closed_at: String? + + attr_accessor title: String + + attr_accessor unresolved_submissions_count: Integer + + attr_accessor updated_at: String + + def initialize: ( + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: ::Array[String], + budget_amount: Float, + business_goal_type: WhopSDK::Models::Workforce::WorkforceBounty::business_goal_type?, + created_at: String, + currency: String, + description: String, + experience_id: String?, + funding_account: WhopSDK::Workforce::WorkforceBounty::FundingAccount?, + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBounty::Poster, + scheduled_frequency: WhopSDK::Models::Workforce::WorkforceBounty::scheduled_frequency?, + scheduled_publish_at: String?, + spots_remaining: Integer, + status: WhopSDK::Models::Workforce::WorkforceBounty::status, + submissions_closed_at: String?, + title: String, + unresolved_submissions_count: Integer, + updated_at: String + ) -> void + + def to_hash: -> { + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: ::Array[String], + budget_amount: Float, + business_goal_type: WhopSDK::Models::Workforce::WorkforceBounty::business_goal_type?, + created_at: String, + currency: String, + description: String, + experience_id: String?, + funding_account: WhopSDK::Workforce::WorkforceBounty::FundingAccount?, + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBounty::Poster, + scheduled_frequency: WhopSDK::Models::Workforce::WorkforceBounty::scheduled_frequency?, + scheduled_publish_at: String?, + spots_remaining: Integer, + status: WhopSDK::Models::Workforce::WorkforceBounty::status, + submissions_closed_at: String?, + title: String, + unresolved_submissions_count: Integer, + updated_at: String + } + + type business_goal_type = + :clipping + | :post_engagement + | :owned_account_growth + | :ugc_content + | :local_activation + | :other + + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + CLIPPING: :clipping + POST_ENGAGEMENT: :post_engagement + OWNED_ACCOUNT_GROWTH: :owned_account_growth + UGC_CONTENT: :ugc_content + LOCAL_ACTIVATION: :local_activation + OTHER: :other + + def self?.values: -> ::Array[WhopSDK::Models::Workforce::WorkforceBounty::business_goal_type] + end + + type funding_account = { id: String, title: String } + + class FundingAccount < 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 poster = + { + id: String, + name: String?, + profile_picture: WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture, + username: String + } + + class Poster < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + profile_picture: WhopSDK::Workforce::WorkforceBounty::Poster::ProfilePicture, + username: String + ) -> void + + def to_hash: -> { + id: String, + name: String?, + profile_picture: WhopSDK::Workforce::WorkforceBounty::Poster::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 + + type scheduled_frequency = :once | :hourly | :daily | :weekly | :monthly + + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + ONCE: :once + HOURLY: :hourly + DAILY: :daily + WEEKLY: :weekly + MONTHLY: :monthly + + def self?.values: -> ::Array[WhopSDK::Models::Workforce::WorkforceBounty::scheduled_frequency] + end + + type status = :scheduled | :open | :closed | :completed | :canceled + + module Status + extend WhopSDK::Internal::Type::Enum + + SCHEDULED: :scheduled + OPEN: :open + CLOSED: :closed + COMPLETED: :completed + CANCELED: :canceled + + def self?.values: -> ::Array[WhopSDK::Models::Workforce::WorkforceBounty::status] + end + end + end + end +end diff --git a/sig/whop_sdk/models/workforce/workforce_bounty_list_item.rbs b/sig/whop_sdk/models/workforce/workforce_bounty_list_item.rbs new file mode 100644 index 00000000..634cf630 --- /dev/null +++ b/sig/whop_sdk/models/workforce/workforce_bounty_list_item.rbs @@ -0,0 +1,227 @@ +module WhopSDK + module Models + class WorkforceBountyListItem = Workforce::WorkforceBountyListItem + + module Workforce + type workforce_bounty_list_item = + { + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: ::Array[String], + budget_amount: Float, + business_goal_type: WhopSDK::Models::Workforce::WorkforceBountyListItem::business_goal_type?, + created_at: String, + currency: String, + experience_id: String?, + funding_account: WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount?, + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBountyListItem::Poster, + scheduled_frequency: WhopSDK::Models::Workforce::WorkforceBountyListItem::scheduled_frequency?, + scheduled_publish_at: String?, + spots_remaining: Integer, + status: WhopSDK::Models::Workforce::WorkforceBountyListItem::status, + submissions_closed_at: String?, + title: String, + unresolved_submissions_count: Integer, + updated_at: String + } + + class WorkforceBountyListItem < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor accepted_submissions_count: Integer + + attr_accessor accepted_submissions_limit: Integer + + attr_accessor allowed_country_codes: ::Array[String] + + attr_accessor budget_amount: Float + + attr_accessor business_goal_type: WhopSDK::Models::Workforce::WorkforceBountyListItem::business_goal_type? + + attr_accessor created_at: String + + attr_accessor currency: String + + attr_accessor experience_id: String? + + attr_accessor funding_account: WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount? + + attr_accessor gross_paid_out_amount: Float + + attr_accessor gross_reward_amount: Float + + attr_accessor poster: WhopSDK::Workforce::WorkforceBountyListItem::Poster + + attr_accessor scheduled_frequency: WhopSDK::Models::Workforce::WorkforceBountyListItem::scheduled_frequency? + + attr_accessor scheduled_publish_at: String? + + attr_accessor spots_remaining: Integer + + attr_accessor status: WhopSDK::Models::Workforce::WorkforceBountyListItem::status + + attr_accessor submissions_closed_at: String? + + attr_accessor title: String + + attr_accessor unresolved_submissions_count: Integer + + attr_accessor updated_at: String + + def initialize: ( + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: ::Array[String], + budget_amount: Float, + business_goal_type: WhopSDK::Models::Workforce::WorkforceBountyListItem::business_goal_type?, + created_at: String, + currency: String, + experience_id: String?, + funding_account: WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount?, + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBountyListItem::Poster, + scheduled_frequency: WhopSDK::Models::Workforce::WorkforceBountyListItem::scheduled_frequency?, + scheduled_publish_at: String?, + spots_remaining: Integer, + status: WhopSDK::Models::Workforce::WorkforceBountyListItem::status, + submissions_closed_at: String?, + title: String, + unresolved_submissions_count: Integer, + updated_at: String + ) -> void + + def to_hash: -> { + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: ::Array[String], + budget_amount: Float, + business_goal_type: WhopSDK::Models::Workforce::WorkforceBountyListItem::business_goal_type?, + created_at: String, + currency: String, + experience_id: String?, + funding_account: WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount?, + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBountyListItem::Poster, + scheduled_frequency: WhopSDK::Models::Workforce::WorkforceBountyListItem::scheduled_frequency?, + scheduled_publish_at: String?, + spots_remaining: Integer, + status: WhopSDK::Models::Workforce::WorkforceBountyListItem::status, + submissions_closed_at: String?, + title: String, + unresolved_submissions_count: Integer, + updated_at: String + } + + type business_goal_type = + :clipping + | :post_engagement + | :owned_account_growth + | :ugc_content + | :local_activation + | :other + + module BusinessGoalType + extend WhopSDK::Internal::Type::Enum + + CLIPPING: :clipping + POST_ENGAGEMENT: :post_engagement + OWNED_ACCOUNT_GROWTH: :owned_account_growth + UGC_CONTENT: :ugc_content + LOCAL_ACTIVATION: :local_activation + OTHER: :other + + def self?.values: -> ::Array[WhopSDK::Models::Workforce::WorkforceBountyListItem::business_goal_type] + end + + type funding_account = { id: String, title: String } + + class FundingAccount < 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 poster = + { + id: String, + name: String?, + profile_picture: WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture, + username: String + } + + class Poster < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + profile_picture: WhopSDK::Workforce::WorkforceBountyListItem::Poster::ProfilePicture, + username: String + ) -> void + + def to_hash: -> { + id: String, + name: String?, + profile_picture: WhopSDK::Workforce::WorkforceBountyListItem::Poster::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 + + type scheduled_frequency = :once | :hourly | :daily | :weekly | :monthly + + module ScheduledFrequency + extend WhopSDK::Internal::Type::Enum + + ONCE: :once + HOURLY: :hourly + DAILY: :daily + WEEKLY: :weekly + MONTHLY: :monthly + + def self?.values: -> ::Array[WhopSDK::Models::Workforce::WorkforceBountyListItem::scheduled_frequency] + end + + type status = :scheduled | :open | :closed | :completed | :canceled + + module Status + extend WhopSDK::Internal::Type::Enum + + SCHEDULED: :scheduled + OPEN: :open + CLOSED: :closed + COMPLETED: :completed + CANCELED: :canceled + + def self?.values: -> ::Array[WhopSDK::Models::Workforce::WorkforceBountyListItem::status] + end + end + end + end +end diff --git a/sig/whop_sdk/resources/accounts.rbs b/sig/whop_sdk/resources/accounts.rbs index 7fdfc857..c097200c 100644 --- a/sig/whop_sdk/resources/accounts.rbs +++ b/sig/whop_sdk/resources/accounts.rbs @@ -1,9 +1,12 @@ module WhopSDK module Resources class Accounts + attr_reader preferences: WhopSDK::Resources::Accounts::Preferences + def create: ( ?email: String, ?metadata: ::Hash[Symbol, top], + ?title: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Account @@ -17,6 +20,7 @@ module WhopSDK ?affiliate_application_required: bool, ?affiliate_instructions: String?, ?banner_image: ::Hash[Symbol, top]?, + ?business_address: WhopSDK::AccountUpdateParams::BusinessAddress, ?business_type: String?, ?country: String?, ?description: String?, @@ -32,6 +36,7 @@ module WhopSDK ?opengraph_image_variant: String?, ?other_business_description: String?, ?other_industry_description: String?, + ?product_tax_code_id: String?, ?require_2fa: bool, ?route: String?, ?send_customer_emails: bool, @@ -41,19 +46,30 @@ module WhopSDK ?social_links: ::Array[::Hash[Symbol, top]], ?store_page_config: ::Hash[Symbol, top]?, ?target_audience: String?, + ?tax_identifiers: ::Array[WhopSDK::AccountUpdateParams::TaxIdentifier], + ?tax_remitted_by: WhopSDK::Models::AccountUpdateParams::tax_remitted_by, ?title: String?, ?use_logo_as_opengraph_image_fallback: bool, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Account def list: ( - ?page: Integer, - ?per: Integer, + ?after: String, + ?before: String, + ?direction: WhopSDK::Models::AccountListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::AccountListParams::order, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::AccountListResponse + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Account] def me: (?request_options: WhopSDK::request_opts) -> WhopSDK::Account + def recommend_actions: ( + String account_id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::AccountRecommendActionsResponse + def initialize: (client: WhopSDK::Client) -> void end end diff --git a/sig/whop_sdk/resources/accounts/preferences.rbs b/sig/whop_sdk/resources/accounts/preferences.rbs new file mode 100644 index 00000000..5d4486b6 --- /dev/null +++ b/sig/whop_sdk/resources/accounts/preferences.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Resources + class Accounts + class Preferences + def retrieve: ( + String account_id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::Accounts::PreferenceRetrieveResponse + + def update: ( + String account_id, + ?ads_payment_methods: WhopSDK::Accounts::PreferenceUpdateParams::AdsPaymentMethods, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::Accounts::PreferenceUpdateResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end + end +end diff --git a/sig/whop_sdk/resources/ad_campaigns.rbs b/sig/whop_sdk/resources/ad_campaigns.rbs index 46da0c86..11e0bb14 100644 --- a/sig/whop_sdk/resources/ad_campaigns.rbs +++ b/sig/whop_sdk/resources/ad_campaigns.rbs @@ -1,33 +1,61 @@ module WhopSDK module Resources class AdCampaigns + def create: ( + objective: WhopSDK::Models::AdCampaignCreateParams::objective, + platform: WhopSDK::Models::AdCampaignCreateParams::platform, + title: String, + ?account_id: String, + ?bid_type: WhopSDK::Models::AdCampaignCreateParams::bid_type, + ?budget_amount: Float, + ?budget_optimization: WhopSDK::Models::AdCampaignCreateParams::budget_optimization, + ?budget_type: WhopSDK::Models::AdCampaignCreateParams::budget_type, + ?desired_cost_per_result: Float, + ?ends_at: String, + ?special_ad_categories: ::Array[WhopSDK::Models::AdCampaignCreateParams::special_ad_category], + ?starts_at: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::AdCampaign + def retrieve: ( String id, - ?stats_from: Time?, - ?stats_to: Time?, + ?stats_from: String, + ?stats_to: String, + ?time_zone: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AdCampaign def update: ( String id, - ?budget: Float?, + ?bid_type: WhopSDK::Models::AdCampaignUpdateParams::bid_type, + ?budget_amount: Float, + ?budget_optimization: WhopSDK::Models::AdCampaignUpdateParams::budget_optimization, + ?ends_at: String, + ?starts_at: String, + ?status: WhopSDK::Models::AdCampaignUpdateParams::status, + ?title: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AdCampaign def list: ( - ?after: String?, - ?before: String?, - ?company_id: String?, - ?created_after: Time?, - ?created_before: Time?, - ?first: Integer?, - ?last: Integer?, - ?query: String?, - ?stats_from: Time?, - ?stats_to: Time?, - ?status: WhopSDK::Models::ad_campaign_status?, + ?account_id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::AdCampaignListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::AdCampaignListParams::order, + ?query: String, + ?stats_from: String, + ?stats_to: String, + ?status: WhopSDK::Models::AdCampaignListParams::status, + ?time_zone: String, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::AdCampaignListResponse] + ) -> WhopSDK::Internal::CursorPage[WhopSDK::AdCampaign] + + def delete: (String id, ?request_options: WhopSDK::request_opts) -> bool def pause: ( String id, diff --git a/sig/whop_sdk/resources/ad_groups.rbs b/sig/whop_sdk/resources/ad_groups.rbs index b9d628f5..635da56a 100644 --- a/sig/whop_sdk/resources/ad_groups.rbs +++ b/sig/whop_sdk/resources/ad_groups.rbs @@ -1,43 +1,83 @@ module WhopSDK module Resources class AdGroups + def create: ( + ad_campaign_id: String, + ?audiences: top, + ?bid_type: WhopSDK::Models::AdGroupCreateParams::bid_type, + ?budget_amount: Float, + ?budget_type: WhopSDK::Models::AdGroupCreateParams::budget_type, + ?conversion_event: WhopSDK::Models::AdGroupCreateParams::conversion_event?, + ?conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location, + ?demographics: top, + ?desired_cost_per_result: Float, + ?devices: top, + ?dynamic_creative: bool, + ?ends_at: String, + ?frequency_cap: top, + ?languages: ::Array[String], + ?message_apps: ::Array[WhopSDK::Models::AdGroupCreateParams::message_app], + ?minimum_daily_spend: Float, + ?optimization_goal: String, + ?placements: top, + ?regions: top, + ?starts_at: String, + ?status: WhopSDK::Models::AdGroupCreateParams::status, + ?title: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::AdGroup + def retrieve: ( String id, - ?stats_from: Time?, - ?stats_to: Time?, + ?stats_from: String, + ?stats_to: String, + ?time_zone: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AdGroup def update: ( String id, - ?budget: Float?, - ?budget_type: WhopSDK::Models::ad_budget_type?, - ?config: WhopSDK::AdGroupUpdateParams::Config?, - ?daily_budget: Float?, - ?name: String?, - ?platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, - ?status: WhopSDK::Models::ad_group_status?, - ?title: String?, + ?audiences: top, + ?bid_type: WhopSDK::Models::AdGroupUpdateParams::bid_type, + ?budget_amount: Float, + ?budget_type: WhopSDK::Models::AdGroupUpdateParams::budget_type, + ?conversion_event: WhopSDK::Models::AdGroupUpdateParams::conversion_event?, + ?conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location, + ?demographics: top, + ?desired_cost_per_result: Float, + ?devices: top, + ?ends_at: String, + ?frequency_cap: top, + ?languages: ::Array[String], + ?message_apps: ::Array[WhopSDK::Models::AdGroupUpdateParams::message_app], + ?minimum_daily_spend: Float, + ?optimization_goal: String, + ?placements: top, + ?regions: top, + ?starts_at: String, + ?status: WhopSDK::Models::AdGroupUpdateParams::status, + ?title: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AdGroup def list: ( - ?ad_campaign_id: String?, - ?ad_campaign_ids: ::Array[String]?, - ?after: String?, - ?before: String?, - ?campaign_id: String?, - ?company_id: String?, - ?created_after: Time?, - ?created_before: Time?, - ?first: Integer?, - ?last: Integer?, - ?query: String?, - ?stats_from: Time?, - ?stats_to: Time?, - ?status: WhopSDK::Models::ad_group_status?, + ?account_id: String, + ?ad_campaign_id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::AdGroupListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::AdGroupListParams::order, + ?query: String, + ?stats_from: String, + ?stats_to: String, + ?status: String, + ?time_zone: String, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::AdGroupListResponse] + ) -> WhopSDK::Internal::CursorPage[WhopSDK::AdGroup] def delete: (String id, ?request_options: WhopSDK::request_opts) -> bool diff --git a/sig/whop_sdk/resources/ads.rbs b/sig/whop_sdk/resources/ads.rbs index 7e6a88b0..3762de69 100644 --- a/sig/whop_sdk/resources/ads.rbs +++ b/sig/whop_sdk/resources/ads.rbs @@ -1,36 +1,76 @@ module WhopSDK module Resources class Ads + def create: ( + ?ad_group: top, + ?ad_group_id: String, + ?call_to_action: WhopSDK::Models::AdCreateParams::call_to_action, + ?creatives: ::Array[WhopSDK::AdCreateParams::Creative], + ?descriptions: ::Array[String], + ?headlines: ::Array[String], + ?lead_form: WhopSDK::AdCreateParams::LeadForm, + ?lead_form_id: String, + ?messaging_config: WhopSDK::AdCreateParams::MessagingConfig, + ?multi_advertiser_ads: bool, + ?post_id: String, + ?post_source: WhopSDK::Models::AdCreateParams::post_source, + ?primary_texts: ::Array[String], + ?social_accounts: ::Array[WhopSDK::AdCreateParams::SocialAccount], + ?title: String, + ?url: String, + ?url_parameters: top, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Ad + def retrieve: ( String id, - ?stats_from: Time?, - ?stats_to: Time?, + ?stats_from: String, + ?stats_to: String, + ?time_zone: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Ad + + def update: ( + String id, + ?call_to_action: WhopSDK::Models::AdUpdateParams::call_to_action, + ?creatives: ::Array[WhopSDK::AdUpdateParams::Creative], + ?descriptions: ::Array[String], + ?headlines: ::Array[String], + ?lead_form: WhopSDK::AdUpdateParams::LeadForm, + ?lead_form_id: String, + ?messaging_config: WhopSDK::AdUpdateParams::MessagingConfig, + ?multi_advertiser_ads: bool, + ?post_id: String, + ?post_source: WhopSDK::Models::AdUpdateParams::post_source, + ?primary_texts: ::Array[String], + ?social_accounts: ::Array[WhopSDK::AdUpdateParams::SocialAccount], + ?title: String, + ?url: String, + ?url_parameters: top, ?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?, - ?last: Integer?, - ?order: WhopSDK::Models::AdListParams::order?, - ?order_by: WhopSDK::Models::AdListParams::order_by?, - ?order_direction: WhopSDK::Models::direction?, - ?query: String?, - ?stats_from: Time?, - ?stats_to: Time?, - ?status: WhopSDK::Models::external_ad_status?, + ?account_id: String, + ?ad_campaign_id: String, + ?ad_group_id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::AdListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::AdListParams::order, + ?query: String, + ?stats_from: String, + ?stats_to: String, + ?status: WhopSDK::Models::AdListParams::status, + ?time_zone: String, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::AdListResponse] + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Ad] + + def delete: (String id, ?request_options: WhopSDK::request_opts) -> bool def pause: ( String id, diff --git a/sig/whop_sdk/resources/apps.rbs b/sig/whop_sdk/resources/apps.rbs index 5365ce0a..9398864f 100644 --- a/sig/whop_sdk/resources/apps.rbs +++ b/sig/whop_sdk/resources/apps.rbs @@ -7,6 +7,7 @@ module WhopSDK ?base_url: String?, ?icon: WhopSDK::AppCreateParams::Icon?, ?redirect_uris: ::Array[String]?, + ?route: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::App @@ -30,6 +31,8 @@ module WhopSDK ?openapi_path: String?, ?redirect_uris: ::Array[String]?, ?required_scopes: ::Array[WhopSDK::Models::AppUpdateParams::required_scope]?, + ?route: String?, + ?secrets: ::Hash[Symbol, top]?, ?skills_path: String?, ?status: WhopSDK::Models::app_statuses?, ?request_options: WhopSDK::request_opts @@ -50,6 +53,19 @@ module WhopSDK ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::AppListResponse] + def logs: ( + String id, + ?after: String, + ?app_build_id: String, + ?before: String, + ?created_after: Time, + ?created_before: Time, + ?first: Integer, + ?level: WhopSDK::Models::AppLogsParams::level, + ?query: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::AppLogsResponse + def initialize: (client: WhopSDK::Client) -> void end end diff --git a/sig/whop_sdk/resources/audiences.rbs b/sig/whop_sdk/resources/audiences.rbs new file mode 100644 index 00000000..28b14a18 --- /dev/null +++ b/sig/whop_sdk/resources/audiences.rbs @@ -0,0 +1,28 @@ +module WhopSDK + module Resources + class Audiences + def create: ( + account_id: String, + column_mapping: WhopSDK::AudienceCreateParams::ColumnMapping, + file_id: String, + name: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Audience + + def list: ( + account_id: String, + ?after: String, + ?audience_id: String, + ?first: Integer, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Audience] + + def delete: ( + String audience_id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::AudienceDeleteResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/authorized_users.rbs b/sig/whop_sdk/resources/authorized_users.rbs index 87c2ff8a..7492c5bb 100644 --- a/sig/whop_sdk/resources/authorized_users.rbs +++ b/sig/whop_sdk/resources/authorized_users.rbs @@ -5,6 +5,7 @@ module WhopSDK company_id: String, role: WhopSDK::Models::authorized_user_roles, user_id: String, + ?elevation: WhopSDK::AuthorizedUserCreateParams::Elevation?, ?send_emails: bool?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AuthorizedUser diff --git a/sig/whop_sdk/resources/bounties.rbs b/sig/whop_sdk/resources/bounties.rbs index 71e48afc..3fb64889 100644 --- a/sig/whop_sdk/resources/bounties.rbs +++ b/sig/whop_sdk/resources/bounties.rbs @@ -8,10 +8,14 @@ module WhopSDK title: String, ?accepted_submissions_limit: Integer?, ?allowed_country_codes: ::Array[String]?, + ?business_goal_type: WhopSDK::Models::BountyCreateParams::business_goal_type?, ?experience_id: String?, ?origin_account_id: String?, ?post_markdown_content: String?, ?post_title: String?, + ?scheduled_frequency: WhopSDK::Models::BountyCreateParams::scheduled_frequency?, + ?scheduled_publish_at: Time?, + ?scheduled_timezone: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::BountyCreateResponse diff --git a/sig/whop_sdk/resources/cards.rbs b/sig/whop_sdk/resources/cards.rbs new file mode 100644 index 00000000..4a719d7f --- /dev/null +++ b/sig/whop_sdk/resources/cards.rbs @@ -0,0 +1,47 @@ +module WhopSDK + module Resources + class Cards + def create: ( + ?account_id: String, + ?assigned_user_id: String, + ?name: String, + ?spend_limit: Float, + ?spend_limit_frequency: WhopSDK::Models::CardCreateParams::spend_limit_frequency, + ?transaction_limit: Float, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::CardCreateResponse + + def retrieve: ( + String card_id, + ?account_id: String, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::CardRetrieveResponse + + def update: ( + String card_id, + ?account_id: String, + ?billing: WhopSDK::CardUpdateParams::Billing, + ?canceled: bool, + ?frozen: bool, + ?name: String, + ?pin: String, + ?remove_limit: bool, + ?spend_limit: Float, + ?spend_limit_frequency: WhopSDK::Models::CardUpdateParams::spend_limit_frequency, + ?transaction_limit: Float, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::CardUpdateResponse + + def list: ( + ?account_id: String, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::CardListResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/checkout_configurations.rbs b/sig/whop_sdk/resources/checkout_configurations.rbs index da16433a..ee459714 100644 --- a/sig/whop_sdk/resources/checkout_configurations.rbs +++ b/sig/whop_sdk/resources/checkout_configurations.rbs @@ -2,28 +2,38 @@ module WhopSDK module Resources class CheckoutConfigurations def create: ( - body: WhopSDK::Models::CheckoutConfigurationCreateParams::body, + ?affiliate_code: String?, + ?company_id: String, + ?currency: String?, + ?metadata: top?, + ?mode: WhopSDK::Models::CheckoutConfigurationCreateParams::mode, + ?payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration?, + ?plan: WhopSDK::CheckoutConfigurationCreateParams::Plan?, + ?plan_id: String?, + ?redirect_url: String?, + ?three_ds_level: String?, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::CheckoutConfiguration + ) -> WhopSDK::Models::CheckoutConfigurationCreateResponse def retrieve: ( String id, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::CheckoutConfiguration + ) -> WhopSDK::Models::CheckoutConfigurationRetrieveResponse def list: ( company_id: String, - ?after: String?, - ?before: String?, - ?created_after: Time?, - ?created_before: Time?, - ?direction: WhopSDK::Models::direction?, - ?first: Integer?, - ?last: Integer?, - ?plan_id: String?, + ?after: String, + ?created_after: Integer, + ?created_before: Integer, + ?direction: WhopSDK::Models::CheckoutConfigurationListParams::direction, + ?first: Integer, + ?order: WhopSDK::Models::CheckoutConfigurationListParams::order, + ?plan_id: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::CheckoutConfigurationListResponse] + def delete: (String id, ?request_options: WhopSDK::request_opts) -> nil + def initialize: (client: WhopSDK::Client) -> void end end diff --git a/sig/whop_sdk/resources/conversions.rbs b/sig/whop_sdk/resources/conversions.rbs deleted file mode 100644 index 28f6899b..00000000 --- a/sig/whop_sdk/resources/conversions.rbs +++ /dev/null @@ -1,29 +0,0 @@ -module WhopSDK - module Resources - class Conversions - def create: ( - company_id: String, - event_name: WhopSDK::Models::ConversionCreateParams::event_name, - ?action_source: WhopSDK::Models::ConversionCreateParams::action_source?, - ?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?, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::ConversionCreateResponse - - def initialize: (client: WhopSDK::Client) -> void - end - end -end diff --git a/sig/whop_sdk/resources/deposits.rbs b/sig/whop_sdk/resources/deposits.rbs index 5098da4d..4200946e 100644 --- a/sig/whop_sdk/resources/deposits.rbs +++ b/sig/whop_sdk/resources/deposits.rbs @@ -2,13 +2,18 @@ module WhopSDK module Resources class Deposits def create: ( - amount: Float, destination: WhopSDK::Models::DepositCreateParams::destination, + ?amount: Float, ?metadata: ::Hash[Symbol, top], ?network: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::DepositCreateResponse + def list: ( + account_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::DepositListResponse + def initialize: (client: WhopSDK::Client) -> void end end diff --git a/sig/whop_sdk/resources/events.rbs b/sig/whop_sdk/resources/events.rbs new file mode 100644 index 00000000..ff1121a8 --- /dev/null +++ b/sig/whop_sdk/resources/events.rbs @@ -0,0 +1,40 @@ +module WhopSDK + module Resources + class Events + def create: ( + account_id: String, + event_name: WhopSDK::Models::EventCreateParams::event_name, + ?action_source: WhopSDK::Models::EventCreateParams::action_source?, + ?context: WhopSDK::EventCreateParams::Context?, + ?currency: WhopSDK::Models::EventCreateParams::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::EventCreateParams::User?, + ?value: Float?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::EventCreateResponse + + def list: ( + person_id: String, + ?account_id: String, + ?after: String, + ?before: String, + ?first: Integer, + ?from: Integer, + ?to: Integer, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::EventListResponse] + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/financial_activity.rbs b/sig/whop_sdk/resources/financial_activity.rbs index 448d522e..1c683b33 100644 --- a/sig/whop_sdk/resources/financial_activity.rbs +++ b/sig/whop_sdk/resources/financial_activity.rbs @@ -3,8 +3,11 @@ module WhopSDK class FinancialActivity def list: ( ?account_id: String, + ?available_after: Date, + ?available_before: Date, ?currency: String, ?cursor: String, + ?include_owned_accounts: bool, ?limit: Integer, ?line_types: ::Array[String], ?posted_after: Time, diff --git a/sig/whop_sdk/resources/media.rbs b/sig/whop_sdk/resources/media.rbs new file mode 100644 index 00000000..02d68c05 --- /dev/null +++ b/sig/whop_sdk/resources/media.rbs @@ -0,0 +1,22 @@ +module WhopSDK + module Resources + class Media + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::MediaAsset + + def generate: ( + prompt: String, + type: WhopSDK::Models::MediaGenerateParams::type_, + ?account_id: String, + ?duration_seconds: WhopSDK::Models::MediaGenerateParams::duration_seconds, + ?reference_media: ::Array[String], + ?resolution: WhopSDK::Models::MediaGenerateParams::resolution, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::MediaAsset + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/payout_methods.rbs b/sig/whop_sdk/resources/payout_methods.rbs deleted file mode 100644 index c3743973..00000000 --- a/sig/whop_sdk/resources/payout_methods.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module WhopSDK - module Resources - class PayoutMethods - def retrieve: ( - String id, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::PayoutMethodRetrieveResponse - - def list: ( - company_id: String, - ?after: String?, - ?before: String?, - ?first: Integer?, - ?last: Integer?, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::PayoutMethodListResponse] - - def initialize: (client: WhopSDK::Client) -> void - end - end -end diff --git a/sig/whop_sdk/resources/payouts.rbs b/sig/whop_sdk/resources/payouts.rbs new file mode 100644 index 00000000..bdd5665a --- /dev/null +++ b/sig/whop_sdk/resources/payouts.rbs @@ -0,0 +1,29 @@ +module WhopSDK + module Resources + class Payouts + attr_reader methods_: WhopSDK::Resources::Payouts::Methods + + def create: ( + account_id: String, + amount: Float, + payout_method_id: String, + ?currency: String, + ?idempotency_key: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::PayoutCreateResponse + + def list: ( + ?account_id: String, + ?after: String, + ?before: String, + ?currency: String, + ?first: Integer, + ?last: Integer, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::PayoutListResponse] + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/payouts/methods.rbs b/sig/whop_sdk/resources/payouts/methods.rbs new file mode 100644 index 00000000..141a1691 --- /dev/null +++ b/sig/whop_sdk/resources/payouts/methods.rbs @@ -0,0 +1,23 @@ +module WhopSDK + module Resources + class Payouts + class Methods + def list: ( + ?account_id: String, + ?after: String, + ?amount: Float, + ?before: String, + ?currency: String, + ?first: Integer, + ?include_available: bool, + ?last: Integer, + ?status: WhopSDK::Models::Payouts::MethodListParams::status, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::Payouts::MethodListResponse] + + def initialize: (client: WhopSDK::Client) -> void + end + end + end +end diff --git a/sig/whop_sdk/resources/people.rbs b/sig/whop_sdk/resources/people.rbs new file mode 100644 index 00000000..82d2b4ea --- /dev/null +++ b/sig/whop_sdk/resources/people.rbs @@ -0,0 +1,28 @@ +module WhopSDK + module Resources + class People + def retrieve: ( + String person_id, + ?account_id: String, + ?from: Integer, + ?to: Integer, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::PersonRetrieveResponse + + def list: ( + ?account_id: String, + ?after: String, + ?before: String, + ?direction: WhopSDK::Models::PersonListParams::direction, + ?filters: String, + ?first: Integer, + ?from: Integer, + ?sort: String, + ?to: Integer, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::PersonListResponse] + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/plans.rbs b/sig/whop_sdk/resources/plans.rbs index 872d9f2d..ab8757ff 100644 --- a/sig/whop_sdk/resources/plans.rbs +++ b/sig/whop_sdk/resources/plans.rbs @@ -2,11 +2,10 @@ module WhopSDK module Resources class Plans def create: ( - product_id: String, + ?account_id: String, ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, ?checkout_styling: top?, - ?company_id: String, ?currency: String, ?custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, ?description: String?, @@ -19,6 +18,7 @@ module WhopSDK ?override_tax_type: String, ?payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration?, ?plan_type: String, + ?product_id: String, ?release_method: String, ?renewal_price: Float?, ?split_pay_required_payments: Integer?, @@ -66,7 +66,7 @@ module WhopSDK ) -> WhopSDK::Plan def list: ( - company_id: String, + account_id: String, ?after: String, ?before: String, ?created_after: String, @@ -84,6 +84,14 @@ module WhopSDK def delete: (String id, ?request_options: WhopSDK::request_opts) -> bool + def calculate_tax: ( + String id, + ?address: WhopSDK::PlanCalculateTaxParams::Address?, + ?ip_address: String, + ?tax_ids: ::Array[WhopSDK::PlanCalculateTaxParams::TaxID]?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::PlanCalculateTaxResponse + def initialize: (client: WhopSDK::Client) -> void end end diff --git a/sig/whop_sdk/resources/products.rbs b/sig/whop_sdk/resources/products.rbs index cac4e0be..81bc6773 100644 --- a/sig/whop_sdk/resources/products.rbs +++ b/sig/whop_sdk/resources/products.rbs @@ -2,26 +2,24 @@ module WhopSDK module Resources class Products def create: ( - company_id: String, title: String, ?collect_shipping_address: bool?, - ?custom_cta: WhopSDK::Models::custom_cta?, + ?company_id: String, + ?custom_cta: String?, ?custom_cta_url: String?, ?custom_statement_descriptor: String?, ?description: String?, - ?experience_ids: ::Array[String]?, ?global_affiliate_percentage: Float?, - ?global_affiliate_status: WhopSDK::Models::global_affiliate_status?, + ?global_affiliate_status: String, ?headline: String?, ?member_affiliate_percentage: Float?, - ?member_affiliate_status: WhopSDK::Models::global_affiliate_status?, - ?metadata: ::Hash[Symbol, top]?, - ?plan_options: WhopSDK::ProductCreateParams::PlanOptions?, + ?member_affiliate_status: String, + ?metadata: top?, ?product_tax_code_id: String?, ?redirect_purchase_url: String?, ?route: String?, ?send_welcome_message: bool?, - ?visibility: WhopSDK::Models::visibility?, + ?visibility: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Product @@ -32,40 +30,26 @@ module WhopSDK def update: ( String id, - ?collect_shipping_address: bool?, - ?custom_cta: WhopSDK::Models::custom_cta?, - ?custom_cta_url: String?, - ?custom_statement_descriptor: String?, ?description: String?, - ?gallery_images: ::Array[WhopSDK::ProductUpdateParams::GalleryImage]?, - ?global_affiliate_percentage: Float?, - ?global_affiliate_status: WhopSDK::Models::global_affiliate_status?, ?headline: String?, - ?member_affiliate_percentage: Float?, - ?member_affiliate_status: WhopSDK::Models::global_affiliate_status?, - ?metadata: ::Hash[Symbol, top]?, + ?metadata: top?, ?product_tax_code_id: String?, - ?redirect_purchase_url: String?, - ?route: String?, ?send_welcome_message: bool?, - ?store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig?, - ?title: String?, - ?visibility: WhopSDK::Models::visibility?, + ?title: String, + ?visibility: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Product 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::ProductListParams::order?, - ?product_types: ::Array[WhopSDK::Models::access_pass_type]?, - ?visibilities: ::Array[WhopSDK::Models::visibility_filter]?, + ?access_pass_types: ::Array[String], + ?after: String, + ?before: String, + ?direction: WhopSDK::Models::ProductListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: String, + ?visibilities: ::Array[String], ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::ProductListItem] diff --git a/sig/whop_sdk/resources/referrals.rbs b/sig/whop_sdk/resources/referrals.rbs new file mode 100644 index 00000000..87b39701 --- /dev/null +++ b/sig/whop_sdk/resources/referrals.rbs @@ -0,0 +1,21 @@ +module WhopSDK + module Resources + class Referrals + attr_reader businesses: WhopSDK::Resources::Referrals::Businesses + + attr_reader partners: WhopSDK::Resources::Referrals::Partners + + def referred_users: ( + ?after: String, + ?before: String, + ?first: Integer, + ?has_businesses: bool, + ?has_earning_businesses: bool, + ?last: Integer, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::ReferralReferredUsersResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/referrals/businesses.rbs b/sig/whop_sdk/resources/referrals/businesses.rbs new file mode 100644 index 00000000..c0d96321 --- /dev/null +++ b/sig/whop_sdk/resources/referrals/businesses.rbs @@ -0,0 +1,38 @@ +module WhopSDK + module Resources + class Referrals + class Businesses + attr_reader earnings: WhopSDK::Resources::Referrals::Businesses::Earnings + + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::Referrals::BusinessRetrieveResponse + + def list: ( + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::Referrals::BusinessListParams::direction, + ?first: Integer, + ?has_earnings: bool, + ?last: Integer, + ?order: WhopSDK::Models::Referrals::BusinessListParams::order, + ?referred_user_id: String, + ?referred_username: String, + ?status: WhopSDK::Models::Referrals::BusinessListParams::status, + ?tier: WhopSDK::Models::Referrals::BusinessListParams::tier, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::Referrals::BusinessListResponse] + + def leaderboard: ( + ?period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::Referrals::BusinessLeaderboardResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end + end +end diff --git a/sig/whop_sdk/resources/referrals/businesses/earnings.rbs b/sig/whop_sdk/resources/referrals/businesses/earnings.rbs new file mode 100644 index 00000000..fc424b90 --- /dev/null +++ b/sig/whop_sdk/resources/referrals/businesses/earnings.rbs @@ -0,0 +1,25 @@ +module WhopSDK + module Resources + class Referrals + class Businesses + class Earnings + def list: ( + String id, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order, + ?status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::Referrals::Businesses::EarningListResponse] + + def initialize: (client: WhopSDK::Client) -> void + end + end + end + end +end diff --git a/sig/whop_sdk/resources/referrals/partners.rbs b/sig/whop_sdk/resources/referrals/partners.rbs new file mode 100644 index 00000000..d4da1e94 --- /dev/null +++ b/sig/whop_sdk/resources/referrals/partners.rbs @@ -0,0 +1,13 @@ +module WhopSDK + module Resources + class Referrals + class Partners + def create: ( + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::Referrals::PartnerCreateResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end + end +end diff --git a/sig/whop_sdk/resources/social_accounts.rbs b/sig/whop_sdk/resources/social_accounts.rbs new file mode 100644 index 00000000..c0d9c82f --- /dev/null +++ b/sig/whop_sdk/resources/social_accounts.rbs @@ -0,0 +1,52 @@ +module WhopSDK + module Resources + class SocialAccounts + def create: ( + platform: WhopSDK::Models::SocialAccountCreateParams::platform, + ?account_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::SocialAccount + + def list: ( + ?account_id: String, + ?after: String, + ?before: String, + ?direction: WhopSDK::Models::SocialAccountListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::SocialAccountListParams::order, + ?platform: WhopSDK::Models::SocialAccountListParams::platform, + ?scopes: ::Array[WhopSDK::Models::SocialAccountListParams::scope], + ?user_id: String, + ?verified: bool, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::SocialAccount] + + def delete: ( + String id, + ?account_id: String, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> bool + + def connect: ( + platform: WhopSDK::Models::SocialAccountConnectParams::platform, + ?account_id: String, + ?redirect_url: String, + ?scopes: ::Array[WhopSDK::Models::SocialAccountConnectParams::scope], + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::SocialAccountConnectResponse + + def posts: ( + String id, + account_id: String, + ?after: String, + ?first: Integer, + ?post_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::SocialAccountPostsResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/stats.rbs b/sig/whop_sdk/resources/stats.rbs new file mode 100644 index 00000000..0bcb85a9 --- /dev/null +++ b/sig/whop_sdk/resources/stats.rbs @@ -0,0 +1,39 @@ +module WhopSDK + module Resources + class Stats + def retrieve: ( + String metric, + from: Date, + to: Date, + ?access_level: String, + ?account_id: String, + ?ad_campaign_ids: ::Array[String], + ?ad_group_ids: ::Array[String], + ?ad_ids: ::Array[String], + ?breakdown_by: String, + ?card_network: String, + ?category: String, + ?convert_to: String, + ?currency: String, + ?fee_type: String, + ?interval: WhopSDK::Models::StatRetrieveParams::interval, + ?most_recent_action: String, + ?payment_method: String, + ?product: String, + ?referred_user_id: String, + ?segment: String, + ?snapshot_window: WhopSDK::Models::StatRetrieveParams::snapshot_window, + ?source: String, + ?status: String, + ?time_zone: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::StatRetrieveResponse + + def list: ( + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::StatListResponse + + 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 4afbb528..178462f3 100644 --- a/sig/whop_sdk/resources/swaps.rbs +++ b/sig/whop_sdk/resources/swaps.rbs @@ -13,10 +13,15 @@ module WhopSDK ) -> WhopSDK::Models::SwapCreateResponse def retrieve: ( - account_id: String, + String id, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::SwapRetrieveResponse + def list: ( + account_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::SwapListResponse + def create_quote: ( amount: String, from_token: String, diff --git a/sig/whop_sdk/resources/transfers.rbs b/sig/whop_sdk/resources/transfers.rbs index 06db24f0..3693ddc0 100644 --- a/sig/whop_sdk/resources/transfers.rbs +++ b/sig/whop_sdk/resources/transfers.rbs @@ -3,31 +3,34 @@ module WhopSDK class Transfers def create: ( amount: Float, - currency: WhopSDK::Models::currency, - destination_id: String, origin_id: String, + ?currency: String, + ?destination_id: String, + ?expires_at: Time?, ?idempotence_key: String?, ?metadata: ::Hash[Symbol, top]?, ?notes: String?, + ?redeemable_count: Integer, + ?type: WhopSDK::Models::TransferCreateParams::type_, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Transfer + ) -> WhopSDK::Models::transfer_create_response def retrieve: ( String id, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Transfer + ) -> WhopSDK::Models::TransferRetrieveResponse def list: ( - ?after: String?, - ?before: String?, - ?created_after: Time?, - ?created_before: Time?, - ?destination_id: String?, - ?direction: WhopSDK::Models::direction?, - ?first: Integer?, - ?last: Integer?, - ?order: WhopSDK::Models::TransferListParams::order?, - ?origin_id: String?, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?destination_id: String, + ?direction: WhopSDK::Models::TransferListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::TransferListParams::order, + ?origin_id: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::TransferListResponse] diff --git a/sig/whop_sdk/resources/users.rbs b/sig/whop_sdk/resources/users.rbs index bc12c11e..3520bc76 100644 --- a/sig/whop_sdk/resources/users.rbs +++ b/sig/whop_sdk/resources/users.rbs @@ -4,6 +4,11 @@ module WhopSDK def retrieve: ( String id, ?account_id: String, + ?from: String, + ?include_balance_history: bool, + ?interval: WhopSDK::Models::UserRetrieveParams::interval, + ?time_zone: String, + ?to: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::User diff --git a/sig/whop_sdk/resources/verifications.rbs b/sig/whop_sdk/resources/verifications.rbs index 93318ad8..84f68769 100644 --- a/sig/whop_sdk/resources/verifications.rbs +++ b/sig/whop_sdk/resources/verifications.rbs @@ -1,19 +1,29 @@ module WhopSDK module Resources class Verifications + def create: ( + account_id: String, + body: WhopSDK::Models::VerificationCreateParams::body, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::VerificationCreateResponse + def retrieve: ( - String id, + String verification_id, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::VerificationRetrieveResponse + def update: ( + String verification_id, + body: WhopSDK::Models::VerificationUpdateParams::body, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::VerificationUpdateResponse + def list: ( - payout_account_id: String, - ?after: String?, - ?before: String?, - ?first: Integer?, - ?last: Integer?, + account_id: String, + ?direction: WhopSDK::Models::VerificationListParams::direction, + ?order: WhopSDK::Models::VerificationListParams::order, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::VerificationListResponse] + ) -> WhopSDK::Models::VerificationListResponse def initialize: (client: WhopSDK::Client) -> void end diff --git a/sig/whop_sdk/resources/wallets.rbs b/sig/whop_sdk/resources/wallets.rbs deleted file mode 100644 index 5543a065..00000000 --- a/sig/whop_sdk/resources/wallets.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module WhopSDK - module Resources - class Wallets - def list: ( - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::WalletListResponse - - def balance: ( - account_id: String, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::WalletBalanceResponse - - def send_: ( - account_id: String, - amount: String, - to: String, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::WalletSendResponse - - def initialize: (client: WhopSDK::Client) -> void - end - end -end diff --git a/sig/whop_sdk/resources/webhooks.rbs b/sig/whop_sdk/resources/webhooks.rbs index 9f213c61..97530bfe 100644 --- a/sig/whop_sdk/resources/webhooks.rbs +++ b/sig/whop_sdk/resources/webhooks.rbs @@ -41,7 +41,9 @@ module WhopSDK String payload, headers: ::Hash[String, String], ?key: String? - ) -> (WhopSDK::CourseLessonInteractionCompletedWebhookEvent + ) -> (WhopSDK::ChatMessageCreatedWebhookEvent + | WhopSDK::ChatReactionCreatedWebhookEvent + | WhopSDK::CourseLessonInteractionCompletedWebhookEvent | WhopSDK::DisputeCreatedWebhookEvent | WhopSDK::DisputeUpdatedWebhookEvent | WhopSDK::DisputeAlertCreatedWebhookEvent @@ -58,9 +60,11 @@ module WhopSDK | WhopSDK::InvoicePaidWebhookEvent | WhopSDK::InvoicePastDueWebhookEvent | WhopSDK::InvoiceVoidedWebhookEvent + | WhopSDK::LedgerAccountFundsAvailableWebhookEvent | WhopSDK::MembershipActivatedWebhookEvent | WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent | WhopSDK::MembershipDeactivatedWebhookEvent + | WhopSDK::MembershipTrialEndingSoonWebhookEvent | WhopSDK::PaymentCreatedWebhookEvent | WhopSDK::PaymentFailedWebhookEvent | WhopSDK::PaymentPendingWebhookEvent diff --git a/sig/whop_sdk/resources/workforce.rbs b/sig/whop_sdk/resources/workforce.rbs new file mode 100644 index 00000000..cac3a76a --- /dev/null +++ b/sig/whop_sdk/resources/workforce.rbs @@ -0,0 +1,9 @@ +module WhopSDK + module Resources + class Workforce + attr_reader bounties: WhopSDK::Resources::Workforce::Bounties + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/workforce/bounties.rbs b/sig/whop_sdk/resources/workforce/bounties.rbs new file mode 100644 index 00000000..e0702c8f --- /dev/null +++ b/sig/whop_sdk/resources/workforce/bounties.rbs @@ -0,0 +1,30 @@ +module WhopSDK + module Resources + class Workforce + class Bounties + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Workforce::WorkforceBounty + + def list: ( + ?account_id: String, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::Workforce::BountyListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::Workforce::BountyListParams::order, + ?query: String, + ?status: WhopSDK::Models::Workforce::BountyListParams::status, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Workforce::WorkforceBountyListItem] + + def initialize: (client: WhopSDK::Client) -> void + end + end + end +end diff --git a/test/whop_sdk/resource_namespaces.rb b/test/whop_sdk/resource_namespaces.rb index 658d9b96..d746d3ad 100644 --- a/test/whop_sdk/resource_namespaces.rb +++ b/test/whop_sdk/resource_namespaces.rb @@ -3,8 +3,25 @@ module WhopSDK module Test module Resources + module Accounts + end + module Affiliates end + + module Businesses + end + + module Payouts + end + + module Referrals + module Businesses + end + end + + module Workforce + end end end end diff --git a/test/whop_sdk/resources/accounts/preferences_test.rb b/test/whop_sdk/resources/accounts/preferences_test.rb new file mode 100644 index 00000000..cb18501e --- /dev/null +++ b/test/whop_sdk/resources/accounts/preferences_test.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class WhopSDK::Test::Resources::Accounts::PreferencesTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.accounts.preferences.retrieve("account_id") + + assert_pattern do + response => WhopSDK::Models::Accounts::PreferenceRetrieveResponse + end + + assert_pattern do + response => { + ads_payment_methods: WhopSDK::Models::Accounts::PreferenceRetrieveResponse::AdsPaymentMethods | nil + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @whop.accounts.preferences.update("account_id") + + assert_pattern do + response => WhopSDK::Models::Accounts::PreferenceUpdateResponse + end + + assert_pattern do + response => { + ads_payment_methods: WhopSDK::Models::Accounts::PreferenceUpdateResponse::AdsPaymentMethods | nil + } + end + end +end diff --git a/test/whop_sdk/resources/accounts_test.rb b/test/whop_sdk/resources/accounts_test.rb index 4fa77d81..5c164ee6 100644 --- a/test/whop_sdk/resources/accounts_test.rb +++ b/test/whop_sdk/resources/accounts_test.rb @@ -15,8 +15,11 @@ def test_create assert_pattern do response => { id: String, + balances: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::Balance]), banner_image_url: String | nil, + business_address: WhopSDK::Internal::Type::Unknown | nil, business_type: String | nil, + capabilities: WhopSDK::Account::Capabilities | nil, country: String | nil, created_at: String, description: String | nil, @@ -33,18 +36,27 @@ def test_create other_business_description: String | nil, other_industry_description: String | nil, parent_account_id: String | nil, + product_tax_code: WhopSDK::Internal::Type::Unknown | nil, + recommended_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RecommendedAction]) | nil, require_2fa: WhopSDK::Internal::Type::Boolean, + required_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RequiredAction]) | nil, 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]), + status: String | nil, store_page_config: WhopSDK::Internal::Type::Unknown, target_audience: String | nil, + tax_identifiers: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + tax_remitted_by: String | nil, title: String, + total_earned_usd: Float | nil, + total_usd: String | nil, use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, - wallet: WhopSDK::AccountWallet | nil + verification: WhopSDK::Internal::Type::Unknown, + wallet: WhopSDK::Account::Wallet | nil } end end @@ -61,8 +73,11 @@ def test_retrieve assert_pattern do response => { id: String, + balances: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::Balance]), banner_image_url: String | nil, + business_address: WhopSDK::Internal::Type::Unknown | nil, business_type: String | nil, + capabilities: WhopSDK::Account::Capabilities | nil, country: String | nil, created_at: String, description: String | nil, @@ -79,18 +94,27 @@ def test_retrieve other_business_description: String | nil, other_industry_description: String | nil, parent_account_id: String | nil, + product_tax_code: WhopSDK::Internal::Type::Unknown | nil, + recommended_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RecommendedAction]) | nil, require_2fa: WhopSDK::Internal::Type::Boolean, + required_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RequiredAction]) | nil, 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]), + status: String | nil, store_page_config: WhopSDK::Internal::Type::Unknown, target_audience: String | nil, + tax_identifiers: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + tax_remitted_by: String | nil, title: String, + total_earned_usd: Float | nil, + total_usd: String | nil, use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, - wallet: WhopSDK::AccountWallet | nil + verification: WhopSDK::Internal::Type::Unknown, + wallet: WhopSDK::Account::Wallet | nil } end end @@ -107,8 +131,11 @@ def test_update assert_pattern do response => { id: String, + balances: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::Balance]), banner_image_url: String | nil, + business_address: WhopSDK::Internal::Type::Unknown | nil, business_type: String | nil, + capabilities: WhopSDK::Account::Capabilities | nil, country: String | nil, created_at: String, description: String | nil, @@ -125,18 +152,27 @@ def test_update other_business_description: String | nil, other_industry_description: String | nil, parent_account_id: String | nil, + product_tax_code: WhopSDK::Internal::Type::Unknown | nil, + recommended_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RecommendedAction]) | nil, require_2fa: WhopSDK::Internal::Type::Boolean, + required_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RequiredAction]) | nil, 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]), + status: String | nil, store_page_config: WhopSDK::Internal::Type::Unknown, target_audience: String | nil, + tax_identifiers: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + tax_remitted_by: String | nil, title: String, + total_earned_usd: Float | nil, + total_usd: String | nil, use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, - wallet: WhopSDK::AccountWallet | nil + verification: WhopSDK::Internal::Type::Unknown, + wallet: WhopSDK::Account::Wallet | nil } end end @@ -147,13 +183,61 @@ def test_list response = @whop.accounts.list assert_pattern do - response => WhopSDK::Models::AccountListResponse + response => WhopSDK::Internal::CursorPage end + row = response.to_enum.first + return if row.nil? + assert_pattern do - response => { - accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account]), - pagination: WhopSDK::Models::AccountListResponse::Pagination + row => WhopSDK::Account + end + + assert_pattern do + row => { + id: String, + balances: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::Balance]), + banner_image_url: String | nil, + business_address: WhopSDK::Internal::Type::Unknown | nil, + business_type: String | nil, + capabilities: WhopSDK::Account::Capabilities | 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, + product_tax_code: WhopSDK::Internal::Type::Unknown | nil, + recommended_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RecommendedAction]) | nil, + require_2fa: WhopSDK::Internal::Type::Boolean, + required_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RequiredAction]) | nil, + 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]), + status: String | nil, + store_page_config: WhopSDK::Internal::Type::Unknown, + target_audience: String | nil, + tax_identifiers: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + tax_remitted_by: String | nil, + title: String, + total_earned_usd: Float | nil, + total_usd: String | nil, + use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, + verification: WhopSDK::Internal::Type::Unknown, + wallet: WhopSDK::Account::Wallet | nil } end end @@ -170,8 +254,11 @@ def test_me assert_pattern do response => { id: String, + balances: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::Balance]), banner_image_url: String | nil, + business_address: WhopSDK::Internal::Type::Unknown | nil, business_type: String | nil, + capabilities: WhopSDK::Account::Capabilities | nil, country: String | nil, created_at: String, description: String | nil, @@ -188,18 +275,43 @@ def test_me other_business_description: String | nil, other_industry_description: String | nil, parent_account_id: String | nil, + product_tax_code: WhopSDK::Internal::Type::Unknown | nil, + recommended_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RecommendedAction]) | nil, require_2fa: WhopSDK::Internal::Type::Boolean, + required_actions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Account::RequiredAction]) | nil, 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]), + status: String | nil, store_page_config: WhopSDK::Internal::Type::Unknown, target_audience: String | nil, + tax_identifiers: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + tax_remitted_by: String | nil, title: String, + total_earned_usd: Float | nil, + total_usd: String | nil, use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, - wallet: WhopSDK::AccountWallet | nil + verification: WhopSDK::Internal::Type::Unknown, + wallet: WhopSDK::Account::Wallet | nil + } + end + end + + def test_recommend_actions + skip("Mock server tests are disabled") + + response = @whop.accounts.recommend_actions("account_id") + + assert_pattern do + response => WhopSDK::Models::AccountRecommendActionsResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AccountRecommendActionsResponse::Data]) } end end diff --git a/test/whop_sdk/resources/ad_campaigns_test.rb b/test/whop_sdk/resources/ad_campaigns_test.rb index d84a154c..5cfb76a8 100644 --- a/test/whop_sdk/resources/ad_campaigns_test.rb +++ b/test/whop_sdk/resources/ad_campaigns_test.rb @@ -3,10 +3,73 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::AdCampaignsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @whop.ad_campaigns.create(objective: :awareness, platform: :meta, title: "title") + + assert_pattern do + response => WhopSDK::AdCampaign + end + + assert_pattern do + response => { + id: String, + added_to_carts: Float, + bid_type: WhopSDK::AdCampaign::BidType | nil, + budget_amount: Float | nil, + budget_optimization: WhopSDK::AdCampaign::BudgetOptimization | nil, + budget_type: WhopSDK::AdCampaign::BudgetType | nil, + click_through_rate: Float, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, + cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdCampaign::DeliveryStatus, + frequency: Float | nil, + impressions: Float, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), + leads: Float, + objective: WhopSDK::AdCampaign::Objective | nil, + optimization_goal: String | nil, + platform: WhopSDK::AdCampaign::Platform, + purchase_value: Float, + purchases: Float, + reach: Float, + result_event: WhopSDK::AdCampaign::ResultEvent | nil, + result_event_name: String | nil, + return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), + spend: Float, + spend_currency: String | nil, + status: WhopSDK::AdCampaign::Status, + submitted_applications: Float, + title: String, + unique_click_through_rate: Float | nil, + unique_clicks: Float, + updated_at: String, + viewed_contents: Float + } + end + end + def test_retrieve skip("Mock server tests are disabled") - response = @whop.ad_campaigns.retrieve("adcamp_xxxxxxxxxxx") + response = @whop.ad_campaigns.retrieve("id") assert_pattern do response => WhopSDK::AdCampaign @@ -15,32 +78,53 @@ def test_retrieve assert_pattern do response => { id: String, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + bid_type: WhopSDK::AdCampaign::BidType | nil, + budget_amount: Float | nil, + budget_optimization: WhopSDK::AdCampaign::BudgetOptimization | nil, + budget_type: WhopSDK::AdCampaign::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, - impressions: Integer, + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + leads: Float, + objective: WhopSDK::AdCampaign::Objective | nil, + optimization_goal: String | nil, + platform: WhopSDK::AdCampaign::Platform, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::AdCampaign::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdCampaignStatus, + spend_currency: String | nil, + status: WhopSDK::AdCampaign::Status, + submitted_applications: Float, title: String, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end @@ -48,7 +132,7 @@ def test_retrieve def test_update skip("Mock server tests are disabled") - response = @whop.ad_campaigns.update("adcamp_xxxxxxxxxxx") + response = @whop.ad_campaigns.update("id") assert_pattern do response => WhopSDK::AdCampaign @@ -57,32 +141,53 @@ def test_update assert_pattern do response => { id: String, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + bid_type: WhopSDK::AdCampaign::BidType | nil, + budget_amount: Float | nil, + budget_optimization: WhopSDK::AdCampaign::BudgetOptimization | nil, + budget_type: WhopSDK::AdCampaign::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, - impressions: Integer, + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + leads: Float, + objective: WhopSDK::AdCampaign::Objective | nil, + optimization_goal: String | nil, + platform: WhopSDK::AdCampaign::Platform, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::AdCampaign::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdCampaignStatus, + spend_currency: String | nil, + status: WhopSDK::AdCampaign::Status, + submitted_applications: Float, title: String, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end @@ -100,46 +205,77 @@ def test_list return if row.nil? assert_pattern do - row => WhopSDK::Models::AdCampaignListResponse + row => WhopSDK::AdCampaign end assert_pattern do row => { id: String, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + bid_type: WhopSDK::AdCampaign::BidType | nil, + budget_amount: Float | nil, + budget_optimization: WhopSDK::AdCampaign::BudgetOptimization | nil, + budget_type: WhopSDK::AdCampaign::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, - impressions: Integer, - issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdCampaignListResponse::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + impressions: Float, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), + leads: Float, + objective: WhopSDK::AdCampaign::Objective | nil, + optimization_goal: String | nil, + platform: WhopSDK::AdCampaign::Platform, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::AdCampaign::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdCampaignStatus, + spend_currency: String | nil, + status: WhopSDK::AdCampaign::Status, + submitted_applications: Float, title: String, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end + def test_delete + skip("Mock server tests are disabled") + + response = @whop.ad_campaigns.delete("id") + + assert_pattern do + response => WhopSDK::Internal::Type::Boolean + end + end + def test_pause skip("Mock server tests are disabled") - response = @whop.ad_campaigns.pause("adcamp_xxxxxxxxxxx") + response = @whop.ad_campaigns.pause("id") assert_pattern do response => WhopSDK::AdCampaign @@ -148,32 +284,53 @@ def test_pause assert_pattern do response => { id: String, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + bid_type: WhopSDK::AdCampaign::BidType | nil, + budget_amount: Float | nil, + budget_optimization: WhopSDK::AdCampaign::BudgetOptimization | nil, + budget_type: WhopSDK::AdCampaign::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, - impressions: Integer, + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + leads: Float, + objective: WhopSDK::AdCampaign::Objective | nil, + optimization_goal: String | nil, + platform: WhopSDK::AdCampaign::Platform, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::AdCampaign::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdCampaignStatus, + spend_currency: String | nil, + status: WhopSDK::AdCampaign::Status, + submitted_applications: Float, title: String, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end @@ -181,7 +338,7 @@ def test_pause def test_unpause skip("Mock server tests are disabled") - response = @whop.ad_campaigns.unpause("adcamp_xxxxxxxxxxx") + response = @whop.ad_campaigns.unpause("id") assert_pattern do response => WhopSDK::AdCampaign @@ -190,32 +347,53 @@ def test_unpause assert_pattern do response => { id: String, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + bid_type: WhopSDK::AdCampaign::BidType | nil, + budget_amount: Float | nil, + budget_optimization: WhopSDK::AdCampaign::BudgetOptimization | nil, + budget_type: WhopSDK::AdCampaign::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, - impressions: Integer, + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + leads: Float, + objective: WhopSDK::AdCampaign::Objective | nil, + optimization_goal: String | nil, + platform: WhopSDK::AdCampaign::Platform, purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::AdCampaign::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdCampaignStatus, + spend_currency: String | nil, + status: WhopSDK::AdCampaign::Status, + submitted_applications: Float, title: String, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end diff --git a/test/whop_sdk/resources/ad_groups_test.rb b/test/whop_sdk/resources/ad_groups_test.rb index c5d483e1..297039dc 100644 --- a/test/whop_sdk/resources/ad_groups_test.rb +++ b/test/whop_sdk/resources/ad_groups_test.rb @@ -3,10 +3,85 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::AdGroupsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @whop.ad_groups.create(ad_campaign_id: "ad_campaign_id") + + assert_pattern do + response => WhopSDK::AdGroup + end + + assert_pattern do + response => { + id: String, + ad_campaign: WhopSDK::AdGroup::AdCampaign, + added_to_carts: Float, + audiences: WhopSDK::Internal::Type::Unknown, + bid_type: WhopSDK::AdGroup::BidType | nil, + budget_amount: Float | nil, + budget_type: WhopSDK::AdGroup::BudgetType | nil, + click_through_rate: Float, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::AdGroup::ConversionEvent | nil, + conversion_location: WhopSDK::AdGroup::ConversionLocation | nil, + cost_per_added_to_cart: Float | nil, + cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdGroup::DeliveryStatus, + demographics: WhopSDK::Internal::Type::Unknown, + desired_cost_per_result: Float | nil, + devices: WhopSDK::Internal::Type::Unknown, + dynamic_creative: WhopSDK::Internal::Type::Boolean, + ends_at: String | nil, + frequency: Float | nil, + frequency_cap: WhopSDK::Internal::Type::Unknown | nil, + impressions: Float, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), + languages: ^(WhopSDK::Internal::Type::ArrayOf[String]), + leads: Float, + message_apps: ^(WhopSDK::Internal::Type::ArrayOf[String]), + minimum_daily_spend: Float | nil, + optimization_goal: String | nil, + placements: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + purchase_value: Float, + purchases: Float, + reach: Float, + regions: WhopSDK::Internal::Type::Unknown, + result_event: WhopSDK::AdGroup::ResultEvent | nil, + result_event_name: String | nil, + return_on_ad_spend: Float, + schedules: Float, + spend: Float, + spend_currency: String | nil, + starts_at: String | nil, + status: WhopSDK::AdGroup::Status, + submitted_applications: Float, + title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Float, + updated_at: String, + viewed_contents: Float + } + end + end + def test_retrieve skip("Mock server tests are disabled") - response = @whop.ad_groups.retrieve("adgrp_xxxxxxxxxxxx") + response = @whop.ad_groups.retrieve("id") assert_pattern do response => WhopSDK::AdGroup @@ -16,32 +91,64 @@ def test_retrieve response => { id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + audiences: WhopSDK::Internal::Type::Unknown, + bid_type: WhopSDK::AdGroup::BidType | nil, + budget_amount: Float | nil, + budget_type: WhopSDK::AdGroup::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::AdGroup::ConversionEvent | nil, + conversion_location: WhopSDK::AdGroup::ConversionLocation | nil, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdGroup::DeliveryStatus, + demographics: WhopSDK::Internal::Type::Unknown, + desired_cost_per_result: Float | nil, + devices: WhopSDK::Internal::Type::Unknown, + dynamic_creative: WhopSDK::Internal::Type::Boolean, + ends_at: String | nil, frequency: Float | nil, - impressions: Integer, + frequency_cap: WhopSDK::Internal::Type::Unknown | nil, + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + languages: ^(WhopSDK::Internal::Type::ArrayOf[String]), + leads: Float, + message_apps: ^(WhopSDK::Internal::Type::ArrayOf[String]), + minimum_daily_spend: Float | nil, + optimization_goal: String | nil, + placements: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: WhopSDK::Internal::Type::Unknown, + result_event: WhopSDK::AdGroup::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdGroupStatus, + spend_currency: String | nil, + starts_at: String | nil, + status: WhopSDK::AdGroup::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end @@ -49,7 +156,7 @@ def test_retrieve def test_update skip("Mock server tests are disabled") - response = @whop.ad_groups.update("adgrp_xxxxxxxxxxxx") + response = @whop.ad_groups.update("id") assert_pattern do response => WhopSDK::AdGroup @@ -59,32 +166,64 @@ def test_update response => { id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + audiences: WhopSDK::Internal::Type::Unknown, + bid_type: WhopSDK::AdGroup::BidType | nil, + budget_amount: Float | nil, + budget_type: WhopSDK::AdGroup::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::AdGroup::ConversionEvent | nil, + conversion_location: WhopSDK::AdGroup::ConversionLocation | nil, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdGroup::DeliveryStatus, + demographics: WhopSDK::Internal::Type::Unknown, + desired_cost_per_result: Float | nil, + devices: WhopSDK::Internal::Type::Unknown, + dynamic_creative: WhopSDK::Internal::Type::Boolean, + ends_at: String | nil, frequency: Float | nil, - impressions: Integer, + frequency_cap: WhopSDK::Internal::Type::Unknown | nil, + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + languages: ^(WhopSDK::Internal::Type::ArrayOf[String]), + leads: Float, + message_apps: ^(WhopSDK::Internal::Type::ArrayOf[String]), + minimum_daily_spend: Float | nil, + optimization_goal: String | nil, + placements: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: WhopSDK::Internal::Type::Unknown, + result_event: WhopSDK::AdGroup::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdGroupStatus, + spend_currency: String | nil, + starts_at: String | nil, + status: WhopSDK::AdGroup::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end @@ -102,39 +241,71 @@ def test_list return if row.nil? assert_pattern do - row => WhopSDK::Models::AdGroupListResponse + row => WhopSDK::AdGroup end assert_pattern do row => { id: String, - ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + ad_campaign: WhopSDK::AdGroup::AdCampaign, + added_to_carts: Float, + audiences: WhopSDK::Internal::Type::Unknown, + bid_type: WhopSDK::AdGroup::BidType | nil, + budget_amount: Float | nil, + budget_type: WhopSDK::AdGroup::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::AdGroup::ConversionEvent | nil, + conversion_location: WhopSDK::AdGroup::ConversionLocation | nil, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdGroup::DeliveryStatus, + demographics: WhopSDK::Internal::Type::Unknown, + desired_cost_per_result: Float | nil, + devices: WhopSDK::Internal::Type::Unknown, + dynamic_creative: WhopSDK::Internal::Type::Boolean, + ends_at: String | nil, frequency: Float | nil, - impressions: Integer, - issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdGroupListResponse::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + frequency_cap: WhopSDK::Internal::Type::Unknown | nil, + impressions: Float, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), + languages: ^(WhopSDK::Internal::Type::ArrayOf[String]), + leads: Float, + message_apps: ^(WhopSDK::Internal::Type::ArrayOf[String]), + minimum_daily_spend: Float | nil, + optimization_goal: String | nil, + placements: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: WhopSDK::Internal::Type::Unknown, + result_event: WhopSDK::AdGroup::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdGroupStatus, + spend_currency: String | nil, + starts_at: String | nil, + status: WhopSDK::AdGroup::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end @@ -142,7 +313,7 @@ def test_list def test_delete skip("Mock server tests are disabled") - response = @whop.ad_groups.delete("adgrp_xxxxxxxxxxxx") + response = @whop.ad_groups.delete("id") assert_pattern do response => WhopSDK::Internal::Type::Boolean @@ -152,7 +323,7 @@ def test_delete def test_pause skip("Mock server tests are disabled") - response = @whop.ad_groups.pause("adgrp_xxxxxxxxxxxx") + response = @whop.ad_groups.pause("id") assert_pattern do response => WhopSDK::AdGroup @@ -162,32 +333,64 @@ def test_pause response => { id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + audiences: WhopSDK::Internal::Type::Unknown, + bid_type: WhopSDK::AdGroup::BidType | nil, + budget_amount: Float | nil, + budget_type: WhopSDK::AdGroup::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::AdGroup::ConversionEvent | nil, + conversion_location: WhopSDK::AdGroup::ConversionLocation | nil, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdGroup::DeliveryStatus, + demographics: WhopSDK::Internal::Type::Unknown, + desired_cost_per_result: Float | nil, + devices: WhopSDK::Internal::Type::Unknown, + dynamic_creative: WhopSDK::Internal::Type::Boolean, + ends_at: String | nil, frequency: Float | nil, - impressions: Integer, + frequency_cap: WhopSDK::Internal::Type::Unknown | nil, + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + languages: ^(WhopSDK::Internal::Type::ArrayOf[String]), + leads: Float, + message_apps: ^(WhopSDK::Internal::Type::ArrayOf[String]), + minimum_daily_spend: Float | nil, + optimization_goal: String | nil, + placements: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: WhopSDK::Internal::Type::Unknown, + result_event: WhopSDK::AdGroup::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdGroupStatus, + spend_currency: String | nil, + starts_at: String | nil, + status: WhopSDK::AdGroup::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end @@ -195,7 +398,7 @@ def test_pause def test_unpause skip("Mock server tests are disabled") - response = @whop.ad_groups.unpause("adgrp_xxxxxxxxxxxx") + response = @whop.ad_groups.unpause("id") assert_pattern do response => WhopSDK::AdGroup @@ -205,32 +408,64 @@ def test_unpause response => { id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign, - budget: Float | nil, - budget_type: WhopSDK::AdBudgetType | nil, + added_to_carts: Float, + audiences: WhopSDK::Internal::Type::Unknown, + bid_type: WhopSDK::AdGroup::BidType | nil, + budget_amount: Float | nil, + budget_type: WhopSDK::AdGroup::BudgetType | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + conversion_event: WhopSDK::AdGroup::ConversionEvent | nil, + conversion_location: WhopSDK::AdGroup::ConversionLocation | nil, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + custom_conversions: Float, + delivery_status: WhopSDK::AdGroup::DeliveryStatus, + demographics: WhopSDK::Internal::Type::Unknown, + desired_cost_per_result: Float | nil, + devices: WhopSDK::Internal::Type::Unknown, + dynamic_creative: WhopSDK::Internal::Type::Boolean, + ends_at: String | nil, frequency: Float | nil, - impressions: Integer, + frequency_cap: WhopSDK::Internal::Type::Unknown | nil, + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + languages: ^(WhopSDK::Internal::Type::ArrayOf[String]), + leads: Float, + message_apps: ^(WhopSDK::Internal::Type::ArrayOf[String]), + minimum_daily_spend: Float | nil, + optimization_goal: String | nil, + placements: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + regions: WhopSDK::Internal::Type::Unknown, + result_event: WhopSDK::AdGroup::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::AdGroupStatus, + spend_currency: String | nil, + starts_at: String | nil, + status: WhopSDK::AdGroup::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + viewed_contents: Float } end end diff --git a/test/whop_sdk/resources/ads_test.rb b/test/whop_sdk/resources/ads_test.rb index 3db3c1d9..32a9c59a 100644 --- a/test/whop_sdk/resources/ads_test.rb +++ b/test/whop_sdk/resources/ads_test.rb @@ -3,10 +3,154 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::AdsTest < WhopSDK::Test::ResourceTest + def test_create + skip("Mock server tests are disabled") + + response = @whop.ads.create + + assert_pattern do + response => WhopSDK::Ad + end + + assert_pattern do + response => { + id: String, + ad_campaign: WhopSDK::Ad::AdCampaign, + ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Ad::CallToAction | nil, + click_through_rate: Float, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, + cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), + custom_conversions: Float, + delivery_status: WhopSDK::Ad::DeliveryStatus, + descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), + frequency: Float | nil, + headlines: ^(WhopSDK::Internal::Type::ArrayOf[String]), + impressions: Float, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), + lead_form: WhopSDK::Internal::Type::Unknown | nil, + lead_form_id: String | nil, + leads: Float, + messaging_config: WhopSDK::Internal::Type::Unknown | nil, + multi_advertiser_ads: WhopSDK::Internal::Type::Boolean, + post_id: String | nil, + post_source: WhopSDK::Ad::PostSource | nil, + post_thumbnail_url: String | nil, + primary_texts: ^(WhopSDK::Internal::Type::ArrayOf[String]), + purchase_value: Float, + purchases: Float, + reach: Float, + result_event: WhopSDK::Ad::ResultEvent | nil, + result_event_name: String | nil, + return_on_ad_spend: Float, + schedules: Float, + social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + spend: Float, + spend_currency: String | nil, + status: WhopSDK::Ad::Status, + submitted_applications: Float, + title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Float, + updated_at: String, + url: String | nil, + url_parameters: WhopSDK::Internal::Type::Unknown, + viewed_contents: Float + } + end + end + def test_retrieve skip("Mock server tests are disabled") - response = @whop.ads.retrieve("ad_xxxxxxxxxxxxxxx") + response = @whop.ads.retrieve("id") + + assert_pattern do + response => WhopSDK::Ad + end + + assert_pattern do + response => { + id: String, + ad_campaign: WhopSDK::Ad::AdCampaign, + ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Ad::CallToAction | nil, + click_through_rate: Float, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, + cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), + custom_conversions: Float, + delivery_status: WhopSDK::Ad::DeliveryStatus, + descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), + frequency: Float | nil, + headlines: ^(WhopSDK::Internal::Type::ArrayOf[String]), + impressions: Float, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), + lead_form: WhopSDK::Internal::Type::Unknown | nil, + lead_form_id: String | nil, + leads: Float, + messaging_config: WhopSDK::Internal::Type::Unknown | nil, + multi_advertiser_ads: WhopSDK::Internal::Type::Boolean, + post_id: String | nil, + post_source: WhopSDK::Ad::PostSource | nil, + post_thumbnail_url: String | nil, + primary_texts: ^(WhopSDK::Internal::Type::ArrayOf[String]), + purchase_value: Float, + purchases: Float, + reach: Float, + result_event: WhopSDK::Ad::ResultEvent | nil, + result_event_name: String | nil, + return_on_ad_spend: Float, + schedules: Float, + social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + spend: Float, + spend_currency: String | nil, + status: WhopSDK::Ad::Status, + submitted_applications: Float, + title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Float, + updated_at: String, + url: String | nil, + url_parameters: WhopSDK::Internal::Type::Unknown, + viewed_contents: Float + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @whop.ads.update("id") assert_pattern do response => WhopSDK::Ad @@ -17,30 +161,60 @@ def test_retrieve id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Ad::CallToAction | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), + custom_conversions: Float, + delivery_status: WhopSDK::Ad::DeliveryStatus, + descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, - impressions: Integer, + headlines: ^(WhopSDK::Internal::Type::ArrayOf[String]), + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + lead_form: WhopSDK::Internal::Type::Unknown | nil, + lead_form_id: String | nil, + leads: Float, + messaging_config: WhopSDK::Internal::Type::Unknown | nil, + multi_advertiser_ads: WhopSDK::Internal::Type::Boolean, + post_id: String | nil, + post_source: WhopSDK::Ad::PostSource | nil, + post_thumbnail_url: String | nil, + primary_texts: ^(WhopSDK::Internal::Type::ArrayOf[String]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Ad::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::ExternalAdStatus, + spend_currency: String | nil, + status: WhopSDK::Ad::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: String | nil, + url_parameters: WhopSDK::Internal::Type::Unknown, + viewed_contents: Float } end end @@ -58,46 +232,86 @@ def test_list return if row.nil? assert_pattern do - row => WhopSDK::Models::AdListResponse + row => WhopSDK::Ad end assert_pattern do row => { id: String, - ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign, - ad_group: WhopSDK::Models::AdListResponse::AdGroup, + ad_campaign: WhopSDK::Ad::AdCampaign, + ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Ad::CallToAction | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), + custom_conversions: Float, + delivery_status: WhopSDK::Ad::DeliveryStatus, + descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, - impressions: Integer, - issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdListResponse::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + headlines: ^(WhopSDK::Internal::Type::ArrayOf[String]), + impressions: Float, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), + lead_form: WhopSDK::Internal::Type::Unknown | nil, + lead_form_id: String | nil, + leads: Float, + messaging_config: WhopSDK::Internal::Type::Unknown | nil, + multi_advertiser_ads: WhopSDK::Internal::Type::Boolean, + post_id: String | nil, + post_source: WhopSDK::Ad::PostSource | nil, + post_thumbnail_url: String | nil, + primary_texts: ^(WhopSDK::Internal::Type::ArrayOf[String]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Ad::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::ExternalAdStatus, + spend_currency: String | nil, + status: WhopSDK::Ad::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: String | nil, + url_parameters: WhopSDK::Internal::Type::Unknown, + viewed_contents: Float } end end + def test_delete + skip("Mock server tests are disabled") + + response = @whop.ads.delete("id") + + assert_pattern do + response => WhopSDK::Internal::Type::Boolean + end + end + def test_pause skip("Mock server tests are disabled") - response = @whop.ads.pause("ad_xxxxxxxxxxxxxxx") + response = @whop.ads.pause("id") assert_pattern do response => WhopSDK::Ad @@ -108,30 +322,60 @@ def test_pause id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Ad::CallToAction | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), + custom_conversions: Float, + delivery_status: WhopSDK::Ad::DeliveryStatus, + descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, - impressions: Integer, + headlines: ^(WhopSDK::Internal::Type::ArrayOf[String]), + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + lead_form: WhopSDK::Internal::Type::Unknown | nil, + lead_form_id: String | nil, + leads: Float, + messaging_config: WhopSDK::Internal::Type::Unknown | nil, + multi_advertiser_ads: WhopSDK::Internal::Type::Boolean, + post_id: String | nil, + post_source: WhopSDK::Ad::PostSource | nil, + post_thumbnail_url: String | nil, + primary_texts: ^(WhopSDK::Internal::Type::ArrayOf[String]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Ad::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::ExternalAdStatus, + spend_currency: String | nil, + status: WhopSDK::Ad::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: String | nil, + url_parameters: WhopSDK::Internal::Type::Unknown, + viewed_contents: Float } end end @@ -139,7 +383,7 @@ def test_pause def test_unpause skip("Mock server tests are disabled") - response = @whop.ads.unpause("ad_xxxxxxxxxxxxxxx") + response = @whop.ads.unpause("id") assert_pattern do response => WhopSDK::Ad @@ -150,30 +394,60 @@ def test_unpause id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + added_to_carts: Float, + call_to_action: WhopSDK::Ad::CallToAction | nil, click_through_rate: Float, - clicks: Integer, + clicks: Float, + completed_registrations: Float, + contacts: Float, + cost_per_added_to_cart: Float | nil, cost_per_click: Float, + cost_per_completed_registration: Float | nil, + cost_per_contact: Float | nil, cost_per_lead: Float | nil, cost_per_mille: Float, cost_per_purchase: Float | nil, cost_per_result: Float | nil, - created_at: Time, + cost_per_schedule: Float | nil, + cost_per_submitted_application: Float | nil, + cost_per_viewed_content: Float | nil, + created_at: String, + creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), + custom_conversions: Float, + delivery_status: WhopSDK::Ad::DeliveryStatus, + descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, - impressions: Integer, + headlines: ^(WhopSDK::Internal::Type::ArrayOf[String]), + impressions: Float, issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), - leads: Integer, - platform: WhopSDK::AdCampaignPlatform, + lead_form: WhopSDK::Internal::Type::Unknown | nil, + lead_form_id: String | nil, + leads: Float, + messaging_config: WhopSDK::Internal::Type::Unknown | nil, + multi_advertiser_ads: WhopSDK::Internal::Type::Boolean, + post_id: String | nil, + post_source: WhopSDK::Ad::PostSource | nil, + post_thumbnail_url: String | nil, + primary_texts: ^(WhopSDK::Internal::Type::ArrayOf[String]), purchase_value: Float, - purchases: Integer, - reach: Integer, + purchases: Float, + reach: Float, + result_event: WhopSDK::Ad::ResultEvent | nil, + result_event_name: String | nil, return_on_ad_spend: Float, + schedules: Float, + social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), spend: Float, - spend_currency: WhopSDK::Currency | nil, - status: WhopSDK::ExternalAdStatus, + spend_currency: String | nil, + status: WhopSDK::Ad::Status, + submitted_applications: Float, title: String | nil, unique_click_through_rate: Float | nil, - unique_clicks: Integer, - updated_at: Time + unique_clicks: Float, + updated_at: String, + url: String | nil, + url_parameters: WhopSDK::Internal::Type::Unknown, + viewed_contents: Float } end end diff --git a/test/whop_sdk/resources/apps_test.rb b/test/whop_sdk/resources/apps_test.rb index c3e797d0..3c1de31e 100644 --- a/test/whop_sdk/resources/apps_test.rb +++ b/test/whop_sdk/resources/apps_test.rb @@ -25,12 +25,16 @@ def test_create_required_params discover_path: String | nil, domain_id: String, experience_path: String | nil, + hosted_url: String | nil, icon: WhopSDK::App::Icon | nil, name: String, openapi_path: String | nil, origin: String | nil, + production_web_build: WhopSDK::App::ProductionWebBuild | nil, redirect_uris: ^(WhopSDK::Internal::Type::ArrayOf[String]), requested_permissions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::App::RequestedPermission]), + route: String | nil, + secrets: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, skills_path: String | nil, stats: WhopSDK::App::Stats | nil, status: WhopSDK::AppStatuses, @@ -61,12 +65,16 @@ def test_retrieve discover_path: String | nil, domain_id: String, experience_path: String | nil, + hosted_url: String | nil, icon: WhopSDK::App::Icon | nil, name: String, openapi_path: String | nil, origin: String | nil, + production_web_build: WhopSDK::App::ProductionWebBuild | nil, redirect_uris: ^(WhopSDK::Internal::Type::ArrayOf[String]), requested_permissions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::App::RequestedPermission]), + route: String | nil, + secrets: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, skills_path: String | nil, stats: WhopSDK::App::Stats | nil, status: WhopSDK::AppStatuses, @@ -97,12 +105,16 @@ def test_update discover_path: String | nil, domain_id: String, experience_path: String | nil, + hosted_url: String | nil, icon: WhopSDK::App::Icon | nil, name: String, openapi_path: String | nil, origin: String | nil, + production_web_build: WhopSDK::App::ProductionWebBuild | nil, redirect_uris: ^(WhopSDK::Internal::Type::ArrayOf[String]), requested_permissions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::App::RequestedPermission]), + route: String | nil, + secrets: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, skills_path: String | nil, stats: WhopSDK::App::Stats | nil, status: WhopSDK::AppStatuses, @@ -139,14 +151,33 @@ def test_list discover_path: String | nil, domain_id: String, experience_path: String | nil, + hosted_url: String | nil, icon: WhopSDK::Models::AppListResponse::Icon | nil, name: String, openapi_path: String | nil, origin: String | nil, + route: String | nil, skills_path: String | nil, status: WhopSDK::AppStatuses, verified: WhopSDK::Internal::Type::Boolean } end end + + def test_logs + skip("Mock server tests are disabled") + + response = @whop.apps.logs("id") + + assert_pattern do + response => WhopSDK::Models::AppLogsResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AppLogsResponse::Data]), + page_info: WhopSDK::Models::AppLogsResponse::PageInfo + } + end + end end diff --git a/test/whop_sdk/resources/audiences_test.rb b/test/whop_sdk/resources/audiences_test.rb new file mode 100644 index 00000000..0b8d6bfa --- /dev/null +++ b/test/whop_sdk/resources/audiences_test.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::AudiencesTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @whop.audiences.create(account_id: "account_id", column_mapping: {}, file_id: "file_id", name: "name") + + assert_pattern do + response => WhopSDK::Audience + end + + assert_pattern do + response => { + id: String, + created_at: Float, + error_message: String | nil, + matched_rows: Float, + name: String, + platform_audience_ids: ^(WhopSDK::Internal::Type::ArrayOf[String]), + processed_rows: Float, + progress_percent: Float, + status: WhopSDK::Audience::Status, + total_rows: Float, + updated_at: Float + } + end + end + + def test_list_required_params + skip("Mock server tests are disabled") + + response = @whop.audiences.list(account_id: "account_id") + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Audience + end + + assert_pattern do + row => { + id: String, + created_at: Float, + error_message: String | nil, + matched_rows: Float, + name: String, + platform_audience_ids: ^(WhopSDK::Internal::Type::ArrayOf[String]), + processed_rows: Float, + progress_percent: Float, + status: WhopSDK::Audience::Status, + total_rows: Float, + updated_at: Float + } + end + end + + def test_delete + skip("Mock server tests are disabled") + + response = @whop.audiences.delete("audience_id") + + assert_pattern do + response => WhopSDK::Models::AudienceDeleteResponse + end + + assert_pattern do + response => { + success: WhopSDK::Internal::Type::Boolean + } + end + end +end diff --git a/test/whop_sdk/resources/cards_test.rb b/test/whop_sdk/resources/cards_test.rb new file mode 100644 index 00000000..108edc1e --- /dev/null +++ b/test/whop_sdk/resources/cards_test.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::CardsTest < WhopSDK::Test::ResourceTest + def test_create + skip("Mock server tests are disabled") + + response = @whop.cards.create + + assert_pattern do + response => WhopSDK::Models::CardCreateResponse + end + + assert_pattern do + response => { + id: String, + billing: WhopSDK::Models::CardCreateResponse::Billing | nil, + canceled_at: Time | nil, + created_at: Time | nil, + expiration_month: String | nil, + expiration_year: String | nil, + last4: String | nil, + limit: WhopSDK::Models::CardCreateResponse::Limit | nil, + name: String | nil, + object: WhopSDK::Models::CardCreateResponse::Object, + spent_last_month: Integer | nil, + status: WhopSDK::Models::CardCreateResponse::Status | nil, + type: WhopSDK::Models::CardCreateResponse::Type | nil, + user_id: String | nil, + secrets: WhopSDK::Models::CardCreateResponse::Secrets | nil + } + end + end + + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.cards.retrieve("card_id") + + assert_pattern do + response => WhopSDK::Models::CardRetrieveResponse + end + + assert_pattern do + response => { + id: String, + billing: WhopSDK::Models::CardRetrieveResponse::Billing | nil, + canceled_at: Time | nil, + created_at: Time | nil, + expiration_month: String | nil, + expiration_year: String | nil, + last4: String | nil, + limit: WhopSDK::Models::CardRetrieveResponse::Limit | nil, + name: String | nil, + object: WhopSDK::Models::CardRetrieveResponse::Object, + spent_last_month: Integer | nil, + status: WhopSDK::Models::CardRetrieveResponse::Status | nil, + type: WhopSDK::Models::CardRetrieveResponse::Type | nil, + user_id: String | nil, + secrets: WhopSDK::Models::CardRetrieveResponse::Secrets | nil + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @whop.cards.update("card_id") + + assert_pattern do + response => WhopSDK::Models::CardUpdateResponse + end + + assert_pattern do + response => { + id: String, + billing: WhopSDK::Models::CardUpdateResponse::Billing | nil, + canceled_at: Time | nil, + created_at: Time | nil, + expiration_month: String | nil, + expiration_year: String | nil, + last4: String | nil, + limit: WhopSDK::Models::CardUpdateResponse::Limit | nil, + name: String | nil, + object: WhopSDK::Models::CardUpdateResponse::Object, + spent_last_month: Integer | nil, + status: WhopSDK::Models::CardUpdateResponse::Status | nil, + type: WhopSDK::Models::CardUpdateResponse::Type | nil, + user_id: String | nil, + secrets: WhopSDK::Models::CardUpdateResponse::Secrets | nil + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.cards.list + + assert_pattern do + response => WhopSDK::Models::CardListResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::CardListResponse::Data]) + } + end + end +end diff --git a/test/whop_sdk/resources/checkout_configurations_test.rb b/test/whop_sdk/resources/checkout_configurations_test.rb index 5dee0d4b..d1517991 100644 --- a/test/whop_sdk/resources/checkout_configurations_test.rb +++ b/test/whop_sdk/resources/checkout_configurations_test.rb @@ -3,29 +3,30 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::CheckoutConfigurationsTest < WhopSDK::Test::ResourceTest - def test_create_required_params + def test_create skip("Mock server tests are disabled") - response = - @whop.checkout_configurations.create(body: {plan: {company_id: "biz_xxxxxxxxxxxxxx", currency: :usd}}) + response = @whop.checkout_configurations.create assert_pattern do - response => WhopSDK::CheckoutConfiguration + response => WhopSDK::Models::CheckoutConfigurationCreateResponse end assert_pattern do response => { id: String, - affiliate_code: String | nil, - allow_promo_codes: WhopSDK::Internal::Type::Boolean, company_id: String, - currency: WhopSDK::Currency | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - mode: WhopSDK::CheckoutModes, - payment_method_configuration: WhopSDK::CheckoutConfiguration::PaymentMethodConfiguration | nil, - plan: WhopSDK::CheckoutConfiguration::Plan | nil, - purchase_url: String, - redirect_url: String | nil + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationCreateResponse::Mode, + updated_at: String, + affiliate_code: String | nil, + currency: String | nil, + metadata: WhopSDK::Internal::Type::Unknown | nil, + payment_method_configuration: WhopSDK::Models::CheckoutConfigurationCreateResponse::PaymentMethodConfiguration | nil, + plan: WhopSDK::Models::CheckoutConfigurationCreateResponse::Plan | nil, + purchase_url: String | nil, + redirect_url: String | nil, + three_ds_level: String | nil } end end @@ -33,25 +34,27 @@ def test_create_required_params def test_retrieve skip("Mock server tests are disabled") - response = @whop.checkout_configurations.retrieve("ch_xxxxxxxxxxxxxxx") + response = @whop.checkout_configurations.retrieve("id") assert_pattern do - response => WhopSDK::CheckoutConfiguration + response => WhopSDK::Models::CheckoutConfigurationRetrieveResponse end assert_pattern do response => { id: String, - affiliate_code: String | nil, - allow_promo_codes: WhopSDK::Internal::Type::Boolean, company_id: String, - currency: WhopSDK::Currency | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - mode: WhopSDK::CheckoutModes, - payment_method_configuration: WhopSDK::CheckoutConfiguration::PaymentMethodConfiguration | nil, - plan: WhopSDK::CheckoutConfiguration::Plan | nil, - purchase_url: String, - redirect_url: String | nil + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Mode, + updated_at: String, + affiliate_code: String | nil, + currency: String | nil, + metadata: WhopSDK::Internal::Type::Unknown | nil, + payment_method_configuration: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::PaymentMethodConfiguration | nil, + plan: WhopSDK::Models::CheckoutConfigurationRetrieveResponse::Plan | nil, + purchase_url: String | nil, + redirect_url: String | nil, + three_ds_level: String | nil } end end @@ -59,7 +62,7 @@ def test_retrieve def test_list_required_params skip("Mock server tests are disabled") - response = @whop.checkout_configurations.list(company_id: "biz_xxxxxxxxxxxxxx") + response = @whop.checkout_configurations.list(company_id: "company_id") assert_pattern do response => WhopSDK::Internal::CursorPage @@ -75,17 +78,29 @@ def test_list_required_params assert_pattern do row => { id: String, - affiliate_code: String | nil, - allow_promo_codes: WhopSDK::Internal::Type::Boolean, company_id: String, - currency: WhopSDK::Currency | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - mode: WhopSDK::CheckoutModes, + created_at: String, + mode: WhopSDK::Models::CheckoutConfigurationListResponse::Mode, + updated_at: String, + affiliate_code: String | nil, + currency: String | nil, + metadata: WhopSDK::Internal::Type::Unknown | nil, payment_method_configuration: WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration | nil, plan: WhopSDK::Models::CheckoutConfigurationListResponse::Plan | nil, - purchase_url: String, - redirect_url: String | nil + purchase_url: String | nil, + redirect_url: String | nil, + three_ds_level: String | nil } end end + + def test_delete + skip("Mock server tests are disabled") + + response = @whop.checkout_configurations.delete("id") + + assert_pattern do + response => nil + end + end end diff --git a/test/whop_sdk/resources/conversions_test.rb b/test/whop_sdk/resources/conversions_test.rb deleted file mode 100644 index 4a44da1d..00000000 --- a/test/whop_sdk/resources/conversions_test.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class WhopSDK::Test::Resources::ConversionsTest < WhopSDK::Test::ResourceTest - def test_create_required_params - skip("Mock server tests are disabled") - - response = @whop.conversions.create(company_id: "biz_xxxxxxxxxxxxxx", event_name: :lead) - - assert_pattern do - response => WhopSDK::Models::ConversionCreateResponse - end - - assert_pattern do - response => { - id: String - } - end - end -end diff --git a/test/whop_sdk/resources/deposits_test.rb b/test/whop_sdk/resources/deposits_test.rb index daeafc5c..f2129280 100644 --- a/test/whop_sdk/resources/deposits_test.rb +++ b/test/whop_sdk/resources/deposits_test.rb @@ -6,7 +6,7 @@ class WhopSDK::Test::Resources::DepositsTest < WhopSDK::Test::ResourceTest def test_create_required_params skip("Mock server tests are disabled") - response = @whop.deposits.create(amount: 0, destination: "string") + response = @whop.deposits.create(destination: "string") assert_pattern do response => WhopSDK::Models::DepositCreateResponse @@ -14,12 +14,30 @@ def test_create_required_params assert_pattern do response => { - amount: String, - deposit_address: WhopSDK::Models::DepositCreateResponse::DepositAddress, - destination: WhopSDK::Models::DepositCreateResponse::Destination, + account_id: String | nil, hosted_url: String | nil, metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), - object: WhopSDK::Models::DepositCreateResponse::Object + methods_: WhopSDK::Models::DepositCreateResponse::Methods, + object: WhopSDK::Models::DepositCreateResponse::Object, + amount: String | nil + } + end + end + + def test_list_required_params + skip("Mock server tests are disabled") + + response = @whop.deposits.list(account_id: "account_id") + + assert_pattern do + response => WhopSDK::Models::DepositListResponse + end + + assert_pattern do + response => { + account_id: String, + bank: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::DepositListResponse::Bank]), + object: WhopSDK::Models::DepositListResponse::Object } end end diff --git a/test/whop_sdk/resources/events_test.rb b/test/whop_sdk/resources/events_test.rb new file mode 100644 index 00000000..1f8ad67e --- /dev/null +++ b/test/whop_sdk/resources/events_test.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::EventsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @whop.events.create(account_id: "account_id", event_name: :lead) + + assert_pattern do + response => WhopSDK::Models::EventCreateResponse + end + + assert_pattern do + response => { + id: String + } + end + end + + def test_list_required_params + skip("Mock server tests are disabled") + + response = @whop.events.list(person_id: "person_id") + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::EventListResponse + end + + assert_pattern do + row => { + id: String, + event_id: String, + event_name: String, + event_time: Integer, + context: WhopSDK::Models::EventListResponse::Context | nil, + currency: String | nil, + custom_name: String | nil, + path: String | nil, + questions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::EventListResponse::Question]) | nil, + referrer_url: String | nil, + total_usd_amount: Float | nil, + url: String | nil, + user: WhopSDK::Models::EventListResponse::User | nil, + value: Float | nil + } + end + end +end diff --git a/test/whop_sdk/resources/media_test.rb b/test/whop_sdk/resources/media_test.rb new file mode 100644 index 00000000..ed3f60c3 --- /dev/null +++ b/test/whop_sdk/resources/media_test.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::MediaTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.media.retrieve("id") + + assert_pattern do + response => WhopSDK::MediaAsset + end + + assert_pattern do + response => { + id: String, + amount_charged: Float | nil, + completed_at: String | nil, + created_at: String, + currency: String, + error_message: String | nil, + file: WhopSDK::MediaAsset::File | nil, + generation: WhopSDK::MediaAsset::Generation, + media_type: WhopSDK::MediaAsset::MediaType, + source: WhopSDK::MediaAsset::Source, + status: WhopSDK::MediaAsset::Status + } + end + end + + def test_generate_required_params + skip("Mock server tests are disabled") + + response = @whop.media.generate(prompt: "prompt", type: :video) + + assert_pattern do + response => WhopSDK::MediaAsset + end + + assert_pattern do + response => { + id: String, + amount_charged: Float | nil, + completed_at: String | nil, + created_at: String, + currency: String, + error_message: String | nil, + file: WhopSDK::MediaAsset::File | nil, + generation: WhopSDK::MediaAsset::Generation, + media_type: WhopSDK::MediaAsset::MediaType, + source: WhopSDK::MediaAsset::Source, + status: WhopSDK::MediaAsset::Status + } + end + end +end diff --git a/test/whop_sdk/resources/payments_test.rb b/test/whop_sdk/resources/payments_test.rb index 1c235583..92e9a2c3 100644 --- a/test/whop_sdk/resources/payments_test.rb +++ b/test/whop_sdk/resources/payments_test.rb @@ -54,17 +54,22 @@ def test_create_required_params refundable: WhopSDK::Internal::Type::Boolean, refunded_amount: Float | nil, refunded_at: Time | nil, + refunds: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Refund]), resolutions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Resolution]) | nil, retryable: WhopSDK::Internal::Type::Boolean, + risk_score: Integer | nil, + risk_signals: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, settlement_amount: Float, settlement_currency: WhopSDK::Currency, settlement_exchange_rate: Float | nil, + shipping_address: WhopSDK::Payment::ShippingAddress | nil, status: WhopSDK::ReceiptStatus | nil, substatus: WhopSDK::FriendlyReceiptStatus, subtotal: Float | nil, tax_amount: Float | nil, tax_behavior: WhopSDK::ReceiptTaxBehavior | nil, tax_refunded_amount: Float | nil, + three_ds_verified: WhopSDK::Internal::Type::Boolean, total: Float | nil, updated_at: Time, usd_total: Float | nil, @@ -117,17 +122,22 @@ def test_retrieve refundable: WhopSDK::Internal::Type::Boolean, refunded_amount: Float | nil, refunded_at: Time | nil, + refunds: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Refund]), resolutions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Resolution]) | nil, retryable: WhopSDK::Internal::Type::Boolean, + risk_score: Integer | nil, + risk_signals: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, settlement_amount: Float, settlement_currency: WhopSDK::Currency, settlement_exchange_rate: Float | nil, + shipping_address: WhopSDK::Payment::ShippingAddress | nil, status: WhopSDK::ReceiptStatus | nil, substatus: WhopSDK::FriendlyReceiptStatus, subtotal: Float | nil, tax_amount: Float | nil, tax_behavior: WhopSDK::ReceiptTaxBehavior | nil, tax_refunded_amount: Float | nil, + three_ds_verified: WhopSDK::Internal::Type::Boolean, total: Float | nil, updated_at: Time, usd_total: Float | nil, @@ -186,6 +196,7 @@ def test_list refunded_at: Time | nil, retryable: WhopSDK::Internal::Type::Boolean, settlement_currency: WhopSDK::Currency, + shipping_address: WhopSDK::Models::PaymentListResponse::ShippingAddress | nil, status: WhopSDK::ReceiptStatus | nil, substatus: WhopSDK::FriendlyReceiptStatus, subtotal: Float | nil, @@ -269,17 +280,22 @@ def test_refund refundable: WhopSDK::Internal::Type::Boolean, refunded_amount: Float | nil, refunded_at: Time | nil, + refunds: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Refund]), resolutions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Resolution]) | nil, retryable: WhopSDK::Internal::Type::Boolean, + risk_score: Integer | nil, + risk_signals: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, settlement_amount: Float, settlement_currency: WhopSDK::Currency, settlement_exchange_rate: Float | nil, + shipping_address: WhopSDK::Payment::ShippingAddress | nil, status: WhopSDK::ReceiptStatus | nil, substatus: WhopSDK::FriendlyReceiptStatus, subtotal: Float | nil, tax_amount: Float | nil, tax_behavior: WhopSDK::ReceiptTaxBehavior | nil, tax_refunded_amount: Float | nil, + three_ds_verified: WhopSDK::Internal::Type::Boolean, total: Float | nil, updated_at: Time, usd_total: Float | nil, @@ -332,17 +348,22 @@ def test_retry_ refundable: WhopSDK::Internal::Type::Boolean, refunded_amount: Float | nil, refunded_at: Time | nil, + refunds: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Refund]), resolutions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Resolution]) | nil, retryable: WhopSDK::Internal::Type::Boolean, + risk_score: Integer | nil, + risk_signals: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, settlement_amount: Float, settlement_currency: WhopSDK::Currency, settlement_exchange_rate: Float | nil, + shipping_address: WhopSDK::Payment::ShippingAddress | nil, status: WhopSDK::ReceiptStatus | nil, substatus: WhopSDK::FriendlyReceiptStatus, subtotal: Float | nil, tax_amount: Float | nil, tax_behavior: WhopSDK::ReceiptTaxBehavior | nil, tax_refunded_amount: Float | nil, + three_ds_verified: WhopSDK::Internal::Type::Boolean, total: Float | nil, updated_at: Time, usd_total: Float | nil, @@ -395,17 +416,22 @@ def test_void refundable: WhopSDK::Internal::Type::Boolean, refunded_amount: Float | nil, refunded_at: Time | nil, + refunds: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Refund]), resolutions: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Resolution]) | nil, retryable: WhopSDK::Internal::Type::Boolean, + risk_score: Integer | nil, + risk_signals: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, settlement_amount: Float, settlement_currency: WhopSDK::Currency, settlement_exchange_rate: Float | nil, + shipping_address: WhopSDK::Payment::ShippingAddress | nil, status: WhopSDK::ReceiptStatus | nil, substatus: WhopSDK::FriendlyReceiptStatus, subtotal: Float | nil, tax_amount: Float | nil, tax_behavior: WhopSDK::ReceiptTaxBehavior | nil, tax_refunded_amount: Float | nil, + three_ds_verified: WhopSDK::Internal::Type::Boolean, total: Float | nil, updated_at: Time, usd_total: Float | nil, diff --git a/test/whop_sdk/resources/payout_methods_test.rb b/test/whop_sdk/resources/payout_methods_test.rb deleted file mode 100644 index 8f2cb68a..00000000 --- a/test/whop_sdk/resources/payout_methods_test.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class WhopSDK::Test::Resources::PayoutMethodsTest < WhopSDK::Test::ResourceTest - def test_retrieve - skip("Mock server tests are disabled") - - response = @whop.payout_methods.retrieve("potk_xxxxxxxxxxxxx") - - assert_pattern do - response => WhopSDK::Models::PayoutMethodRetrieveResponse - end - - assert_pattern do - response => { - id: String, - account_reference: String | nil, - company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company | nil, - created_at: Time, - currency: String, - destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination | nil, - institution_name: String | nil, - is_default: WhopSDK::Internal::Type::Boolean, - nickname: String | nil - } - end - end - - def test_list_required_params - skip("Mock server tests are disabled") - - response = @whop.payout_methods.list(company_id: "biz_xxxxxxxxxxxxxx") - - assert_pattern do - response => WhopSDK::Internal::CursorPage - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => WhopSDK::Models::PayoutMethodListResponse - end - - assert_pattern do - row => { - id: String, - account_reference: String | nil, - company: WhopSDK::Models::PayoutMethodListResponse::Company | nil, - created_at: Time, - currency: String, - destination: WhopSDK::Models::PayoutMethodListResponse::Destination | nil, - institution_name: String | nil, - is_default: WhopSDK::Internal::Type::Boolean, - nickname: String | nil - } - end - end -end diff --git a/test/whop_sdk/resources/payouts/methods_test.rb b/test/whop_sdk/resources/payouts/methods_test.rb new file mode 100644 index 00000000..7a0674ae --- /dev/null +++ b/test/whop_sdk/resources/payouts/methods_test.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class WhopSDK::Test::Resources::Payouts::MethodsTest < WhopSDK::Test::ResourceTest + def test_list + skip("Mock server tests are disabled") + + response = @whop.payouts.methods_.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::Payouts::MethodListResponse + end + + assert_pattern do + row => { + id: String, + account_reference: String | nil, + created_at: Time, + destination_currency: String, + institution_name: String | nil, + is_default: WhopSDK::Internal::Type::Boolean, + nickname: String | nil, + object: WhopSDK::Models::Payouts::MethodListResponse::Object, + payer_name: String | nil, + payout_destination: WhopSDK::Models::Payouts::MethodListResponse::PayoutDestination | nil, + quote: WhopSDK::Models::Payouts::MethodListResponse::Quote | nil, + status: WhopSDK::Models::Payouts::MethodListResponse::Status + } + end + end +end diff --git a/test/whop_sdk/resources/payouts_test.rb b/test/whop_sdk/resources/payouts_test.rb new file mode 100644 index 00000000..564f17d9 --- /dev/null +++ b/test/whop_sdk/resources/payouts_test.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::PayoutsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @whop.payouts.create(account_id: "account_id", amount: 0, payout_method_id: "payout_method_id") + + assert_pattern do + response => WhopSDK::Models::PayoutCreateResponse + end + + assert_pattern do + response => { + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: Time | nil, + fee_amount: Float, + object: WhopSDK::Models::PayoutCreateResponse::Object, + payer_name: String | nil, + payout_token: WhopSDK::Models::PayoutCreateResponse::PayoutToken | nil, + speed: WhopSDK::Models::PayoutCreateResponse::Speed, + status: WhopSDK::Models::PayoutCreateResponse::Status + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.payouts.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::PayoutListResponse + end + + assert_pattern do + row => { + id: String, + amount: Float, + created_at: Time, + currency: String, + estimated_arrival: Time | nil, + fee_amount: Float, + object: WhopSDK::Models::PayoutListResponse::Object, + payer_name: String | nil, + payout_request_id: String | nil, + payout_token: WhopSDK::Models::PayoutListResponse::PayoutToken | nil, + speed: WhopSDK::Models::PayoutListResponse::Speed, + status: WhopSDK::Models::PayoutListResponse::Status + } + end + end +end diff --git a/test/whop_sdk/resources/people_test.rb b/test/whop_sdk/resources/people_test.rb new file mode 100644 index 00000000..995de2ec --- /dev/null +++ b/test/whop_sdk/resources/people_test.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::PeopleTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.people.retrieve("person_id") + + assert_pattern do + response => WhopSDK::Models::PersonRetrieveResponse + end + + assert_pattern do + response => { + data: WhopSDK::Models::PersonRetrieveResponse::Data + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.people.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::PersonListResponse + end + + assert_pattern do + row => { + id: String, + account_id: String, + first_seen_at: Integer, + last_seen_at: Integer, + person_id: String, + purchase_count: Integer, + ad_sets: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonListResponse::AdSet]) | nil, + ads: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonListResponse::Ad]) | nil, + aov: Float | nil, + campaigns: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PersonListResponse::Campaign]) | nil, + email: String | nil, + has_failed_payment: WhopSDK::Internal::Type::Boolean | nil, + ltv: Float | nil, + name: String | nil, + phone: String | nil + } + end + end +end diff --git a/test/whop_sdk/resources/plans_test.rb b/test/whop_sdk/resources/plans_test.rb index 09207eeb..208f9b39 100644 --- a/test/whop_sdk/resources/plans_test.rb +++ b/test/whop_sdk/resources/plans_test.rb @@ -3,10 +3,10 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::PlansTest < WhopSDK::Test::ResourceTest - def test_create_required_params + def test_create skip("Mock server tests are disabled") - response = @whop.plans.create(product_id: "product_id") + response = @whop.plans.create assert_pattern do response => WhopSDK::Plan @@ -15,13 +15,13 @@ def test_create_required_params assert_pattern do response => { id: String, + account: WhopSDK::Internal::Type::Unknown | nil, adaptive_pricing_enabled: WhopSDK::Internal::Type::Boolean, billing_period: Float | nil, collect_tax: WhopSDK::Internal::Type::Boolean, - company: WhopSDK::Internal::Type::Unknown | nil, created_at: String, currency: WhopSDK::Plan::Currency, - custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField]), description: String | nil, expiration_days: Float | nil, initial_price: Float, @@ -37,7 +37,7 @@ def test_create_required_params renewal_price: Float, split_pay_required_payments: Float | nil, stock: Float | nil, - tax_type: String, + tax_type: WhopSDK::Plan::TaxType, three_ds_level: WhopSDK::Plan::ThreeDSLevel | nil, title: String | nil, trial_period_days: Float | nil, @@ -60,13 +60,13 @@ def test_retrieve assert_pattern do response => { id: String, + account: WhopSDK::Internal::Type::Unknown | nil, adaptive_pricing_enabled: WhopSDK::Internal::Type::Boolean, billing_period: Float | nil, collect_tax: WhopSDK::Internal::Type::Boolean, - company: WhopSDK::Internal::Type::Unknown | nil, created_at: String, currency: WhopSDK::Plan::Currency, - custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField]), description: String | nil, expiration_days: Float | nil, initial_price: Float, @@ -82,7 +82,7 @@ def test_retrieve renewal_price: Float, split_pay_required_payments: Float | nil, stock: Float | nil, - tax_type: String, + tax_type: WhopSDK::Plan::TaxType, three_ds_level: WhopSDK::Plan::ThreeDSLevel | nil, title: String | nil, trial_period_days: Float | nil, @@ -105,13 +105,13 @@ def test_update assert_pattern do response => { id: String, + account: WhopSDK::Internal::Type::Unknown | nil, adaptive_pricing_enabled: WhopSDK::Internal::Type::Boolean, billing_period: Float | nil, collect_tax: WhopSDK::Internal::Type::Boolean, - company: WhopSDK::Internal::Type::Unknown | nil, created_at: String, currency: WhopSDK::Plan::Currency, - custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), + custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField]), description: String | nil, expiration_days: Float | nil, initial_price: Float, @@ -127,7 +127,7 @@ def test_update renewal_price: Float, split_pay_required_payments: Float | nil, stock: Float | nil, - tax_type: String, + tax_type: WhopSDK::Plan::TaxType, three_ds_level: WhopSDK::Plan::ThreeDSLevel | nil, title: String | nil, trial_period_days: Float | nil, @@ -141,7 +141,7 @@ def test_update def test_list_required_params skip("Mock server tests are disabled") - response = @whop.plans.list(company_id: "company_id") + response = @whop.plans.list(account_id: "account_id") assert_pattern do response => WhopSDK::Internal::CursorPage @@ -157,9 +157,9 @@ def test_list_required_params assert_pattern do row => { id: String, + account: WhopSDK::Internal::Type::Unknown | nil, adaptive_pricing_enabled: WhopSDK::Internal::Type::Boolean, billing_period: Float | nil, - company: WhopSDK::Internal::Type::Unknown | nil, created_at: String, currency: String, description: String | nil, @@ -196,4 +196,25 @@ def test_delete response => WhopSDK::Internal::Type::Boolean end end + + def test_calculate_tax + skip("Mock server tests are disabled") + + response = @whop.plans.calculate_tax("id") + + assert_pattern do + response => WhopSDK::Models::PlanCalculateTaxResponse + end + + assert_pattern do + response => { + currency: String, + status: WhopSDK::Models::PlanCalculateTaxResponse::Status, + subtotal: Integer, + tax_amount: Integer, + tax_behavior: WhopSDK::Models::PlanCalculateTaxResponse::TaxBehavior, + total: Integer + } + end + end end diff --git a/test/whop_sdk/resources/products_test.rb b/test/whop_sdk/resources/products_test.rb index bf30d56a..c5c2a153 100644 --- a/test/whop_sdk/resources/products_test.rb +++ b/test/whop_sdk/resources/products_test.rb @@ -6,7 +6,7 @@ class WhopSDK::Test::Resources::ProductsTest < WhopSDK::Test::ResourceTest def test_create_required_params skip("Mock server tests are disabled") - response = @whop.products.create(company_id: "biz_xxxxxxxxxxxxxx", title: "title") + response = @whop.products.create(title: "title") assert_pattern do response => WhopSDK::Product @@ -45,7 +45,7 @@ def test_create_required_params def test_retrieve skip("Mock server tests are disabled") - response = @whop.products.retrieve("prod_xxxxxxxxxxxxx") + response = @whop.products.retrieve("id") assert_pattern do response => WhopSDK::Product @@ -84,7 +84,7 @@ def test_retrieve def test_update skip("Mock server tests are disabled") - response = @whop.products.update("prod_xxxxxxxxxxxxx") + response = @whop.products.update("id") assert_pattern do response => WhopSDK::Product @@ -123,7 +123,7 @@ def test_update def test_list_required_params skip("Mock server tests are disabled") - response = @whop.products.list(company_id: "biz_xxxxxxxxxxxxxx") + response = @whop.products.list(company_id: "company_id") assert_pattern do response => WhopSDK::Internal::CursorPage @@ -157,7 +157,7 @@ def test_list_required_params def test_delete skip("Mock server tests are disabled") - response = @whop.products.delete("prod_xxxxxxxxxxxxx") + response = @whop.products.delete("id") assert_pattern do response => WhopSDK::Internal::Type::Boolean diff --git a/test/whop_sdk/resources/referrals/businesses/earnings_test.rb b/test/whop_sdk/resources/referrals/businesses/earnings_test.rb new file mode 100644 index 00000000..4d0122f2 --- /dev/null +++ b/test/whop_sdk/resources/referrals/businesses/earnings_test.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class WhopSDK::Test::Resources::Referrals::Businesses::EarningsTest < WhopSDK::Test::ResourceTest + def test_list + skip("Mock server tests are disabled") + + response = @whop.referrals.businesses.earnings.list("id") + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::Referrals::Businesses::EarningListResponse + end + + assert_pattern do + row => { + id: String | nil, + account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account | nil, + cancelation_reason: String | nil, + commission_amount_usd: String | nil, + created_at: Time, + financial_activity: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]) | nil, + object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object, + payout_at: Time | nil, + payout_percentage: Float | nil, + product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product | nil, + resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource | nil, + second_tier: WhopSDK::Internal::Type::Boolean, + status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status, + transaction_amount_usd: String + } + end + end +end diff --git a/test/whop_sdk/resources/referrals/businesses_test.rb b/test/whop_sdk/resources/referrals/businesses_test.rb new file mode 100644 index 00000000..377200ab --- /dev/null +++ b/test/whop_sdk/resources/referrals/businesses_test.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class WhopSDK::Test::Resources::Referrals::BusinessesTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.referrals.businesses.retrieve("id") + + assert_pattern do + response => WhopSDK::Models::Referrals::BusinessRetrieveResponse + end + + assert_pattern do + response => { + id: String, + account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account | nil, + created_at: Time, + earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner | nil, + my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier, + object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object, + owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner | nil, + payout_percentage: Float, + referral_expires_at: Time | nil, + referral_started_at: Time | nil, + status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status, + volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.referrals.businesses.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::Referrals::BusinessListResponse + end + + assert_pattern do + row => { + id: String, + account: WhopSDK::Models::Referrals::BusinessListResponse::Account | nil, + created_at: Time, + earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner | nil, + my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier, + object: WhopSDK::Models::Referrals::BusinessListResponse::Object, + owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner | nil, + payout_percentage: Float, + referral_expires_at: Time | nil, + referral_started_at: Time | nil, + status: WhopSDK::Models::Referrals::BusinessListResponse::Status, + volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + } + end + end + + def test_leaderboard + skip("Mock server tests are disabled") + + response = @whop.referrals.businesses.leaderboard + + assert_pattern do + response => WhopSDK::Models::Referrals::BusinessLeaderboardResponse + end + + assert_pattern do + response => { + leaders: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader]), + me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me | nil + } + end + end +end diff --git a/test/whop_sdk/resources/referrals/partners_test.rb b/test/whop_sdk/resources/referrals/partners_test.rb new file mode 100644 index 00000000..c6bb02db --- /dev/null +++ b/test/whop_sdk/resources/referrals/partners_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class WhopSDK::Test::Resources::Referrals::PartnersTest < WhopSDK::Test::ResourceTest + def test_create + skip("Mock server tests are disabled") + + response = @whop.referrals.partners.create + + assert_pattern do + response => WhopSDK::Models::Referrals::PartnerCreateResponse + end + + assert_pattern do + response => { + referral_link: String, + whop_partner_enabled_at: Time + } + end + end +end diff --git a/test/whop_sdk/resources/referrals_test.rb b/test/whop_sdk/resources/referrals_test.rb new file mode 100644 index 00000000..d5c4cd7e --- /dev/null +++ b/test/whop_sdk/resources/referrals_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::ReferralsTest < WhopSDK::Test::ResourceTest + def test_referred_users + skip("Mock server tests are disabled") + + response = @whop.referrals.referred_users + + assert_pattern do + response => WhopSDK::Models::ReferralReferredUsersResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::ReferralReferredUsersResponse::Data]), + page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + } + end + end +end diff --git a/test/whop_sdk/resources/setup_intents_test.rb b/test/whop_sdk/resources/setup_intents_test.rb index 945b5d05..f51f8133 100644 --- a/test/whop_sdk/resources/setup_intents_test.rb +++ b/test/whop_sdk/resources/setup_intents_test.rb @@ -22,7 +22,8 @@ def test_retrieve member: WhopSDK::SetupIntent::Member | nil, metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_method: WhopSDK::SetupIntent::PaymentMethod | nil, - status: WhopSDK::SetupIntentStatus + status: WhopSDK::SetupIntentStatus, + three_ds_verified: WhopSDK::Internal::Type::Boolean } end end diff --git a/test/whop_sdk/resources/social_accounts_test.rb b/test/whop_sdk/resources/social_accounts_test.rb new file mode 100644 index 00000000..d9ae4d53 --- /dev/null +++ b/test/whop_sdk/resources/social_accounts_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::SocialAccountsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @whop.social_accounts.create(platform: :facebook) + + assert_pattern do + response => WhopSDK::SocialAccount + end + + assert_pattern do + response => { + id: String, + external_id: String | nil, + name: String | nil, + platform: WhopSDK::SocialAccount::Platform, + profile_picture_url: String | nil, + scopes: ^(WhopSDK::Internal::Type::ArrayOf[String]), + url: String | nil, + username: String | nil, + verified: WhopSDK::Internal::Type::Boolean + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.social_accounts.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::SocialAccount + end + + assert_pattern do + row => { + id: String, + external_id: String | nil, + name: String | nil, + platform: WhopSDK::SocialAccount::Platform, + profile_picture_url: String | nil, + scopes: ^(WhopSDK::Internal::Type::ArrayOf[String]), + url: String | nil, + username: String | nil, + verified: WhopSDK::Internal::Type::Boolean + } + end + end + + def test_delete + skip("Mock server tests are disabled") + + response = @whop.social_accounts.delete("id") + + assert_pattern do + response => WhopSDK::Internal::Type::Boolean + end + end + + def test_connect_required_params + skip("Mock server tests are disabled") + + response = @whop.social_accounts.connect(platform: :meta_business) + + assert_pattern do + response => WhopSDK::Models::SocialAccountConnectResponse + end + + assert_pattern do + response => { + authorize_url: String + } + end + end + + def test_posts_required_params + skip("Mock server tests are disabled") + + response = @whop.social_accounts.posts("id", account_id: "account_id") + + assert_pattern do + response => WhopSDK::Models::SocialAccountPostsResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::SocialAccountPost]), + page_info: WhopSDK::Models::SocialAccountPostsResponse::PageInfo + } + end + end +end diff --git a/test/whop_sdk/resources/stats_test.rb b/test/whop_sdk/resources/stats_test.rb new file mode 100644 index 00000000..67014d35 --- /dev/null +++ b/test/whop_sdk/resources/stats_test.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::StatsTest < WhopSDK::Test::ResourceTest + def test_retrieve_required_params + skip("Mock server tests are disabled") + + response = @whop.stats.retrieve("metric", from: "2019-12-27", to: "2019-12-27") + + assert_pattern do + response => WhopSDK::Models::StatRetrieveResponse + end + + assert_pattern do + response => { + data: WhopSDK::Models::StatRetrieveResponse::Data + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.stats.list + + assert_pattern do + response => WhopSDK::Models::StatListResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::StatListResponse::Data]) + } + end + end +end diff --git a/test/whop_sdk/resources/swaps_test.rb b/test/whop_sdk/resources/swaps_test.rb index 9a7ee2fa..bba1b0ce 100644 --- a/test/whop_sdk/resources/swaps_test.rb +++ b/test/whop_sdk/resources/swaps_test.rb @@ -20,6 +20,7 @@ def test_create_required_params assert_pattern do response => { + id: String, account_id: String, object: WhopSDK::Models::SwapCreateResponse::Object, status: String, @@ -31,10 +32,10 @@ def test_create_required_params end end - def test_retrieve_required_params + def test_retrieve skip("Mock server tests are disabled") - response = @whop.swaps.retrieve(account_id: "account_id") + response = @whop.swaps.retrieve("id") assert_pattern do response => WhopSDK::Models::SwapRetrieveResponse @@ -42,6 +43,7 @@ def test_retrieve_required_params assert_pattern do response => { + id: String, account_id: String, object: WhopSDK::Models::SwapRetrieveResponse::Object, status: String, @@ -51,6 +53,22 @@ def test_retrieve_required_params end end + def test_list_required_params + skip("Mock server tests are disabled") + + response = @whop.swaps.list(account_id: "account_id") + + assert_pattern do + response => WhopSDK::Models::SwapListResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::SwapListResponse::Data]) + } + end + end + def test_create_quote_required_params skip("Mock server tests are disabled") diff --git a/test/whop_sdk/resources/transfers_test.rb b/test/whop_sdk/resources/transfers_test.rb index 27f930e5..329a7df5 100644 --- a/test/whop_sdk/resources/transfers_test.rb +++ b/test/whop_sdk/resources/transfers_test.rb @@ -6,42 +6,28 @@ class WhopSDK::Test::Resources::TransfersTest < WhopSDK::Test::ResourceTest def test_create_required_params skip("Mock server tests are disabled") - response = - @whop.transfers.create( - amount: 6.9, - currency: :usd, - destination_id: "destination_id", - origin_id: "origin_id" - ) + response = @whop.transfers.create(amount: 0, origin_id: "origin_id") assert_pattern do - response => WhopSDK::Transfer + response => WhopSDK::Models::TransferCreateResponse end assert_pattern do - response => { - id: String, - amount: Float, - created_at: Time, - currency: WhopSDK::Currency, - destination: WhopSDK::Transfer::Destination, - destination_ledger_account_id: String, - fee_amount: Float | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - notes: String | nil, - origin: WhopSDK::Transfer::Origin, - origin_ledger_account_id: String - } + case response + in WhopSDK::Models::TransferCreateResponse::Transfer + in WhopSDK::Models::TransferCreateResponse::Send + in WhopSDK::Models::TransferCreateResponse::ClaimLink + end end end def test_retrieve skip("Mock server tests are disabled") - response = @whop.transfers.retrieve("ctt_xxxxxxxxxxxxxx") + response = @whop.transfers.retrieve("id") assert_pattern do - response => WhopSDK::Transfer + response => WhopSDK::Models::TransferRetrieveResponse end assert_pattern do @@ -49,14 +35,14 @@ def test_retrieve id: String, amount: Float, created_at: Time, - currency: WhopSDK::Currency, - destination: WhopSDK::Transfer::Destination, + currency: String, + destination: WhopSDK::Models::TransferRetrieveResponse::Destination, destination_ledger_account_id: String, + origin: WhopSDK::Models::TransferRetrieveResponse::Origin, + origin_ledger_account_id: String, fee_amount: Float | nil, metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - notes: String | nil, - origin: WhopSDK::Transfer::Origin, - origin_ledger_account_id: String + notes: String | nil } end end @@ -82,12 +68,12 @@ def test_list id: String, amount: Float, created_at: Time, - currency: WhopSDK::Currency, + currency: String, destination_ledger_account_id: String, + origin_ledger_account_id: String, fee_amount: Float | nil, metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - notes: String | nil, - origin_ledger_account_id: String + notes: String | nil } end end diff --git a/test/whop_sdk/resources/users_test.rb b/test/whop_sdk/resources/users_test.rb index 5c22ad5c..88c338ae 100644 --- a/test/whop_sdk/resources/users_test.rb +++ b/test/whop_sdk/resources/users_test.rb @@ -15,11 +15,16 @@ def test_retrieve assert_pattern do response => { id: String, + balance: WhopSDK::UserBalance | nil, + balance_history: WhopSDK::User::BalanceHistory | nil, bio: String | nil, created_at: String, + earnings_usd: WhopSDK::User::EarningsUsd | nil, name: String | nil, profile_picture: WhopSDK::Internal::Type::Unknown | nil, - username: String + username: String, + verification: WhopSDK::Internal::Type::Unknown, + whop_partner_enabled_at: String | nil } end end @@ -36,11 +41,16 @@ def test_update assert_pattern do response => { id: String, + balance: WhopSDK::UserBalance | nil, + balance_history: WhopSDK::User::BalanceHistory | nil, bio: String | nil, created_at: String, + earnings_usd: WhopSDK::User::EarningsUsd | nil, name: String | nil, profile_picture: WhopSDK::Internal::Type::Unknown | nil, - username: String + username: String, + verification: WhopSDK::Internal::Type::Unknown, + whop_partner_enabled_at: String | nil } end end @@ -64,11 +74,16 @@ def test_list assert_pattern do row => { id: String, + balance: WhopSDK::UserBalance | nil, + balance_history: WhopSDK::User::BalanceHistory | nil, bio: String | nil, created_at: String, + earnings_usd: WhopSDK::User::EarningsUsd | nil, name: String | nil, profile_picture: WhopSDK::Internal::Type::Unknown | nil, - username: String + username: String, + verification: WhopSDK::Internal::Type::Unknown, + whop_partner_enabled_at: String | nil } end end @@ -102,11 +117,16 @@ def test_update_me assert_pattern do response => { id: String, + balance: WhopSDK::UserBalance | nil, + balance_history: WhopSDK::User::BalanceHistory | nil, bio: String | nil, created_at: String, + earnings_usd: WhopSDK::User::EarningsUsd | nil, name: String | nil, profile_picture: WhopSDK::Internal::Type::Unknown | nil, - username: String + username: String, + verification: WhopSDK::Internal::Type::Unknown, + whop_partner_enabled_at: String | nil } end end diff --git a/test/whop_sdk/resources/verifications_test.rb b/test/whop_sdk/resources/verifications_test.rb index 6705246a..e2978b59 100644 --- a/test/whop_sdk/resources/verifications_test.rb +++ b/test/whop_sdk/resources/verifications_test.rb @@ -3,10 +3,40 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::VerificationsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @whop.verifications.create(account_id: "account_id", body: {kind: :individual}) + + assert_pattern do + response => WhopSDK::Models::VerificationCreateResponse + end + + assert_pattern do + response => { + id: String | nil, + address: WhopSDK::Models::VerificationCreateResponse::Address | nil, + business_name: String | nil, + business_structure: String | nil, + country: String | nil, + created_at: String | nil, + date_of_birth: String | nil, + first_name: String | nil, + kind: WhopSDK::Models::VerificationCreateResponse::Kind | nil, + last_name: String | nil, + requested_information: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationCreateResponse::RequestedInformation]) | nil, + required_documents: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationCreateResponse::RequiredDocument]) | nil, + session_url: String | nil, + status: WhopSDK::Models::VerificationCreateResponse::Status | nil, + updated_at: String | nil + } + end + end + def test_retrieve skip("Mock server tests are disabled") - response = @whop.verifications.retrieve("verf_xxxxxxxxxxxxx") + response = @whop.verifications.retrieve("verification_id") assert_pattern do response => WhopSDK::Models::VerificationRetrieveResponse @@ -14,36 +44,67 @@ def test_retrieve assert_pattern do response => { - id: String, - last_error_code: WhopSDK::VerificationErrorCode | nil, - last_error_reason: String | nil, - status: WhopSDK::VerificationStatus + id: String | nil, + address: WhopSDK::Models::VerificationRetrieveResponse::Address | nil, + business_name: String | nil, + business_structure: String | nil, + country: String | nil, + created_at: String | nil, + date_of_birth: String | nil, + first_name: String | nil, + kind: WhopSDK::Models::VerificationRetrieveResponse::Kind | nil, + last_name: String | nil, + requested_information: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationRetrieveResponse::RequestedInformation]) | nil, + required_documents: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationRetrieveResponse::RequiredDocument]) | nil, + session_url: String | nil, + status: WhopSDK::Models::VerificationRetrieveResponse::Status | nil, + updated_at: String | nil } end end - def test_list_required_params + def test_update_required_params skip("Mock server tests are disabled") - response = @whop.verifications.list(payout_account_id: "poact_xxxxxxxxxxxx") + response = @whop.verifications.update("verification_id", body: {}) assert_pattern do - response => WhopSDK::Internal::CursorPage + response => WhopSDK::Models::VerificationUpdateResponse end - row = response.to_enum.first - return if row.nil? + assert_pattern do + response => { + id: String | nil, + address: WhopSDK::Models::VerificationUpdateResponse::Address | nil, + business_name: String | nil, + business_structure: String | nil, + country: String | nil, + created_at: String | nil, + date_of_birth: String | nil, + first_name: String | nil, + kind: WhopSDK::Models::VerificationUpdateResponse::Kind | nil, + last_name: String | nil, + requested_information: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationUpdateResponse::RequestedInformation]) | nil, + required_documents: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationUpdateResponse::RequiredDocument]) | nil, + session_url: String | nil, + status: WhopSDK::Models::VerificationUpdateResponse::Status | nil, + updated_at: String | nil + } + end + end + + def test_list_required_params + skip("Mock server tests are disabled") + + response = @whop.verifications.list(account_id: "account_id") assert_pattern do - row => WhopSDK::Models::VerificationListResponse + response => WhopSDK::Models::VerificationListResponse end assert_pattern do - row => { - id: String, - last_error_code: WhopSDK::VerificationErrorCode | nil, - last_error_reason: String | nil, - status: WhopSDK::VerificationStatus + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::VerificationListResponse::Data]) | nil } end end diff --git a/test/whop_sdk/resources/wallets_test.rb b/test/whop_sdk/resources/wallets_test.rb deleted file mode 100644 index 885ff814..00000000 --- a/test/whop_sdk/resources/wallets_test.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class WhopSDK::Test::Resources::WalletsTest < WhopSDK::Test::ResourceTest - def test_list - skip("Mock server tests are disabled") - - response = @whop.wallets.list - - assert_pattern do - response => WhopSDK::Models::WalletListResponse - end - - assert_pattern do - response => { - wallets: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::WalletListResponse::Wallet]) - } - end - end - - def test_balance_required_params - skip("Mock server tests are disabled") - - response = @whop.wallets.balance(account_id: "account_id") - - assert_pattern do - response => WhopSDK::Models::WalletBalanceResponse - end - - assert_pattern do - response => { - object: WhopSDK::Models::WalletBalanceResponse::Object, - tokens: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::WalletBalanceResponse::Token]), - total_usd: String - } - end - end - - def test_send__required_params - skip("Mock server tests are disabled") - - response = @whop.wallets.send_(account_id: "account_id", amount: "amount", to: "to") - - assert_pattern do - response => WhopSDK::Models::WalletSendResponse - end - - assert_pattern do - response => { - amount: String, - currency: String, - destination: WhopSDK::Models::WalletSendResponse::Destination, - object: WhopSDK::Models::WalletSendResponse::Object, - source: WhopSDK::Models::WalletSendResponse::Source, - tx_hash: String - } - end - end -end diff --git a/test/whop_sdk/resources/webhooks_test.rb b/test/whop_sdk/resources/webhooks_test.rb index 1aa71e1c..b4170ca7 100644 --- a/test/whop_sdk/resources/webhooks_test.rb +++ b/test/whop_sdk/resources/webhooks_test.rb @@ -121,7 +121,7 @@ def test_unwrap webhook = StandardWebhooks::Webhook.new(key) data = - "{\"id\":\"msg_xxxxxxxxxxxxxxxxxxxxxxxx\",\"api_version\":\"v1\",\"data\":{\"id\":\"crsli_xxxxxxxxxxxx\",\"completed\":true,\"course\":{\"id\":\"cors_xxxxxxxxxxxxx\",\"experience\":{\"id\":\"exp_xxxxxxxxxxxxxx\"},\"title\":\"Introduction to Technical Analysis\"},\"created_at\":\"2023-12-01T05:00:00.401Z\",\"lesson\":{\"id\":\"lesn_xxxxxxxxxxxxx\",\"chapter\":{\"id\":\"chap_xxxxxxxxxxxxx\"},\"title\":\"Understanding Candlestick Patterns\"},\"user\":{\"id\":\"user_xxxxxxxxxxxxx\",\"name\":\"John Doe\",\"username\":\"johndoe42\"}},\"timestamp\":\"2025-01-01T00:00:00.000Z\",\"type\":\"course_lesson_interaction.completed\",\"company_id\":\"biz_xxxxxxxxxxxxxx\"}" + "{\"id\":\"msg_xxxxxxxxxxxxxxxxxxxxxxxx\",\"api_version\":\"v1\",\"data\":{\"audience\":{\"type\":\"channel\",\"user_ids\":[\"user_xxxxxxxxxxxxxx\"]},\"channel\":{\"id\":\"feed_xxxxxxxxxxxxxx\",\"type\":\"chat\",\"experience_id\":\"exp_xxxxxxxxxxxxxx\"},\"message\":{\"id\":\"id\",\"content\":\"Hey, are you available for a **quick call**?\",\"created_at\":\"2023-12-01T05:00:00.401Z\",\"is_edited\":true,\"is_pinned\":true,\"mentions\":[\"string\"],\"mentions_everyone\":true,\"message_type\":\"regular\",\"poll\":{\"options\":[{\"id\":\"id\",\"text\":\"text\"}]},\"poll_votes\":[{\"count\":42,\"option_id\":\"option_id\"}],\"reaction_counts\":[{\"count\":42,\"emoji\":\"emoji\"}],\"replying_to_message_id\":\"replying_to_message_id\",\"updated_at\":\"2023-12-01T05:00:00.401Z\",\"user\":{\"id\":\"user_xxxxxxxxxxxxx\",\"name\":\"John Doe\",\"username\":\"johndoe42\"},\"view_count\":42},\"reason\":\"channel_message\"},\"timestamp\":\"2025-01-01T00:00:00.000Z\",\"type\":\"chat.message.created\",\"company_id\":\"biz_xxxxxxxxxxxxxx\"}" message_id = "1" timestamp = Time.now.to_i.to_s signature = webhook.sign(message_id, timestamp, data) diff --git a/test/whop_sdk/resources/workforce/bounties_test.rb b/test/whop_sdk/resources/workforce/bounties_test.rb new file mode 100644 index 00000000..f0d0b81d --- /dev/null +++ b/test/whop_sdk/resources/workforce/bounties_test.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class WhopSDK::Test::Resources::Workforce::BountiesTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.workforce.bounties.retrieve("id") + + assert_pattern do + response => WhopSDK::Workforce::WorkforceBounty + end + + assert_pattern do + response => { + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: ^(WhopSDK::Internal::Type::ArrayOf[String]), + budget_amount: Float, + business_goal_type: WhopSDK::Workforce::WorkforceBounty::BusinessGoalType | nil, + created_at: String, + currency: String, + description: String, + experience_id: String | nil, + funding_account: WhopSDK::Workforce::WorkforceBounty::FundingAccount | nil, + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBounty::Poster, + scheduled_frequency: WhopSDK::Workforce::WorkforceBounty::ScheduledFrequency | nil, + scheduled_publish_at: String | nil, + spots_remaining: Integer, + status: WhopSDK::Workforce::WorkforceBounty::Status, + submissions_closed_at: String | nil, + title: String, + unresolved_submissions_count: Integer, + updated_at: String + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.workforce.bounties.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Workforce::WorkforceBountyListItem + end + + assert_pattern do + row => { + id: String, + accepted_submissions_count: Integer, + accepted_submissions_limit: Integer, + allowed_country_codes: ^(WhopSDK::Internal::Type::ArrayOf[String]), + budget_amount: Float, + business_goal_type: WhopSDK::Workforce::WorkforceBountyListItem::BusinessGoalType | nil, + created_at: String, + currency: String, + experience_id: String | nil, + funding_account: WhopSDK::Workforce::WorkforceBountyListItem::FundingAccount | nil, + gross_paid_out_amount: Float, + gross_reward_amount: Float, + poster: WhopSDK::Workforce::WorkforceBountyListItem::Poster, + scheduled_frequency: WhopSDK::Workforce::WorkforceBountyListItem::ScheduledFrequency | nil, + scheduled_publish_at: String | nil, + spots_remaining: Integer, + status: WhopSDK::Workforce::WorkforceBountyListItem::Status, + submissions_closed_at: String | nil, + title: String, + unresolved_submissions_count: Integer, + updated_at: String + } + end + end +end diff --git a/test/whop_sdk/resources/workforce_test.rb b/test/whop_sdk/resources/workforce_test.rb new file mode 100644 index 00000000..562238b1 --- /dev/null +++ b/test/whop_sdk/resources/workforce_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::WorkforceTest < WhopSDK::Test::ResourceTest +end From ad10edca8ef9f740f9deed2239428e1370ef71f9 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 03:57:58 +0000 Subject: [PATCH 19/34] Unfreeze the TypeScript and Ruby SDKs after a month of failed builds Stainless-Generated-From: a2f0202f90ad251392b77ddaba28dd3f738acc11 --- Rakefile | 7 ++++++- lib/whop_sdk/internal/transport/base_client.rb | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 0d85a3e2..529ac154 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "etc" require "pathname" require "securerandom" require "shellwords" @@ -37,7 +38,11 @@ multitask(:test) do ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } end -xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] +# Cap parallelism at the CPU count. `--max-procs=0` spawns one process per +# 300-file batch with no upper bound; on large SDKs (thousands of files) that +# oversubscribes CPUs and stacks up rubocop processes, exhausting memory and +# slowing CI to the point of timing out. +xargs = %W[xargs --no-run-if-empty --null --max-procs=#{Etc.nprocessors} --max-args=300 --] ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")} filtered = ->(ext, dirs) do diff --git a/lib/whop_sdk/internal/transport/base_client.rb b/lib/whop_sdk/internal/transport/base_client.rb index 392a7ebd..bd51b071 100644 --- a/lib/whop_sdk/internal/transport/base_client.rb +++ b/lib/whop_sdk/internal/transport/base_client.rb @@ -306,7 +306,10 @@ def initialize( WhopSDK::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end - headers.delete("content-type") if body.nil? + # Generated methods always pass `req[:body]` for operations that define a + # request body, so only elide the content-type header when the operation + # has no body at all, not when an optional body param was omitted. + headers.delete("content-type") if body.nil? && !req.key?(:body) url = WhopSDK::Internal::Util.join_parsed_uri( @base_url_components, From 5c7982d0663f8d9e4cf627020323c0928d1ca11d Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 04:07:14 +0000 Subject: [PATCH 20/34] Show custom audience size and Facebook match estimates Stainless-Generated-From: d9526dec14690eda3247da999f38f917f9077c50 --- lib/whop_sdk/models/audience.rb | 89 ++++++++++++-- rbi/whop_sdk/models/audience.rbi | 142 ++++++++++++++++++++-- sig/whop_sdk/models/audience.rbs | 75 ++++++++++-- test/whop_sdk/resources/audiences_test.rb | 10 +- 4 files changed, 285 insertions(+), 31 deletions(-) diff --git a/lib/whop_sdk/models/audience.rb b/lib/whop_sdk/models/audience.rb index b3cf411d..d24e5a55 100644 --- a/lib/whop_sdk/models/audience.rb +++ b/lib/whop_sdk/models/audience.rb @@ -11,10 +11,10 @@ class Audience < WhopSDK::Internal::Type::BaseModel required :id, String # @!attribute created_at - # Unix timestamp when the audience was created. + # When the audience was created, as an ISO 8601 timestamp. # - # @return [Float] - required :created_at, Float + # @return [String] + required :created_at, String # @!attribute error_message # Processing error message. `null` unless processing is partial or failed. @@ -22,6 +22,11 @@ class Audience < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :error_message, String, nil?: true + # @!attribute match_rates + # + # @return [Array] + required :match_rates, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Audience::MatchRate] } + # @!attribute matched_rows # Rows successfully uploaded to connected ad accounts. # @@ -66,21 +71,23 @@ class Audience < WhopSDK::Internal::Type::BaseModel required :total_rows, Float # @!attribute updated_at - # Unix timestamp when the audience was last updated. + # When the audience was last updated, as an ISO 8601 timestamp. # - # @return [Float] - required :updated_at, Float + # @return [String] + required :updated_at, String - # @!method initialize(id:, created_at:, error_message:, matched_rows:, name:, platform_audience_ids:, processed_rows:, progress_percent:, status:, total_rows:, updated_at:) + # @!method initialize(id:, created_at:, error_message:, match_rates:, matched_rows:, name:, platform_audience_ids:, processed_rows:, progress_percent:, status:, total_rows:, updated_at:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::Audience} for more details. # # @param id [String] Audience ID, prefixed `adaud_`. # - # @param created_at [Float] Unix timestamp when the audience was created. + # @param created_at [String] When the audience was created, as an ISO 8601 timestamp. # # @param error_message [String, nil] Processing error message. `null` unless processing is partial or failed. # + # @param match_rates [Array] + # # @param matched_rows [Float] Rows successfully uploaded to connected ad accounts. # # @param name [String] Audience display name. @@ -95,7 +102,71 @@ class Audience < WhopSDK::Internal::Type::BaseModel # # @param total_rows [Float] Total rows detected in the uploaded CSV. # - # @param updated_at [Float] Unix timestamp when the audience was last updated. + # @param updated_at [String] When the audience was last updated, as an ISO 8601 timestamp. + + class MatchRate < WhopSDK::Internal::Type::BaseModel + # @!attribute lower_bound + # Lower bound of the estimated match rate percentage. `null` until available. + # + # @return [Float, nil] + required :lower_bound, Float, nil?: true + + # @!attribute platform + # The ad platform that provided the match-rate estimate. + # + # @return [Symbol, WhopSDK::Models::Audience::MatchRate::Platform] + required :platform, enum: -> { WhopSDK::Audience::MatchRate::Platform } + + # @!attribute status + # Availability of the estimated match rate. + # + # @return [Symbol, WhopSDK::Models::Audience::MatchRate::Status, nil] + required :status, enum: -> { WhopSDK::Audience::MatchRate::Status }, nil?: true + + # @!attribute upper_bound + # Upper bound of the estimated match rate percentage. `null` until available. + # + # @return [Float, nil] + required :upper_bound, Float, nil?: true + + # @!method initialize(lower_bound:, platform:, status:, upper_bound:) + # Estimated match rates by ad platform. Empty when the audience was not sent to a + # supported platform. + # + # @param lower_bound [Float, nil] Lower bound of the estimated match rate percentage. `null` until available. + # + # @param platform [Symbol, WhopSDK::Models::Audience::MatchRate::Platform] The ad platform that provided the match-rate estimate. + # + # @param status [Symbol, WhopSDK::Models::Audience::MatchRate::Status, nil] Availability of the estimated match rate. + # + # @param upper_bound [Float, nil] Upper bound of the estimated match rate percentage. `null` until available. + + # The ad platform that provided the match-rate estimate. + # + # @see WhopSDK::Models::Audience::MatchRate#platform + module Platform + extend WhopSDK::Internal::Type::Enum + + META = :meta + + # @!method self.values + # @return [Array] + end + + # Availability of the estimated match rate. + # + # @see WhopSDK::Models::Audience::MatchRate#status + module Status + extend WhopSDK::Internal::Type::Enum + + CALCULATING = :calculating + AVAILABLE = :available + UNAVAILABLE = :unavailable + + # @!method self.values + # @return [Array] + end + end # Current state of the audience import. `syncing` means Whop is sending matched # rows to connected ad accounts. When status is `partial` or `failed`, diff --git a/rbi/whop_sdk/models/audience.rbi b/rbi/whop_sdk/models/audience.rbi index 241f6999..3d203024 100644 --- a/rbi/whop_sdk/models/audience.rbi +++ b/rbi/whop_sdk/models/audience.rbi @@ -10,14 +10,17 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # Unix timestamp when the audience was created. - sig { returns(Float) } + # When the audience was created, as an ISO 8601 timestamp. + sig { returns(String) } attr_accessor :created_at # Processing error message. `null` unless processing is partial or failed. sig { returns(T.nilable(String)) } attr_accessor :error_message + sig { returns(T::Array[WhopSDK::Audience::MatchRate]) } + attr_accessor :match_rates + # Rows successfully uploaded to connected ad accounts. sig { returns(Float) } attr_accessor :matched_rows @@ -47,15 +50,16 @@ module WhopSDK sig { returns(Float) } attr_accessor :total_rows - # Unix timestamp when the audience was last updated. - sig { returns(Float) } + # When the audience was last updated, as an ISO 8601 timestamp. + sig { returns(String) } attr_accessor :updated_at sig do params( id: String, - created_at: Float, + created_at: String, error_message: T.nilable(String), + match_rates: T::Array[WhopSDK::Audience::MatchRate::OrHash], matched_rows: Float, name: String, platform_audience_ids: T::Array[String], @@ -63,16 +67,17 @@ module WhopSDK progress_percent: Float, status: WhopSDK::Audience::Status::OrSymbol, total_rows: Float, - updated_at: Float + updated_at: String ).returns(T.attached_class) end def self.new( # Audience ID, prefixed `adaud_`. id:, - # Unix timestamp when the audience was created. + # When the audience was created, as an ISO 8601 timestamp. created_at:, # Processing error message. `null` unless processing is partial or failed. error_message:, + match_rates:, # Rows successfully uploaded to connected ad accounts. matched_rows:, # Audience display name. @@ -88,7 +93,7 @@ module WhopSDK status:, # Total rows detected in the uploaded CSV. total_rows:, - # Unix timestamp when the audience was last updated. + # When the audience was last updated, as an ISO 8601 timestamp. updated_at: ) end @@ -97,8 +102,9 @@ module WhopSDK override.returns( { id: String, - created_at: Float, + created_at: String, error_message: T.nilable(String), + match_rates: T::Array[WhopSDK::Audience::MatchRate], matched_rows: Float, name: String, platform_audience_ids: T::Array[String], @@ -106,13 +112,129 @@ module WhopSDK progress_percent: Float, status: WhopSDK::Audience::Status::TaggedSymbol, total_rows: Float, - updated_at: Float + updated_at: String } ) end def to_hash end + class MatchRate < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Audience::MatchRate, WhopSDK::Internal::AnyHash) + end + + # Lower bound of the estimated match rate percentage. `null` until available. + sig { returns(T.nilable(Float)) } + attr_accessor :lower_bound + + # The ad platform that provided the match-rate estimate. + sig { returns(WhopSDK::Audience::MatchRate::Platform::TaggedSymbol) } + attr_accessor :platform + + # Availability of the estimated match rate. + sig do + returns(T.nilable(WhopSDK::Audience::MatchRate::Status::TaggedSymbol)) + end + attr_accessor :status + + # Upper bound of the estimated match rate percentage. `null` until available. + sig { returns(T.nilable(Float)) } + attr_accessor :upper_bound + + # Estimated match rates by ad platform. Empty when the audience was not sent to a + # supported platform. + sig do + params( + lower_bound: T.nilable(Float), + platform: WhopSDK::Audience::MatchRate::Platform::OrSymbol, + status: T.nilable(WhopSDK::Audience::MatchRate::Status::OrSymbol), + upper_bound: T.nilable(Float) + ).returns(T.attached_class) + end + def self.new( + # Lower bound of the estimated match rate percentage. `null` until available. + lower_bound:, + # The ad platform that provided the match-rate estimate. + platform:, + # Availability of the estimated match rate. + status:, + # Upper bound of the estimated match rate percentage. `null` until available. + upper_bound: + ) + end + + sig do + override.returns( + { + lower_bound: T.nilable(Float), + platform: WhopSDK::Audience::MatchRate::Platform::TaggedSymbol, + status: + T.nilable(WhopSDK::Audience::MatchRate::Status::TaggedSymbol), + upper_bound: T.nilable(Float) + } + ) + end + def to_hash + end + + # The ad platform that provided the match-rate estimate. + module Platform + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Audience::MatchRate::Platform) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + META = + T.let(:meta, WhopSDK::Audience::MatchRate::Platform::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::Audience::MatchRate::Platform::TaggedSymbol] + ) + end + def self.values + end + end + + # Availability of the estimated match rate. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::Audience::MatchRate::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CALCULATING = + T.let( + :calculating, + WhopSDK::Audience::MatchRate::Status::TaggedSymbol + ) + AVAILABLE = + T.let( + :available, + WhopSDK::Audience::MatchRate::Status::TaggedSymbol + ) + UNAVAILABLE = + T.let( + :unavailable, + WhopSDK::Audience::MatchRate::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Audience::MatchRate::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + # Current state of the audience import. `syncing` means Whop is sending matched # rows to connected ad accounts. When status is `partial` or `failed`, # `error_message` explains what went wrong. diff --git a/sig/whop_sdk/models/audience.rbs b/sig/whop_sdk/models/audience.rbs index 557659a1..22807753 100644 --- a/sig/whop_sdk/models/audience.rbs +++ b/sig/whop_sdk/models/audience.rbs @@ -3,8 +3,9 @@ module WhopSDK type audience = { id: String, - created_at: Float, + created_at: String, error_message: String?, + match_rates: ::Array[WhopSDK::Audience::MatchRate], matched_rows: Float, name: String, platform_audience_ids: ::Array[String], @@ -12,16 +13,18 @@ module WhopSDK progress_percent: Float, status: WhopSDK::Models::Audience::status, total_rows: Float, - updated_at: Float + updated_at: String } class Audience < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor created_at: Float + attr_accessor created_at: String attr_accessor error_message: String? + attr_accessor match_rates: ::Array[WhopSDK::Audience::MatchRate] + attr_accessor matched_rows: Float attr_accessor name: String @@ -36,12 +39,13 @@ module WhopSDK attr_accessor total_rows: Float - attr_accessor updated_at: Float + attr_accessor updated_at: String def initialize: ( id: String, - created_at: Float, + created_at: String, error_message: String?, + match_rates: ::Array[WhopSDK::Audience::MatchRate], matched_rows: Float, name: String, platform_audience_ids: ::Array[String], @@ -49,13 +53,14 @@ module WhopSDK progress_percent: Float, status: WhopSDK::Models::Audience::status, total_rows: Float, - updated_at: Float + updated_at: String ) -> void def to_hash: -> { id: String, - created_at: Float, + created_at: String, error_message: String?, + match_rates: ::Array[WhopSDK::Audience::MatchRate], matched_rows: Float, name: String, platform_audience_ids: ::Array[String], @@ -63,9 +68,63 @@ module WhopSDK progress_percent: Float, status: WhopSDK::Models::Audience::status, total_rows: Float, - updated_at: Float + updated_at: String } + type match_rate = + { + lower_bound: Float?, + platform: WhopSDK::Models::Audience::MatchRate::platform, + status: WhopSDK::Models::Audience::MatchRate::status?, + upper_bound: Float? + } + + class MatchRate < WhopSDK::Internal::Type::BaseModel + attr_accessor lower_bound: Float? + + attr_accessor platform: WhopSDK::Models::Audience::MatchRate::platform + + attr_accessor status: WhopSDK::Models::Audience::MatchRate::status? + + attr_accessor upper_bound: Float? + + def initialize: ( + lower_bound: Float?, + platform: WhopSDK::Models::Audience::MatchRate::platform, + status: WhopSDK::Models::Audience::MatchRate::status?, + upper_bound: Float? + ) -> void + + def to_hash: -> { + lower_bound: Float?, + platform: WhopSDK::Models::Audience::MatchRate::platform, + status: WhopSDK::Models::Audience::MatchRate::status?, + upper_bound: Float? + } + + type platform = :meta + + module Platform + extend WhopSDK::Internal::Type::Enum + + META: :meta + + def self?.values: -> ::Array[WhopSDK::Models::Audience::MatchRate::platform] + end + + type status = :calculating | :available | :unavailable + + module Status + extend WhopSDK::Internal::Type::Enum + + CALCULATING: :calculating + AVAILABLE: :available + UNAVAILABLE: :unavailable + + def self?.values: -> ::Array[WhopSDK::Models::Audience::MatchRate::status] + end + end + type status = :pending | :processing | :syncing | :ready | :partial | :failed diff --git a/test/whop_sdk/resources/audiences_test.rb b/test/whop_sdk/resources/audiences_test.rb index 0b8d6bfa..c254ab87 100644 --- a/test/whop_sdk/resources/audiences_test.rb +++ b/test/whop_sdk/resources/audiences_test.rb @@ -16,8 +16,9 @@ def test_create_required_params assert_pattern do response => { id: String, - created_at: Float, + created_at: String, error_message: String | nil, + match_rates: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Audience::MatchRate]), matched_rows: Float, name: String, platform_audience_ids: ^(WhopSDK::Internal::Type::ArrayOf[String]), @@ -25,7 +26,7 @@ def test_create_required_params progress_percent: Float, status: WhopSDK::Audience::Status, total_rows: Float, - updated_at: Float + updated_at: String } end end @@ -49,8 +50,9 @@ def test_list_required_params assert_pattern do row => { id: String, - created_at: Float, + created_at: String, error_message: String | nil, + match_rates: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Audience::MatchRate]), matched_rows: Float, name: String, platform_audience_ids: ^(WhopSDK::Internal::Type::ArrayOf[String]), @@ -58,7 +60,7 @@ def test_list_required_params progress_percent: Float, status: WhopSDK::Audience::Status, total_rows: Float, - updated_at: Float + updated_at: String } end end From e749b6767724482e608e2741004b9d4a1d8cda37 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 04:19:00 +0000 Subject: [PATCH 21/34] Break custom pixel events out by name in ads reporting Stainless-Generated-From: c8ad86bda78d69f41afedba69234338e84516110 --- lib/whop_sdk/models/ad.rb | 25 +++++++++++++++- lib/whop_sdk/models/ad_campaign.rb | 25 +++++++++++++++- lib/whop_sdk/models/ad_group.rb | 25 +++++++++++++++- rbi/whop_sdk/models/ad.rbi | 30 ++++++++++++++++++++ rbi/whop_sdk/models/ad_campaign.rbi | 30 ++++++++++++++++++++ rbi/whop_sdk/models/ad_group.rbi | 30 ++++++++++++++++++++ sig/whop_sdk/models/ad.rbs | 10 +++++++ sig/whop_sdk/models/ad_campaign.rbs | 10 +++++++ sig/whop_sdk/models/ad_group.rbs | 10 +++++++ test/whop_sdk/resources/ad_campaigns_test.rb | 12 ++++++++ test/whop_sdk/resources/ad_groups_test.rb | 12 ++++++++ test/whop_sdk/resources/ads_test.rb | 12 ++++++++ 12 files changed, 228 insertions(+), 3 deletions(-) diff --git a/lib/whop_sdk/models/ad.rb b/lib/whop_sdk/models/ad.rb index f515e672..a8a4be3f 100644 --- a/lib/whop_sdk/models/ad.rb +++ b/lib/whop_sdk/models/ad.rb @@ -151,6 +151,16 @@ class Ad < WhopSDK::Internal::Type::BaseModel # @return [Float] required :custom_conversions, Float + # @!attribute custom_event_counts + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + # + # @return [Object] + required :custom_event_counts, WhopSDK::Internal::Type::Unknown + # @!attribute delivery_status # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. @@ -281,6 +291,15 @@ class Ad < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :result_event_name, String, nil?: true + # @!attribute results + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + # + # @return [Float, nil] + required :results, Float, nil?: true + # @!attribute return_on_ad_spend # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. @@ -365,7 +384,7 @@ class Ad < WhopSDK::Internal::Type::BaseModel # @return [Float] required :viewed_contents, Float - # @!method initialize(id:, ad_campaign:, ad_group:, added_to_carts:, call_to_action:, click_through_rate:, clicks:, completed_registrations:, contacts:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, creatives:, custom_conversions:, delivery_status:, descriptions:, frequency:, headlines:, impressions:, issues:, lead_form:, lead_form_id:, leads:, messaging_config:, multi_advertiser_ads:, post_id:, post_source:, post_thumbnail_url:, primary_texts:, purchase_value:, purchases:, reach:, result_event:, result_event_name:, return_on_ad_spend:, schedules:, social_accounts:, spend:, spend_currency:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, url:, url_parameters:, viewed_contents:) + # @!method initialize(id:, ad_campaign:, ad_group:, added_to_carts:, call_to_action:, click_through_rate:, clicks:, completed_registrations:, contacts:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, creatives:, custom_conversions:, custom_event_counts:, delivery_status:, descriptions:, frequency:, headlines:, impressions:, issues:, lead_form:, lead_form_id:, leads:, messaging_config:, multi_advertiser_ads:, post_id:, post_source:, post_thumbnail_url:, primary_texts:, purchase_value:, purchases:, reach:, result_event:, result_event_name:, results:, return_on_ad_spend:, schedules:, social_accounts:, spend:, spend_currency:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, url:, url_parameters:, viewed_contents:) # Some parameter documentations has been truncated, see {WhopSDK::Models::Ad} for # more details. # @@ -415,6 +434,8 @@ class Ad < WhopSDK::Internal::Type::BaseModel # # @param custom_conversions [Float] Whop pixel-attributed custom (merchant-defined) conversion events, last-click, a # + # @param custom_event_counts [Object] Whop pixel-attributed custom conversions broken out by merchant-defined event na + # # @param delivery_status [Symbol, WhopSDK::Models::Ad::DeliveryStatus] The current delivery state, mirroring the Delivery column in the ads dashboard. # # @param descriptions [Array] @@ -455,6 +476,8 @@ class Ad < WhopSDK::Internal::Type::BaseModel # # @param result_event_name [String, nil] The merchant-defined event name when result_event is custom; null for the standa # + # @param results [Float, nil] The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # # @param return_on_ad_spend [Float] Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # # @param schedules [Float] Whop pixel-attributed schedule events, last-click. diff --git a/lib/whop_sdk/models/ad_campaign.rb b/lib/whop_sdk/models/ad_campaign.rb index fa377418..e4420da9 100644 --- a/lib/whop_sdk/models/ad_campaign.rb +++ b/lib/whop_sdk/models/ad_campaign.rb @@ -152,6 +152,16 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # @return [Float] required :custom_conversions, Float + # @!attribute custom_event_counts + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + # + # @return [Object] + required :custom_event_counts, WhopSDK::Internal::Type::Unknown + # @!attribute delivery_status # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. @@ -234,6 +244,15 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :result_event_name, String, nil?: true + # @!attribute results + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + # + # @return [Float, nil] + required :results, Float, nil?: true + # @!attribute return_on_ad_spend # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. @@ -307,7 +326,7 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # @return [Float] required :viewed_contents, Float - # @!method initialize(id:, added_to_carts:, bid_type:, budget_amount:, budget_optimization:, budget_type:, click_through_rate:, clicks:, completed_registrations:, contacts:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, custom_conversions:, delivery_status:, frequency:, impressions:, issues:, leads:, objective:, optimization_goal:, platform:, purchase_value:, purchases:, reach:, result_event:, result_event_name:, return_on_ad_spend:, schedules:, special_ad_categories:, spend:, spend_currency:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, viewed_contents:) + # @!method initialize(id:, added_to_carts:, bid_type:, budget_amount:, budget_optimization:, budget_type:, click_through_rate:, clicks:, completed_registrations:, contacts:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, custom_conversions:, custom_event_counts:, delivery_status:, frequency:, impressions:, issues:, leads:, objective:, optimization_goal:, platform:, purchase_value:, purchases:, reach:, result_event:, result_event_name:, results:, return_on_ad_spend:, schedules:, special_ad_categories:, spend:, spend_currency:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, viewed_contents:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdCampaign} for more details. # @@ -357,6 +376,8 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # # @param custom_conversions [Float] Whop pixel-attributed custom (merchant-defined) conversion events, last-click, a # + # @param custom_event_counts [Object] Whop pixel-attributed custom conversions broken out by merchant-defined event na + # # @param delivery_status [Symbol, WhopSDK::Models::AdCampaign::DeliveryStatus] The current delivery state, mirroring the Delivery column in the ads dashboard. # # @param frequency [Float, nil] Platform-reported impressions divided by reach. @@ -383,6 +404,8 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # # @param result_event_name [String, nil] The merchant-defined event name when result_event is custom; null for the standa # + # @param results [Float, nil] The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # # @param return_on_ad_spend [Float] Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # # @param schedules [Float] Whop pixel-attributed schedule events, last-click. diff --git a/lib/whop_sdk/models/ad_group.rb b/lib/whop_sdk/models/ad_group.rb index 86a3f405..4b5c8aaf 100644 --- a/lib/whop_sdk/models/ad_group.rb +++ b/lib/whop_sdk/models/ad_group.rb @@ -172,6 +172,16 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # @return [Float] required :custom_conversions, Float + # @!attribute custom_event_counts + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + # + # @return [Object] + required :custom_event_counts, WhopSDK::Internal::Type::Unknown + # @!attribute delivery_status # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. @@ -306,6 +316,15 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :result_event_name, String, nil?: true + # @!attribute results + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + # + # @return [Float, nil] + required :results, Float, nil?: true + # @!attribute return_on_ad_spend # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. @@ -379,7 +398,7 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # @return [Float] required :viewed_contents, Float - # @!method initialize(id:, ad_campaign:, added_to_carts:, audiences:, bid_type:, budget_amount:, budget_type:, click_through_rate:, clicks:, completed_registrations:, contacts:, conversion_event:, conversion_location:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, custom_conversions:, delivery_status:, demographics:, desired_cost_per_result:, devices:, dynamic_creative:, ends_at:, frequency:, frequency_cap:, impressions:, issues:, languages:, leads:, message_apps:, minimum_daily_spend:, optimization_goal:, placements:, purchase_value:, purchases:, reach:, regions:, result_event:, result_event_name:, return_on_ad_spend:, schedules:, spend:, spend_currency:, starts_at:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, viewed_contents:) + # @!method initialize(id:, ad_campaign:, added_to_carts:, audiences:, bid_type:, budget_amount:, budget_type:, click_through_rate:, clicks:, completed_registrations:, contacts:, conversion_event:, conversion_location:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, custom_conversions:, custom_event_counts:, delivery_status:, demographics:, desired_cost_per_result:, devices:, dynamic_creative:, ends_at:, frequency:, frequency_cap:, impressions:, issues:, languages:, leads:, message_apps:, minimum_daily_spend:, optimization_goal:, placements:, purchase_value:, purchases:, reach:, regions:, result_event:, result_event_name:, results:, return_on_ad_spend:, schedules:, spend:, spend_currency:, starts_at:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, viewed_contents:) # Some parameter documentations has been truncated, see {WhopSDK::Models::AdGroup} # for more details. # @@ -435,6 +454,8 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # # @param custom_conversions [Float] Whop pixel-attributed custom (merchant-defined) conversion events, last-click, a # + # @param custom_event_counts [Object] Whop pixel-attributed custom conversions broken out by merchant-defined event na + # # @param delivery_status [Symbol, WhopSDK::Models::AdGroup::DeliveryStatus] The current delivery state, mirroring the Delivery column in the ads dashboard. # # @param demographics [Object] Demographic targeting: automatic (Advantage+), age range, gender. @@ -479,6 +500,8 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # # @param result_event_name [String, nil] The merchant-defined event name when result_event is custom; null for the standa # + # @param results [Float, nil] The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # # @param return_on_ad_spend [Float] Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # # @param schedules [Float] Whop pixel-attributed schedule events, last-click. diff --git a/rbi/whop_sdk/models/ad.rbi b/rbi/whop_sdk/models/ad.rbi index 556c25df..a2743ffc 100644 --- a/rbi/whop_sdk/models/ad.rbi +++ b/rbi/whop_sdk/models/ad.rbi @@ -112,6 +112,14 @@ module WhopSDK sig { returns(Float) } attr_accessor :custom_conversions + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + sig { returns(T.anything) } + attr_accessor :custom_event_counts + # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. sig { returns(WhopSDK::Ad::DeliveryStatus::TaggedSymbol) } @@ -202,6 +210,13 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :result_event_name + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + sig { returns(T.nilable(Float)) } + attr_accessor :results + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. sig { returns(Float) } @@ -283,6 +298,7 @@ module WhopSDK created_at: String, creatives: T::Array[WhopSDK::Ad::Creative::OrHash], custom_conversions: Float, + custom_event_counts: T.anything, delivery_status: WhopSDK::Ad::DeliveryStatus::OrSymbol, descriptions: T::Array[String], frequency: T.nilable(Float), @@ -303,6 +319,7 @@ module WhopSDK reach: Float, result_event: T.nilable(WhopSDK::Ad::ResultEvent::OrSymbol), result_event_name: T.nilable(String), + results: T.nilable(Float), return_on_ad_spend: Float, schedules: Float, social_accounts: T::Array[T.anything], @@ -375,6 +392,12 @@ module WhopSDK # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, # across all custom event names. custom_conversions:, + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + custom_event_counts:, # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. delivery_status:, @@ -425,6 +448,11 @@ module WhopSDK # The merchant-defined event name when result_event is custom; null for the # standard events. result_event_name:, + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + results:, # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. return_on_ad_spend:, @@ -482,6 +510,7 @@ module WhopSDK created_at: String, creatives: T::Array[WhopSDK::Ad::Creative], custom_conversions: Float, + custom_event_counts: T.anything, delivery_status: WhopSDK::Ad::DeliveryStatus::TaggedSymbol, descriptions: T::Array[String], frequency: T.nilable(Float), @@ -502,6 +531,7 @@ module WhopSDK reach: Float, result_event: T.nilable(WhopSDK::Ad::ResultEvent::TaggedSymbol), result_event_name: T.nilable(String), + results: T.nilable(Float), return_on_ad_spend: Float, schedules: Float, social_accounts: T::Array[T.anything], diff --git a/rbi/whop_sdk/models/ad_campaign.rbi b/rbi/whop_sdk/models/ad_campaign.rbi index fc8ebd15..cb7d4814 100644 --- a/rbi/whop_sdk/models/ad_campaign.rbi +++ b/rbi/whop_sdk/models/ad_campaign.rbi @@ -112,6 +112,14 @@ module WhopSDK sig { returns(Float) } attr_accessor :custom_conversions + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + sig { returns(T.anything) } + attr_accessor :custom_event_counts + # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. sig { returns(WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol) } @@ -168,6 +176,13 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :result_event_name + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + sig { returns(T.nilable(Float)) } + attr_accessor :results + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. sig { returns(Float) } @@ -244,6 +259,7 @@ module WhopSDK cost_per_viewed_content: T.nilable(Float), created_at: String, custom_conversions: Float, + custom_event_counts: T.anything, delivery_status: WhopSDK::AdCampaign::DeliveryStatus::OrSymbol, frequency: T.nilable(Float), impressions: Float, @@ -257,6 +273,7 @@ module WhopSDK reach: Float, result_event: T.nilable(WhopSDK::AdCampaign::ResultEvent::OrSymbol), result_event_name: T.nilable(String), + results: T.nilable(Float), return_on_ad_spend: Float, schedules: Float, special_ad_categories: @@ -329,6 +346,12 @@ module WhopSDK # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, # across all custom event names. custom_conversions:, + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + custom_event_counts:, # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. delivery_status:, @@ -359,6 +382,11 @@ module WhopSDK # The merchant-defined event name when result_event is custom; null for the # standard events. result_event_name:, + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + results:, # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. return_on_ad_spend:, @@ -414,6 +442,7 @@ module WhopSDK cost_per_viewed_content: T.nilable(Float), created_at: String, custom_conversions: Float, + custom_event_counts: T.anything, delivery_status: WhopSDK::AdCampaign::DeliveryStatus::TaggedSymbol, frequency: T.nilable(Float), impressions: Float, @@ -428,6 +457,7 @@ module WhopSDK result_event: T.nilable(WhopSDK::AdCampaign::ResultEvent::TaggedSymbol), result_event_name: T.nilable(String), + results: T.nilable(Float), return_on_ad_spend: Float, schedules: Float, special_ad_categories: diff --git a/rbi/whop_sdk/models/ad_group.rbi b/rbi/whop_sdk/models/ad_group.rbi index 8f638171..529b6fa7 100644 --- a/rbi/whop_sdk/models/ad_group.rbi +++ b/rbi/whop_sdk/models/ad_group.rbi @@ -127,6 +127,14 @@ module WhopSDK sig { returns(Float) } attr_accessor :custom_conversions + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + sig { returns(T.anything) } + attr_accessor :custom_event_counts + # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. sig { returns(WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol) } @@ -217,6 +225,13 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :result_event_name + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + sig { returns(T.nilable(Float)) } + attr_accessor :results + # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. sig { returns(Float) } @@ -298,6 +313,7 @@ module WhopSDK cost_per_viewed_content: T.nilable(Float), created_at: String, custom_conversions: Float, + custom_event_counts: T.anything, delivery_status: WhopSDK::AdGroup::DeliveryStatus::OrSymbol, demographics: T.anything, desired_cost_per_result: T.nilable(Float), @@ -320,6 +336,7 @@ module WhopSDK regions: T.anything, result_event: T.nilable(WhopSDK::AdGroup::ResultEvent::OrSymbol), result_event_name: T.nilable(String), + results: T.nilable(Float), return_on_ad_spend: Float, schedules: Float, spend: Float, @@ -399,6 +416,12 @@ module WhopSDK # Whop pixel-attributed custom (merchant-defined) conversion events, last-click, # across all custom event names. custom_conversions:, + # Whop pixel-attributed custom conversions broken out by merchant-defined event + # name, last-click, as a { event_name => count } map over the stats window. Empty + # when no named custom events are attributed. Custom events fired without a name + # are counted in custom_conversions but omitted here, so these values sum to at + # most custom_conversions. + custom_event_counts:, # The current delivery state, mirroring the Delivery column in the ads dashboard. # When several states apply at once, the highest-precedence one is returned. delivery_status:, @@ -445,6 +468,11 @@ module WhopSDK # The merchant-defined event name when result_event is custom; null for the # standard events. result_event_name:, + # The Whop pixel-attributed count behind result_event. When a campaign's ad groups + # optimize different goals there is no single result_event (it is null), and this + # is instead the sum of each ad group's own attributed results. Null when nothing + # Whop-attributable is being optimized for. + results:, # Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when # there is no spend. return_on_ad_spend:, @@ -504,6 +532,7 @@ module WhopSDK cost_per_viewed_content: T.nilable(Float), created_at: String, custom_conversions: Float, + custom_event_counts: T.anything, delivery_status: WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol, demographics: T.anything, desired_cost_per_result: T.nilable(Float), @@ -527,6 +556,7 @@ module WhopSDK result_event: T.nilable(WhopSDK::AdGroup::ResultEvent::TaggedSymbol), result_event_name: T.nilable(String), + results: T.nilable(Float), return_on_ad_spend: Float, schedules: Float, spend: Float, diff --git a/sig/whop_sdk/models/ad.rbs b/sig/whop_sdk/models/ad.rbs index b123db0e..314cb85c 100644 --- a/sig/whop_sdk/models/ad.rbs +++ b/sig/whop_sdk/models/ad.rbs @@ -25,6 +25,7 @@ module WhopSDK created_at: String, creatives: ::Array[WhopSDK::Ad::Creative], custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::Ad::delivery_status, descriptions: ::Array[String], frequency: Float?, @@ -45,6 +46,7 @@ module WhopSDK reach: Float, result_event: WhopSDK::Models::Ad::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, social_accounts: ::Array[top], @@ -108,6 +110,8 @@ module WhopSDK attr_accessor custom_conversions: Float + attr_accessor custom_event_counts: top + attr_accessor delivery_status: WhopSDK::Models::Ad::delivery_status attr_accessor descriptions: ::Array[String] @@ -148,6 +152,8 @@ module WhopSDK attr_accessor result_event_name: String? + attr_accessor results: Float? + attr_accessor return_on_ad_spend: Float attr_accessor schedules: Float @@ -200,6 +206,7 @@ module WhopSDK created_at: String, creatives: ::Array[WhopSDK::Ad::Creative], custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::Ad::delivery_status, descriptions: ::Array[String], frequency: Float?, @@ -220,6 +227,7 @@ module WhopSDK reach: Float, result_event: WhopSDK::Models::Ad::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, social_accounts: ::Array[top], @@ -260,6 +268,7 @@ module WhopSDK created_at: String, creatives: ::Array[WhopSDK::Ad::Creative], custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::Ad::delivery_status, descriptions: ::Array[String], frequency: Float?, @@ -280,6 +289,7 @@ module WhopSDK reach: Float, result_event: WhopSDK::Models::Ad::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, social_accounts: ::Array[top], diff --git a/sig/whop_sdk/models/ad_campaign.rbs b/sig/whop_sdk/models/ad_campaign.rbs index eda378d7..e4a5b988 100644 --- a/sig/whop_sdk/models/ad_campaign.rbs +++ b/sig/whop_sdk/models/ad_campaign.rbs @@ -25,6 +25,7 @@ module WhopSDK cost_per_viewed_content: Float?, created_at: String, custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::AdCampaign::delivery_status, frequency: Float?, impressions: Float, @@ -38,6 +39,7 @@ module WhopSDK reach: Float, result_event: WhopSDK::Models::AdCampaign::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ::Array[WhopSDK::Models::AdCampaign::special_ad_category], @@ -99,6 +101,8 @@ module WhopSDK attr_accessor custom_conversions: Float + attr_accessor custom_event_counts: top + attr_accessor delivery_status: WhopSDK::Models::AdCampaign::delivery_status attr_accessor frequency: Float? @@ -125,6 +129,8 @@ module WhopSDK attr_accessor result_event_name: String? + attr_accessor results: Float? + attr_accessor return_on_ad_spend: Float attr_accessor schedules: Float @@ -173,6 +179,7 @@ module WhopSDK cost_per_viewed_content: Float?, created_at: String, custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::AdCampaign::delivery_status, frequency: Float?, impressions: Float, @@ -186,6 +193,7 @@ module WhopSDK reach: Float, result_event: WhopSDK::Models::AdCampaign::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ::Array[WhopSDK::Models::AdCampaign::special_ad_category], @@ -224,6 +232,7 @@ module WhopSDK cost_per_viewed_content: Float?, created_at: String, custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::AdCampaign::delivery_status, frequency: Float?, impressions: Float, @@ -237,6 +246,7 @@ module WhopSDK reach: Float, result_event: WhopSDK::Models::AdCampaign::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ::Array[WhopSDK::Models::AdCampaign::special_ad_category], diff --git a/sig/whop_sdk/models/ad_group.rbs b/sig/whop_sdk/models/ad_group.rbs index 83649da7..3f7741e7 100644 --- a/sig/whop_sdk/models/ad_group.rbs +++ b/sig/whop_sdk/models/ad_group.rbs @@ -28,6 +28,7 @@ module WhopSDK cost_per_viewed_content: Float?, created_at: String, custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::AdGroup::delivery_status, demographics: top, desired_cost_per_result: Float?, @@ -50,6 +51,7 @@ module WhopSDK regions: top, result_event: WhopSDK::Models::AdGroup::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, spend: Float, @@ -117,6 +119,8 @@ module WhopSDK attr_accessor custom_conversions: Float + attr_accessor custom_event_counts: top + attr_accessor delivery_status: WhopSDK::Models::AdGroup::delivery_status attr_accessor demographics: top @@ -161,6 +165,8 @@ module WhopSDK attr_accessor result_event_name: String? + attr_accessor results: Float? + attr_accessor return_on_ad_spend: Float attr_accessor schedules: Float @@ -212,6 +218,7 @@ module WhopSDK cost_per_viewed_content: Float?, created_at: String, custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::AdGroup::delivery_status, demographics: top, desired_cost_per_result: Float?, @@ -234,6 +241,7 @@ module WhopSDK regions: top, result_event: WhopSDK::Models::AdGroup::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, spend: Float, @@ -275,6 +283,7 @@ module WhopSDK cost_per_viewed_content: Float?, created_at: String, custom_conversions: Float, + custom_event_counts: top, delivery_status: WhopSDK::Models::AdGroup::delivery_status, demographics: top, desired_cost_per_result: Float?, @@ -297,6 +306,7 @@ module WhopSDK regions: top, result_event: WhopSDK::Models::AdGroup::result_event?, result_event_name: String?, + results: Float?, return_on_ad_spend: Float, schedules: Float, spend: Float, diff --git a/test/whop_sdk/resources/ad_campaigns_test.rb b/test/whop_sdk/resources/ad_campaigns_test.rb index 5cfb76a8..3af13e13 100644 --- a/test/whop_sdk/resources/ad_campaigns_test.rb +++ b/test/whop_sdk/resources/ad_campaigns_test.rb @@ -37,6 +37,7 @@ def test_create_required_params cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, impressions: Float, @@ -50,6 +51,7 @@ def test_create_required_params reach: Float, result_event: WhopSDK::AdCampaign::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), @@ -100,6 +102,7 @@ def test_retrieve cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, impressions: Float, @@ -113,6 +116,7 @@ def test_retrieve reach: Float, result_event: WhopSDK::AdCampaign::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), @@ -163,6 +167,7 @@ def test_update cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, impressions: Float, @@ -176,6 +181,7 @@ def test_update reach: Float, result_event: WhopSDK::AdCampaign::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), @@ -233,6 +239,7 @@ def test_list cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, impressions: Float, @@ -246,6 +253,7 @@ def test_list reach: Float, result_event: WhopSDK::AdCampaign::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), @@ -306,6 +314,7 @@ def test_pause cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, impressions: Float, @@ -319,6 +328,7 @@ def test_pause reach: Float, result_event: WhopSDK::AdCampaign::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), @@ -369,6 +379,7 @@ def test_unpause cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdCampaign::DeliveryStatus, frequency: Float | nil, impressions: Float, @@ -382,6 +393,7 @@ def test_unpause reach: Float, result_event: WhopSDK::AdCampaign::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, special_ad_categories: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AdCampaign::SpecialAdCategory]), diff --git a/test/whop_sdk/resources/ad_groups_test.rb b/test/whop_sdk/resources/ad_groups_test.rb index 297039dc..794e3dda 100644 --- a/test/whop_sdk/resources/ad_groups_test.rb +++ b/test/whop_sdk/resources/ad_groups_test.rb @@ -40,6 +40,7 @@ def test_create_required_params cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, @@ -62,6 +63,7 @@ def test_create_required_params regions: WhopSDK::Internal::Type::Unknown, result_event: WhopSDK::AdGroup::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, spend: Float, @@ -115,6 +117,7 @@ def test_retrieve cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, @@ -137,6 +140,7 @@ def test_retrieve regions: WhopSDK::Internal::Type::Unknown, result_event: WhopSDK::AdGroup::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, spend: Float, @@ -190,6 +194,7 @@ def test_update cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, @@ -212,6 +217,7 @@ def test_update regions: WhopSDK::Internal::Type::Unknown, result_event: WhopSDK::AdGroup::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, spend: Float, @@ -272,6 +278,7 @@ def test_list cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, @@ -294,6 +301,7 @@ def test_list regions: WhopSDK::Internal::Type::Unknown, result_event: WhopSDK::AdGroup::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, spend: Float, @@ -357,6 +365,7 @@ def test_pause cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, @@ -379,6 +388,7 @@ def test_pause regions: WhopSDK::Internal::Type::Unknown, result_event: WhopSDK::AdGroup::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, spend: Float, @@ -432,6 +442,7 @@ def test_unpause cost_per_viewed_content: Float | nil, created_at: String, custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, @@ -454,6 +465,7 @@ def test_unpause regions: WhopSDK::Internal::Type::Unknown, result_event: WhopSDK::AdGroup::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, spend: Float, diff --git a/test/whop_sdk/resources/ads_test.rb b/test/whop_sdk/resources/ads_test.rb index 32a9c59a..286b0573 100644 --- a/test/whop_sdk/resources/ads_test.rb +++ b/test/whop_sdk/resources/ads_test.rb @@ -37,6 +37,7 @@ def test_create created_at: String, creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::Ad::DeliveryStatus, descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, @@ -57,6 +58,7 @@ def test_create reach: Float, result_event: WhopSDK::Ad::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), @@ -109,6 +111,7 @@ def test_retrieve created_at: String, creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::Ad::DeliveryStatus, descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, @@ -129,6 +132,7 @@ def test_retrieve reach: Float, result_event: WhopSDK::Ad::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), @@ -181,6 +185,7 @@ def test_update created_at: String, creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::Ad::DeliveryStatus, descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, @@ -201,6 +206,7 @@ def test_update reach: Float, result_event: WhopSDK::Ad::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), @@ -260,6 +266,7 @@ def test_list created_at: String, creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::Ad::DeliveryStatus, descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, @@ -280,6 +287,7 @@ def test_list reach: Float, result_event: WhopSDK::Ad::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), @@ -342,6 +350,7 @@ def test_pause created_at: String, creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::Ad::DeliveryStatus, descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, @@ -362,6 +371,7 @@ def test_pause reach: Float, result_event: WhopSDK::Ad::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), @@ -414,6 +424,7 @@ def test_unpause created_at: String, creatives: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Creative]), custom_conversions: Float, + custom_event_counts: WhopSDK::Internal::Type::Unknown, delivery_status: WhopSDK::Ad::DeliveryStatus, descriptions: ^(WhopSDK::Internal::Type::ArrayOf[String]), frequency: Float | nil, @@ -434,6 +445,7 @@ def test_unpause reach: Float, result_event: WhopSDK::Ad::ResultEvent | nil, result_event_name: String | nil, + results: Float | nil, return_on_ad_spend: Float, schedules: Float, social_accounts: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), From 7742af735ba0229572470b33f92cfc2caf6192ec Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 05:08:03 +0000 Subject: [PATCH 22/34] Add personal recommended actions to GET /users/me (core) Stainless-Generated-From: 1ce602254c7bed9cea239d63a66500ad42b88f86 --- .stats.yml | 2 +- lib/whop_sdk.rb | 2 + lib/whop_sdk/models.rb | 2 + lib/whop_sdk/models/account.rb | 9 +- .../account_recommend_actions_response.rb | 9 +- .../referrals/business_retrieve_response.rb | 9 +- .../models/user_recommend_actions_params.rb | 20 ++ .../models/user_recommend_actions_response.rb | 161 +++++++++ lib/whop_sdk/resources/users.rb | 24 ++ rbi/whop_sdk/models.rbi | 2 + rbi/whop_sdk/models/account.rbi | 10 +- .../account_recommend_actions_response.rbi | 10 +- .../referrals/business_retrieve_response.rbi | 10 +- .../models/user_recommend_actions_params.rbi | 35 ++ .../user_recommend_actions_response.rbi | 319 ++++++++++++++++++ rbi/whop_sdk/resources/users.rbi | 18 + sig/whop_sdk/models.rbs | 2 + .../models/user_recommend_actions_params.rbs | 20 ++ .../user_recommend_actions_response.rbs | 143 ++++++++ sig/whop_sdk/resources/users.rbs | 5 + test/whop_sdk/resources/users_test.rb | 16 + 21 files changed, 794 insertions(+), 34 deletions(-) create mode 100644 lib/whop_sdk/models/user_recommend_actions_params.rb create mode 100644 lib/whop_sdk/models/user_recommend_actions_response.rb create mode 100644 rbi/whop_sdk/models/user_recommend_actions_params.rbi create mode 100644 rbi/whop_sdk/models/user_recommend_actions_response.rbi create mode 100644 sig/whop_sdk/models/user_recommend_actions_params.rbs create mode 100644 sig/whop_sdk/models/user_recommend_actions_response.rbs diff --git a/.stats.yml b/.stats.yml index 330fae47..59ea20e2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 271 +configured_endpoints: 272 diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index 24d79ac6..fd9f155f 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -604,6 +604,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_recommend_actions_params" +require_relative "whop_sdk/models/user_recommend_actions_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" diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index 6df246fa..ea809a25 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -849,6 +849,8 @@ module WhopSDK UserListParams = WhopSDK::Models::UserListParams + UserRecommendActionsParams = WhopSDK::Models::UserRecommendActionsParams + UserRetrieveParams = WhopSDK::Models::UserRetrieveParams UserUpdateMeParams = WhopSDK::Models::UserUpdateMeParams diff --git a/lib/whop_sdk/models/account.rb b/lib/whop_sdk/models/account.rb index d6f29d06..b4151592 100644 --- a/lib/whop_sdk/models/account.rb +++ b/lib/whop_sdk/models/account.rb @@ -723,14 +723,13 @@ class RecommendedAction < WhopSDK::Internal::Type::BaseModel required :icon_url, String, nil?: true # @!attribute impact_score - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked # # @return [Integer, nil] required :impact_score, Integer, nil?: true # @!attribute reasoning - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` # # @return [String, nil] required :reasoning, String, nil?: true @@ -768,9 +767,9 @@ class RecommendedAction < WhopSDK::Internal::Type::BaseModel # # @param icon_url [String, nil] Illustration icon URL, or `null` # - # @param impact_score [Integer, nil] Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # @param impact_score [Integer, nil] Estimated impact from 0-100, or `null` when not ranked # - # @param reasoning [String, nil] Why this action was recommended for this account, or `null` + # @param reasoning [String, nil] Why this action was recommended, or `null` # # @param status [Symbol, WhopSDK::Models::Account::RecommendedAction::Status] Always optional — never blocking # diff --git a/lib/whop_sdk/models/account_recommend_actions_response.rb b/lib/whop_sdk/models/account_recommend_actions_response.rb index 3867fca0..fa5b6051 100644 --- a/lib/whop_sdk/models/account_recommend_actions_response.rb +++ b/lib/whop_sdk/models/account_recommend_actions_response.rb @@ -51,14 +51,13 @@ class Data < WhopSDK::Internal::Type::BaseModel required :icon_url, String, nil?: true # @!attribute impact_score - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked # # @return [Integer, nil] required :impact_score, Integer, nil?: true # @!attribute reasoning - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` # # @return [String, nil] required :reasoning, String, nil?: true @@ -91,9 +90,9 @@ class Data < WhopSDK::Internal::Type::BaseModel # # @param icon_url [String, nil] Illustration icon URL, or `null` # - # @param impact_score [Integer, nil] Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # @param impact_score [Integer, nil] Estimated impact from 0-100, or `null` when not ranked # - # @param reasoning [String, nil] Why this action was recommended for this account, or `null` + # @param reasoning [String, nil] Why this action was recommended, or `null` # # @param status [Symbol, WhopSDK::Models::AccountRecommendActionsResponse::Data::Status] Always optional — never blocking # diff --git a/lib/whop_sdk/models/referrals/business_retrieve_response.rb b/lib/whop_sdk/models/referrals/business_retrieve_response.rb index 480925f4..7a30de47 100644 --- a/lib/whop_sdk/models/referrals/business_retrieve_response.rb +++ b/lib/whop_sdk/models/referrals/business_retrieve_response.rb @@ -478,14 +478,13 @@ class RecommendedAction < WhopSDK::Internal::Type::BaseModel required :icon_url, String, nil?: true # @!attribute impact_score - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked # # @return [Integer, nil] required :impact_score, Integer, nil?: true # @!attribute reasoning - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` # # @return [String, nil] required :reasoning, String, nil?: true @@ -520,9 +519,9 @@ class RecommendedAction < WhopSDK::Internal::Type::BaseModel # # @param icon_url [String, nil] Illustration icon URL, or `null` # - # @param impact_score [Integer, nil] Estimated revenue impact from 0-100, comparable across accounts, or `null` when + # @param impact_score [Integer, nil] Estimated impact from 0-100, or `null` when not ranked # - # @param reasoning [String, nil] Why this action was recommended for this account, or `null` + # @param reasoning [String, nil] Why this action was recommended, or `null` # # @param status [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status] Always optional — never blocking # diff --git a/lib/whop_sdk/models/user_recommend_actions_params.rb b/lib/whop_sdk/models/user_recommend_actions_params.rb new file mode 100644 index 00000000..078ef69a --- /dev/null +++ b/lib/whop_sdk/models/user_recommend_actions_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Users#recommend_actions + class UserRecommendActionsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/user_recommend_actions_response.rb b/lib/whop_sdk/models/user_recommend_actions_response.rb new file mode 100644 index 00000000..d2d7c31e --- /dev/null +++ b/lib/whop_sdk/models/user_recommend_actions_response.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Users#recommend_actions + class UserRecommendActionsResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::UserRecommendActionsResponse::Data] } + + # @!method initialize(data:) + # @param data [Array] + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # The account (`biz_`) a business recommendation is for, or `null` for personal + # recommendations + # + # @return [String, nil] + required :account_id, String, nil?: true + + # @!attribute account_name + # The account's display name, or `null` + # + # @return [String, nil] + required :account_name, String, nil?: true + + # @!attribute action + # The recommendation; new values may be added, so handle unknown actions + # gracefully + # + # @return [Symbol, WhopSDK::Models::UserRecommendActionsResponse::Data::Action] + required :action, enum: -> { WhopSDK::Models::UserRecommendActionsResponse::Data::Action } + + # @!attribute blocked_capabilities + # + # @return [Array] + required :blocked_capabilities, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute cta + # The URL the call-to-action links to + # + # @return [String] + required :cta, String + + # @!attribute cta_label + # Button label + # + # @return [String] + required :cta_label, String + + # @!attribute description + # Supporting copy, or empty + # + # @return [String] + required :description, String + + # @!attribute icon_url + # Illustration icon URL, or `null` + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute impact_score + # Estimated impact from 0-100, or `null` when not ranked + # + # @return [Integer, nil] + required :impact_score, Integer, nil?: true + + # @!attribute reasoning + # Why this action was recommended, or `null` + # + # @return [String, nil] + required :reasoning, String, nil?: true + + # @!attribute status + # Always optional — never blocking + # + # @return [Symbol, WhopSDK::Models::UserRecommendActionsResponse::Data::Status] + required :status, enum: -> { WhopSDK::Models::UserRecommendActionsResponse::Data::Status } + + # @!attribute title + # Headline for the recommendation + # + # @return [String] + required :title, String + + # @!method initialize(account_id:, account_name:, action:, blocked_capabilities:, cta:, cta_label:, description:, icon_url:, impact_score:, reasoning:, status:, title:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::UserRecommendActionsResponse::Data} for more details. + # + # @param account_id [String, nil] The account (`biz_`) a business recommendation is for, or `null` for personal re + # + # @param account_name [String, nil] The account's display name, or `null` + # + # @param action [Symbol, WhopSDK::Models::UserRecommendActionsResponse::Data::Action] The recommendation; new values may be added, so handle unknown actions gracefull + # + # @param blocked_capabilities [Array] + # + # @param cta [String] The URL the call-to-action links to + # + # @param cta_label [String] Button label + # + # @param description [String] Supporting copy, or empty + # + # @param icon_url [String, nil] Illustration icon URL, or `null` + # + # @param impact_score [Integer, nil] Estimated impact from 0-100, or `null` when not ranked + # + # @param reasoning [String, nil] Why this action was recommended, or `null` + # + # @param status [Symbol, WhopSDK::Models::UserRecommendActionsResponse::Data::Status] Always optional — never blocking + # + # @param title [String] Headline for the recommendation + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + # + # @see WhopSDK::Models::UserRecommendActionsResponse::Data#action + module Action + extend WhopSDK::Internal::Type::Enum + + CREATE_BUSINESS = :create_business + BECOME_AFFILIATE = :become_affiliate + THEME_BUSINESS = :theme_business + CREATE_PRODUCT = :create_product + CREATE_PLAN = :create_plan + VERIFY_IDENTITY = :verify_identity + CONNECT_AFFILIATE_PROGRAM = :connect_affiliate_program + CREATE_PROMOTION = :create_promotion + SETUP_TRACKING_PIXEL = :setup_tracking_pixel + MIGRATE_FROM_STRIPE = :migrate_from_stripe + ACCEPT_FIRST_PAYMENT = :accept_first_payment + LAUNCH_FIRST_AD = :launch_first_ad + INVITE_TEAM_MEMBER = :invite_team_member + ENABLE_TAX_COLLECTION = :enable_tax_collection + CREATE_CARD = :create_card + JOIN_WHOP_UNIVERSITY = :join_whop_university + APPLY_FOR_FINANCING = :apply_for_financing + + # @!method self.values + # @return [Array] + end + + # Always optional — never blocking + # + # @see WhopSDK::Models::UserRecommendActionsResponse::Data#status + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL = :optional + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/resources/users.rb b/lib/whop_sdk/resources/users.rb index 05a3d805..0c75acb5 100644 --- a/lib/whop_sdk/resources/users.rb +++ b/lib/whop_sdk/resources/users.rb @@ -147,6 +147,30 @@ def check_access(resource_id, params) ) end + # Lists the recommended actions computed for the user: personal suggestions (e.g. + # start a business or become an affiliate) pooled with the highest-impact actions + # across the accounts the user owns. Business actions are tagged with their + # `account_id`/`account_name`; personal actions leave those `null`. Self-only: + # `id` must be `me` or the authenticated user's own tag/username. + # + # @overload recommend_actions(id, request_options: {}) + # + # @param id [String] `me`, or the authenticated user's own `user_` tag or username. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::UserRecommendActionsResponse] + # + # @see WhopSDK::Models::UserRecommendActionsParams + def recommend_actions(id, params = {}) + @client.request( + method: :get, + path: ["users/%1$s/recommend_actions", id], + model: WhopSDK::Models::UserRecommendActionsResponse, + options: params[:request_options] + ) + end + # Some parameter documentations has been truncated, see # {WhopSDK::Models::UserUpdateMeParams} for more details. # diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index e322a950..b0b9517a 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -851,6 +851,8 @@ module WhopSDK UserListParams = WhopSDK::Models::UserListParams + UserRecommendActionsParams = WhopSDK::Models::UserRecommendActionsParams + UserRetrieveParams = WhopSDK::Models::UserRetrieveParams UserUpdateMeParams = WhopSDK::Models::UserUpdateMeParams diff --git a/rbi/whop_sdk/models/account.rbi b/rbi/whop_sdk/models/account.rbi index dcc6ec00..575e78e2 100644 --- a/rbi/whop_sdk/models/account.rbi +++ b/rbi/whop_sdk/models/account.rbi @@ -1086,12 +1086,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :icon_url - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked sig { returns(T.nilable(Integer)) } attr_accessor :impact_score - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` sig { returns(T.nilable(String)) } attr_accessor :reasoning @@ -1136,10 +1135,9 @@ module WhopSDK description:, # Illustration icon URL, or `null` icon_url:, - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked impact_score:, - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` reasoning:, # Always optional — never blocking status:, diff --git a/rbi/whop_sdk/models/account_recommend_actions_response.rbi b/rbi/whop_sdk/models/account_recommend_actions_response.rbi index 92755d7c..e443702c 100644 --- a/rbi/whop_sdk/models/account_recommend_actions_response.rbi +++ b/rbi/whop_sdk/models/account_recommend_actions_response.rbi @@ -77,12 +77,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :icon_url - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked sig { returns(T.nilable(Integer)) } attr_accessor :impact_score - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` sig { returns(T.nilable(String)) } attr_accessor :reasoning @@ -127,10 +126,9 @@ module WhopSDK description:, # Illustration icon URL, or `null` icon_url:, - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked impact_score:, - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` reasoning:, # Always optional — never blocking status:, diff --git a/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi b/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi index 8b3f14a2..8c1886dc 100644 --- a/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi +++ b/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi @@ -1042,12 +1042,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :icon_url - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked sig { returns(T.nilable(Integer)) } attr_accessor :impact_score - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` sig { returns(T.nilable(String)) } attr_accessor :reasoning @@ -1092,10 +1091,9 @@ module WhopSDK description:, # Illustration icon URL, or `null` icon_url:, - # Estimated revenue impact from 0-100, comparable across accounts, or `null` when - # not ranked + # Estimated impact from 0-100, or `null` when not ranked impact_score:, - # Why this action was recommended for this account, or `null` + # Why this action was recommended, or `null` reasoning:, # Always optional — never blocking status:, diff --git a/rbi/whop_sdk/models/user_recommend_actions_params.rbi b/rbi/whop_sdk/models/user_recommend_actions_params.rbi new file mode 100644 index 00000000..39781777 --- /dev/null +++ b/rbi/whop_sdk/models/user_recommend_actions_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module WhopSDK + module Models + class UserRecommendActionsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::UserRecommendActionsParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/user_recommend_actions_response.rbi b/rbi/whop_sdk/models/user_recommend_actions_response.rbi new file mode 100644 index 00000000..6a36e307 --- /dev/null +++ b/rbi/whop_sdk/models/user_recommend_actions_response.rbi @@ -0,0 +1,319 @@ +# typed: strong + +module WhopSDK + module Models + class UserRecommendActionsResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::UserRecommendActionsResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns(T::Array[WhopSDK::Models::UserRecommendActionsResponse::Data]) + end + attr_accessor :data + + sig do + params( + data: + T::Array[ + WhopSDK::Models::UserRecommendActionsResponse::Data::OrHash + ] + ).returns(T.attached_class) + end + def self.new(data:) + end + + sig do + override.returns( + { + data: T::Array[WhopSDK::Models::UserRecommendActionsResponse::Data] + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::UserRecommendActionsResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + # The account (`biz_`) a business recommendation is for, or `null` for personal + # recommendations + sig { returns(T.nilable(String)) } + attr_accessor :account_id + + # The account's display name, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :account_name + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + sig do + returns( + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + end + attr_accessor :action + + sig { returns(T::Array[String]) } + attr_accessor :blocked_capabilities + + # The URL the call-to-action links to + sig { returns(String) } + attr_accessor :cta + + # Button label + sig { returns(String) } + attr_accessor :cta_label + + # Supporting copy, or empty + sig { returns(String) } + attr_accessor :description + + # Illustration icon URL, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + # Estimated impact from 0-100, or `null` when not ranked + sig { returns(T.nilable(Integer)) } + attr_accessor :impact_score + + # Why this action was recommended, or `null` + sig { returns(T.nilable(String)) } + attr_accessor :reasoning + + # Always optional — never blocking + sig do + returns( + WhopSDK::Models::UserRecommendActionsResponse::Data::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Headline for the recommendation + sig { returns(String) } + attr_accessor :title + + sig do + params( + account_id: T.nilable(String), + account_name: T.nilable(String), + action: + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::OrSymbol, + blocked_capabilities: T::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: T.nilable(String), + impact_score: T.nilable(Integer), + reasoning: T.nilable(String), + status: + WhopSDK::Models::UserRecommendActionsResponse::Data::Status::OrSymbol, + title: String + ).returns(T.attached_class) + end + def self.new( + # The account (`biz_`) a business recommendation is for, or `null` for personal + # recommendations + account_id:, + # The account's display name, or `null` + account_name:, + # The recommendation; new values may be added, so handle unknown actions + # gracefully + action:, + blocked_capabilities:, + # The URL the call-to-action links to + cta:, + # Button label + cta_label:, + # Supporting copy, or empty + description:, + # Illustration icon URL, or `null` + icon_url:, + # Estimated impact from 0-100, or `null` when not ranked + impact_score:, + # Why this action was recommended, or `null` + reasoning:, + # Always optional — never blocking + status:, + # Headline for the recommendation + title: + ) + end + + sig do + override.returns( + { + account_id: T.nilable(String), + account_name: T.nilable(String), + action: + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol, + blocked_capabilities: T::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: T.nilable(String), + impact_score: T.nilable(Integer), + reasoning: T.nilable(String), + status: + WhopSDK::Models::UserRecommendActionsResponse::Data::Status::TaggedSymbol, + title: String + } + ) + end + def to_hash + end + + # The recommendation; new values may be added, so handle unknown actions + # gracefully + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_BUSINESS = + T.let( + :create_business, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + BECOME_AFFILIATE = + T.let( + :become_affiliate, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + THEME_BUSINESS = + T.let( + :theme_business, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CREATE_PRODUCT = + T.let( + :create_product, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CREATE_PLAN = + T.let( + :create_plan, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + VERIFY_IDENTITY = + T.let( + :verify_identity, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CONNECT_AFFILIATE_PROGRAM = + T.let( + :connect_affiliate_program, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CREATE_PROMOTION = + T.let( + :create_promotion, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + SETUP_TRACKING_PIXEL = + T.let( + :setup_tracking_pixel, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + MIGRATE_FROM_STRIPE = + T.let( + :migrate_from_stripe, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + ACCEPT_FIRST_PAYMENT = + T.let( + :accept_first_payment, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + LAUNCH_FIRST_AD = + T.let( + :launch_first_ad, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + INVITE_TEAM_MEMBER = + T.let( + :invite_team_member, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + ENABLE_TAX_COLLECTION = + T.let( + :enable_tax_collection, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + CREATE_CARD = + T.let( + :create_card, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + JOIN_WHOP_UNIVERSITY = + T.let( + :join_whop_university, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + APPLY_FOR_FINANCING = + T.let( + :apply_for_financing, + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::UserRecommendActionsResponse::Data::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Always optional — never blocking + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::UserRecommendActionsResponse::Data::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPTIONAL = + T.let( + :optional, + WhopSDK::Models::UserRecommendActionsResponse::Data::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::UserRecommendActionsResponse::Data::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/users.rbi b/rbi/whop_sdk/resources/users.rbi index b3847f79..bc3eb1f8 100644 --- a/rbi/whop_sdk/resources/users.rbi +++ b/rbi/whop_sdk/resources/users.rbi @@ -124,6 +124,24 @@ module WhopSDK ) end + # Lists the recommended actions computed for the user: personal suggestions (e.g. + # start a business or become an affiliate) pooled with the highest-impact actions + # across the accounts the user owns. Business actions are tagged with their + # `account_id`/`account_name`; personal actions leave those `null`. Self-only: + # `id` must be `me` or the authenticated user's own tag/username. + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::UserRecommendActionsResponse) + end + def recommend_actions( + # `me`, or the authenticated user's own `user_` tag or username. + id, + request_options: {} + ) + end + # 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 diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index 758b2865..7acd7cc7 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -807,6 +807,8 @@ module WhopSDK class UserListParams = WhopSDK::Models::UserListParams + class UserRecommendActionsParams = WhopSDK::Models::UserRecommendActionsParams + class UserRetrieveParams = WhopSDK::Models::UserRetrieveParams class UserUpdateMeParams = WhopSDK::Models::UserUpdateMeParams diff --git a/sig/whop_sdk/models/user_recommend_actions_params.rbs b/sig/whop_sdk/models/user_recommend_actions_params.rbs new file mode 100644 index 00000000..ab7f9077 --- /dev/null +++ b/sig/whop_sdk/models/user_recommend_actions_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type user_recommend_actions_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class UserRecommendActionsParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/user_recommend_actions_response.rbs b/sig/whop_sdk/models/user_recommend_actions_response.rbs new file mode 100644 index 00000000..6705f07b --- /dev/null +++ b/sig/whop_sdk/models/user_recommend_actions_response.rbs @@ -0,0 +1,143 @@ +module WhopSDK + module Models + type user_recommend_actions_response = + { data: ::Array[WhopSDK::Models::UserRecommendActionsResponse::Data] } + + class UserRecommendActionsResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::UserRecommendActionsResponse::Data] + + def initialize: ( + data: ::Array[WhopSDK::Models::UserRecommendActionsResponse::Data] + ) -> void + + def to_hash: -> { + data: ::Array[WhopSDK::Models::UserRecommendActionsResponse::Data] + } + + type data = + { + account_id: String?, + account_name: String?, + action: WhopSDK::Models::UserRecommendActionsResponse::Data::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::UserRecommendActionsResponse::Data::status, + title: String + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String? + + attr_accessor account_name: String? + + attr_accessor action: WhopSDK::Models::UserRecommendActionsResponse::Data::action + + attr_accessor blocked_capabilities: ::Array[String] + + attr_accessor cta: String + + attr_accessor cta_label: String + + attr_accessor description: String + + attr_accessor icon_url: String? + + attr_accessor impact_score: Integer? + + attr_accessor reasoning: String? + + attr_accessor status: WhopSDK::Models::UserRecommendActionsResponse::Data::status + + attr_accessor title: String + + def initialize: ( + account_id: String?, + account_name: String?, + action: WhopSDK::Models::UserRecommendActionsResponse::Data::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::UserRecommendActionsResponse::Data::status, + title: String + ) -> void + + def to_hash: -> { + account_id: String?, + account_name: String?, + action: WhopSDK::Models::UserRecommendActionsResponse::Data::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::UserRecommendActionsResponse::Data::status, + title: String + } + + type action = + :create_business + | :become_affiliate + | :theme_business + | :create_product + | :create_plan + | :verify_identity + | :connect_affiliate_program + | :create_promotion + | :setup_tracking_pixel + | :migrate_from_stripe + | :accept_first_payment + | :launch_first_ad + | :invite_team_member + | :enable_tax_collection + | :create_card + | :join_whop_university + | :apply_for_financing + + module Action + extend WhopSDK::Internal::Type::Enum + + CREATE_BUSINESS: :create_business + BECOME_AFFILIATE: :become_affiliate + THEME_BUSINESS: :theme_business + CREATE_PRODUCT: :create_product + CREATE_PLAN: :create_plan + VERIFY_IDENTITY: :verify_identity + CONNECT_AFFILIATE_PROGRAM: :connect_affiliate_program + CREATE_PROMOTION: :create_promotion + SETUP_TRACKING_PIXEL: :setup_tracking_pixel + MIGRATE_FROM_STRIPE: :migrate_from_stripe + ACCEPT_FIRST_PAYMENT: :accept_first_payment + LAUNCH_FIRST_AD: :launch_first_ad + INVITE_TEAM_MEMBER: :invite_team_member + ENABLE_TAX_COLLECTION: :enable_tax_collection + CREATE_CARD: :create_card + JOIN_WHOP_UNIVERSITY: :join_whop_university + APPLY_FOR_FINANCING: :apply_for_financing + + def self?.values: -> ::Array[WhopSDK::Models::UserRecommendActionsResponse::Data::action] + end + + type status = :optional + + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL: :optional + + def self?.values: -> ::Array[WhopSDK::Models::UserRecommendActionsResponse::Data::status] + end + end + end + end +end diff --git a/sig/whop_sdk/resources/users.rbs b/sig/whop_sdk/resources/users.rbs index 3520bc76..de1315f7 100644 --- a/sig/whop_sdk/resources/users.rbs +++ b/sig/whop_sdk/resources/users.rbs @@ -37,6 +37,11 @@ module WhopSDK ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::UserCheckAccessResponse + def recommend_actions: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::UserRecommendActionsResponse + def update_me: ( ?account_id: String, ?bio: String, diff --git a/test/whop_sdk/resources/users_test.rb b/test/whop_sdk/resources/users_test.rb index 88c338ae..ca247c70 100644 --- a/test/whop_sdk/resources/users_test.rb +++ b/test/whop_sdk/resources/users_test.rb @@ -105,6 +105,22 @@ def test_check_access_required_params end end + def test_recommend_actions + skip("Mock server tests are disabled") + + response = @whop.users.recommend_actions("id") + + assert_pattern do + response => WhopSDK::Models::UserRecommendActionsResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::UserRecommendActionsResponse::Data]) + } + end + end + def test_update_me skip("Mock server tests are disabled") From 0a33f788716dced4fb288ea9b22058218d7fc9a6 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 08:37:00 +0000 Subject: [PATCH 23/34] =?UTF-8?q?chore(api):=20finish=20the=20business=5Fr?= =?UTF-8?q?eferrals=20=E2=86=92=20partners=20rename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stainless-Generated-From: e4c44192fa796004bdb6a5d23823723e9bae8cfb --- lib/whop_sdk.rb | 31 +- lib/whop_sdk/client.rb | 8 +- lib/whop_sdk/models.rb | 12 +- lib/whop_sdk/models/partner_create_params.rb | 14 + .../models/partner_create_response.rb | 29 + .../models/partner_leaderboard_params.rb | 43 ++ .../models/partner_leaderboard_response.rb | 278 +++++++ ...ms.rb => partner_referred_users_params.rb} | 6 +- ....rb => partner_referred_users_response.rb} | 34 +- .../business_list_params.rb | 50 +- .../business_list_response.rb | 98 +-- .../business_retrieve_params.rb | 4 +- .../business_retrieve_response.rb | 243 ++++--- .../businesses/earning_list_params.rb | 22 +- .../businesses/earning_list_response.rb | 78 +- .../referrals/business_leaderboard_params.rb | 45 -- .../business_leaderboard_response.rb | 284 -------- .../models/referrals/partner_create_params.rb | 16 - .../referrals/partner_create_response.rb | 31 - lib/whop_sdk/resources/partners.rb | 115 +++ lib/whop_sdk/resources/partners/businesses.rb | 104 +++ .../businesses/earnings.rb | 20 +- lib/whop_sdk/resources/referrals.rb | 77 -- .../resources/referrals/businesses.rb | 132 ---- lib/whop_sdk/resources/referrals/partners.rb | 42 -- rbi/whop_sdk/client.rbi | 6 +- rbi/whop_sdk/models.rbi | 12 +- rbi/whop_sdk/models/partner_create_params.rbi | 27 + .../models/partner_create_response.rbi | 46 ++ .../models/partner_leaderboard_params.rbi | 92 +++ .../models/partner_leaderboard_response.rbi | 508 +++++++++++++ ....rbi => partner_referred_users_params.rbi} | 7 +- ...bi => partner_referred_users_response.rbi} | 43 +- .../business_list_params.rbi | 98 +-- .../business_list_response.rbi | 126 ++-- .../business_retrieve_params.rbi | 4 +- .../business_retrieve_response.rbi | 412 +++++------ .../businesses/earning_list_params.rbi | 62 +- .../businesses/earning_list_response.rbi | 114 +-- .../referrals/business_leaderboard_params.rbi | 120 ---- .../business_leaderboard_response.rbi | 535 -------------- .../referrals/partner_create_params.rbi | 32 - .../referrals/partner_create_response.rbi | 48 -- .../resources/{referrals.rbi => partners.rbi} | 46 +- .../{referrals => partners}/businesses.rbi | 51 +- .../businesses/earnings.rbi | 14 +- rbi/whop_sdk/resources/referrals/partners.rbi | 31 - sig/whop_sdk/client.rbs | 2 +- sig/whop_sdk/models.rbs | 12 +- sig/whop_sdk/models/partner_create_params.rbs | 15 + .../models/partner_create_response.rbs | 19 + .../models/partner_leaderboard_params.rbs | 42 ++ .../models/partner_leaderboard_response.rbs | 219 ++++++ ....rbs => partner_referred_users_params.rbs} | 4 +- ...bs => partner_referred_users_response.rbs} | 40 +- .../business_list_params.rbs | 58 +- .../business_list_response.rbs | 92 +-- .../business_retrieve_params.rbs | 2 +- .../partners/business_retrieve_response.rbs | 677 ++++++++++++++++++ .../businesses/earning_list_params.rbs | 44 +- .../businesses/earning_list_response.rbs | 86 +-- .../referrals/business_leaderboard_params.rbs | 46 -- .../business_leaderboard_response.rbs | 221 ------ .../referrals/business_retrieve_response.rbs | 677 ------------------ .../referrals/partner_create_params.rbs | 17 - .../referrals/partner_create_response.rbs | 21 - sig/whop_sdk/resources/partners.rbs | 28 + .../resources/partners/businesses.rbs | 33 + .../businesses/earnings.rbs | 10 +- sig/whop_sdk/resources/referrals.rbs | 21 - .../resources/referrals/businesses.rbs | 38 - sig/whop_sdk/resources/referrals/partners.rbs | 13 - test/whop_sdk/resource_namespaces.rb | 8 +- .../partners/businesses/earnings_test.rb | 41 ++ .../resources/partners/businesses_test.rb | 68 ++ test/whop_sdk/resources/partners_test.rb | 56 ++ .../referrals/businesses/earnings_test.rb | 41 -- .../resources/referrals/businesses_test.rb | 85 --- .../resources/referrals/partners_test.rb | 22 - test/whop_sdk/resources/referrals_test.rb | 22 - 80 files changed, 3437 insertions(+), 3593 deletions(-) create mode 100644 lib/whop_sdk/models/partner_create_params.rb create mode 100644 lib/whop_sdk/models/partner_create_response.rb create mode 100644 lib/whop_sdk/models/partner_leaderboard_params.rb create mode 100644 lib/whop_sdk/models/partner_leaderboard_response.rb rename lib/whop_sdk/models/{referral_referred_users_params.rb => partner_referred_users_params.rb} (91%) rename lib/whop_sdk/models/{referral_referred_users_response.rb => partner_referred_users_response.rb} (68%) rename lib/whop_sdk/models/{referrals => partners}/business_list_params.rb (69%) rename lib/whop_sdk/models/{referrals => partners}/business_list_response.rb (67%) rename lib/whop_sdk/models/{referrals => partners}/business_retrieve_params.rb (86%) rename lib/whop_sdk/models/{referrals => partners}/business_retrieve_response.rb (63%) rename lib/whop_sdk/models/{referrals => partners}/businesses/earning_list_params.rb (75%) rename lib/whop_sdk/models/{referrals => partners}/businesses/earning_list_response.rb (71%) delete mode 100644 lib/whop_sdk/models/referrals/business_leaderboard_params.rb delete mode 100644 lib/whop_sdk/models/referrals/business_leaderboard_response.rb delete mode 100644 lib/whop_sdk/models/referrals/partner_create_params.rb delete mode 100644 lib/whop_sdk/models/referrals/partner_create_response.rb create mode 100644 lib/whop_sdk/resources/partners.rb create mode 100644 lib/whop_sdk/resources/partners/businesses.rb rename lib/whop_sdk/resources/{referrals => partners}/businesses/earnings.rb (68%) delete mode 100644 lib/whop_sdk/resources/referrals.rb delete mode 100644 lib/whop_sdk/resources/referrals/businesses.rb delete mode 100644 lib/whop_sdk/resources/referrals/partners.rb create mode 100644 rbi/whop_sdk/models/partner_create_params.rbi create mode 100644 rbi/whop_sdk/models/partner_create_response.rbi create mode 100644 rbi/whop_sdk/models/partner_leaderboard_params.rbi create mode 100644 rbi/whop_sdk/models/partner_leaderboard_response.rbi rename rbi/whop_sdk/models/{referral_referred_users_params.rbi => partner_referred_users_params.rbi} (93%) rename rbi/whop_sdk/models/{referral_referred_users_response.rbi => partner_referred_users_response.rbi} (75%) rename rbi/whop_sdk/models/{referrals => partners}/business_list_params.rbi (71%) rename rbi/whop_sdk/models/{referrals => partners}/business_list_response.rbi (75%) rename rbi/whop_sdk/models/{referrals => partners}/business_retrieve_params.rbi (91%) rename rbi/whop_sdk/models/{referrals => partners}/business_retrieve_response.rbi (65%) rename rbi/whop_sdk/models/{referrals => partners}/businesses/earning_list_params.rbi (71%) rename rbi/whop_sdk/models/{referrals => partners}/businesses/earning_list_response.rbi (75%) delete mode 100644 rbi/whop_sdk/models/referrals/business_leaderboard_params.rbi delete mode 100644 rbi/whop_sdk/models/referrals/business_leaderboard_response.rbi delete mode 100644 rbi/whop_sdk/models/referrals/partner_create_params.rbi delete mode 100644 rbi/whop_sdk/models/referrals/partner_create_response.rbi rename rbi/whop_sdk/resources/{referrals.rbi => partners.rbi} (57%) rename rbi/whop_sdk/resources/{referrals => partners}/businesses.rbi (61%) rename rbi/whop_sdk/resources/{referrals => partners}/businesses/earnings.rbi (78%) delete mode 100644 rbi/whop_sdk/resources/referrals/partners.rbi create mode 100644 sig/whop_sdk/models/partner_create_params.rbs create mode 100644 sig/whop_sdk/models/partner_create_response.rbs create mode 100644 sig/whop_sdk/models/partner_leaderboard_params.rbs create mode 100644 sig/whop_sdk/models/partner_leaderboard_response.rbs rename sig/whop_sdk/models/{referral_referred_users_params.rbs => partner_referred_users_params.rbs} (92%) rename sig/whop_sdk/models/{referral_referred_users_response.rbs => partner_referred_users_response.rbs} (61%) rename sig/whop_sdk/models/{referrals => partners}/business_list_params.rbs (61%) rename sig/whop_sdk/models/{referrals => partners}/business_list_response.rbs (54%) rename sig/whop_sdk/models/{referrals => partners}/business_retrieve_params.rbs (96%) create mode 100644 sig/whop_sdk/models/partners/business_retrieve_response.rbs rename sig/whop_sdk/models/{referrals => partners}/businesses/earning_list_params.rbs (60%) rename sig/whop_sdk/models/{referrals => partners}/businesses/earning_list_response.rbs (59%) delete mode 100644 sig/whop_sdk/models/referrals/business_leaderboard_params.rbs delete mode 100644 sig/whop_sdk/models/referrals/business_leaderboard_response.rbs delete mode 100644 sig/whop_sdk/models/referrals/business_retrieve_response.rbs delete mode 100644 sig/whop_sdk/models/referrals/partner_create_params.rbs delete mode 100644 sig/whop_sdk/models/referrals/partner_create_response.rbs create mode 100644 sig/whop_sdk/resources/partners.rbs create mode 100644 sig/whop_sdk/resources/partners/businesses.rbs rename sig/whop_sdk/resources/{referrals => partners}/businesses/earnings.rbs (54%) delete mode 100644 sig/whop_sdk/resources/referrals.rbs delete mode 100644 sig/whop_sdk/resources/referrals/businesses.rbs delete mode 100644 sig/whop_sdk/resources/referrals/partners.rbs create mode 100644 test/whop_sdk/resources/partners/businesses/earnings_test.rb create mode 100644 test/whop_sdk/resources/partners/businesses_test.rb create mode 100644 test/whop_sdk/resources/partners_test.rb delete mode 100644 test/whop_sdk/resources/referrals/businesses/earnings_test.rb delete mode 100644 test/whop_sdk/resources/referrals/businesses_test.rb delete mode 100644 test/whop_sdk/resources/referrals/partners_test.rb delete mode 100644 test/whop_sdk/resources/referrals_test.rb diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index fd9f155f..fc12e23b 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -429,6 +429,18 @@ require_relative "whop_sdk/models/notification_create_response" require_relative "whop_sdk/models/notification_preferences" require_relative "whop_sdk/models/page_info" +require_relative "whop_sdk/models/partner_create_params" +require_relative "whop_sdk/models/partner_create_response" +require_relative "whop_sdk/models/partner_leaderboard_params" +require_relative "whop_sdk/models/partner_leaderboard_response" +require_relative "whop_sdk/models/partner_referred_users_params" +require_relative "whop_sdk/models/partner_referred_users_response" +require_relative "whop_sdk/models/partners/businesses/earning_list_params" +require_relative "whop_sdk/models/partners/businesses/earning_list_response" +require_relative "whop_sdk/models/partners/business_list_params" +require_relative "whop_sdk/models/partners/business_list_response" +require_relative "whop_sdk/models/partners/business_retrieve_params" +require_relative "whop_sdk/models/partners/business_retrieve_response" require_relative "whop_sdk/models/payment" require_relative "whop_sdk/models/payment_created_webhook_event" require_relative "whop_sdk/models/payment_create_params" @@ -502,18 +514,6 @@ require_relative "whop_sdk/models/reaction_retrieve_params" require_relative "whop_sdk/models/receipt_status" require_relative "whop_sdk/models/receipt_tax_behavior" -require_relative "whop_sdk/models/referral_referred_users_params" -require_relative "whop_sdk/models/referral_referred_users_response" -require_relative "whop_sdk/models/referrals/businesses/earning_list_params" -require_relative "whop_sdk/models/referrals/businesses/earning_list_response" -require_relative "whop_sdk/models/referrals/business_leaderboard_params" -require_relative "whop_sdk/models/referrals/business_leaderboard_response" -require_relative "whop_sdk/models/referrals/business_list_params" -require_relative "whop_sdk/models/referrals/business_list_response" -require_relative "whop_sdk/models/referrals/business_retrieve_params" -require_relative "whop_sdk/models/referrals/business_retrieve_response" -require_relative "whop_sdk/models/referrals/partner_create_params" -require_relative "whop_sdk/models/referrals/partner_create_response" require_relative "whop_sdk/models/refund_created_webhook_event" require_relative "whop_sdk/models/refund_list_params" require_relative "whop_sdk/models/refund_list_response" @@ -699,6 +699,9 @@ require_relative "whop_sdk/resources/memberships" require_relative "whop_sdk/resources/messages" require_relative "whop_sdk/resources/notifications" +require_relative "whop_sdk/resources/partners" +require_relative "whop_sdk/resources/partners/businesses" +require_relative "whop_sdk/resources/partners/businesses/earnings" require_relative "whop_sdk/resources/payment_methods" require_relative "whop_sdk/resources/payments" require_relative "whop_sdk/resources/payout_accounts" @@ -709,10 +712,6 @@ require_relative "whop_sdk/resources/products" require_relative "whop_sdk/resources/promo_codes" require_relative "whop_sdk/resources/reactions" -require_relative "whop_sdk/resources/referrals" -require_relative "whop_sdk/resources/referrals/businesses" -require_relative "whop_sdk/resources/referrals/businesses/earnings" -require_relative "whop_sdk/resources/referrals/partners" require_relative "whop_sdk/resources/refunds" require_relative "whop_sdk/resources/resolution_center_cases" require_relative "whop_sdk/resources/reviews" diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index ee72f561..062ea1ef 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -288,14 +288,14 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [WhopSDK::Resources::Payouts] attr_reader :payouts - # The Referrals API covers your Whop partner activity: the users you referred onto + # The Partners API covers your Whop partner activity: the users you referred onto # Whop, the businesses you referred and the earnings generated from their # processing volume, and the partner leaderboard. # # Use it to enroll as a Whop partner, list the users you referred, list your # referred businesses and review their earnings, and see the partner leaderboard. - # @return [WhopSDK::Resources::Referrals] - attr_reader :referrals + # @return [WhopSDK::Resources::Partners] + attr_reader :partners # Cards represent Whop-issued virtual payment cards that spend from an account or # user balance. Cards can be assigned to cardholders and configured with spending @@ -550,7 +550,7 @@ def initialize( @financial_activity = WhopSDK::Resources::FinancialActivity.new(client: self) @stats = WhopSDK::Resources::Stats.new(client: self) @payouts = WhopSDK::Resources::Payouts.new(client: self) - @referrals = WhopSDK::Resources::Referrals.new(client: self) + @partners = WhopSDK::Resources::Partners.new(client: self) @cards = WhopSDK::Resources::Cards.new(client: self) @swaps = WhopSDK::Resources::Swaps.new(client: self) @deposits = WhopSDK::Resources::Deposits.new(client: self) diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index ea809a25..3d3b1dbc 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -601,6 +601,14 @@ module WhopSDK PageInfo = WhopSDK::Models::PageInfo + PartnerCreateParams = WhopSDK::Models::PartnerCreateParams + + PartnerLeaderboardParams = WhopSDK::Models::PartnerLeaderboardParams + + PartnerReferredUsersParams = WhopSDK::Models::PartnerReferredUsersParams + + Partners = WhopSDK::Models::Partners + Payment = WhopSDK::Models::Payment PaymentCreatedWebhookEvent = WhopSDK::Models::PaymentCreatedWebhookEvent @@ -711,10 +719,6 @@ module WhopSDK ReceiptTaxBehavior = WhopSDK::Models::ReceiptTaxBehavior - ReferralReferredUsersParams = WhopSDK::Models::ReferralReferredUsersParams - - Referrals = WhopSDK::Models::Referrals - RefundCreatedWebhookEvent = WhopSDK::Models::RefundCreatedWebhookEvent RefundListParams = WhopSDK::Models::RefundListParams diff --git a/lib/whop_sdk/models/partner_create_params.rb b/lib/whop_sdk/models/partner_create_params.rb new file mode 100644 index 00000000..068fc59c --- /dev/null +++ b/lib/whop_sdk/models/partner_create_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Partners#create + class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/partner_create_response.rb b/lib/whop_sdk/models/partner_create_response.rb new file mode 100644 index 00000000..3cbd731a --- /dev/null +++ b/lib/whop_sdk/models/partner_create_response.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Partners#create + class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute referral_link + # The caller's referral link — businesses that sign up through it are attributed + # to the caller. + # + # @return [String] + required :referral_link, String + + # @!attribute whop_partner_enabled_at + # When the caller became a Whop partner. + # + # @return [Time] + required :whop_partner_enabled_at, Time + + # @!method initialize(referral_link:, whop_partner_enabled_at:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PartnerCreateResponse} for more details. + # + # @param referral_link [String] The caller's referral link — businesses that sign up through it are attributed t + # + # @param whop_partner_enabled_at [Time] When the caller became a Whop partner. + end + end +end diff --git a/lib/whop_sdk/models/partner_leaderboard_params.rb b/lib/whop_sdk/models/partner_leaderboard_params.rb new file mode 100644 index 00000000..f0a1c023 --- /dev/null +++ b/lib/whop_sdk/models/partner_leaderboard_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Partners#leaderboard + class PartnerLeaderboardParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute period + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + # + # @return [Symbol, WhopSDK::Models::PartnerLeaderboardParams::Period, nil] + optional :period, enum: -> { WhopSDK::PartnerLeaderboardParams::Period } + + # @!method initialize(period: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PartnerLeaderboardParams} for more details. + # + # @param period [Symbol, WhopSDK::Models::PartnerLeaderboardParams::Period] Time window for the rankings. `day`, `month`, and `year` count earnings since th + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + module Period + extend WhopSDK::Internal::Type::Enum + + DAY = :day + MONTH = :month + YEAR = :year + LAST_30_DAYS = :last_30_days + ALL_TIME = :all_time + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/partner_leaderboard_response.rb b/lib/whop_sdk/models/partner_leaderboard_response.rb new file mode 100644 index 00000000..60609970 --- /dev/null +++ b/lib/whop_sdk/models/partner_leaderboard_response.rb @@ -0,0 +1,278 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Partners#leaderboard + class PartnerLeaderboardResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute leaders + # The top referrers by total earnings, best first. + # + # @return [Array] + required :leaders, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PartnerLeaderboardResponse::Leader] } + + # @!attribute me + # The caller's own standing; null when the caller has no referral earnings. + # + # @return [WhopSDK::Models::PartnerLeaderboardResponse::Me, nil] + required :me, -> { WhopSDK::Models::PartnerLeaderboardResponse::Me }, nil?: true + + # @!method initialize(leaders:, me:) + # @param leaders [Array] The top referrers by total earnings, best first. + # + # @param me [WhopSDK::Models::PartnerLeaderboardResponse::Me, nil] The caller's own standing; null when the caller has no referral earnings. + + class Leader < WhopSDK::Internal::Type::BaseModel + # @!attribute first_referral_started_at + # When the referrer's earliest partner business became active. + # + # @return [Time] + required :first_referral_started_at, Time + + # @!attribute rank + # 1-based leaderboard position. + # + # @return [Integer] + required :rank, Integer + + # @!attribute total_earnings_usd + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + # + # @return [String] + required :total_earnings_usd, String + + # @!attribute total_volume_usd + # Credited GMV across all the referrer's referred businesses, in USD. + # + # @return [String] + required :total_volume_usd, String + + # @!attribute user + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + # + # @return [WhopSDK::Models::PartnerLeaderboardResponse::Leader::User, nil] + required :user, -> { WhopSDK::Models::PartnerLeaderboardResponse::Leader::User }, nil?: true + + # @!method initialize(first_referral_started_at:, rank:, total_earnings_usd:, total_volume_usd:, user:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PartnerLeaderboardResponse::Leader} for more details. + # + # @param first_referral_started_at [Time] When the referrer's earliest partner business became active. + # + # @param rank [Integer] 1-based leaderboard position. + # + # @param total_earnings_usd [String] The referrer's pending + completed earnings across all referred businesses, in U + # + # @param total_volume_usd [String] Credited GMV across all the referrer's referred businesses, in USD. + # + # @param user [WhopSDK::Models::PartnerLeaderboardResponse::Leader::User, nil] The ranked referrer. Identity fields (id, name, username, profile_picture) are r + + # @see WhopSDK::Models::PartnerLeaderboardResponse::Leader#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute id + # User ID, prefixed `user_`. Present only on the caller's own entry. + # + # @return [String, nil] + optional :id, String + + # @!attribute name + # The user's display name. Present only on the caller's own entry. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture. Present only on the caller's own entry. + # + # @return [WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture, nil] + optional :profile_picture, + -> { WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture } + + # @!attribute username + # The user's unique username. Present only on the caller's own entry. + # + # @return [String, nil] + optional :username, String + + # @!method initialize(city:, country:, id: nil, name: nil, profile_picture: nil, username: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PartnerLeaderboardResponse::Leader::User} for more details. + # + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + # + # @param city [String, nil] The city where the referrer is located, derived from their IP address. Null if l + # + # @param country [String, nil] The country where the referrer is located, derived from their IP address. Null i + # + # @param id [String] User ID, prefixed `user_`. Present only on the caller's own entry. + # + # @param name [String, nil] The user's display name. Present only on the caller's own entry. + # + # @param profile_picture [WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture] The user's profile picture. Present only on the caller's own entry. + # + # @param username [String] The user's unique username. Present only on the caller's own entry. + + # @see WhopSDK::Models::PartnerLeaderboardResponse::Leader::User#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # The user's profile picture URL. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The user's profile picture. Present only on the caller's own entry. + # + # @param url [String] The user's profile picture URL. + end + end + end + + # @see WhopSDK::Models::PartnerLeaderboardResponse#me + class Me < WhopSDK::Internal::Type::BaseModel + # @!attribute first_referral_started_at + # When the referrer's earliest partner business became active. + # + # @return [Time] + required :first_referral_started_at, Time + + # @!attribute rank + # 1-based leaderboard position. + # + # @return [Integer] + required :rank, Integer + + # @!attribute total_earnings_usd + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + # + # @return [String] + required :total_earnings_usd, String + + # @!attribute total_volume_usd + # Credited GMV across all the referrer's referred businesses, in USD. + # + # @return [String] + required :total_volume_usd, String + + # @!attribute user + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + # + # @return [WhopSDK::Models::PartnerLeaderboardResponse::Me::User, nil] + required :user, -> { WhopSDK::Models::PartnerLeaderboardResponse::Me::User }, nil?: true + + # @!method initialize(first_referral_started_at:, rank:, total_earnings_usd:, total_volume_usd:, user:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PartnerLeaderboardResponse::Me} for more details. + # + # The caller's own standing; null when the caller has no referral earnings. + # + # @param first_referral_started_at [Time] When the referrer's earliest partner business became active. + # + # @param rank [Integer] 1-based leaderboard position. + # + # @param total_earnings_usd [String] The referrer's pending + completed earnings across all referred businesses, in U + # + # @param total_volume_usd [String] Credited GMV across all the referrer's referred businesses, in USD. + # + # @param user [WhopSDK::Models::PartnerLeaderboardResponse::Me::User, nil] The ranked referrer. Identity fields (id, name, username, profile_picture) are r + + # @see WhopSDK::Models::PartnerLeaderboardResponse::Me#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute id + # User ID, prefixed `user_`. Present only on the caller's own entry. + # + # @return [String, nil] + optional :id, String + + # @!attribute name + # The user's display name. Present only on the caller's own entry. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture. Present only on the caller's own entry. + # + # @return [WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture, nil] + optional :profile_picture, -> { WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture } + + # @!attribute username + # The user's unique username. Present only on the caller's own entry. + # + # @return [String, nil] + optional :username, String + + # @!method initialize(city:, country:, id: nil, name: nil, profile_picture: nil, username: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PartnerLeaderboardResponse::Me::User} for more details. + # + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + # + # @param city [String, nil] The city where the referrer is located, derived from their IP address. Null if l + # + # @param country [String, nil] The country where the referrer is located, derived from their IP address. Null i + # + # @param id [String] User ID, prefixed `user_`. Present only on the caller's own entry. + # + # @param name [String, nil] The user's display name. Present only on the caller's own entry. + # + # @param profile_picture [WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture] The user's profile picture. Present only on the caller's own entry. + # + # @param username [String] The user's unique username. Present only on the caller's own entry. + + # @see WhopSDK::Models::PartnerLeaderboardResponse::Me::User#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # The user's profile picture URL. + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The user's profile picture. Present only on the caller's own entry. + # + # @param url [String] The user's profile picture URL. + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/referral_referred_users_params.rb b/lib/whop_sdk/models/partner_referred_users_params.rb similarity index 91% rename from lib/whop_sdk/models/referral_referred_users_params.rb rename to lib/whop_sdk/models/partner_referred_users_params.rb index d6f489bd..36243acd 100644 --- a/lib/whop_sdk/models/referral_referred_users_params.rb +++ b/lib/whop_sdk/models/partner_referred_users_params.rb @@ -2,8 +2,8 @@ module WhopSDK module Models - # @see WhopSDK::Resources::Referrals#referred_users - class ReferralReferredUsersParams < WhopSDK::Internal::Type::BaseModel + # @see WhopSDK::Resources::Partners#referred_users + class PartnerReferredUsersParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters @@ -46,7 +46,7 @@ class ReferralReferredUsersParams < WhopSDK::Internal::Type::BaseModel # @!method initialize(after: nil, before: nil, first: nil, has_businesses: nil, has_earning_businesses: nil, last: nil, request_options: {}) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::ReferralReferredUsersParams} for more details. + # {WhopSDK::Models::PartnerReferredUsersParams} for more details. # # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # diff --git a/lib/whop_sdk/models/referral_referred_users_response.rb b/lib/whop_sdk/models/partner_referred_users_response.rb similarity index 68% rename from lib/whop_sdk/models/referral_referred_users_response.rb rename to lib/whop_sdk/models/partner_referred_users_response.rb index b14fa31e..ebadfed3 100644 --- a/lib/whop_sdk/models/referral_referred_users_response.rb +++ b/lib/whop_sdk/models/partner_referred_users_response.rb @@ -2,22 +2,22 @@ module WhopSDK module Models - # @see WhopSDK::Resources::Referrals#referred_users - class ReferralReferredUsersResponse < WhopSDK::Internal::Type::BaseModel + # @see WhopSDK::Resources::Partners#referred_users + class PartnerReferredUsersResponse < WhopSDK::Internal::Type::BaseModel # @!attribute data # - # @return [Array] + # @return [Array] required :data, - -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::ReferralReferredUsersResponse::Data] } + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PartnerReferredUsersResponse::Data] } # @!attribute page_info # - # @return [WhopSDK::Models::ReferralReferredUsersResponse::PageInfo] - required :page_info, -> { WhopSDK::Models::ReferralReferredUsersResponse::PageInfo } + # @return [WhopSDK::Models::PartnerReferredUsersResponse::PageInfo] + required :page_info, -> { WhopSDK::Models::PartnerReferredUsersResponse::PageInfo } # @!method initialize(data:, page_info:) - # @param data [Array] - # @param page_info [WhopSDK::Models::ReferralReferredUsersResponse::PageInfo] + # @param data [Array] + # @param page_info [WhopSDK::Models::PartnerReferredUsersResponse::PageInfo] class Data < WhopSDK::Internal::Type::BaseModel # @!attribute total_earnings_usd @@ -32,15 +32,15 @@ class Data < WhopSDK::Internal::Type::BaseModel # @!attribute user # - # @return [WhopSDK::Models::ReferralReferredUsersResponse::Data::User] - required :user, -> { WhopSDK::Models::ReferralReferredUsersResponse::Data::User } + # @return [WhopSDK::Models::PartnerReferredUsersResponse::Data::User] + required :user, -> { WhopSDK::Models::PartnerReferredUsersResponse::Data::User } # @!method initialize(total_earnings_usd:, total_volume_usd:, user:) # @param total_earnings_usd [String] # @param total_volume_usd [String] - # @param user [WhopSDK::Models::ReferralReferredUsersResponse::Data::User] + # @param user [WhopSDK::Models::PartnerReferredUsersResponse::Data::User] - # @see WhopSDK::Models::ReferralReferredUsersResponse::Data#user + # @see WhopSDK::Models::PartnerReferredUsersResponse::Data#user class User < WhopSDK::Internal::Type::BaseModel # @!attribute id # @@ -69,9 +69,9 @@ class User < WhopSDK::Internal::Type::BaseModel # @!attribute profile_picture # - # @return [WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture, nil] + # @return [WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture, nil] optional :profile_picture, - -> { WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture } + -> { WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture } # @!method initialize(id:, username:, city: nil, country: nil, name: nil, profile_picture: nil) # @param id [String] @@ -79,9 +79,9 @@ class User < WhopSDK::Internal::Type::BaseModel # @param city [String, nil] # @param country [String, nil] # @param name [String, nil] - # @param profile_picture [WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture] + # @param profile_picture [WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture] - # @see WhopSDK::Models::ReferralReferredUsersResponse::Data::User#profile_picture + # @see WhopSDK::Models::PartnerReferredUsersResponse::Data::User#profile_picture class ProfilePicture < WhopSDK::Internal::Type::BaseModel # @!attribute url # @@ -94,7 +94,7 @@ class ProfilePicture < WhopSDK::Internal::Type::BaseModel end end - # @see WhopSDK::Models::ReferralReferredUsersResponse#page_info + # @see WhopSDK::Models::PartnerReferredUsersResponse#page_info class PageInfo < WhopSDK::Internal::Type::BaseModel # @!attribute end_cursor # diff --git a/lib/whop_sdk/models/referrals/business_list_params.rb b/lib/whop_sdk/models/partners/business_list_params.rb similarity index 69% rename from lib/whop_sdk/models/referrals/business_list_params.rb rename to lib/whop_sdk/models/partners/business_list_params.rb index ae2bb082..a1dc4655 100644 --- a/lib/whop_sdk/models/referrals/business_list_params.rb +++ b/lib/whop_sdk/models/partners/business_list_params.rb @@ -2,8 +2,8 @@ module WhopSDK module Models - module Referrals - # @see WhopSDK::Resources::Referrals::Businesses#list + module Partners + # @see WhopSDK::Resources::Partners::Businesses#list class BusinessListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters @@ -21,13 +21,13 @@ class BusinessListParams < WhopSDK::Internal::Type::BaseModel optional :before, String # @!attribute created_after - # Only return business referrals created after this timestamp. + # Only return partner businesses created after this timestamp. # # @return [String, nil] optional :created_after, String # @!attribute created_before - # Only return business referrals created before this timestamp. + # Only return partner businesses created before this timestamp. # # @return [String, nil] optional :created_before, String @@ -35,11 +35,11 @@ class BusinessListParams < WhopSDK::Internal::Type::BaseModel # @!attribute direction # Sort direction. # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Direction, nil] - optional :direction, enum: -> { WhopSDK::Referrals::BusinessListParams::Direction } + # @return [Symbol, WhopSDK::Models::Partners::BusinessListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::Partners::BusinessListParams::Direction } # @!attribute first - # Number of business referrals to return from the start of the window. + # Number of partner businesses to return from the start of the window. # # @return [Integer, nil] optional :first, Integer @@ -52,16 +52,16 @@ class BusinessListParams < WhopSDK::Internal::Type::BaseModel optional :has_earnings, WhopSDK::Internal::Type::Boolean # @!attribute last - # Number of business referrals to return from the end of the window. + # Number of partner businesses to return from the end of the window. # # @return [Integer, nil] optional :last, Integer # @!attribute order - # The field to sort business referrals by. + # The field to sort partner businesses by. # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Order, nil] - optional :order, enum: -> { WhopSDK::Referrals::BusinessListParams::Order } + # @return [Symbol, WhopSDK::Models::Partners::BusinessListParams::Order, nil] + optional :order, enum: -> { WhopSDK::Partners::BusinessListParams::Order } # @!attribute referred_user_id # Filter to referrals attributed to this user. For first-tier referrals, this is @@ -81,44 +81,44 @@ class BusinessListParams < WhopSDK::Internal::Type::BaseModel # @!attribute status # Filter by referral status. # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Status, nil] - optional :status, enum: -> { WhopSDK::Referrals::BusinessListParams::Status } + # @return [Symbol, WhopSDK::Models::Partners::BusinessListParams::Status, nil] + optional :status, enum: -> { WhopSDK::Partners::BusinessListParams::Status } # @!attribute tier # Filter to only first-tier referrals or only second-tier referrals. # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Tier, nil] - optional :tier, enum: -> { WhopSDK::Referrals::BusinessListParams::Tier } + # @return [Symbol, WhopSDK::Models::Partners::BusinessListParams::Tier, nil] + optional :tier, enum: -> { WhopSDK::Partners::BusinessListParams::Tier } # @!method initialize(after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, has_earnings: nil, last: nil, order: nil, referred_user_id: nil, referred_username: nil, status: nil, tier: nil, request_options: {}) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessListParams} for more details. + # {WhopSDK::Models::Partners::BusinessListParams} for more details. # # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). # # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). # - # @param created_after [String] Only return business referrals created after this timestamp. + # @param created_after [String] Only return partner businesses created after this timestamp. # - # @param created_before [String] Only return business referrals created before this timestamp. + # @param created_before [String] Only return partner businesses created before this timestamp. # - # @param direction [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Direction] Sort direction. + # @param direction [Symbol, WhopSDK::Models::Partners::BusinessListParams::Direction] Sort direction. # - # @param first [Integer] Number of business referrals to return from the start of the window. + # @param first [Integer] Number of partner businesses to return from the start of the window. # # @param has_earnings [Boolean] When true, only businesses with pending or completed earnings paid to the caller # - # @param last [Integer] Number of business referrals to return from the end of the window. + # @param last [Integer] Number of partner businesses to return from the end of the window. # - # @param order [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Order] The field to sort business referrals by. + # @param order [Symbol, WhopSDK::Models::Partners::BusinessListParams::Order] The field to sort partner businesses by. # # @param referred_user_id [String] Filter to referrals attributed to this user. For first-tier referrals, this is t # # @param referred_username [String] Filter by the referred user's exact username. Ignored when `referred_user_id` is # - # @param status [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Status] Filter by referral status. + # @param status [Symbol, WhopSDK::Models::Partners::BusinessListParams::Status] Filter by referral status. # - # @param tier [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Tier] Filter to only first-tier referrals or only second-tier referrals. + # @param tier [Symbol, WhopSDK::Models::Partners::BusinessListParams::Tier] Filter to only first-tier referrals or only second-tier referrals. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] @@ -133,7 +133,7 @@ module Direction # @return [Array] end - # The field to sort business referrals by. + # The field to sort partner businesses by. module Order extend WhopSDK::Internal::Type::Enum diff --git a/lib/whop_sdk/models/referrals/business_list_response.rb b/lib/whop_sdk/models/partners/business_list_response.rb similarity index 67% rename from lib/whop_sdk/models/referrals/business_list_response.rb rename to lib/whop_sdk/models/partners/business_list_response.rb index b4768f9f..4cb1edfc 100644 --- a/lib/whop_sdk/models/referrals/business_list_response.rb +++ b/lib/whop_sdk/models/partners/business_list_response.rb @@ -2,11 +2,11 @@ module WhopSDK module Models - module Referrals - # @see WhopSDK::Resources::Referrals::Businesses#list + module Partners + # @see WhopSDK::Resources::Partners::Businesses#list class BusinessListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute id - # Business referral ID. + # Partner business ID. # # @return [String] required :id, String @@ -14,46 +14,46 @@ class BusinessListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute account # Referred account. # - # @return [WhopSDK::Models::Referrals::BusinessListResponse::Account, nil] - required :account, -> { WhopSDK::Models::Referrals::BusinessListResponse::Account }, nil?: true + # @return [WhopSDK::Models::Partners::BusinessListResponse::Account, nil] + required :account, -> { WhopSDK::Models::Partners::BusinessListResponse::Account }, nil?: true # @!attribute created_at - # When the business referral was created. + # When the partner business was created. # # @return [Time] required :created_at, Time # @!attribute earnings_usd # - # @return [WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd] - required :earnings_usd, -> { WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd } + # @return [WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd] + required :earnings_usd, -> { WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd } # @!attribute first_tier_partner # The partner who referred the business owner onto Whop (first tier). Null if # there is no active first-tier partner. # - # @return [WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner, nil] + # @return [WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner, nil] required :first_tier_partner, - -> { WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner }, + -> { WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner }, nil?: true # @!attribute my_partner_tier # Which tier the caller earns on for this business: `first` (they referred the # owner) or `second` (they referred the first-tier partner). # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier] - required :my_partner_tier, enum: -> { WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier } + # @return [Symbol, WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier] + required :my_partner_tier, enum: -> { WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier } # @!attribute object # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::Object] - required :object, enum: -> { WhopSDK::Models::Referrals::BusinessListResponse::Object } + # @return [Symbol, WhopSDK::Models::Partners::BusinessListResponse::Object] + required :object, enum: -> { WhopSDK::Models::Partners::BusinessListResponse::Object } # @!attribute owner # The owner of the referred business. # - # @return [WhopSDK::Models::Referrals::BusinessListResponse::Owner, nil] - required :owner, -> { WhopSDK::Models::Referrals::BusinessListResponse::Owner }, nil?: true + # @return [WhopSDK::Models::Partners::BusinessListResponse::Owner, nil] + required :owner, -> { WhopSDK::Models::Partners::BusinessListResponse::Owner }, nil?: true # @!attribute payout_percentage # Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier @@ -77,33 +77,33 @@ class BusinessListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute status # Current referral status. # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::Status] - required :status, enum: -> { WhopSDK::Models::Referrals::BusinessListResponse::Status } + # @return [Symbol, WhopSDK::Models::Partners::BusinessListResponse::Status] + required :status, enum: -> { WhopSDK::Models::Partners::BusinessListResponse::Status } # @!attribute volume_usd # - # @return [WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd] - required :volume_usd, -> { WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd } + # @return [WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd] + required :volume_usd, -> { WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd } # @!method initialize(id:, account:, created_at:, earnings_usd:, first_tier_partner:, my_partner_tier:, object:, owner:, payout_percentage:, referral_expires_at:, referral_started_at:, status:, volume_usd:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessListResponse} for more details. + # {WhopSDK::Models::Partners::BusinessListResponse} for more details. # - # @param id [String] Business referral ID. + # @param id [String] Partner business ID. # - # @param account [WhopSDK::Models::Referrals::BusinessListResponse::Account, nil] Referred account. + # @param account [WhopSDK::Models::Partners::BusinessListResponse::Account, nil] Referred account. # - # @param created_at [Time] When the business referral was created. + # @param created_at [Time] When the partner business was created. # - # @param earnings_usd [WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd] + # @param earnings_usd [WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd] # - # @param first_tier_partner [WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner, nil] The partner who referred the business owner onto Whop (first tier). Null if ther + # @param first_tier_partner [WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner, nil] The partner who referred the business owner onto Whop (first tier). Null if ther # - # @param my_partner_tier [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier] Which tier the caller earns on for this business: `first` (they referred the own + # @param my_partner_tier [Symbol, WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier] Which tier the caller earns on for this business: `first` (they referred the own # - # @param object [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::Object] + # @param object [Symbol, WhopSDK::Models::Partners::BusinessListResponse::Object] # - # @param owner [WhopSDK::Models::Referrals::BusinessListResponse::Owner, nil] The owner of the referred business. + # @param owner [WhopSDK::Models::Partners::BusinessListResponse::Owner, nil] The owner of the referred business. # # @param payout_percentage [Float] Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier re # @@ -111,11 +111,11 @@ class BusinessListResponse < WhopSDK::Internal::Type::BaseModel # # @param referral_started_at [Time, nil] When the referral became active. # - # @param status [Symbol, WhopSDK::Models::Referrals::BusinessListResponse::Status] Current referral status. + # @param status [Symbol, WhopSDK::Models::Partners::BusinessListResponse::Status] Current referral status. # - # @param volume_usd [WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd] + # @param volume_usd [WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd] - # @see WhopSDK::Models::Referrals::BusinessListResponse#account + # @see WhopSDK::Models::Partners::BusinessListResponse#account class Account < WhopSDK::Internal::Type::BaseModel # @!attribute id # Referred account ID. @@ -153,7 +153,7 @@ class Account < WhopSDK::Internal::Type::BaseModel # @param title [String] Referred account display name. end - # @see WhopSDK::Models::Referrals::BusinessListResponse#earnings_usd + # @see WhopSDK::Models::Partners::BusinessListResponse#earnings_usd class EarningsUsd < WhopSDK::Internal::Type::BaseModel # @!attribute completed # Commission already paid out, in USD. @@ -181,7 +181,7 @@ class EarningsUsd < WhopSDK::Internal::Type::BaseModel # @param total [String] Pending + completed commission, in USD. end - # @see WhopSDK::Models::Referrals::BusinessListResponse#first_tier_partner + # @see WhopSDK::Models::Partners::BusinessListResponse#first_tier_partner class FirstTierPartner < WhopSDK::Internal::Type::BaseModel # @!attribute id # User ID, prefixed `user_`. @@ -198,9 +198,9 @@ class FirstTierPartner < WhopSDK::Internal::Type::BaseModel # @!attribute profile_picture # The user's profile picture. # - # @return [WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture] + # @return [WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture] required :profile_picture, - -> { WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture } + -> { WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture } # @!attribute username # The user's unique username. @@ -216,11 +216,11 @@ class FirstTierPartner < WhopSDK::Internal::Type::BaseModel # # @param name [String, nil] The user's display name. # - # @param profile_picture [WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture] The user's profile picture. + # @param profile_picture [WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture] The user's profile picture. # # @param username [String] The user's unique username. - # @see WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner#profile_picture + # @see WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner#profile_picture class ProfilePicture < WhopSDK::Internal::Type::BaseModel # @!attribute url # The user's profile picture URL. @@ -238,7 +238,7 @@ class ProfilePicture < WhopSDK::Internal::Type::BaseModel # Which tier the caller earns on for this business: `first` (they referred the # owner) or `second` (they referred the first-tier partner). # - # @see WhopSDK::Models::Referrals::BusinessListResponse#my_partner_tier + # @see WhopSDK::Models::Partners::BusinessListResponse#my_partner_tier module MyPartnerTier extend WhopSDK::Internal::Type::Enum @@ -249,17 +249,17 @@ module MyPartnerTier # @return [Array] end - # @see WhopSDK::Models::Referrals::BusinessListResponse#object + # @see WhopSDK::Models::Partners::BusinessListResponse#object module Object extend WhopSDK::Internal::Type::Enum - BUSINESS_REFERRAL = :business_referral + PARTNER_BUSINESS = :partner_business # @!method self.values # @return [Array] end - # @see WhopSDK::Models::Referrals::BusinessListResponse#owner + # @see WhopSDK::Models::Partners::BusinessListResponse#owner class Owner < WhopSDK::Internal::Type::BaseModel # @!attribute id # User ID, prefixed `user_`. @@ -276,8 +276,8 @@ class Owner < WhopSDK::Internal::Type::BaseModel # @!attribute profile_picture # The user's profile picture. # - # @return [WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture] - required :profile_picture, -> { WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture } + # @return [WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture] + required :profile_picture, -> { WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture } # @!attribute username # The user's unique username. @@ -292,11 +292,11 @@ class Owner < WhopSDK::Internal::Type::BaseModel # # @param name [String, nil] The user's display name. # - # @param profile_picture [WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture] The user's profile picture. + # @param profile_picture [WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture] The user's profile picture. # # @param username [String] The user's unique username. - # @see WhopSDK::Models::Referrals::BusinessListResponse::Owner#profile_picture + # @see WhopSDK::Models::Partners::BusinessListResponse::Owner#profile_picture class ProfilePicture < WhopSDK::Internal::Type::BaseModel # @!attribute url # The user's profile picture URL. @@ -313,7 +313,7 @@ class ProfilePicture < WhopSDK::Internal::Type::BaseModel # Current referral status. # - # @see WhopSDK::Models::Referrals::BusinessListResponse#status + # @see WhopSDK::Models::Partners::BusinessListResponse#status module Status extend WhopSDK::Internal::Type::Enum @@ -324,7 +324,7 @@ module Status # @return [Array] end - # @see WhopSDK::Models::Referrals::BusinessListResponse#volume_usd + # @see WhopSDK::Models::Partners::BusinessListResponse#volume_usd class VolumeUsd < WhopSDK::Internal::Type::BaseModel # @!attribute attributed # Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in @@ -347,7 +347,7 @@ class VolumeUsd < WhopSDK::Internal::Type::BaseModel # @!method initialize(attributed:, awaiting_settlement:, settled:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd} for more details. + # {WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd} for more details. # # @param attributed [String] Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in # diff --git a/lib/whop_sdk/models/referrals/business_retrieve_params.rb b/lib/whop_sdk/models/partners/business_retrieve_params.rb similarity index 86% rename from lib/whop_sdk/models/referrals/business_retrieve_params.rb rename to lib/whop_sdk/models/partners/business_retrieve_params.rb index 6f392a37..c28e5d6f 100644 --- a/lib/whop_sdk/models/referrals/business_retrieve_params.rb +++ b/lib/whop_sdk/models/partners/business_retrieve_params.rb @@ -2,8 +2,8 @@ module WhopSDK module Models - module Referrals - # @see WhopSDK::Resources::Referrals::Businesses#retrieve + module Partners + # @see WhopSDK::Resources::Partners::Businesses#retrieve class BusinessRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters diff --git a/lib/whop_sdk/models/referrals/business_retrieve_response.rb b/lib/whop_sdk/models/partners/business_retrieve_response.rb similarity index 63% rename from lib/whop_sdk/models/referrals/business_retrieve_response.rb rename to lib/whop_sdk/models/partners/business_retrieve_response.rb index 7a30de47..e71fdab7 100644 --- a/lib/whop_sdk/models/referrals/business_retrieve_response.rb +++ b/lib/whop_sdk/models/partners/business_retrieve_response.rb @@ -2,11 +2,11 @@ module WhopSDK module Models - module Referrals - # @see WhopSDK::Resources::Referrals::Businesses#retrieve + module Partners + # @see WhopSDK::Resources::Partners::Businesses#retrieve class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel # @!attribute id - # Business referral ID. + # Partner business ID. # # @return [String] required :id, String @@ -14,47 +14,46 @@ class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel # @!attribute account # Referred account. # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account, nil] - required :account, -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account }, nil?: true + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse::Account, nil] + required :account, -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account }, nil?: true # @!attribute created_at - # When the business referral was created. + # When the partner business was created. # # @return [Time] required :created_at, Time # @!attribute earnings_usd # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd] - required :earnings_usd, -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd } + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd] + required :earnings_usd, -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd } # @!attribute first_tier_partner # The partner who referred the business owner onto Whop (first tier). Null if # there is no active first-tier partner. # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner, nil] + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner, nil] required :first_tier_partner, - -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner }, + -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner }, nil?: true # @!attribute my_partner_tier # Which tier the caller earns on for this business: `first` (they referred the # owner) or `second` (they referred the first-tier partner). # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier] - required :my_partner_tier, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier } + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier] + required :my_partner_tier, enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier } # @!attribute object # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object] - required :object, enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object } + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Object] + required :object, enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Object } # @!attribute owner # The owner of the referred business. # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner, nil] - required :owner, -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner }, nil?: true + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner, nil] + required :owner, -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner }, nil?: true # @!attribute payout_percentage # Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier @@ -78,33 +77,33 @@ class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel # @!attribute status # Current referral status. # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status] - required :status, enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status } + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Status] + required :status, enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Status } # @!attribute volume_usd # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd] - required :volume_usd, -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd } + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd] + required :volume_usd, -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd } # @!method initialize(id:, account:, created_at:, earnings_usd:, first_tier_partner:, my_partner_tier:, object:, owner:, payout_percentage:, referral_expires_at:, referral_started_at:, status:, volume_usd:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessRetrieveResponse} for more details. + # {WhopSDK::Models::Partners::BusinessRetrieveResponse} for more details. # - # @param id [String] Business referral ID. + # @param id [String] Partner business ID. # - # @param account [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account, nil] Referred account. + # @param account [WhopSDK::Models::Partners::BusinessRetrieveResponse::Account, nil] Referred account. # - # @param created_at [Time] When the business referral was created. + # @param created_at [Time] When the partner business was created. # - # @param earnings_usd [WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd] + # @param earnings_usd [WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd] # - # @param first_tier_partner [WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner, nil] The partner who referred the business owner onto Whop (first tier). Null if ther + # @param first_tier_partner [WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner, nil] The partner who referred the business owner onto Whop (first tier). Null if ther # - # @param my_partner_tier [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier] Which tier the caller earns on for this business: `first` (they referred the own + # @param my_partner_tier [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier] Which tier the caller earns on for this business: `first` (they referred the own # - # @param object [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object] + # @param object [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Object] # - # @param owner [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner, nil] The owner of the referred business. + # @param owner [WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner, nil] The owner of the referred business. # # @param payout_percentage [Float] Referrer's share of Whop gross profit, as a fraction (0.3 = 30%). Second-tier re # @@ -112,11 +111,11 @@ class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel # # @param referral_started_at [Time, nil] When the referral became active. # - # @param status [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status] Current referral status. + # @param status [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Status] Current referral status. # - # @param volume_usd [WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd] + # @param volume_usd [WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd] - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#account + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse#account class Account < WhopSDK::Internal::Type::BaseModel # @!attribute id # Referred account ID. @@ -126,9 +125,9 @@ class Account < WhopSDK::Internal::Type::BaseModel # @!attribute capabilities # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities, nil] + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities, nil] required :capabilities, - -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities }, + -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities }, nil?: true # @!attribute logo_url @@ -140,17 +139,17 @@ class Account < WhopSDK::Internal::Type::BaseModel # @!attribute recommended_actions # Optional actions that unlock capabilities or grow the referred account. # - # @return [Array, nil] + # @return [Array, nil] required :recommended_actions, - -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction] }, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction] }, nil?: true # @!attribute required_actions # Actions the referred account owner must take to unblock capabilities. # - # @return [Array, nil] + # @return [Array, nil] required :required_actions, - -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction] }, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction] }, nil?: true # @!attribute route @@ -170,123 +169,123 @@ class Account < WhopSDK::Internal::Type::BaseModel # # @param id [String] Referred account ID. # - # @param capabilities [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities, nil] + # @param capabilities [WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities, nil] # # @param logo_url [String, nil] Referred account logo URL. # - # @param recommended_actions [Array, nil] Optional actions that unlock capabilities or grow the referred account. + # @param recommended_actions [Array, nil] Optional actions that unlock capabilities or grow the referred account. # - # @param required_actions [Array, nil] Actions the referred account owner must take to unblock capabilities. + # @param required_actions [Array, nil] Actions the referred account owner must take to unblock capabilities. # # @param route [String] Referred account route. # # @param title [String] Referred account display name. - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account#capabilities + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account#capabilities class Capabilities < WhopSDK::Internal::Type::BaseModel # @!attribute accept_bank_payments # Bank payins: debits, transfers, and local bank rails # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments] required :accept_bank_payments, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments } # @!attribute accept_bnpl_payments # Buy-now-pay-later payins; requires approval # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments] required :accept_bnpl_payments, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments } # @!attribute accept_card_payments # Card payins, including Apple Pay and Google Pay # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments] required :accept_card_payments, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments } # @!attribute bank_deposit # Deposits by bank wire or ACH to the account's virtual bank account # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit] required :bank_deposit, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit } # @!attribute card_deposit # Balance top-ups by charging a stored payment method # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit] required :card_deposit, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit } # @!attribute card_issuing # Issuing Whop cards; requires card application approval # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing] required :card_issuing, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing } # @!attribute crypto_deposit # On-chain deposits to the account's crypto wallet # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit] required :crypto_deposit, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit } # @!attribute crypto_payout # On-chain payouts to a crypto wallet # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout] required :crypto_payout, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout } # @!attribute instant_payout # Instant payouts to an eligible payout destination # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout] required :instant_payout, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout } # @!attribute standard_payout # Standard payouts to an external payout destination # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout] required :standard_payout, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout } # @!attribute transfer # Transfers to other accounts # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer] required :transfer, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer } # @!method initialize(accept_bank_payments:, accept_bnpl_payments:, accept_card_payments:, bank_deposit:, card_deposit:, card_issuing:, crypto_deposit:, crypto_payout:, instant_payout:, standard_payout:, transfer:) - # @param accept_bank_payments [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments] Bank payins: debits, transfers, and local bank rails + # @param accept_bank_payments [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments] Bank payins: debits, transfers, and local bank rails # - # @param accept_bnpl_payments [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments] Buy-now-pay-later payins; requires approval + # @param accept_bnpl_payments [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments] Buy-now-pay-later payins; requires approval # - # @param accept_card_payments [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments] Card payins, including Apple Pay and Google Pay + # @param accept_card_payments [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments] Card payins, including Apple Pay and Google Pay # - # @param bank_deposit [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit] Deposits by bank wire or ACH to the account's virtual bank account + # @param bank_deposit [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit] Deposits by bank wire or ACH to the account's virtual bank account # - # @param card_deposit [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit] Balance top-ups by charging a stored payment method + # @param card_deposit [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit] Balance top-ups by charging a stored payment method # - # @param card_issuing [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing] Issuing Whop cards; requires card application approval + # @param card_issuing [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing] Issuing Whop cards; requires card application approval # - # @param crypto_deposit [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit] On-chain deposits to the account's crypto wallet + # @param crypto_deposit [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit] On-chain deposits to the account's crypto wallet # - # @param crypto_payout [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout] On-chain payouts to a crypto wallet + # @param crypto_payout [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout] On-chain payouts to a crypto wallet # - # @param instant_payout [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout] Instant payouts to an eligible payout destination + # @param instant_payout [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout] Instant payouts to an eligible payout destination # - # @param standard_payout [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout] Standard payouts to an external payout destination + # @param standard_payout [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout] Standard payouts to an external payout destination # - # @param transfer [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer] Transfers to other accounts + # @param transfer [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer] Transfers to other accounts # Bank payins: debits, transfers, and local bank rails # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#accept_bank_payments + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#accept_bank_payments module AcceptBankPayments extend WhopSDK::Internal::Type::Enum @@ -300,7 +299,7 @@ module AcceptBankPayments # Buy-now-pay-later payins; requires approval # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#accept_bnpl_payments + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#accept_bnpl_payments module AcceptBnplPayments extend WhopSDK::Internal::Type::Enum @@ -314,7 +313,7 @@ module AcceptBnplPayments # Card payins, including Apple Pay and Google Pay # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#accept_card_payments + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#accept_card_payments module AcceptCardPayments extend WhopSDK::Internal::Type::Enum @@ -328,7 +327,7 @@ module AcceptCardPayments # Deposits by bank wire or ACH to the account's virtual bank account # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#bank_deposit + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#bank_deposit module BankDeposit extend WhopSDK::Internal::Type::Enum @@ -342,7 +341,7 @@ module BankDeposit # Balance top-ups by charging a stored payment method # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#card_deposit + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#card_deposit module CardDeposit extend WhopSDK::Internal::Type::Enum @@ -356,7 +355,7 @@ module CardDeposit # Issuing Whop cards; requires card application approval # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#card_issuing + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#card_issuing module CardIssuing extend WhopSDK::Internal::Type::Enum @@ -370,7 +369,7 @@ module CardIssuing # On-chain deposits to the account's crypto wallet # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#crypto_deposit + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#crypto_deposit module CryptoDeposit extend WhopSDK::Internal::Type::Enum @@ -384,7 +383,7 @@ module CryptoDeposit # On-chain payouts to a crypto wallet # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#crypto_payout + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#crypto_payout module CryptoPayout extend WhopSDK::Internal::Type::Enum @@ -398,7 +397,7 @@ module CryptoPayout # Instant payouts to an eligible payout destination # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#instant_payout + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#instant_payout module InstantPayout extend WhopSDK::Internal::Type::Enum @@ -412,7 +411,7 @@ module InstantPayout # Standard payouts to an external payout destination # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#standard_payout + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#standard_payout module StandardPayout extend WhopSDK::Internal::Type::Enum @@ -426,7 +425,7 @@ module StandardPayout # Transfers to other accounts # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities#transfer + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities#transfer module Transfer extend WhopSDK::Internal::Type::Enum @@ -444,9 +443,9 @@ class RecommendedAction < WhopSDK::Internal::Type::BaseModel # The recommendation; new values may be added, so handle unknown actions # gracefully # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action] required :action, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action } # @!attribute blocked_capabilities # @@ -492,9 +491,9 @@ class RecommendedAction < WhopSDK::Internal::Type::BaseModel # @!attribute status # Always optional — never blocking # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status] required :status, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status } # @!attribute title # Headline for the recommendation @@ -504,10 +503,10 @@ class RecommendedAction < WhopSDK::Internal::Type::BaseModel # @!method initialize(action:, blocked_capabilities:, cta:, cta_label:, description:, icon_url:, impact_score:, reasoning:, status:, title:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction} + # {WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction} # for more details. # - # @param action [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action] The recommendation; new values may be added, so handle unknown actions gracefull + # @param action [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action] The recommendation; new values may be added, so handle unknown actions gracefull # # @param blocked_capabilities [Array] # @@ -523,14 +522,14 @@ class RecommendedAction < WhopSDK::Internal::Type::BaseModel # # @param reasoning [String, nil] Why this action was recommended, or `null` # - # @param status [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status] Always optional — never blocking + # @param status [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status] Always optional — never blocking # # @param title [String] Headline for the recommendation # The recommendation; new values may be added, so handle unknown actions # gracefully # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction#action + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction#action module Action extend WhopSDK::Internal::Type::Enum @@ -556,7 +555,7 @@ module Action # Always optional — never blocking # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction#status + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction#status module Status extend WhopSDK::Internal::Type::Enum @@ -572,9 +571,9 @@ class RequiredAction < WhopSDK::Internal::Type::BaseModel # What the holder must do; new values may be added, so handle unknown actions # gracefully # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action] required :action, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action } # @!attribute blocked_capabilities # @@ -608,9 +607,9 @@ class RequiredAction < WhopSDK::Internal::Type::BaseModel # @!attribute status # required (act now) or pending (under review) # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status] + # @return [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status] required :status, - enum: -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status } + enum: -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status } # @!attribute title # Headline for the action @@ -620,10 +619,10 @@ class RequiredAction < WhopSDK::Internal::Type::BaseModel # @!method initialize(action:, blocked_capabilities:, cta:, cta_label:, description:, icon_url:, status:, title:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction} + # {WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction} # for more details. # - # @param action [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action] What the holder must do; new values may be added, so handle unknown actions grac + # @param action [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action] What the holder must do; new values may be added, so handle unknown actions grac # # @param blocked_capabilities [Array] # @@ -635,14 +634,14 @@ class RequiredAction < WhopSDK::Internal::Type::BaseModel # # @param icon_url [String, nil] The URL of the action's illustration icon, or null if it has none # - # @param status [Symbol, WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status] required (act now) or pending (under review) + # @param status [Symbol, WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status] required (act now) or pending (under review) # # @param title [String] Headline for the action # What the holder must do; new values may be added, so handle unknown actions # gracefully # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction#action + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction#action module Action extend WhopSDK::Internal::Type::Enum @@ -657,7 +656,7 @@ module Action # required (act now) or pending (under review) # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction#status + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction#status module Status extend WhopSDK::Internal::Type::Enum @@ -670,7 +669,7 @@ module Status end end - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#earnings_usd + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse#earnings_usd class EarningsUsd < WhopSDK::Internal::Type::BaseModel # @!attribute completed # Commission already paid out, in USD. @@ -698,7 +697,7 @@ class EarningsUsd < WhopSDK::Internal::Type::BaseModel # @param total [String] Pending + completed commission, in USD. end - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#first_tier_partner + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse#first_tier_partner class FirstTierPartner < WhopSDK::Internal::Type::BaseModel # @!attribute id # User ID, prefixed `user_`. @@ -715,9 +714,9 @@ class FirstTierPartner < WhopSDK::Internal::Type::BaseModel # @!attribute profile_picture # The user's profile picture. # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture] + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture] required :profile_picture, - -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture } + -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture } # @!attribute username # The user's unique username. @@ -733,11 +732,11 @@ class FirstTierPartner < WhopSDK::Internal::Type::BaseModel # # @param name [String, nil] The user's display name. # - # @param profile_picture [WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture] The user's profile picture. + # @param profile_picture [WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture] The user's profile picture. # # @param username [String] The user's unique username. - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner#profile_picture + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner#profile_picture class ProfilePicture < WhopSDK::Internal::Type::BaseModel # @!attribute url # The user's profile picture URL. @@ -755,7 +754,7 @@ class ProfilePicture < WhopSDK::Internal::Type::BaseModel # Which tier the caller earns on for this business: `first` (they referred the # owner) or `second` (they referred the first-tier partner). # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#my_partner_tier + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse#my_partner_tier module MyPartnerTier extend WhopSDK::Internal::Type::Enum @@ -766,17 +765,17 @@ module MyPartnerTier # @return [Array] end - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#object + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse#object module Object extend WhopSDK::Internal::Type::Enum - BUSINESS_REFERRAL = :business_referral + PARTNER_BUSINESS = :partner_business # @!method self.values # @return [Array] end - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#owner + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse#owner class Owner < WhopSDK::Internal::Type::BaseModel # @!attribute id # User ID, prefixed `user_`. @@ -793,9 +792,9 @@ class Owner < WhopSDK::Internal::Type::BaseModel # @!attribute profile_picture # The user's profile picture. # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture] + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture] required :profile_picture, - -> { WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture } + -> { WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture } # @!attribute username # The user's unique username. @@ -810,11 +809,11 @@ class Owner < WhopSDK::Internal::Type::BaseModel # # @param name [String, nil] The user's display name. # - # @param profile_picture [WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture] The user's profile picture. + # @param profile_picture [WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture] The user's profile picture. # # @param username [String] The user's unique username. - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner#profile_picture + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner#profile_picture class ProfilePicture < WhopSDK::Internal::Type::BaseModel # @!attribute url # The user's profile picture URL. @@ -831,7 +830,7 @@ class ProfilePicture < WhopSDK::Internal::Type::BaseModel # Current referral status. # - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#status + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse#status module Status extend WhopSDK::Internal::Type::Enum @@ -842,7 +841,7 @@ module Status # @return [Array] end - # @see WhopSDK::Models::Referrals::BusinessRetrieveResponse#volume_usd + # @see WhopSDK::Models::Partners::BusinessRetrieveResponse#volume_usd class VolumeUsd < WhopSDK::Internal::Type::BaseModel # @!attribute attributed # Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in @@ -865,7 +864,7 @@ class VolumeUsd < WhopSDK::Internal::Type::BaseModel # @!method initialize(attributed:, awaiting_settlement:, settled:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd} for more + # {WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd} for more # details. # # @param attributed [String] Credited GMV (awaiting_settlement + settled); excludes canceled and reversed, in diff --git a/lib/whop_sdk/models/referrals/businesses/earning_list_params.rb b/lib/whop_sdk/models/partners/businesses/earning_list_params.rb similarity index 75% rename from lib/whop_sdk/models/referrals/businesses/earning_list_params.rb rename to lib/whop_sdk/models/partners/businesses/earning_list_params.rb index 12daab8e..3c8bba12 100644 --- a/lib/whop_sdk/models/referrals/businesses/earning_list_params.rb +++ b/lib/whop_sdk/models/partners/businesses/earning_list_params.rb @@ -2,9 +2,9 @@ module WhopSDK module Models - module Referrals + module Partners module Businesses - # @see WhopSDK::Resources::Referrals::Businesses::Earnings#list + # @see WhopSDK::Resources::Partners::Businesses::Earnings#list class EarningListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters @@ -39,8 +39,8 @@ class EarningListParams < WhopSDK::Internal::Type::BaseModel # @!attribute direction # Sort direction. # - # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Direction, nil] - optional :direction, enum: -> { WhopSDK::Referrals::Businesses::EarningListParams::Direction } + # @return [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::Partners::Businesses::EarningListParams::Direction } # @!attribute first # @@ -55,14 +55,14 @@ class EarningListParams < WhopSDK::Internal::Type::BaseModel # @!attribute order # The field to sort earnings by. # - # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Order, nil] - optional :order, enum: -> { WhopSDK::Referrals::Businesses::EarningListParams::Order } + # @return [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Order, nil] + optional :order, enum: -> { WhopSDK::Partners::Businesses::EarningListParams::Order } # @!attribute status # Filter by earning status. # - # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Status, nil] - optional :status, enum: -> { WhopSDK::Referrals::Businesses::EarningListParams::Status } + # @return [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Status, nil] + optional :status, enum: -> { WhopSDK::Partners::Businesses::EarningListParams::Status } # @!method initialize(id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, status: nil, request_options: {}) # @param id [String] @@ -75,15 +75,15 @@ class EarningListParams < WhopSDK::Internal::Type::BaseModel # # @param created_before [String] Only return earnings created before this timestamp. # - # @param direction [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Direction] Sort direction. + # @param direction [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Direction] Sort direction. # # @param first [Integer] # # @param last [Integer] # - # @param order [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Order] The field to sort earnings by. + # @param order [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Order] The field to sort earnings by. # - # @param status [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Status] Filter by earning status. + # @param status [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Status] Filter by earning status. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/whop_sdk/models/referrals/businesses/earning_list_response.rb b/lib/whop_sdk/models/partners/businesses/earning_list_response.rb similarity index 71% rename from lib/whop_sdk/models/referrals/businesses/earning_list_response.rb rename to lib/whop_sdk/models/partners/businesses/earning_list_response.rb index b0e2815e..29064d51 100644 --- a/lib/whop_sdk/models/referrals/businesses/earning_list_response.rb +++ b/lib/whop_sdk/models/partners/businesses/earning_list_response.rb @@ -2,9 +2,9 @@ module WhopSDK module Models - module Referrals + module Partners module Businesses - # @see WhopSDK::Resources::Referrals::Businesses::Earnings#list + # @see WhopSDK::Resources::Partners::Businesses::Earnings#list class EarningListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute id # @@ -14,8 +14,8 @@ class EarningListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute account # Referred account. # - # @return [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account, nil] - required :account, -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account }, nil?: true + # @return [WhopSDK::Models::Partners::Businesses::EarningListResponse::Account, nil] + required :account, -> { WhopSDK::Models::Partners::Businesses::EarningListResponse::Account }, nil?: true # @!attribute cancelation_reason # Why the earning was canceled or reversed, if applicable. @@ -38,15 +38,15 @@ class EarningListResponse < WhopSDK::Internal::Type::BaseModel # Income and cost lines behind this earning's commission. Null for earnings # settled before this data was recorded. # - # @return [Array, nil] + # @return [Array, nil] required :financial_activity, - -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity] }, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity] }, nil?: true # @!attribute object # - # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object] - required :object, enum: -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object } + # @return [Symbol, WhopSDK::Models::Partners::Businesses::EarningListResponse::Object] + required :object, enum: -> { WhopSDK::Models::Partners::Businesses::EarningListResponse::Object } # @!attribute payout_at # @@ -62,15 +62,15 @@ class EarningListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute product # - # @return [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product, nil] - required :product, -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product }, nil?: true + # @return [WhopSDK::Models::Partners::Businesses::EarningListResponse::Product, nil] + required :product, -> { WhopSDK::Models::Partners::Businesses::EarningListResponse::Product }, nil?: true # @!attribute resource # The resource that generated the affiliate earning. # - # @return [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource, nil] + # @return [WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource, nil] required :resource, - -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource }, + -> { WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource }, nil?: true # @!attribute second_tier @@ -82,8 +82,8 @@ class EarningListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute status # Current status of the earning. # - # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status] - required :status, enum: -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status } + # @return [Symbol, WhopSDK::Models::Partners::Businesses::EarningListResponse::Status] + required :status, enum: -> { WhopSDK::Models::Partners::Businesses::EarningListResponse::Status } # @!attribute transaction_amount_usd # The sale amount the commission is calculated from, in USD. @@ -93,11 +93,11 @@ class EarningListResponse < WhopSDK::Internal::Type::BaseModel # @!method initialize(id:, account:, cancelation_reason:, commission_amount_usd:, created_at:, financial_activity:, object:, payout_at:, payout_percentage:, product:, resource:, second_tier:, status:, transaction_amount_usd:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::Businesses::EarningListResponse} for more details. + # {WhopSDK::Models::Partners::Businesses::EarningListResponse} for more details. # # @param id [String, nil] # - # @param account [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account, nil] Referred account. + # @param account [WhopSDK::Models::Partners::Businesses::EarningListResponse::Account, nil] Referred account. # # @param cancelation_reason [String, nil] Why the earning was canceled or reversed, if applicable. # @@ -105,25 +105,25 @@ class EarningListResponse < WhopSDK::Internal::Type::BaseModel # # @param created_at [Time] # - # @param financial_activity [Array, nil] Income and cost lines behind this earning's commission. Null for earnings settle + # @param financial_activity [Array, nil] Income and cost lines behind this earning's commission. Null for earnings settle # - # @param object [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object] + # @param object [Symbol, WhopSDK::Models::Partners::Businesses::EarningListResponse::Object] # # @param payout_at [Time, nil] # # @param payout_percentage [Float, nil] The referrer's share of Whop's gross profit, as a fraction (0.3 = 30%). Null unt # - # @param product [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product, nil] + # @param product [WhopSDK::Models::Partners::Businesses::EarningListResponse::Product, nil] # - # @param resource [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource, nil] The resource that generated the affiliate earning. + # @param resource [WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource, nil] The resource that generated the affiliate earning. # # @param second_tier [Boolean] Whether this earning is a second-tier (grandparent) commission. # - # @param status [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status] Current status of the earning. + # @param status [Symbol, WhopSDK::Models::Partners::Businesses::EarningListResponse::Status] Current status of the earning. # # @param transaction_amount_usd [String] The sale amount the commission is calculated from, in USD. - # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#account + # @see WhopSDK::Models::Partners::Businesses::EarningListResponse#account class Account < WhopSDK::Internal::Type::BaseModel # @!attribute id # Referred account ID. @@ -194,9 +194,9 @@ class FinancialActivity < WhopSDK::Internal::Type::BaseModel # @!attribute type # Whether the line is income Whop collected or a cost Whop paid. # - # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type] + # @return [Symbol, WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type] required :type, - enum: -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type } + enum: -> { WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type } # @!method initialize(amount:, amount_usd:, category:, created_at:, currency:, type:) # @param amount [String] Line amount in its native currency. @@ -209,11 +209,11 @@ class FinancialActivity < WhopSDK::Internal::Type::BaseModel # # @param currency [String] Currency of the native amount. # - # @param type [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type] Whether the line is income Whop collected or a cost Whop paid. + # @param type [Symbol, WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type] Whether the line is income Whop collected or a cost Whop paid. # Whether the line is income Whop collected or a cost Whop paid. # - # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity#type + # @see WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity#type module Type extend WhopSDK::Internal::Type::Enum @@ -225,17 +225,17 @@ module Type end end - # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#object + # @see WhopSDK::Models::Partners::Businesses::EarningListResponse#object module Object extend WhopSDK::Internal::Type::Enum - BUSINESS_REFERRAL_EARNING = :business_referral_earning + PARTNER_BUSINESS_EARNING = :partner_business_earning # @!method self.values # @return [Array] end - # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#product + # @see WhopSDK::Models::Partners::Businesses::EarningListResponse#product class Product < WhopSDK::Internal::Type::BaseModel # @!attribute id # @@ -258,7 +258,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # @param title [String] end - # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#resource + # @see WhopSDK::Models::Partners::Businesses::EarningListResponse#resource class Resource < WhopSDK::Internal::Type::BaseModel # @!attribute id # @@ -267,9 +267,9 @@ class Resource < WhopSDK::Internal::Type::BaseModel # @!attribute alternative_payment_method # - # @return [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, nil] + # @return [WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, nil] required :alternative_payment_method, - -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod }, + -> { WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod }, nil?: true # @!attribute brand @@ -294,9 +294,9 @@ class Resource < WhopSDK::Internal::Type::BaseModel # @!attribute object # - # @return [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object] + # @return [Symbol, WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object] required :object, - enum: -> { WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object } + enum: -> { WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object } # @!attribute payment_method_type # @@ -312,16 +312,16 @@ class Resource < WhopSDK::Internal::Type::BaseModel # The resource that generated the affiliate earning. # # @param id [String] - # @param alternative_payment_method [WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, nil] + # @param alternative_payment_method [WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, nil] # @param brand [String, nil] # @param created_at [Time] # @param currency [String] # @param last4 [String, nil] - # @param object [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object] + # @param object [Symbol, WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object] # @param payment_method_type [String, nil] # @param processor [String, nil] - # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource#alternative_payment_method + # @see WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource#alternative_payment_method class AlternativePaymentMethod < WhopSDK::Internal::Type::BaseModel # @!attribute image_url # @@ -338,7 +338,7 @@ class AlternativePaymentMethod < WhopSDK::Internal::Type::BaseModel # @param name [String] end - # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource#object + # @see WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource#object module Object extend WhopSDK::Internal::Type::Enum @@ -351,7 +351,7 @@ module Object # Current status of the earning. # - # @see WhopSDK::Models::Referrals::Businesses::EarningListResponse#status + # @see WhopSDK::Models::Partners::Businesses::EarningListResponse#status module Status extend WhopSDK::Internal::Type::Enum diff --git a/lib/whop_sdk/models/referrals/business_leaderboard_params.rb b/lib/whop_sdk/models/referrals/business_leaderboard_params.rb deleted file mode 100644 index 345d39d6..00000000 --- a/lib/whop_sdk/models/referrals/business_leaderboard_params.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - module Referrals - # @see WhopSDK::Resources::Referrals::Businesses#leaderboard - class BusinessLeaderboardParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - # @!attribute period - # Time window for the rankings. `day`, `month`, and `year` count earnings since - # the start of the current calendar day, month, or year; `last_30_days` counts - # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. - # - # @return [Symbol, WhopSDK::Models::Referrals::BusinessLeaderboardParams::Period, nil] - optional :period, enum: -> { WhopSDK::Referrals::BusinessLeaderboardParams::Period } - - # @!method initialize(period: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessLeaderboardParams} for more details. - # - # @param period [Symbol, WhopSDK::Models::Referrals::BusinessLeaderboardParams::Period] Time window for the rankings. `day`, `month`, and `year` count earnings since th - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - - # Time window for the rankings. `day`, `month`, and `year` count earnings since - # the start of the current calendar day, month, or year; `last_30_days` counts - # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. - module Period - extend WhopSDK::Internal::Type::Enum - - DAY = :day - MONTH = :month - YEAR = :year - LAST_30_DAYS = :last_30_days - ALL_TIME = :all_time - - # @!method self.values - # @return [Array] - end - end - end - end -end diff --git a/lib/whop_sdk/models/referrals/business_leaderboard_response.rb b/lib/whop_sdk/models/referrals/business_leaderboard_response.rb deleted file mode 100644 index 5188221b..00000000 --- a/lib/whop_sdk/models/referrals/business_leaderboard_response.rb +++ /dev/null @@ -1,284 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - module Referrals - # @see WhopSDK::Resources::Referrals::Businesses#leaderboard - class BusinessLeaderboardResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute leaders - # The top referrers by total earnings, best first. - # - # @return [Array] - required :leaders, - -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader] } - - # @!attribute me - # The caller's own standing; null when the caller has no referral earnings. - # - # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me, nil] - required :me, -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me }, nil?: true - - # @!method initialize(leaders:, me:) - # @param leaders [Array] The top referrers by total earnings, best first. - # - # @param me [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me, nil] The caller's own standing; null when the caller has no referral earnings. - - class Leader < WhopSDK::Internal::Type::BaseModel - # @!attribute first_referral_started_at - # When the referrer's earliest business referral became active. - # - # @return [Time] - required :first_referral_started_at, Time - - # @!attribute rank - # 1-based leaderboard position. - # - # @return [Integer] - required :rank, Integer - - # @!attribute total_earnings_usd - # The referrer's pending + completed earnings across all referred businesses, in - # USD. - # - # @return [String] - required :total_earnings_usd, String - - # @!attribute total_volume_usd - # Credited GMV across all the referrer's referred businesses, in USD. - # - # @return [String] - required :total_volume_usd, String - - # @!attribute user - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - # - # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, nil] - required :user, -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User }, nil?: true - - # @!method initialize(first_referral_started_at:, rank:, total_earnings_usd:, total_volume_usd:, user:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader} for more - # details. - # - # @param first_referral_started_at [Time] When the referrer's earliest business referral became active. - # - # @param rank [Integer] 1-based leaderboard position. - # - # @param total_earnings_usd [String] The referrer's pending + completed earnings across all referred businesses, in U - # - # @param total_volume_usd [String] Credited GMV across all the referrer's referred businesses, in USD. - # - # @param user [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, nil] The ranked referrer. Identity fields (id, name, username, profile_picture) are r - - # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader#user - class User < WhopSDK::Internal::Type::BaseModel - # @!attribute city - # The city where the referrer is located, derived from their IP address. Null if - # location sharing is disabled. - # - # @return [String, nil] - required :city, String, nil?: true - - # @!attribute country - # The country where the referrer is located, derived from their IP address. Null - # if location sharing is disabled. - # - # @return [String, nil] - required :country, String, nil?: true - - # @!attribute id - # User ID, prefixed `user_`. Present only on the caller's own entry. - # - # @return [String, nil] - optional :id, String - - # @!attribute name - # The user's display name. Present only on the caller's own entry. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # The user's profile picture. Present only on the caller's own entry. - # - # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, nil] - optional :profile_picture, - -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture } - - # @!attribute username - # The user's unique username. Present only on the caller's own entry. - # - # @return [String, nil] - optional :username, String - - # @!method initialize(city:, country:, id: nil, name: nil, profile_picture: nil, username: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User} for more - # details. - # - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - # - # @param city [String, nil] The city where the referrer is located, derived from their IP address. Null if l - # - # @param country [String, nil] The country where the referrer is located, derived from their IP address. Null i - # - # @param id [String] User ID, prefixed `user_`. Present only on the caller's own entry. - # - # @param name [String, nil] The user's display name. Present only on the caller's own entry. - # - # @param profile_picture [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture] The user's profile picture. Present only on the caller's own entry. - # - # @param username [String] The user's unique username. Present only on the caller's own entry. - - # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User#profile_picture - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - # @!attribute url - # The user's profile picture URL. - # - # @return [String] - required :url, String - - # @!method initialize(url:) - # The user's profile picture. Present only on the caller's own entry. - # - # @param url [String] The user's profile picture URL. - end - end - end - - # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse#me - class Me < WhopSDK::Internal::Type::BaseModel - # @!attribute first_referral_started_at - # When the referrer's earliest business referral became active. - # - # @return [Time] - required :first_referral_started_at, Time - - # @!attribute rank - # 1-based leaderboard position. - # - # @return [Integer] - required :rank, Integer - - # @!attribute total_earnings_usd - # The referrer's pending + completed earnings across all referred businesses, in - # USD. - # - # @return [String] - required :total_earnings_usd, String - - # @!attribute total_volume_usd - # Credited GMV across all the referrer's referred businesses, in USD. - # - # @return [String] - required :total_volume_usd, String - - # @!attribute user - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - # - # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User, nil] - required :user, -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User }, nil?: true - - # @!method initialize(first_referral_started_at:, rank:, total_earnings_usd:, total_volume_usd:, user:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me} for more details. - # - # The caller's own standing; null when the caller has no referral earnings. - # - # @param first_referral_started_at [Time] When the referrer's earliest business referral became active. - # - # @param rank [Integer] 1-based leaderboard position. - # - # @param total_earnings_usd [String] The referrer's pending + completed earnings across all referred businesses, in U - # - # @param total_volume_usd [String] Credited GMV across all the referrer's referred businesses, in USD. - # - # @param user [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User, nil] The ranked referrer. Identity fields (id, name, username, profile_picture) are r - - # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me#user - class User < WhopSDK::Internal::Type::BaseModel - # @!attribute city - # The city where the referrer is located, derived from their IP address. Null if - # location sharing is disabled. - # - # @return [String, nil] - required :city, String, nil?: true - - # @!attribute country - # The country where the referrer is located, derived from their IP address. Null - # if location sharing is disabled. - # - # @return [String, nil] - required :country, String, nil?: true - - # @!attribute id - # User ID, prefixed `user_`. Present only on the caller's own entry. - # - # @return [String, nil] - optional :id, String - - # @!attribute name - # The user's display name. Present only on the caller's own entry. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # The user's profile picture. Present only on the caller's own entry. - # - # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, nil] - optional :profile_picture, - -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture } - - # @!attribute username - # The user's unique username. Present only on the caller's own entry. - # - # @return [String, nil] - optional :username, String - - # @!method initialize(city:, country:, id: nil, name: nil, profile_picture: nil, username: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User} for more - # details. - # - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - # - # @param city [String, nil] The city where the referrer is located, derived from their IP address. Null if l - # - # @param country [String, nil] The country where the referrer is located, derived from their IP address. Null i - # - # @param id [String] User ID, prefixed `user_`. Present only on the caller's own entry. - # - # @param name [String, nil] The user's display name. Present only on the caller's own entry. - # - # @param profile_picture [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture] The user's profile picture. Present only on the caller's own entry. - # - # @param username [String] The user's unique username. Present only on the caller's own entry. - - # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User#profile_picture - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - # @!attribute url - # The user's profile picture URL. - # - # @return [String] - required :url, String - - # @!method initialize(url:) - # The user's profile picture. Present only on the caller's own entry. - # - # @param url [String] The user's profile picture URL. - end - end - end - end - end - end -end diff --git a/lib/whop_sdk/models/referrals/partner_create_params.rb b/lib/whop_sdk/models/referrals/partner_create_params.rb deleted file mode 100644 index aec5e568..00000000 --- a/lib/whop_sdk/models/referrals/partner_create_params.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - module Referrals - # @see WhopSDK::Resources::Referrals::Partners#create - class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - # @!method initialize(request_options: {}) - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/whop_sdk/models/referrals/partner_create_response.rb b/lib/whop_sdk/models/referrals/partner_create_response.rb deleted file mode 100644 index 40b5064c..00000000 --- a/lib/whop_sdk/models/referrals/partner_create_response.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - module Referrals - # @see WhopSDK::Resources::Referrals::Partners#create - class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute referral_link - # The caller's referral link — businesses that sign up through it are attributed - # to the caller. - # - # @return [String] - required :referral_link, String - - # @!attribute whop_partner_enabled_at - # When the caller became a Whop partner. - # - # @return [Time] - required :whop_partner_enabled_at, Time - - # @!method initialize(referral_link:, whop_partner_enabled_at:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::PartnerCreateResponse} for more details. - # - # @param referral_link [String] The caller's referral link — businesses that sign up through it are attributed t - # - # @param whop_partner_enabled_at [Time] When the caller became a Whop partner. - end - end - end -end diff --git a/lib/whop_sdk/resources/partners.rb b/lib/whop_sdk/resources/partners.rb new file mode 100644 index 00000000..ef62a11e --- /dev/null +++ b/lib/whop_sdk/resources/partners.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # The Partners API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Partners + # The Partners API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + # @return [WhopSDK::Resources::Partners::Businesses] + attr_reader :businesses + + # Enrolls the calling user in the Whop partner program, making their partner + # businesses eligible for earnings. Idempotent — enrolling again keeps the + # original enrollment time. + # + # @overload create(request_options: {}) + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::PartnerCreateResponse] + # + # @see WhopSDK::Models::PartnerCreateParams + def create(params = {}) + @client.request( + method: :post, + path: "partners", + model: WhopSDK::Models::PartnerCreateResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PartnerLeaderboardParams} for more details. + # + # Ranks referrers by partner business earnings — all-time by default, or over the + # current day, month, year, or trailing 30 days — and includes the caller's own + # standing. + # + # @overload leaderboard(period: nil, request_options: {}) + # + # @param period [Symbol, WhopSDK::Models::PartnerLeaderboardParams::Period] Time window for the rankings. `day`, `month`, and `year` count earnings since th + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::PartnerLeaderboardResponse] + # + # @see WhopSDK::Models::PartnerLeaderboardParams + def leaderboard(params = {}) + parsed, options = WhopSDK::PartnerLeaderboardParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "partners/leaderboard", + query: query, + model: WhopSDK::Models::PartnerLeaderboardResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PartnerReferredUsersParams} for more details. + # + # Lists the users the caller referred onto Whop (newest first), each with the + # second-tier earnings the caller has made from that user's businesses. + # + # @overload referred_users(after: nil, before: nil, first: nil, has_businesses: nil, has_earning_businesses: nil, last: nil, request_options: {}) + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param first [Integer] Number of referred users to return from the start of the window. + # + # @param has_businesses [Boolean] When true, only referred users who brought at least one business onto Whop. + # + # @param has_earning_businesses [Boolean] When true, only referred users with at least one business that has generated ear + # + # @param last [Integer] Number of referred users to return from the end of the window. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::PartnerReferredUsersResponse] + # + # @see WhopSDK::Models::PartnerReferredUsersParams + def referred_users(params = {}) + parsed, options = WhopSDK::PartnerReferredUsersParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "partners/referred_users", + query: query, + model: WhopSDK::Models::PartnerReferredUsersResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + @businesses = WhopSDK::Resources::Partners::Businesses.new(client: client) + end + end + end +end diff --git a/lib/whop_sdk/resources/partners/businesses.rb b/lib/whop_sdk/resources/partners/businesses.rb new file mode 100644 index 00000000..b65d91da --- /dev/null +++ b/lib/whop_sdk/resources/partners/businesses.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Partners + # The Partners API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + class Businesses + # The Partners API covers your Whop partner activity: the users you referred onto + # Whop, the businesses you referred and the earnings generated from their + # processing volume, and the partner leaderboard. + # + # Use it to enroll as a Whop partner, list the users you referred, list your + # referred businesses and review their earnings, and see the partner leaderboard. + # @return [WhopSDK::Resources::Partners::Businesses::Earnings] + attr_reader :earnings + + # Retrieves a single referred business and its referral terms. + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] The partner business ID (a coma\_ identifier). + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Partners::BusinessRetrieveResponse] + # + # @see WhopSDK::Models::Partners::BusinessRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["partners/businesses/%1$s", id], + model: WhopSDK::Models::Partners::BusinessRetrieveResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Partners::BusinessListParams} for more details. + # + # Lists the businesses the authenticated user referred onto Whop, most recent + # first. + # + # @overload list(after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, has_earnings: nil, last: nil, order: nil, referred_user_id: nil, referred_username: nil, status: nil, tier: nil, request_options: {}) + # + # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). + # + # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). + # + # @param created_after [String] Only return partner businesses created after this timestamp. + # + # @param created_before [String] Only return partner businesses created before this timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Partners::BusinessListParams::Direction] Sort direction. + # + # @param first [Integer] Number of partner businesses to return from the start of the window. + # + # @param has_earnings [Boolean] When true, only businesses with pending or completed earnings paid to the caller + # + # @param last [Integer] Number of partner businesses to return from the end of the window. + # + # @param order [Symbol, WhopSDK::Models::Partners::BusinessListParams::Order] The field to sort partner businesses by. + # + # @param referred_user_id [String] Filter to referrals attributed to this user. For first-tier referrals, this is t + # + # @param referred_username [String] Filter by the referred user's exact username. Ignored when `referred_user_id` is + # + # @param status [Symbol, WhopSDK::Models::Partners::BusinessListParams::Status] Filter by referral status. + # + # @param tier [Symbol, WhopSDK::Models::Partners::BusinessListParams::Tier] Filter to only first-tier referrals or only second-tier referrals. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::Partners::BusinessListParams + def list(params = {}) + parsed, options = WhopSDK::Partners::BusinessListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "partners/businesses", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::Partners::BusinessListResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + @earnings = WhopSDK::Resources::Partners::Businesses::Earnings.new(client: client) + end + end + end + end +end diff --git a/lib/whop_sdk/resources/referrals/businesses/earnings.rb b/lib/whop_sdk/resources/partners/businesses/earnings.rb similarity index 68% rename from lib/whop_sdk/resources/referrals/businesses/earnings.rb rename to lib/whop_sdk/resources/partners/businesses/earnings.rb index 53acb759..8edfc7c1 100644 --- a/lib/whop_sdk/resources/referrals/businesses/earnings.rb +++ b/lib/whop_sdk/resources/partners/businesses/earnings.rb @@ -2,9 +2,9 @@ module WhopSDK module Resources - class Referrals + class Partners class Businesses - # The Referrals API covers your Whop partner activity: the users you referred onto + # The Partners API covers your Whop partner activity: the users you referred onto # Whop, the businesses you referred and the earnings generated from their # processing volume, and the partner leaderboard. # @@ -16,7 +16,7 @@ class Earnings # # @overload list(id, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, status: nil, request_options: {}) # - # @param id [String] The business referral ID (a coma\_ identifier). + # @param id [String] The partner business ID (a coma\_ identifier). # # @param after [String] # @@ -26,30 +26,30 @@ class Earnings # # @param created_before [String] Only return earnings created before this timestamp. # - # @param direction [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Direction] Sort direction. + # @param direction [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Direction] Sort direction. # # @param first [Integer] # # @param last [Integer] # - # @param order [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Order] The field to sort earnings by. + # @param order [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Order] The field to sort earnings by. # - # @param status [Symbol, WhopSDK::Models::Referrals::Businesses::EarningListParams::Status] Filter by earning status. + # @param status [Symbol, WhopSDK::Models::Partners::Businesses::EarningListParams::Status] Filter by earning status. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Internal::CursorPage] + # @return [WhopSDK::Internal::CursorPage] # - # @see WhopSDK::Models::Referrals::Businesses::EarningListParams + # @see WhopSDK::Models::Partners::Businesses::EarningListParams def list(id, params = {}) - parsed, options = WhopSDK::Referrals::Businesses::EarningListParams.dump_request(params) + parsed, options = WhopSDK::Partners::Businesses::EarningListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["partners/businesses/%1$s/earnings", id], query: query, page: WhopSDK::Internal::CursorPage, - model: WhopSDK::Models::Referrals::Businesses::EarningListResponse, + model: WhopSDK::Models::Partners::Businesses::EarningListResponse, options: options ) end diff --git a/lib/whop_sdk/resources/referrals.rb b/lib/whop_sdk/resources/referrals.rb deleted file mode 100644 index 6104b08a..00000000 --- a/lib/whop_sdk/resources/referrals.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Resources - # The Referrals API covers your Whop partner activity: the users you referred onto - # Whop, the businesses you referred and the earnings generated from their - # processing volume, and the partner leaderboard. - # - # Use it to enroll as a Whop partner, list the users you referred, list your - # referred businesses and review their earnings, and see the partner leaderboard. - class Referrals - # The Referrals API covers your Whop partner activity: the users you referred onto - # Whop, the businesses you referred and the earnings generated from their - # processing volume, and the partner leaderboard. - # - # Use it to enroll as a Whop partner, list the users you referred, list your - # referred businesses and review their earnings, and see the partner leaderboard. - # @return [WhopSDK::Resources::Referrals::Businesses] - attr_reader :businesses - - # The Referrals API covers your Whop partner activity: the users you referred onto - # Whop, the businesses you referred and the earnings generated from their - # processing volume, and the partner leaderboard. - # - # Use it to enroll as a Whop partner, list the users you referred, list your - # referred businesses and review their earnings, and see the partner leaderboard. - # @return [WhopSDK::Resources::Referrals::Partners] - attr_reader :partners - - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::ReferralReferredUsersParams} for more details. - # - # Lists the users the caller referred onto Whop (newest first), each with the - # second-tier earnings the caller has made from that user's businesses. - # - # @overload referred_users(after: nil, before: nil, first: nil, has_businesses: nil, has_earning_businesses: nil, last: nil, request_options: {}) - # - # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). - # - # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). - # - # @param first [Integer] Number of referred users to return from the start of the window. - # - # @param has_businesses [Boolean] When true, only referred users who brought at least one business onto Whop. - # - # @param has_earning_businesses [Boolean] When true, only referred users with at least one business that has generated ear - # - # @param last [Integer] Number of referred users to return from the end of the window. - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Models::ReferralReferredUsersResponse] - # - # @see WhopSDK::Models::ReferralReferredUsersParams - def referred_users(params = {}) - parsed, options = WhopSDK::ReferralReferredUsersParams.dump_request(params) - query = WhopSDK::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "partners/referred_users", - query: query, - model: WhopSDK::Models::ReferralReferredUsersResponse, - options: options - ) - end - - # @api private - # - # @param client [WhopSDK::Client] - def initialize(client:) - @client = client - @businesses = WhopSDK::Resources::Referrals::Businesses.new(client: client) - @partners = WhopSDK::Resources::Referrals::Partners.new(client: client) - end - end - end -end diff --git a/lib/whop_sdk/resources/referrals/businesses.rb b/lib/whop_sdk/resources/referrals/businesses.rb deleted file mode 100644 index 5936ad02..00000000 --- a/lib/whop_sdk/resources/referrals/businesses.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Resources - class Referrals - # The Referrals API covers your Whop partner activity: the users you referred onto - # Whop, the businesses you referred and the earnings generated from their - # processing volume, and the partner leaderboard. - # - # Use it to enroll as a Whop partner, list the users you referred, list your - # referred businesses and review their earnings, and see the partner leaderboard. - class Businesses - # The Referrals API covers your Whop partner activity: the users you referred onto - # Whop, the businesses you referred and the earnings generated from their - # processing volume, and the partner leaderboard. - # - # Use it to enroll as a Whop partner, list the users you referred, list your - # referred businesses and review their earnings, and see the partner leaderboard. - # @return [WhopSDK::Resources::Referrals::Businesses::Earnings] - attr_reader :earnings - - # Retrieves a single referred business and its referral terms. - # - # @overload retrieve(id, request_options: {}) - # - # @param id [String] The business referral ID (a coma\_ identifier). - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Models::Referrals::BusinessRetrieveResponse] - # - # @see WhopSDK::Models::Referrals::BusinessRetrieveParams - def retrieve(id, params = {}) - @client.request( - method: :get, - path: ["partners/businesses/%1$s", id], - model: WhopSDK::Models::Referrals::BusinessRetrieveResponse, - options: params[:request_options] - ) - end - - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessListParams} for more details. - # - # Lists the businesses the authenticated user referred onto Whop, most recent - # first. - # - # @overload list(after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, has_earnings: nil, last: nil, order: nil, referred_user_id: nil, referred_username: nil, status: nil, tier: nil, request_options: {}) - # - # @param after [String] Cursor to fetch the page after (from page_info.end_cursor). - # - # @param before [String] Cursor to fetch the page before (from page_info.start_cursor). - # - # @param created_after [String] Only return business referrals created after this timestamp. - # - # @param created_before [String] Only return business referrals created before this timestamp. - # - # @param direction [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Direction] Sort direction. - # - # @param first [Integer] Number of business referrals to return from the start of the window. - # - # @param has_earnings [Boolean] When true, only businesses with pending or completed earnings paid to the caller - # - # @param last [Integer] Number of business referrals to return from the end of the window. - # - # @param order [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Order] The field to sort business referrals by. - # - # @param referred_user_id [String] Filter to referrals attributed to this user. For first-tier referrals, this is t - # - # @param referred_username [String] Filter by the referred user's exact username. Ignored when `referred_user_id` is - # - # @param status [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Status] Filter by referral status. - # - # @param tier [Symbol, WhopSDK::Models::Referrals::BusinessListParams::Tier] Filter to only first-tier referrals or only second-tier referrals. - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Internal::CursorPage] - # - # @see WhopSDK::Models::Referrals::BusinessListParams - def list(params = {}) - parsed, options = WhopSDK::Referrals::BusinessListParams.dump_request(params) - query = WhopSDK::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "partners/businesses", - query: query, - page: WhopSDK::Internal::CursorPage, - model: WhopSDK::Models::Referrals::BusinessListResponse, - options: options - ) - end - - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Referrals::BusinessLeaderboardParams} for more details. - # - # Ranks referrers by business referral earnings — all-time by default, or over the - # current day, month, year, or trailing 30 days — and includes the caller's own - # standing. - # - # @overload leaderboard(period: nil, request_options: {}) - # - # @param period [Symbol, WhopSDK::Models::Referrals::BusinessLeaderboardParams::Period] Time window for the rankings. `day`, `month`, and `year` count earnings since th - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse] - # - # @see WhopSDK::Models::Referrals::BusinessLeaderboardParams - def leaderboard(params = {}) - parsed, options = WhopSDK::Referrals::BusinessLeaderboardParams.dump_request(params) - query = WhopSDK::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "partners/leaderboard", - query: query, - model: WhopSDK::Models::Referrals::BusinessLeaderboardResponse, - options: options - ) - end - - # @api private - # - # @param client [WhopSDK::Client] - def initialize(client:) - @client = client - @earnings = WhopSDK::Resources::Referrals::Businesses::Earnings.new(client: client) - end - end - end - end -end diff --git a/lib/whop_sdk/resources/referrals/partners.rb b/lib/whop_sdk/resources/referrals/partners.rb deleted file mode 100644 index 0ceb833c..00000000 --- a/lib/whop_sdk/resources/referrals/partners.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Resources - class Referrals - # The Referrals API covers your Whop partner activity: the users you referred onto - # Whop, the businesses you referred and the earnings generated from their - # processing volume, and the partner leaderboard. - # - # Use it to enroll as a Whop partner, list the users you referred, list your - # referred businesses and review their earnings, and see the partner leaderboard. - class Partners - # Enrolls the calling user in the Whop partner program, making their business - # referrals eligible for earnings. Idempotent — enrolling again keeps the original - # enrollment time. - # - # @overload create(request_options: {}) - # - # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [WhopSDK::Models::Referrals::PartnerCreateResponse] - # - # @see WhopSDK::Models::Referrals::PartnerCreateParams - def create(params = {}) - @client.request( - method: :post, - path: "partners", - model: WhopSDK::Models::Referrals::PartnerCreateResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [WhopSDK::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/rbi/whop_sdk/client.rbi b/rbi/whop_sdk/client.rbi index c8562a0f..0d570182 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -271,14 +271,14 @@ module WhopSDK sig { returns(WhopSDK::Resources::Payouts) } attr_reader :payouts - # The Referrals API covers your Whop partner activity: the users you referred onto + # The Partners API covers your Whop partner activity: the users you referred onto # Whop, the businesses you referred and the earnings generated from their # processing volume, and the partner leaderboard. # # Use it to enroll as a Whop partner, list the users you referred, list your # referred businesses and review their earnings, and see the partner leaderboard. - sig { returns(WhopSDK::Resources::Referrals) } - attr_reader :referrals + sig { returns(WhopSDK::Resources::Partners) } + attr_reader :partners # Cards represent Whop-issued virtual payment cards that spend from an account or # user balance. Cards can be assigned to cardholders and configured with spending diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index b0b9517a..65bbd340 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -589,6 +589,14 @@ module WhopSDK PageInfo = WhopSDK::Models::PageInfo + PartnerCreateParams = WhopSDK::Models::PartnerCreateParams + + PartnerLeaderboardParams = WhopSDK::Models::PartnerLeaderboardParams + + PartnerReferredUsersParams = WhopSDK::Models::PartnerReferredUsersParams + + Partners = WhopSDK::Models::Partners + Payment = WhopSDK::Models::Payment PaymentCreatedWebhookEvent = WhopSDK::Models::PaymentCreatedWebhookEvent @@ -702,10 +710,6 @@ module WhopSDK ReceiptTaxBehavior = WhopSDK::Models::ReceiptTaxBehavior - ReferralReferredUsersParams = WhopSDK::Models::ReferralReferredUsersParams - - Referrals = WhopSDK::Models::Referrals - RefundCreatedWebhookEvent = WhopSDK::Models::RefundCreatedWebhookEvent RefundListParams = WhopSDK::Models::RefundListParams diff --git a/rbi/whop_sdk/models/partner_create_params.rbi b/rbi/whop_sdk/models/partner_create_params.rbi new file mode 100644 index 00000000..b33cafce --- /dev/null +++ b/rbi/whop_sdk/models/partner_create_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module WhopSDK + module Models + class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::PartnerCreateParams, WhopSDK::Internal::AnyHash) + end + + sig do + params(request_options: WhopSDK::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: WhopSDK::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/partner_create_response.rbi b/rbi/whop_sdk/models/partner_create_response.rbi new file mode 100644 index 00000000..f842fff5 --- /dev/null +++ b/rbi/whop_sdk/models/partner_create_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module WhopSDK + module Models + class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PartnerCreateResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The caller's referral link — businesses that sign up through it are attributed + # to the caller. + sig { returns(String) } + attr_accessor :referral_link + + # When the caller became a Whop partner. + sig { returns(Time) } + attr_accessor :whop_partner_enabled_at + + sig do + params(referral_link: String, whop_partner_enabled_at: Time).returns( + T.attached_class + ) + end + def self.new( + # The caller's referral link — businesses that sign up through it are attributed + # to the caller. + referral_link:, + # When the caller became a Whop partner. + whop_partner_enabled_at: + ) + end + + sig do + override.returns( + { referral_link: String, whop_partner_enabled_at: Time } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/partner_leaderboard_params.rbi b/rbi/whop_sdk/models/partner_leaderboard_params.rbi new file mode 100644 index 00000000..0571cf8e --- /dev/null +++ b/rbi/whop_sdk/models/partner_leaderboard_params.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module WhopSDK + module Models + class PartnerLeaderboardParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::PartnerLeaderboardParams, WhopSDK::Internal::AnyHash) + end + + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + sig do + returns(T.nilable(WhopSDK::PartnerLeaderboardParams::Period::OrSymbol)) + end + attr_reader :period + + sig do + params(period: WhopSDK::PartnerLeaderboardParams::Period::OrSymbol).void + end + attr_writer :period + + sig do + params( + period: WhopSDK::PartnerLeaderboardParams::Period::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + period: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + period: WhopSDK::PartnerLeaderboardParams::Period::OrSymbol, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + module Period + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::PartnerLeaderboardParams::Period) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAY = + T.let(:day, WhopSDK::PartnerLeaderboardParams::Period::TaggedSymbol) + MONTH = + T.let(:month, WhopSDK::PartnerLeaderboardParams::Period::TaggedSymbol) + YEAR = + T.let(:year, WhopSDK::PartnerLeaderboardParams::Period::TaggedSymbol) + LAST_30_DAYS = + T.let( + :last_30_days, + WhopSDK::PartnerLeaderboardParams::Period::TaggedSymbol + ) + ALL_TIME = + T.let( + :all_time, + WhopSDK::PartnerLeaderboardParams::Period::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::PartnerLeaderboardParams::Period::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/partner_leaderboard_response.rbi b/rbi/whop_sdk/models/partner_leaderboard_response.rbi new file mode 100644 index 00000000..d0ddae0a --- /dev/null +++ b/rbi/whop_sdk/models/partner_leaderboard_response.rbi @@ -0,0 +1,508 @@ +# typed: strong + +module WhopSDK + module Models + class PartnerLeaderboardResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PartnerLeaderboardResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The top referrers by total earnings, best first. + sig do + returns(T::Array[WhopSDK::Models::PartnerLeaderboardResponse::Leader]) + end + attr_accessor :leaders + + # The caller's own standing; null when the caller has no referral earnings. + sig do + returns(T.nilable(WhopSDK::Models::PartnerLeaderboardResponse::Me)) + end + attr_reader :me + + sig do + params( + me: T.nilable(WhopSDK::Models::PartnerLeaderboardResponse::Me::OrHash) + ).void + end + attr_writer :me + + sig do + params( + leaders: + T::Array[ + WhopSDK::Models::PartnerLeaderboardResponse::Leader::OrHash + ], + me: T.nilable(WhopSDK::Models::PartnerLeaderboardResponse::Me::OrHash) + ).returns(T.attached_class) + end + def self.new( + # The top referrers by total earnings, best first. + leaders:, + # The caller's own standing; null when the caller has no referral earnings. + me: + ) + end + + sig do + override.returns( + { + leaders: + T::Array[WhopSDK::Models::PartnerLeaderboardResponse::Leader], + me: T.nilable(WhopSDK::Models::PartnerLeaderboardResponse::Me) + } + ) + end + def to_hash + end + + class Leader < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PartnerLeaderboardResponse::Leader, + WhopSDK::Internal::AnyHash + ) + end + + # When the referrer's earliest partner business became active. + sig { returns(Time) } + attr_accessor :first_referral_started_at + + # 1-based leaderboard position. + sig { returns(Integer) } + attr_accessor :rank + + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + sig { returns(String) } + attr_accessor :total_earnings_usd + + # Credited GMV across all the referrer's referred businesses, in USD. + sig { returns(String) } + attr_accessor :total_volume_usd + + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + sig do + returns( + T.nilable(WhopSDK::Models::PartnerLeaderboardResponse::Leader::User) + ) + end + attr_reader :user + + sig do + params( + user: + T.nilable( + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::OrHash + ) + ).void + end + attr_writer :user + + sig do + params( + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: + T.nilable( + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # When the referrer's earliest partner business became active. + first_referral_started_at:, + # 1-based leaderboard position. + rank:, + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + total_earnings_usd:, + # Credited GMV across all the referrer's referred businesses, in USD. + total_volume_usd:, + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + user: + ) + end + + sig do + override.returns( + { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: + T.nilable( + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User + ) + } + ) + end + def to_hash + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User, + WhopSDK::Internal::AnyHash + ) + end + + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # User ID, prefixed `user_`. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # The user's display name. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture. Present only on the caller's own entry. + sig do + returns( + T.nilable( + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture + ) + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # The user's unique username. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + city:, + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + country:, + # User ID, prefixed `user_`. Present only on the caller's own entry. + id: nil, + # The user's display name. Present only on the caller's own entry. + name: nil, + # The user's profile picture. Present only on the caller's own entry. + profile_picture: nil, + # The user's unique username. Present only on the caller's own entry. + username: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # The user's profile picture URL. + sig { returns(String) } + attr_accessor :url + + # The user's profile picture. Present only on the caller's own entry. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # The user's profile picture URL. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + end + + class Me < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PartnerLeaderboardResponse::Me, + WhopSDK::Internal::AnyHash + ) + end + + # When the referrer's earliest partner business became active. + sig { returns(Time) } + attr_accessor :first_referral_started_at + + # 1-based leaderboard position. + sig { returns(Integer) } + attr_accessor :rank + + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + sig { returns(String) } + attr_accessor :total_earnings_usd + + # Credited GMV across all the referrer's referred businesses, in USD. + sig { returns(String) } + attr_accessor :total_volume_usd + + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + sig do + returns( + T.nilable(WhopSDK::Models::PartnerLeaderboardResponse::Me::User) + ) + end + attr_reader :user + + sig do + params( + user: + T.nilable( + WhopSDK::Models::PartnerLeaderboardResponse::Me::User::OrHash + ) + ).void + end + attr_writer :user + + # The caller's own standing; null when the caller has no referral earnings. + sig do + params( + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: + T.nilable( + WhopSDK::Models::PartnerLeaderboardResponse::Me::User::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # When the referrer's earliest partner business became active. + first_referral_started_at:, + # 1-based leaderboard position. + rank:, + # The referrer's pending + completed earnings across all referred businesses, in + # USD. + total_earnings_usd:, + # Credited GMV across all the referrer's referred businesses, in USD. + total_volume_usd:, + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + user: + ) + end + + sig do + override.returns( + { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: + T.nilable(WhopSDK::Models::PartnerLeaderboardResponse::Me::User) + } + ) + end + def to_hash + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PartnerLeaderboardResponse::Me::User, + WhopSDK::Internal::AnyHash + ) + end + + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # User ID, prefixed `user_`. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # The user's display name. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture. Present only on the caller's own entry. + sig do + returns( + T.nilable( + WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture + ) + ) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + # The user's unique username. Present only on the caller's own entry. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # The ranked referrer. Identity fields (id, name, username, profile_picture) are + # returned only on the caller's own entry; other referrers expose coarse location + # only. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture::OrHash, + username: String + ).returns(T.attached_class) + end + def self.new( + # The city where the referrer is located, derived from their IP address. Null if + # location sharing is disabled. + city:, + # The country where the referrer is located, derived from their IP address. Null + # if location sharing is disabled. + country:, + # User ID, prefixed `user_`. Present only on the caller's own entry. + id: nil, + # The user's display name. Present only on the caller's own entry. + name: nil, + # The user's profile picture. Present only on the caller's own entry. + profile_picture: nil, + # The user's unique username. Present only on the caller's own entry. + username: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + id: String, + name: T.nilable(String), + profile_picture: + WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture, + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # The user's profile picture URL. + sig { returns(String) } + attr_accessor :url + + # The user's profile picture. Present only on the caller's own entry. + sig { params(url: String).returns(T.attached_class) } + def self.new( + # The user's profile picture URL. + url: + ) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/referral_referred_users_params.rbi b/rbi/whop_sdk/models/partner_referred_users_params.rbi similarity index 93% rename from rbi/whop_sdk/models/referral_referred_users_params.rbi rename to rbi/whop_sdk/models/partner_referred_users_params.rbi index 1658e42b..c60be7c8 100644 --- a/rbi/whop_sdk/models/referral_referred_users_params.rbi +++ b/rbi/whop_sdk/models/partner_referred_users_params.rbi @@ -2,16 +2,13 @@ module WhopSDK module Models - class ReferralReferredUsersParams < WhopSDK::Internal::Type::BaseModel + class PartnerReferredUsersParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters OrHash = T.type_alias do - T.any( - WhopSDK::ReferralReferredUsersParams, - WhopSDK::Internal::AnyHash - ) + T.any(WhopSDK::PartnerReferredUsersParams, WhopSDK::Internal::AnyHash) end # Cursor to fetch the page after (from page_info.end_cursor). diff --git a/rbi/whop_sdk/models/referral_referred_users_response.rbi b/rbi/whop_sdk/models/partner_referred_users_response.rbi similarity index 75% rename from rbi/whop_sdk/models/referral_referred_users_response.rbi rename to rbi/whop_sdk/models/partner_referred_users_response.rbi index 3fadd81b..09e9d0d1 100644 --- a/rbi/whop_sdk/models/referral_referred_users_response.rbi +++ b/rbi/whop_sdk/models/partner_referred_users_response.rbi @@ -2,27 +2,27 @@ module WhopSDK module Models - class ReferralReferredUsersResponse < WhopSDK::Internal::Type::BaseModel + class PartnerReferredUsersResponse < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::Models::ReferralReferredUsersResponse, + WhopSDK::Models::PartnerReferredUsersResponse, WhopSDK::Internal::AnyHash ) end sig do - returns(T::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data]) + returns(T::Array[WhopSDK::Models::PartnerReferredUsersResponse::Data]) end attr_accessor :data - sig { returns(WhopSDK::Models::ReferralReferredUsersResponse::PageInfo) } + sig { returns(WhopSDK::Models::PartnerReferredUsersResponse::PageInfo) } attr_reader :page_info sig do params( page_info: - WhopSDK::Models::ReferralReferredUsersResponse::PageInfo::OrHash + WhopSDK::Models::PartnerReferredUsersResponse::PageInfo::OrHash ).void end attr_writer :page_info @@ -31,10 +31,10 @@ module WhopSDK params( data: T::Array[ - WhopSDK::Models::ReferralReferredUsersResponse::Data::OrHash + WhopSDK::Models::PartnerReferredUsersResponse::Data::OrHash ], page_info: - WhopSDK::Models::ReferralReferredUsersResponse::PageInfo::OrHash + WhopSDK::Models::PartnerReferredUsersResponse::PageInfo::OrHash ).returns(T.attached_class) end def self.new(data:, page_info:) @@ -43,9 +43,8 @@ module WhopSDK sig do override.returns( { - data: - T::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data], - page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + data: T::Array[WhopSDK::Models::PartnerReferredUsersResponse::Data], + page_info: WhopSDK::Models::PartnerReferredUsersResponse::PageInfo } ) end @@ -56,7 +55,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::ReferralReferredUsersResponse::Data, + WhopSDK::Models::PartnerReferredUsersResponse::Data, WhopSDK::Internal::AnyHash ) end @@ -68,14 +67,14 @@ module WhopSDK attr_accessor :total_volume_usd sig do - returns(WhopSDK::Models::ReferralReferredUsersResponse::Data::User) + returns(WhopSDK::Models::PartnerReferredUsersResponse::Data::User) end attr_reader :user sig do params( user: - WhopSDK::Models::ReferralReferredUsersResponse::Data::User::OrHash + WhopSDK::Models::PartnerReferredUsersResponse::Data::User::OrHash ).void end attr_writer :user @@ -85,7 +84,7 @@ module WhopSDK total_earnings_usd: String, total_volume_usd: String, user: - WhopSDK::Models::ReferralReferredUsersResponse::Data::User::OrHash + WhopSDK::Models::PartnerReferredUsersResponse::Data::User::OrHash ).returns(T.attached_class) end def self.new(total_earnings_usd:, total_volume_usd:, user:) @@ -96,7 +95,7 @@ module WhopSDK { total_earnings_usd: String, total_volume_usd: String, - user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + user: WhopSDK::Models::PartnerReferredUsersResponse::Data::User } ) end @@ -107,7 +106,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::ReferralReferredUsersResponse::Data::User, + WhopSDK::Models::PartnerReferredUsersResponse::Data::User, WhopSDK::Internal::AnyHash ) end @@ -130,7 +129,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture ) ) end @@ -139,7 +138,7 @@ module WhopSDK sig do params( profile_picture: - WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture::OrHash + WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture::OrHash ).void end attr_writer :profile_picture @@ -152,7 +151,7 @@ module WhopSDK country: T.nilable(String), name: T.nilable(String), profile_picture: - WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture::OrHash + WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture::OrHash ).returns(T.attached_class) end def self.new( @@ -174,7 +173,7 @@ module WhopSDK country: T.nilable(String), name: T.nilable(String), profile_picture: - WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture } ) end @@ -185,7 +184,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture, + WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture, WhopSDK::Internal::AnyHash ) end @@ -208,7 +207,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::ReferralReferredUsersResponse::PageInfo, + WhopSDK::Models::PartnerReferredUsersResponse::PageInfo, WhopSDK::Internal::AnyHash ) end diff --git a/rbi/whop_sdk/models/referrals/business_list_params.rbi b/rbi/whop_sdk/models/partners/business_list_params.rbi similarity index 71% rename from rbi/whop_sdk/models/referrals/business_list_params.rbi rename to rbi/whop_sdk/models/partners/business_list_params.rbi index 00cd20ee..97e92d77 100644 --- a/rbi/whop_sdk/models/referrals/business_list_params.rbi +++ b/rbi/whop_sdk/models/partners/business_list_params.rbi @@ -2,7 +2,7 @@ module WhopSDK module Models - module Referrals + module Partners class BusinessListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters @@ -10,7 +10,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Referrals::BusinessListParams, + WhopSDK::Partners::BusinessListParams, WhopSDK::Internal::AnyHash ) end @@ -29,14 +29,14 @@ module WhopSDK sig { params(before: String).void } attr_writer :before - # Only return business referrals created after this timestamp. + # Only return partner businesses created after this timestamp. sig { returns(T.nilable(String)) } attr_reader :created_after sig { params(created_after: String).void } attr_writer :created_after - # Only return business referrals created before this timestamp. + # Only return partner businesses created before this timestamp. sig { returns(T.nilable(String)) } attr_reader :created_before @@ -47,7 +47,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol + WhopSDK::Partners::BusinessListParams::Direction::OrSymbol ) ) end @@ -56,12 +56,12 @@ module WhopSDK sig do params( direction: - WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol + WhopSDK::Partners::BusinessListParams::Direction::OrSymbol ).void end attr_writer :direction - # Number of business referrals to return from the start of the window. + # Number of partner businesses to return from the start of the window. sig { returns(T.nilable(Integer)) } attr_reader :first @@ -76,24 +76,24 @@ module WhopSDK sig { params(has_earnings: T::Boolean).void } attr_writer :has_earnings - # Number of business referrals to return from the end of the window. + # Number of partner businesses to return from the end of the window. sig { returns(T.nilable(Integer)) } attr_reader :last sig { params(last: Integer).void } attr_writer :last - # The field to sort business referrals by. + # The field to sort partner businesses by. sig do returns( - T.nilable(WhopSDK::Referrals::BusinessListParams::Order::OrSymbol) + T.nilable(WhopSDK::Partners::BusinessListParams::Order::OrSymbol) ) end attr_reader :order sig do params( - order: WhopSDK::Referrals::BusinessListParams::Order::OrSymbol + order: WhopSDK::Partners::BusinessListParams::Order::OrSymbol ).void end attr_writer :order @@ -118,14 +118,14 @@ module WhopSDK # Filter by referral status. sig do returns( - T.nilable(WhopSDK::Referrals::BusinessListParams::Status::OrSymbol) + T.nilable(WhopSDK::Partners::BusinessListParams::Status::OrSymbol) ) end attr_reader :status sig do params( - status: WhopSDK::Referrals::BusinessListParams::Status::OrSymbol + status: WhopSDK::Partners::BusinessListParams::Status::OrSymbol ).void end attr_writer :status @@ -133,14 +133,14 @@ module WhopSDK # Filter to only first-tier referrals or only second-tier referrals. sig do returns( - T.nilable(WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol) + T.nilable(WhopSDK::Partners::BusinessListParams::Tier::OrSymbol) ) end attr_reader :tier sig do params( - tier: WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol + tier: WhopSDK::Partners::BusinessListParams::Tier::OrSymbol ).void end attr_writer :tier @@ -152,15 +152,15 @@ module WhopSDK created_after: String, created_before: String, direction: - WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol, + WhopSDK::Partners::BusinessListParams::Direction::OrSymbol, first: Integer, has_earnings: T::Boolean, last: Integer, - order: WhopSDK::Referrals::BusinessListParams::Order::OrSymbol, + order: WhopSDK::Partners::BusinessListParams::Order::OrSymbol, referred_user_id: String, referred_username: String, - status: WhopSDK::Referrals::BusinessListParams::Status::OrSymbol, - tier: WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol, + status: WhopSDK::Partners::BusinessListParams::Status::OrSymbol, + tier: WhopSDK::Partners::BusinessListParams::Tier::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -169,20 +169,20 @@ module WhopSDK after: nil, # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # Only return business referrals created after this timestamp. + # Only return partner businesses created after this timestamp. created_after: nil, - # Only return business referrals created before this timestamp. + # Only return partner businesses created before this timestamp. created_before: nil, # Sort direction. direction: nil, - # Number of business referrals to return from the start of the window. + # Number of partner businesses to return from the start of the window. first: nil, # When true, only businesses with pending or completed earnings paid to the # caller. has_earnings: nil, - # Number of business referrals to return from the end of the window. + # Number of partner businesses to return from the end of the window. last: nil, - # The field to sort business referrals by. + # The field to sort partner businesses by. order: nil, # Filter to referrals attributed to this user. For first-tier referrals, this is # the referred account owner; for second-tier referrals, this is the partner you @@ -207,15 +207,15 @@ module WhopSDK created_after: String, created_before: String, direction: - WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol, + WhopSDK::Partners::BusinessListParams::Direction::OrSymbol, first: Integer, has_earnings: T::Boolean, last: Integer, - order: WhopSDK::Referrals::BusinessListParams::Order::OrSymbol, + order: WhopSDK::Partners::BusinessListParams::Order::OrSymbol, referred_user_id: String, referred_username: String, - status: WhopSDK::Referrals::BusinessListParams::Status::OrSymbol, - tier: WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol, + status: WhopSDK::Partners::BusinessListParams::Status::OrSymbol, + tier: WhopSDK::Partners::BusinessListParams::Tier::OrSymbol, request_options: WhopSDK::RequestOptions } ) @@ -229,25 +229,25 @@ module WhopSDK TaggedSymbol = T.type_alias do - T.all(Symbol, WhopSDK::Referrals::BusinessListParams::Direction) + T.all(Symbol, WhopSDK::Partners::BusinessListParams::Direction) end OrSymbol = T.type_alias { T.any(Symbol, String) } ASC = T.let( :asc, - WhopSDK::Referrals::BusinessListParams::Direction::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Direction::TaggedSymbol ) DESC = T.let( :desc, - WhopSDK::Referrals::BusinessListParams::Direction::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Direction::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Referrals::BusinessListParams::Direction::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Direction::TaggedSymbol ] ) end @@ -255,51 +255,51 @@ module WhopSDK end end - # The field to sort business referrals by. + # The field to sort partner businesses by. module Order extend WhopSDK::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, WhopSDK::Referrals::BusinessListParams::Order) + T.all(Symbol, WhopSDK::Partners::BusinessListParams::Order) end OrSymbol = T.type_alias { T.any(Symbol, String) } CREATED_AT = T.let( :created_at, - WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Order::TaggedSymbol ) REFERRAL_STARTED_AT = T.let( :referral_started_at, - WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Order::TaggedSymbol ) REFERRAL_EXPIRES_AT = T.let( :referral_expires_at, - WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Order::TaggedSymbol ) PAYOUT_PERCENTAGE = T.let( :payout_percentage, - WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Order::TaggedSymbol ) VOLUME_USD = T.let( :volume_usd, - WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Order::TaggedSymbol ) EARNINGS_USD = T.let( :earnings_usd, - WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Order::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Referrals::BusinessListParams::Order::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Order::TaggedSymbol ] ) end @@ -313,25 +313,25 @@ module WhopSDK TaggedSymbol = T.type_alias do - T.all(Symbol, WhopSDK::Referrals::BusinessListParams::Status) + T.all(Symbol, WhopSDK::Partners::BusinessListParams::Status) end OrSymbol = T.type_alias { T.any(Symbol, String) } ACTIVE = T.let( :active, - WhopSDK::Referrals::BusinessListParams::Status::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Status::TaggedSymbol ) REMOVED = T.let( :removed, - WhopSDK::Referrals::BusinessListParams::Status::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Status::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Referrals::BusinessListParams::Status::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Status::TaggedSymbol ] ) end @@ -345,25 +345,25 @@ module WhopSDK TaggedSymbol = T.type_alias do - T.all(Symbol, WhopSDK::Referrals::BusinessListParams::Tier) + T.all(Symbol, WhopSDK::Partners::BusinessListParams::Tier) end OrSymbol = T.type_alias { T.any(Symbol, String) } FIRST = T.let( :first, - WhopSDK::Referrals::BusinessListParams::Tier::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Tier::TaggedSymbol ) SECOND = T.let( :second, - WhopSDK::Referrals::BusinessListParams::Tier::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Tier::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Referrals::BusinessListParams::Tier::TaggedSymbol + WhopSDK::Partners::BusinessListParams::Tier::TaggedSymbol ] ) end diff --git a/rbi/whop_sdk/models/referrals/business_list_response.rbi b/rbi/whop_sdk/models/partners/business_list_response.rbi similarity index 75% rename from rbi/whop_sdk/models/referrals/business_list_response.rbi rename to rbi/whop_sdk/models/partners/business_list_response.rbi index e7dbb10f..4144e57c 100644 --- a/rbi/whop_sdk/models/referrals/business_list_response.rbi +++ b/rbi/whop_sdk/models/partners/business_list_response.rbi @@ -2,24 +2,24 @@ module WhopSDK module Models - module Referrals + module Partners class BusinessListResponse < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessListResponse, + WhopSDK::Models::Partners::BusinessListResponse, WhopSDK::Internal::AnyHash ) end - # Business referral ID. + # Partner business ID. sig { returns(String) } attr_accessor :id # Referred account. sig do returns( - T.nilable(WhopSDK::Models::Referrals::BusinessListResponse::Account) + T.nilable(WhopSDK::Models::Partners::BusinessListResponse::Account) ) end attr_reader :account @@ -28,25 +28,25 @@ module WhopSDK params( account: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::Account::OrHash + WhopSDK::Models::Partners::BusinessListResponse::Account::OrHash ) ).void end attr_writer :account - # When the business referral was created. + # When the partner business was created. sig { returns(Time) } attr_accessor :created_at sig do - returns(WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd) + returns(WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd) end attr_reader :earnings_usd sig do params( earnings_usd: - WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd::OrHash + WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd::OrHash ).void end attr_writer :earnings_usd @@ -56,7 +56,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner ) ) end @@ -66,7 +66,7 @@ module WhopSDK params( first_tier_partner: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::OrHash + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::OrHash ) ).void end @@ -76,14 +76,14 @@ module WhopSDK # owner) or `second` (they referred the first-tier partner). sig do returns( - WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier::TaggedSymbol ) end attr_accessor :my_partner_tier sig do returns( - WhopSDK::Models::Referrals::BusinessListResponse::Object::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::Object::TaggedSymbol ) end attr_accessor :object @@ -91,7 +91,7 @@ module WhopSDK # The owner of the referred business. sig do returns( - T.nilable(WhopSDK::Models::Referrals::BusinessListResponse::Owner) + T.nilable(WhopSDK::Models::Partners::BusinessListResponse::Owner) ) end attr_reader :owner @@ -100,7 +100,7 @@ module WhopSDK params( owner: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::Owner::OrHash + WhopSDK::Models::Partners::BusinessListResponse::Owner::OrHash ) ).void end @@ -122,20 +122,20 @@ module WhopSDK # Current referral status. sig do returns( - WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::Status::TaggedSymbol ) end attr_accessor :status sig do - returns(WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd) + returns(WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd) end attr_reader :volume_usd sig do params( volume_usd: - WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd::OrHash + WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd::OrHash ).void end attr_writer :volume_usd @@ -145,38 +145,38 @@ module WhopSDK id: String, account: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::Account::OrHash + WhopSDK::Models::Partners::BusinessListResponse::Account::OrHash ), created_at: Time, earnings_usd: - WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd::OrHash, + WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd::OrHash, first_tier_partner: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::OrHash + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::OrHash ), my_partner_tier: - WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::OrSymbol, + WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier::OrSymbol, object: - WhopSDK::Models::Referrals::BusinessListResponse::Object::OrSymbol, + WhopSDK::Models::Partners::BusinessListResponse::Object::OrSymbol, owner: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::Owner::OrHash + WhopSDK::Models::Partners::BusinessListResponse::Owner::OrHash ), payout_percentage: Float, referral_expires_at: T.nilable(Time), referral_started_at: T.nilable(Time), status: - WhopSDK::Models::Referrals::BusinessListResponse::Status::OrSymbol, + WhopSDK::Models::Partners::BusinessListResponse::Status::OrSymbol, volume_usd: - WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd::OrHash + WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd::OrHash ).returns(T.attached_class) end def self.new( - # Business referral ID. + # Partner business ID. id:, # Referred account. account:, - # When the business referral was created. + # When the partner business was created. created_at:, earnings_usd:, # The partner who referred the business owner onto Whop (first tier). Null if @@ -207,30 +207,30 @@ module WhopSDK id: String, account: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::Account + WhopSDK::Models::Partners::BusinessListResponse::Account ), created_at: Time, earnings_usd: - WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, + WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd, first_tier_partner: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner ), my_partner_tier: - WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol, + WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier::TaggedSymbol, object: - WhopSDK::Models::Referrals::BusinessListResponse::Object::TaggedSymbol, + WhopSDK::Models::Partners::BusinessListResponse::Object::TaggedSymbol, owner: T.nilable( - WhopSDK::Models::Referrals::BusinessListResponse::Owner + WhopSDK::Models::Partners::BusinessListResponse::Owner ), payout_percentage: Float, referral_expires_at: T.nilable(Time), referral_started_at: T.nilable(Time), status: - WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol, + WhopSDK::Models::Partners::BusinessListResponse::Status::TaggedSymbol, volume_usd: - WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd } ) end @@ -241,7 +241,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessListResponse::Account, + WhopSDK::Models::Partners::BusinessListResponse::Account, WhopSDK::Internal::AnyHash ) end @@ -301,7 +301,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, + WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd, WhopSDK::Internal::AnyHash ) end @@ -346,7 +346,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner, + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner, WhopSDK::Internal::AnyHash ) end @@ -362,7 +362,7 @@ module WhopSDK # The user's profile picture. sig do returns( - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture ) end attr_reader :profile_picture @@ -370,7 +370,7 @@ module WhopSDK sig do params( profile_picture: - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture::OrHash + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture::OrHash ).void end attr_writer :profile_picture @@ -386,7 +386,7 @@ module WhopSDK id: String, name: T.nilable(String), profile_picture: - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture::OrHash, + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture::OrHash, username: String ).returns(T.attached_class) end @@ -408,7 +408,7 @@ module WhopSDK id: String, name: T.nilable(String), profile_picture: - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture, username: String } ) @@ -420,7 +420,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture, WhopSDK::Internal::AnyHash ) end @@ -452,7 +452,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier + WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -460,18 +460,18 @@ module WhopSDK FIRST = T.let( :first, - WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier::TaggedSymbol ) SECOND = T.let( :second, - WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier::TaggedSymbol ] ) end @@ -486,21 +486,21 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessListResponse::Object + WhopSDK::Models::Partners::BusinessListResponse::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } - BUSINESS_REFERRAL = + PARTNER_BUSINESS = T.let( - :business_referral, - WhopSDK::Models::Referrals::BusinessListResponse::Object::TaggedSymbol + :partner_business, + WhopSDK::Models::Partners::BusinessListResponse::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessListResponse::Object::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::Object::TaggedSymbol ] ) end @@ -512,7 +512,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessListResponse::Owner, + WhopSDK::Models::Partners::BusinessListResponse::Owner, WhopSDK::Internal::AnyHash ) end @@ -528,7 +528,7 @@ module WhopSDK # The user's profile picture. sig do returns( - WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture + WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture ) end attr_reader :profile_picture @@ -536,7 +536,7 @@ module WhopSDK sig do params( profile_picture: - WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture::OrHash + WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture::OrHash ).void end attr_writer :profile_picture @@ -551,7 +551,7 @@ module WhopSDK id: String, name: T.nilable(String), profile_picture: - WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture::OrHash, + WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture::OrHash, username: String ).returns(T.attached_class) end @@ -573,7 +573,7 @@ module WhopSDK id: String, name: T.nilable(String), profile_picture: - WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture, username: String } ) @@ -585,7 +585,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture, WhopSDK::Internal::AnyHash ) end @@ -616,7 +616,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessListResponse::Status + WhopSDK::Models::Partners::BusinessListResponse::Status ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -624,18 +624,18 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::Status::TaggedSymbol ) REMOVED = T.let( :removed, - WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::Status::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessListResponse::Status::TaggedSymbol ] ) end @@ -647,7 +647,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd, + WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd, WhopSDK::Internal::AnyHash ) end diff --git a/rbi/whop_sdk/models/referrals/business_retrieve_params.rbi b/rbi/whop_sdk/models/partners/business_retrieve_params.rbi similarity index 91% rename from rbi/whop_sdk/models/referrals/business_retrieve_params.rbi rename to rbi/whop_sdk/models/partners/business_retrieve_params.rbi index dfedb4b3..1e49d543 100644 --- a/rbi/whop_sdk/models/referrals/business_retrieve_params.rbi +++ b/rbi/whop_sdk/models/partners/business_retrieve_params.rbi @@ -2,7 +2,7 @@ module WhopSDK module Models - module Referrals + module Partners class BusinessRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters @@ -10,7 +10,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Referrals::BusinessRetrieveParams, + WhopSDK::Partners::BusinessRetrieveParams, WhopSDK::Internal::AnyHash ) end diff --git a/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi b/rbi/whop_sdk/models/partners/business_retrieve_response.rbi similarity index 65% rename from rbi/whop_sdk/models/referrals/business_retrieve_response.rbi rename to rbi/whop_sdk/models/partners/business_retrieve_response.rbi index 8c1886dc..dfcea6e3 100644 --- a/rbi/whop_sdk/models/referrals/business_retrieve_response.rbi +++ b/rbi/whop_sdk/models/partners/business_retrieve_response.rbi @@ -2,17 +2,17 @@ module WhopSDK module Models - module Referrals + module Partners class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse, + WhopSDK::Models::Partners::BusinessRetrieveResponse, WhopSDK::Internal::AnyHash ) end - # Business referral ID. + # Partner business ID. sig { returns(String) } attr_accessor :id @@ -20,7 +20,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account ) ) end @@ -30,19 +30,19 @@ module WhopSDK params( account: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::OrHash ) ).void end attr_writer :account - # When the business referral was created. + # When the partner business was created. sig { returns(Time) } attr_accessor :created_at sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd + WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd ) end attr_reader :earnings_usd @@ -50,7 +50,7 @@ module WhopSDK sig do params( earnings_usd: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd::OrHash ).void end attr_writer :earnings_usd @@ -60,7 +60,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner ) ) end @@ -70,7 +70,7 @@ module WhopSDK params( first_tier_partner: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::OrHash ) ).void end @@ -80,14 +80,14 @@ module WhopSDK # owner) or `second` (they referred the first-tier partner). sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol ) end attr_accessor :my_partner_tier sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Object::TaggedSymbol ) end attr_accessor :object @@ -96,7 +96,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner ) ) end @@ -106,7 +106,7 @@ module WhopSDK params( owner: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::OrHash ) ).void end @@ -128,14 +128,14 @@ module WhopSDK # Current referral status. sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Status::TaggedSymbol ) end attr_accessor :status sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd ) end attr_reader :volume_usd @@ -143,7 +143,7 @@ module WhopSDK sig do params( volume_usd: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd::OrHash ).void end attr_writer :volume_usd @@ -153,38 +153,38 @@ module WhopSDK id: String, account: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::OrHash ), created_at: Time, earnings_usd: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd::OrHash, + WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd::OrHash, first_tier_partner: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::OrHash ), my_partner_tier: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier::OrSymbol, object: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Object::OrSymbol, owner: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::OrHash ), payout_percentage: Float, referral_expires_at: T.nilable(Time), referral_started_at: T.nilable(Time), status: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Status::OrSymbol, volume_usd: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd::OrHash ).returns(T.attached_class) end def self.new( - # Business referral ID. + # Partner business ID. id:, # Referred account. account:, - # When the business referral was created. + # When the partner business was created. created_at:, earnings_usd:, # The partner who referred the business owner onto Whop (first tier). Null if @@ -215,30 +215,30 @@ module WhopSDK id: String, account: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account ), created_at: Time, earnings_usd: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, + WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd, first_tier_partner: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner ), my_partner_tier: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol, object: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Object::TaggedSymbol, owner: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner ), payout_percentage: Float, referral_expires_at: T.nilable(Time), referral_started_at: T.nilable(Time), status: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Status::TaggedSymbol, volume_usd: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd + WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd } ) end @@ -249,7 +249,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account, WhopSDK::Internal::AnyHash ) end @@ -261,7 +261,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities ) ) end @@ -271,7 +271,7 @@ module WhopSDK params( capabilities: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::OrHash ) ).void end @@ -286,7 +286,7 @@ module WhopSDK returns( T.nilable( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction ] ) ) @@ -298,7 +298,7 @@ module WhopSDK returns( T.nilable( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction ] ) ) @@ -319,19 +319,19 @@ module WhopSDK id: String, capabilities: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::OrHash ), logo_url: T.nilable(String), recommended_actions: T.nilable( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::OrHash ] ), required_actions: T.nilable( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::OrHash ] ), route: String, @@ -361,19 +361,19 @@ module WhopSDK id: String, capabilities: T.nilable( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities ), logo_url: T.nilable(String), recommended_actions: T.nilable( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction ] ), required_actions: T.nilable( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction ] ), route: String, @@ -388,7 +388,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities, WhopSDK::Internal::AnyHash ) end @@ -396,7 +396,7 @@ module WhopSDK # Bank payins: debits, transfers, and local bank rails sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol ) end attr_accessor :accept_bank_payments @@ -404,7 +404,7 @@ module WhopSDK # Buy-now-pay-later payins; requires approval sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol ) end attr_accessor :accept_bnpl_payments @@ -412,7 +412,7 @@ module WhopSDK # Card payins, including Apple Pay and Google Pay sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol ) end attr_accessor :accept_card_payments @@ -420,7 +420,7 @@ module WhopSDK # Deposits by bank wire or ACH to the account's virtual bank account sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol ) end attr_accessor :bank_deposit @@ -428,7 +428,7 @@ module WhopSDK # Balance top-ups by charging a stored payment method sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol ) end attr_accessor :card_deposit @@ -436,7 +436,7 @@ module WhopSDK # Issuing Whop cards; requires card application approval sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol ) end attr_accessor :card_issuing @@ -444,7 +444,7 @@ module WhopSDK # On-chain deposits to the account's crypto wallet sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol ) end attr_accessor :crypto_deposit @@ -452,7 +452,7 @@ module WhopSDK # On-chain payouts to a crypto wallet sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol ) end attr_accessor :crypto_payout @@ -460,7 +460,7 @@ module WhopSDK # Instant payouts to an eligible payout destination sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol ) end attr_accessor :instant_payout @@ -468,7 +468,7 @@ module WhopSDK # Standard payouts to an external payout destination sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol ) end attr_accessor :standard_payout @@ -476,7 +476,7 @@ module WhopSDK # Transfers to other accounts sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol ) end attr_accessor :transfer @@ -484,27 +484,27 @@ module WhopSDK sig do params( accept_bank_payments: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::OrSymbol, accept_bnpl_payments: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::OrSymbol, accept_card_payments: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::OrSymbol, bank_deposit: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::OrSymbol, card_deposit: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::OrSymbol, card_issuing: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::OrSymbol, crypto_deposit: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::OrSymbol, crypto_payout: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::OrSymbol, instant_payout: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::OrSymbol, standard_payout: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::OrSymbol, transfer: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::OrSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer::OrSymbol ).returns(T.attached_class) end def self.new( @@ -537,27 +537,27 @@ module WhopSDK override.returns( { accept_bank_payments: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol, accept_bnpl_payments: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol, accept_card_payments: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol, bank_deposit: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol, card_deposit: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol, card_issuing: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol, crypto_deposit: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol, crypto_payout: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol, instant_payout: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol, standard_payout: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol, transfer: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol } ) end @@ -572,7 +572,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -580,23 +580,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBankPayments::TaggedSymbol ] ) end @@ -612,7 +612,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -620,23 +620,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptBnplPayments::TaggedSymbol ] ) end @@ -652,7 +652,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -660,23 +660,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::AcceptCardPayments::TaggedSymbol ] ) end @@ -692,7 +692,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -700,23 +700,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::BankDeposit::TaggedSymbol ] ) end @@ -732,7 +732,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -740,23 +740,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardDeposit::TaggedSymbol ] ) end @@ -772,7 +772,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -780,23 +780,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CardIssuing::TaggedSymbol ] ) end @@ -812,7 +812,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -820,23 +820,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoDeposit::TaggedSymbol ] ) end @@ -852,7 +852,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -860,23 +860,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::CryptoPayout::TaggedSymbol ] ) end @@ -892,7 +892,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -900,23 +900,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::InstantPayout::TaggedSymbol ] ) end @@ -932,7 +932,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -940,23 +940,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::StandardPayout::TaggedSymbol ] ) end @@ -972,7 +972,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -980,23 +980,23 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol ) INACTIVE = T.let( :inactive, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::Transfer::TaggedSymbol ] ) end @@ -1009,7 +1009,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction, WhopSDK::Internal::AnyHash ) end @@ -1018,7 +1018,7 @@ module WhopSDK # gracefully sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) end attr_accessor :action @@ -1053,7 +1053,7 @@ module WhopSDK # Always optional — never blocking sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol ) end attr_accessor :status @@ -1065,7 +1065,7 @@ module WhopSDK sig do params( action: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::OrSymbol, blocked_capabilities: T::Array[String], cta: String, cta_label: String, @@ -1074,7 +1074,7 @@ module WhopSDK impact_score: T.nilable(Integer), reasoning: T.nilable(String), status: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status::OrSymbol, title: String ).returns(T.attached_class) end @@ -1106,7 +1106,7 @@ module WhopSDK override.returns( { action: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol, blocked_capabilities: T::Array[String], cta: String, cta_label: String, @@ -1115,7 +1115,7 @@ module WhopSDK impact_score: T.nilable(Integer), reasoning: T.nilable(String), status: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol, title: String } ) @@ -1132,7 +1132,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -1140,83 +1140,83 @@ module WhopSDK THEME_BUSINESS = T.let( :theme_business, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) CREATE_PRODUCT = T.let( :create_product, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) CREATE_PLAN = T.let( :create_plan, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) VERIFY_IDENTITY = T.let( :verify_identity, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) CONNECT_AFFILIATE_PROGRAM = T.let( :connect_affiliate_program, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) CREATE_PROMOTION = T.let( :create_promotion, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) SETUP_TRACKING_PIXEL = T.let( :setup_tracking_pixel, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) MIGRATE_FROM_STRIPE = T.let( :migrate_from_stripe, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) ACCEPT_FIRST_PAYMENT = T.let( :accept_first_payment, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) LAUNCH_FIRST_AD = T.let( :launch_first_ad, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) INVITE_TEAM_MEMBER = T.let( :invite_team_member, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) ENABLE_TAX_COLLECTION = T.let( :enable_tax_collection, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) CREATE_CARD = T.let( :create_card, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) JOIN_WHOP_UNIVERSITY = T.let( :join_whop_university, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) APPLY_FOR_FINANCING = T.let( :apply_for_financing, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Action::TaggedSymbol ] ) end @@ -1232,7 +1232,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -1240,13 +1240,13 @@ module WhopSDK OPTIONAL = T.let( :optional, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::Status::TaggedSymbol ] ) end @@ -1259,7 +1259,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction, WhopSDK::Internal::AnyHash ) end @@ -1268,7 +1268,7 @@ module WhopSDK # gracefully sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol ) end attr_accessor :action @@ -1295,7 +1295,7 @@ module WhopSDK # required (act now) or pending (under review) sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol ) end attr_accessor :status @@ -1307,14 +1307,14 @@ module WhopSDK sig do params( action: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action::OrSymbol, blocked_capabilities: T::Array[String], cta: T.nilable(String), cta_label: String, description: String, icon_url: T.nilable(String), status: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::OrSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status::OrSymbol, title: String ).returns(T.attached_class) end @@ -1342,14 +1342,14 @@ module WhopSDK override.returns( { action: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol, blocked_capabilities: T::Array[String], cta: T.nilable(String), cta_label: String, description: String, icon_url: T.nilable(String), status: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol, title: String } ) @@ -1366,7 +1366,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -1374,28 +1374,28 @@ module WhopSDK DEPOSIT_FUNDS = T.let( :deposit_funds, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol ) SUBMIT_INFORMATION_REQUEST = T.let( :submit_information_request, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol ) VERIFY_IDENTITY = T.let( :verify_identity, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol ) CONNECT_FULFILLMENT_TRACKER = T.let( :connect_fulfillment_tracker, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Action::TaggedSymbol ] ) end @@ -1411,7 +1411,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -1419,18 +1419,18 @@ module WhopSDK REQUIRED = T.let( :required, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::Status::TaggedSymbol ] ) end @@ -1444,7 +1444,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, + WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd, WhopSDK::Internal::AnyHash ) end @@ -1489,7 +1489,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner, + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner, WhopSDK::Internal::AnyHash ) end @@ -1505,7 +1505,7 @@ module WhopSDK # The user's profile picture. sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture ) end attr_reader :profile_picture @@ -1513,7 +1513,7 @@ module WhopSDK sig do params( profile_picture: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture::OrHash ).void end attr_writer :profile_picture @@ -1529,7 +1529,7 @@ module WhopSDK id: String, name: T.nilable(String), profile_picture: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture::OrHash, + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture::OrHash, username: String ).returns(T.attached_class) end @@ -1551,7 +1551,7 @@ module WhopSDK id: String, name: T.nilable(String), profile_picture: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, username: String } ) @@ -1563,7 +1563,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, + WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, WhopSDK::Internal::AnyHash ) end @@ -1595,7 +1595,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier + WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -1603,18 +1603,18 @@ module WhopSDK FIRST = T.let( :first, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol ) SECOND = T.let( :second, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier::TaggedSymbol ] ) end @@ -1629,21 +1629,21 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object + WhopSDK::Models::Partners::BusinessRetrieveResponse::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } - BUSINESS_REFERRAL = + PARTNER_BUSINESS = T.let( - :business_referral, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::TaggedSymbol + :partner_business, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Object::TaggedSymbol ] ) end @@ -1655,7 +1655,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner, WhopSDK::Internal::AnyHash ) end @@ -1671,7 +1671,7 @@ module WhopSDK # The user's profile picture. sig do returns( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture ) end attr_reader :profile_picture @@ -1679,7 +1679,7 @@ module WhopSDK sig do params( profile_picture: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture::OrHash + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture::OrHash ).void end attr_writer :profile_picture @@ -1694,7 +1694,7 @@ module WhopSDK id: String, name: T.nilable(String), profile_picture: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture::OrHash, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture::OrHash, username: String ).returns(T.attached_class) end @@ -1716,7 +1716,7 @@ module WhopSDK id: String, name: T.nilable(String), profile_picture: - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture, username: String } ) @@ -1728,7 +1728,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture, + WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture, WhopSDK::Internal::AnyHash ) end @@ -1759,7 +1759,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status + WhopSDK::Models::Partners::BusinessRetrieveResponse::Status ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -1767,18 +1767,18 @@ module WhopSDK ACTIVE = T.let( :active, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Status::TaggedSymbol ) REMOVED = T.let( :removed, - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Status::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::BusinessRetrieveResponse::Status::TaggedSymbol ] ) end @@ -1790,7 +1790,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd, + WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd, WhopSDK::Internal::AnyHash ) end diff --git a/rbi/whop_sdk/models/referrals/businesses/earning_list_params.rbi b/rbi/whop_sdk/models/partners/businesses/earning_list_params.rbi similarity index 71% rename from rbi/whop_sdk/models/referrals/businesses/earning_list_params.rbi rename to rbi/whop_sdk/models/partners/businesses/earning_list_params.rbi index a8fe56a2..2fdaf6a3 100644 --- a/rbi/whop_sdk/models/referrals/businesses/earning_list_params.rbi +++ b/rbi/whop_sdk/models/partners/businesses/earning_list_params.rbi @@ -2,7 +2,7 @@ module WhopSDK module Models - module Referrals + module Partners module Businesses class EarningListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter @@ -11,7 +11,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Referrals::Businesses::EarningListParams, + WhopSDK::Partners::Businesses::EarningListParams, WhopSDK::Internal::AnyHash ) end @@ -49,7 +49,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol + WhopSDK::Partners::Businesses::EarningListParams::Direction::OrSymbol ) ) end @@ -58,7 +58,7 @@ module WhopSDK sig do params( direction: - WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol + WhopSDK::Partners::Businesses::EarningListParams::Direction::OrSymbol ).void end attr_writer :direction @@ -79,7 +79,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol + WhopSDK::Partners::Businesses::EarningListParams::Order::OrSymbol ) ) end @@ -88,7 +88,7 @@ module WhopSDK sig do params( order: - WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol + WhopSDK::Partners::Businesses::EarningListParams::Order::OrSymbol ).void end attr_writer :order @@ -97,7 +97,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol + WhopSDK::Partners::Businesses::EarningListParams::Status::OrSymbol ) ) end @@ -106,7 +106,7 @@ module WhopSDK sig do params( status: - WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol + WhopSDK::Partners::Businesses::EarningListParams::Status::OrSymbol ).void end attr_writer :status @@ -119,13 +119,13 @@ module WhopSDK created_after: String, created_before: String, direction: - WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Direction::OrSymbol, first: Integer, last: Integer, order: - WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Order::OrSymbol, status: - WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Status::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -158,13 +158,13 @@ module WhopSDK created_after: String, created_before: String, direction: - WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Direction::OrSymbol, first: Integer, last: Integer, order: - WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Order::OrSymbol, status: - WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Status::OrSymbol, request_options: WhopSDK::RequestOptions } ) @@ -180,7 +180,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Referrals::Businesses::EarningListParams::Direction + WhopSDK::Partners::Businesses::EarningListParams::Direction ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -188,18 +188,18 @@ module WhopSDK ASC = T.let( :asc, - WhopSDK::Referrals::Businesses::EarningListParams::Direction::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Direction::TaggedSymbol ) DESC = T.let( :desc, - WhopSDK::Referrals::Businesses::EarningListParams::Direction::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Direction::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Referrals::Businesses::EarningListParams::Direction::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Direction::TaggedSymbol ] ) end @@ -215,7 +215,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Referrals::Businesses::EarningListParams::Order + WhopSDK::Partners::Businesses::EarningListParams::Order ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -223,28 +223,28 @@ module WhopSDK CREATED_AT = T.let( :created_at, - WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Order::TaggedSymbol ) COMMISSION_AMOUNT = T.let( :commission_amount, - WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Order::TaggedSymbol ) TRANSACTION_AMOUNT = T.let( :transaction_amount, - WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Order::TaggedSymbol ) PAYOUT_AT = T.let( :payout_at, - WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Order::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Referrals::Businesses::EarningListParams::Order::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Order::TaggedSymbol ] ) end @@ -260,7 +260,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Referrals::Businesses::EarningListParams::Status + WhopSDK::Partners::Businesses::EarningListParams::Status ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -268,33 +268,33 @@ module WhopSDK AWAITING_SETTLEMENT = T.let( :awaiting_settlement, - WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Status::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Status::TaggedSymbol ) COMPLETED = T.let( :completed, - WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Status::TaggedSymbol ) CANCELED = T.let( :canceled, - WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Status::TaggedSymbol ) REVERSED = T.let( :reversed, - WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Status::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Referrals::Businesses::EarningListParams::Status::TaggedSymbol + WhopSDK::Partners::Businesses::EarningListParams::Status::TaggedSymbol ] ) end diff --git a/rbi/whop_sdk/models/referrals/businesses/earning_list_response.rbi b/rbi/whop_sdk/models/partners/businesses/earning_list_response.rbi similarity index 75% rename from rbi/whop_sdk/models/referrals/businesses/earning_list_response.rbi rename to rbi/whop_sdk/models/partners/businesses/earning_list_response.rbi index decf4ec0..f5c176b2 100644 --- a/rbi/whop_sdk/models/referrals/businesses/earning_list_response.rbi +++ b/rbi/whop_sdk/models/partners/businesses/earning_list_response.rbi @@ -2,13 +2,13 @@ module WhopSDK module Models - module Referrals + module Partners module Businesses class EarningListResponse < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::Businesses::EarningListResponse, + WhopSDK::Models::Partners::Businesses::EarningListResponse, WhopSDK::Internal::AnyHash ) end @@ -20,7 +20,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account + WhopSDK::Models::Partners::Businesses::EarningListResponse::Account ) ) end @@ -30,7 +30,7 @@ module WhopSDK params( account: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::Account::OrHash ) ).void end @@ -53,7 +53,7 @@ module WhopSDK returns( T.nilable( T::Array[ - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity ] ) ) @@ -62,7 +62,7 @@ module WhopSDK sig do returns( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Object::TaggedSymbol ) end attr_accessor :object @@ -78,7 +78,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product + WhopSDK::Models::Partners::Businesses::EarningListResponse::Product ) ) end @@ -88,7 +88,7 @@ module WhopSDK params( product: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::Product::OrHash ) ).void end @@ -98,7 +98,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource ) ) end @@ -108,7 +108,7 @@ module WhopSDK params( resource: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::OrHash ) ).void end @@ -121,7 +121,7 @@ module WhopSDK # Current status of the earning. sig do returns( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::TaggedSymbol ) end attr_accessor :status @@ -135,7 +135,7 @@ module WhopSDK id: T.nilable(String), account: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::Account::OrHash ), cancelation_reason: T.nilable(String), commission_amount_usd: T.nilable(String), @@ -143,24 +143,24 @@ module WhopSDK financial_activity: T.nilable( T::Array[ - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::OrHash ] ), object: - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::OrSymbol, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Object::OrSymbol, payout_at: T.nilable(Time), payout_percentage: T.nilable(Float), product: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::Product::OrHash ), resource: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::OrHash ), second_tier: T::Boolean, status: - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::OrSymbol, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::OrSymbol, transaction_amount_usd: String ).returns(T.attached_class) end @@ -199,7 +199,7 @@ module WhopSDK id: T.nilable(String), account: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account + WhopSDK::Models::Partners::Businesses::EarningListResponse::Account ), cancelation_reason: T.nilable(String), commission_amount_usd: T.nilable(String), @@ -207,24 +207,24 @@ module WhopSDK financial_activity: T.nilable( T::Array[ - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity ] ), object: - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::TaggedSymbol, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Object::TaggedSymbol, payout_at: T.nilable(Time), payout_percentage: T.nilable(Float), product: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product + WhopSDK::Models::Partners::Businesses::EarningListResponse::Product ), resource: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource ), second_tier: T::Boolean, status: - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::TaggedSymbol, transaction_amount_usd: String } ) @@ -236,7 +236,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Account, WhopSDK::Internal::AnyHash ) end @@ -296,7 +296,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity, + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity, WhopSDK::Internal::AnyHash ) end @@ -323,7 +323,7 @@ module WhopSDK # Whether the line is income Whop collected or a cost Whop paid. sig do returns( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol ) end attr_accessor :type @@ -336,7 +336,7 @@ module WhopSDK created_at: T.nilable(Time), currency: String, type: - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::OrSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type::OrSymbol ).returns(T.attached_class) end def self.new( @@ -363,7 +363,7 @@ module WhopSDK created_at: T.nilable(Time), currency: String, type: - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol } ) end @@ -378,7 +378,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -386,18 +386,18 @@ module WhopSDK INCOME = T.let( :income, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol ) EXPENSE = T.let( :expense, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::Type::TaggedSymbol ] ) end @@ -413,21 +413,21 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object + WhopSDK::Models::Partners::Businesses::EarningListResponse::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } - BUSINESS_REFERRAL_EARNING = + PARTNER_BUSINESS_EARNING = T.let( - :business_referral_earning, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::TaggedSymbol + :partner_business_earning, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Object::TaggedSymbol ] ) end @@ -439,7 +439,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Product, WhopSDK::Internal::AnyHash ) end @@ -472,7 +472,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource, WhopSDK::Internal::AnyHash ) end @@ -483,7 +483,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod ) ) end @@ -493,7 +493,7 @@ module WhopSDK params( alternative_payment_method: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod::OrHash ) ).void end @@ -513,7 +513,7 @@ module WhopSDK sig do returns( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object::TaggedSymbol ) end attr_accessor :object @@ -530,14 +530,14 @@ module WhopSDK id: String, alternative_payment_method: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod::OrHash + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod::OrHash ), brand: T.nilable(String), created_at: Time, currency: String, last4: T.nilable(String), object: - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::OrSymbol, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object::OrSymbol, payment_method_type: T.nilable(String), processor: T.nilable(String) ).returns(T.attached_class) @@ -561,14 +561,14 @@ module WhopSDK id: String, alternative_payment_method: T.nilable( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod ), brand: T.nilable(String), created_at: Time, currency: String, last4: T.nilable(String), object: - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::TaggedSymbol, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object::TaggedSymbol, payment_method_type: T.nilable(String), processor: T.nilable(String) } @@ -581,7 +581,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod, WhopSDK::Internal::AnyHash ) end @@ -614,7 +614,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -622,13 +622,13 @@ module WhopSDK RECEIPT = T.let( :receipt, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::Object::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::Object::TaggedSymbol ] ) end @@ -645,7 +645,7 @@ module WhopSDK T.type_alias do T.all( Symbol, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status ) end OrSymbol = T.type_alias { T.any(Symbol, String) } @@ -653,33 +653,33 @@ module WhopSDK AWAITING_SETTLEMENT = T.let( :awaiting_settlement, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::TaggedSymbol ) PENDING = T.let( :pending, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::TaggedSymbol ) COMPLETED = T.let( :completed, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::TaggedSymbol ) CANCELED = T.let( :canceled, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::TaggedSymbol ) REVERSED = T.let( :reversed, - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status::TaggedSymbol + WhopSDK::Models::Partners::Businesses::EarningListResponse::Status::TaggedSymbol ] ) end diff --git a/rbi/whop_sdk/models/referrals/business_leaderboard_params.rbi b/rbi/whop_sdk/models/referrals/business_leaderboard_params.rbi deleted file mode 100644 index f52a598a..00000000 --- a/rbi/whop_sdk/models/referrals/business_leaderboard_params.rbi +++ /dev/null @@ -1,120 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - module Referrals - class BusinessLeaderboardParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - WhopSDK::Referrals::BusinessLeaderboardParams, - WhopSDK::Internal::AnyHash - ) - end - - # Time window for the rankings. `day`, `month`, and `year` count earnings since - # the start of the current calendar day, month, or year; `last_30_days` counts - # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. - sig do - returns( - T.nilable( - WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol - ) - ) - end - attr_reader :period - - sig do - params( - period: - WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol - ).void - end - attr_writer :period - - sig do - params( - period: - WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol, - request_options: WhopSDK::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Time window for the rankings. `day`, `month`, and `year` count earnings since - # the start of the current calendar day, month, or year; `last_30_days` counts - # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. - period: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - period: - WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol, - request_options: WhopSDK::RequestOptions - } - ) - end - def to_hash - end - - # Time window for the rankings. `day`, `month`, and `year` count earnings since - # the start of the current calendar day, month, or year; `last_30_days` counts - # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. - module Period - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::Referrals::BusinessLeaderboardParams::Period - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - DAY = - T.let( - :day, - WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol - ) - MONTH = - T.let( - :month, - WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol - ) - YEAR = - T.let( - :year, - WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol - ) - LAST_30_DAYS = - T.let( - :last_30_days, - WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol - ) - ALL_TIME = - T.let( - :all_time, - WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::Referrals::BusinessLeaderboardParams::Period::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end - end -end diff --git a/rbi/whop_sdk/models/referrals/business_leaderboard_response.rbi b/rbi/whop_sdk/models/referrals/business_leaderboard_response.rbi deleted file mode 100644 index 538eb1ff..00000000 --- a/rbi/whop_sdk/models/referrals/business_leaderboard_response.rbi +++ /dev/null @@ -1,535 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - module Referrals - class BusinessLeaderboardResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse, - WhopSDK::Internal::AnyHash - ) - end - - # The top referrers by total earnings, best first. - sig do - returns( - T::Array[ - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader - ] - ) - end - attr_accessor :leaders - - # The caller's own standing; null when the caller has no referral earnings. - sig do - returns( - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me - ) - ) - end - attr_reader :me - - sig do - params( - me: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::OrHash - ) - ).void - end - attr_writer :me - - sig do - params( - leaders: - T::Array[ - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::OrHash - ], - me: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::OrHash - ) - ).returns(T.attached_class) - end - def self.new( - # The top referrers by total earnings, best first. - leaders:, - # The caller's own standing; null when the caller has no referral earnings. - me: - ) - end - - sig do - override.returns( - { - leaders: - T::Array[ - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader - ], - me: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me - ) - } - ) - end - def to_hash - end - - class Leader < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader, - WhopSDK::Internal::AnyHash - ) - end - - # When the referrer's earliest business referral became active. - sig { returns(Time) } - attr_accessor :first_referral_started_at - - # 1-based leaderboard position. - sig { returns(Integer) } - attr_accessor :rank - - # The referrer's pending + completed earnings across all referred businesses, in - # USD. - sig { returns(String) } - attr_accessor :total_earnings_usd - - # Credited GMV across all the referrer's referred businesses, in USD. - sig { returns(String) } - attr_accessor :total_volume_usd - - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - sig do - returns( - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User - ) - ) - end - attr_reader :user - - sig do - params( - user: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::OrHash - ) - ).void - end - attr_writer :user - - sig do - params( - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::OrHash - ) - ).returns(T.attached_class) - end - def self.new( - # When the referrer's earliest business referral became active. - first_referral_started_at:, - # 1-based leaderboard position. - rank:, - # The referrer's pending + completed earnings across all referred businesses, in - # USD. - total_earnings_usd:, - # Credited GMV across all the referrer's referred businesses, in USD. - total_volume_usd:, - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - user: - ) - end - - sig do - override.returns( - { - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User - ) - } - ) - end - def to_hash - end - - class User < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, - WhopSDK::Internal::AnyHash - ) - end - - # The city where the referrer is located, derived from their IP address. Null if - # location sharing is disabled. - sig { returns(T.nilable(String)) } - attr_accessor :city - - # The country where the referrer is located, derived from their IP address. Null - # if location sharing is disabled. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # User ID, prefixed `user_`. Present only on the caller's own entry. - sig { returns(T.nilable(String)) } - attr_reader :id - - sig { params(id: String).void } - attr_writer :id - - # The user's display name. Present only on the caller's own entry. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The user's profile picture. Present only on the caller's own entry. - sig do - returns( - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture - ) - ) - end - attr_reader :profile_picture - - sig do - params( - profile_picture: - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture::OrHash - ).void - end - attr_writer :profile_picture - - # The user's unique username. Present only on the caller's own entry. - sig { returns(T.nilable(String)) } - attr_reader :username - - sig { params(username: String).void } - attr_writer :username - - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - sig do - params( - city: T.nilable(String), - country: T.nilable(String), - id: String, - name: T.nilable(String), - profile_picture: - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture::OrHash, - username: String - ).returns(T.attached_class) - end - def self.new( - # The city where the referrer is located, derived from their IP address. Null if - # location sharing is disabled. - city:, - # The country where the referrer is located, derived from their IP address. Null - # if location sharing is disabled. - country:, - # User ID, prefixed `user_`. Present only on the caller's own entry. - id: nil, - # The user's display name. Present only on the caller's own entry. - name: nil, - # The user's profile picture. Present only on the caller's own entry. - profile_picture: nil, - # The user's unique username. Present only on the caller's own entry. - username: nil - ) - end - - sig do - override.returns( - { - city: T.nilable(String), - country: T.nilable(String), - id: String, - name: T.nilable(String), - profile_picture: - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, - username: String - } - ) - end - def to_hash - end - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, - WhopSDK::Internal::AnyHash - ) - end - - # The user's profile picture URL. - sig { returns(String) } - attr_accessor :url - - # The user's profile picture. Present only on the caller's own entry. - sig { params(url: String).returns(T.attached_class) } - def self.new( - # The user's profile picture URL. - url: - ) - end - - sig { override.returns({ url: String }) } - def to_hash - end - end - end - end - - class Me < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me, - WhopSDK::Internal::AnyHash - ) - end - - # When the referrer's earliest business referral became active. - sig { returns(Time) } - attr_accessor :first_referral_started_at - - # 1-based leaderboard position. - sig { returns(Integer) } - attr_accessor :rank - - # The referrer's pending + completed earnings across all referred businesses, in - # USD. - sig { returns(String) } - attr_accessor :total_earnings_usd - - # Credited GMV across all the referrer's referred businesses, in USD. - sig { returns(String) } - attr_accessor :total_volume_usd - - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - sig do - returns( - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User - ) - ) - end - attr_reader :user - - sig do - params( - user: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::OrHash - ) - ).void - end - attr_writer :user - - # The caller's own standing; null when the caller has no referral earnings. - sig do - params( - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::OrHash - ) - ).returns(T.attached_class) - end - def self.new( - # When the referrer's earliest business referral became active. - first_referral_started_at:, - # 1-based leaderboard position. - rank:, - # The referrer's pending + completed earnings across all referred businesses, in - # USD. - total_earnings_usd:, - # Credited GMV across all the referrer's referred businesses, in USD. - total_volume_usd:, - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - user: - ) - end - - sig do - override.returns( - { - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User - ) - } - ) - end - def to_hash - end - - class User < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User, - WhopSDK::Internal::AnyHash - ) - end - - # The city where the referrer is located, derived from their IP address. Null if - # location sharing is disabled. - sig { returns(T.nilable(String)) } - attr_accessor :city - - # The country where the referrer is located, derived from their IP address. Null - # if location sharing is disabled. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # User ID, prefixed `user_`. Present only on the caller's own entry. - sig { returns(T.nilable(String)) } - attr_reader :id - - sig { params(id: String).void } - attr_writer :id - - # The user's display name. Present only on the caller's own entry. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The user's profile picture. Present only on the caller's own entry. - sig do - returns( - T.nilable( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture - ) - ) - end - attr_reader :profile_picture - - sig do - params( - profile_picture: - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture::OrHash - ).void - end - attr_writer :profile_picture - - # The user's unique username. Present only on the caller's own entry. - sig { returns(T.nilable(String)) } - attr_reader :username - - sig { params(username: String).void } - attr_writer :username - - # The ranked referrer. Identity fields (id, name, username, profile_picture) are - # returned only on the caller's own entry; other referrers expose coarse location - # only. - sig do - params( - city: T.nilable(String), - country: T.nilable(String), - id: String, - name: T.nilable(String), - profile_picture: - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture::OrHash, - username: String - ).returns(T.attached_class) - end - def self.new( - # The city where the referrer is located, derived from their IP address. Null if - # location sharing is disabled. - city:, - # The country where the referrer is located, derived from their IP address. Null - # if location sharing is disabled. - country:, - # User ID, prefixed `user_`. Present only on the caller's own entry. - id: nil, - # The user's display name. Present only on the caller's own entry. - name: nil, - # The user's profile picture. Present only on the caller's own entry. - profile_picture: nil, - # The user's unique username. Present only on the caller's own entry. - username: nil - ) - end - - sig do - override.returns( - { - city: T.nilable(String), - country: T.nilable(String), - id: String, - name: T.nilable(String), - profile_picture: - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, - username: String - } - ) - end - def to_hash - end - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, - WhopSDK::Internal::AnyHash - ) - end - - # The user's profile picture URL. - sig { returns(String) } - attr_accessor :url - - # The user's profile picture. Present only on the caller's own entry. - sig { params(url: String).returns(T.attached_class) } - def self.new( - # The user's profile picture URL. - url: - ) - end - - sig { override.returns({ url: String }) } - def to_hash - end - end - end - end - end - end - end -end diff --git a/rbi/whop_sdk/models/referrals/partner_create_params.rbi b/rbi/whop_sdk/models/referrals/partner_create_params.rbi deleted file mode 100644 index 00a816cd..00000000 --- a/rbi/whop_sdk/models/referrals/partner_create_params.rbi +++ /dev/null @@ -1,32 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - module Referrals - class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - WhopSDK::Referrals::PartnerCreateParams, - WhopSDK::Internal::AnyHash - ) - end - - sig do - params(request_options: WhopSDK::RequestOptions::OrHash).returns( - T.attached_class - ) - end - def self.new(request_options: {}) - end - - sig { override.returns({ request_options: WhopSDK::RequestOptions }) } - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/models/referrals/partner_create_response.rbi b/rbi/whop_sdk/models/referrals/partner_create_response.rbi deleted file mode 100644 index d4d75478..00000000 --- a/rbi/whop_sdk/models/referrals/partner_create_response.rbi +++ /dev/null @@ -1,48 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - module Referrals - class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::Referrals::PartnerCreateResponse, - WhopSDK::Internal::AnyHash - ) - end - - # The caller's referral link — businesses that sign up through it are attributed - # to the caller. - sig { returns(String) } - attr_accessor :referral_link - - # When the caller became a Whop partner. - sig { returns(Time) } - attr_accessor :whop_partner_enabled_at - - sig do - params(referral_link: String, whop_partner_enabled_at: Time).returns( - T.attached_class - ) - end - def self.new( - # The caller's referral link — businesses that sign up through it are attributed - # to the caller. - referral_link:, - # When the caller became a Whop partner. - whop_partner_enabled_at: - ) - end - - sig do - override.returns( - { referral_link: String, whop_partner_enabled_at: Time } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/resources/referrals.rbi b/rbi/whop_sdk/resources/partners.rbi similarity index 57% rename from rbi/whop_sdk/resources/referrals.rbi rename to rbi/whop_sdk/resources/partners.rbi index 12ddbef6..decca14f 100644 --- a/rbi/whop_sdk/resources/referrals.rbi +++ b/rbi/whop_sdk/resources/partners.rbi @@ -2,30 +2,50 @@ module WhopSDK module Resources - # The Referrals API covers your Whop partner activity: the users you referred onto + # The Partners API covers your Whop partner activity: the users you referred onto # Whop, the businesses you referred and the earnings generated from their # processing volume, and the partner leaderboard. # # Use it to enroll as a Whop partner, list the users you referred, list your # referred businesses and review their earnings, and see the partner leaderboard. - class Referrals - # The Referrals API covers your Whop partner activity: the users you referred onto + class Partners + # The Partners API covers your Whop partner activity: the users you referred onto # Whop, the businesses you referred and the earnings generated from their # processing volume, and the partner leaderboard. # # Use it to enroll as a Whop partner, list the users you referred, list your # referred businesses and review their earnings, and see the partner leaderboard. - sig { returns(WhopSDK::Resources::Referrals::Businesses) } + sig { returns(WhopSDK::Resources::Partners::Businesses) } attr_reader :businesses - # The Referrals API covers your Whop partner activity: the users you referred onto - # Whop, the businesses you referred and the earnings generated from their - # processing volume, and the partner leaderboard. - # - # Use it to enroll as a Whop partner, list the users you referred, list your - # referred businesses and review their earnings, and see the partner leaderboard. - sig { returns(WhopSDK::Resources::Referrals::Partners) } - attr_reader :partners + # Enrolls the calling user in the Whop partner program, making their partner + # businesses eligible for earnings. Idempotent — enrolling again keeps the + # original enrollment time. + sig do + params(request_options: WhopSDK::RequestOptions::OrHash).returns( + WhopSDK::Models::PartnerCreateResponse + ) + end + def create(request_options: {}) + end + + # Ranks referrers by partner business earnings — all-time by default, or over the + # current day, month, year, or trailing 30 days — and includes the caller's own + # standing. + sig do + params( + period: WhopSDK::PartnerLeaderboardParams::Period::OrSymbol, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::PartnerLeaderboardResponse) + end + def leaderboard( + # Time window for the rankings. `day`, `month`, and `year` count earnings since + # the start of the current calendar day, month, or year; `last_30_days` counts + # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. + period: nil, + request_options: {} + ) + end # Lists the users the caller referred onto Whop (newest first), each with the # second-tier earnings the caller has made from that user's businesses. @@ -38,7 +58,7 @@ module WhopSDK has_earning_businesses: T::Boolean, last: Integer, request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::ReferralReferredUsersResponse) + ).returns(WhopSDK::Models::PartnerReferredUsersResponse) end def referred_users( # Cursor to fetch the page after (from page_info.end_cursor). diff --git a/rbi/whop_sdk/resources/referrals/businesses.rbi b/rbi/whop_sdk/resources/partners/businesses.rbi similarity index 61% rename from rbi/whop_sdk/resources/referrals/businesses.rbi rename to rbi/whop_sdk/resources/partners/businesses.rbi index 68969c91..c8bf6a08 100644 --- a/rbi/whop_sdk/resources/referrals/businesses.rbi +++ b/rbi/whop_sdk/resources/partners/businesses.rbi @@ -2,21 +2,21 @@ module WhopSDK module Resources - class Referrals - # The Referrals API covers your Whop partner activity: the users you referred onto + class Partners + # The Partners API covers your Whop partner activity: the users you referred onto # Whop, the businesses you referred and the earnings generated from their # processing volume, and the partner leaderboard. # # Use it to enroll as a Whop partner, list the users you referred, list your # referred businesses and review their earnings, and see the partner leaderboard. class Businesses - # The Referrals API covers your Whop partner activity: the users you referred onto + # The Partners API covers your Whop partner activity: the users you referred onto # Whop, the businesses you referred and the earnings generated from their # processing volume, and the partner leaderboard. # # Use it to enroll as a Whop partner, list the users you referred, list your # referred businesses and review their earnings, and see the partner leaderboard. - sig { returns(WhopSDK::Resources::Referrals::Businesses::Earnings) } + sig { returns(WhopSDK::Resources::Partners::Businesses::Earnings) } attr_reader :earnings # Retrieves a single referred business and its referral terms. @@ -24,10 +24,10 @@ module WhopSDK params( id: String, request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::Referrals::BusinessRetrieveResponse) + ).returns(WhopSDK::Models::Partners::BusinessRetrieveResponse) end def retrieve( - # The business referral ID (a coma\_ identifier). + # The partner business ID (a coma\_ identifier). id, request_options: {} ) @@ -42,19 +42,19 @@ module WhopSDK created_after: String, created_before: String, direction: - WhopSDK::Referrals::BusinessListParams::Direction::OrSymbol, + WhopSDK::Partners::BusinessListParams::Direction::OrSymbol, first: Integer, has_earnings: T::Boolean, last: Integer, - order: WhopSDK::Referrals::BusinessListParams::Order::OrSymbol, + order: WhopSDK::Partners::BusinessListParams::Order::OrSymbol, referred_user_id: String, referred_username: String, - status: WhopSDK::Referrals::BusinessListParams::Status::OrSymbol, - tier: WhopSDK::Referrals::BusinessListParams::Tier::OrSymbol, + status: WhopSDK::Partners::BusinessListParams::Status::OrSymbol, + tier: WhopSDK::Partners::BusinessListParams::Tier::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash ).returns( WhopSDK::Internal::CursorPage[ - WhopSDK::Models::Referrals::BusinessListResponse + WhopSDK::Models::Partners::BusinessListResponse ] ) end @@ -63,20 +63,20 @@ module WhopSDK after: nil, # Cursor to fetch the page before (from page_info.start_cursor). before: nil, - # Only return business referrals created after this timestamp. + # Only return partner businesses created after this timestamp. created_after: nil, - # Only return business referrals created before this timestamp. + # Only return partner businesses created before this timestamp. created_before: nil, # Sort direction. direction: nil, - # Number of business referrals to return from the start of the window. + # Number of partner businesses to return from the start of the window. first: nil, # When true, only businesses with pending or completed earnings paid to the # caller. has_earnings: nil, - # Number of business referrals to return from the end of the window. + # Number of partner businesses to return from the end of the window. last: nil, - # The field to sort business referrals by. + # The field to sort partner businesses by. order: nil, # Filter to referrals attributed to this user. For first-tier referrals, this is # the referred account owner; for second-tier referrals, this is the partner you @@ -93,25 +93,6 @@ module WhopSDK ) end - # Ranks referrers by business referral earnings — all-time by default, or over the - # current day, month, year, or trailing 30 days — and includes the caller's own - # standing. - sig do - params( - period: - WhopSDK::Referrals::BusinessLeaderboardParams::Period::OrSymbol, - request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::Referrals::BusinessLeaderboardResponse) - end - def leaderboard( - # Time window for the rankings. `day`, `month`, and `year` count earnings since - # the start of the current calendar day, month, or year; `last_30_days` counts - # earnings over the trailing 30 days; `all_time` ranks lifetime earnings. - period: 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/referrals/businesses/earnings.rbi b/rbi/whop_sdk/resources/partners/businesses/earnings.rbi similarity index 78% rename from rbi/whop_sdk/resources/referrals/businesses/earnings.rbi rename to rbi/whop_sdk/resources/partners/businesses/earnings.rbi index 4c5dda10..57062bcb 100644 --- a/rbi/whop_sdk/resources/referrals/businesses/earnings.rbi +++ b/rbi/whop_sdk/resources/partners/businesses/earnings.rbi @@ -2,9 +2,9 @@ module WhopSDK module Resources - class Referrals + class Partners class Businesses - # The Referrals API covers your Whop partner activity: the users you referred onto + # The Partners API covers your Whop partner activity: the users you referred onto # Whop, the businesses you referred and the earnings generated from their # processing volume, and the partner leaderboard. # @@ -21,22 +21,22 @@ module WhopSDK created_after: String, created_before: String, direction: - WhopSDK::Referrals::Businesses::EarningListParams::Direction::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Direction::OrSymbol, first: Integer, last: Integer, order: - WhopSDK::Referrals::Businesses::EarningListParams::Order::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Order::OrSymbol, status: - WhopSDK::Referrals::Businesses::EarningListParams::Status::OrSymbol, + WhopSDK::Partners::Businesses::EarningListParams::Status::OrSymbol, request_options: WhopSDK::RequestOptions::OrHash ).returns( WhopSDK::Internal::CursorPage[ - WhopSDK::Models::Referrals::Businesses::EarningListResponse + WhopSDK::Models::Partners::Businesses::EarningListResponse ] ) end def list( - # The business referral ID (a coma\_ identifier). + # The partner business ID (a coma\_ identifier). id, after: nil, before: nil, diff --git a/rbi/whop_sdk/resources/referrals/partners.rbi b/rbi/whop_sdk/resources/referrals/partners.rbi deleted file mode 100644 index 706e46ac..00000000 --- a/rbi/whop_sdk/resources/referrals/partners.rbi +++ /dev/null @@ -1,31 +0,0 @@ -# typed: strong - -module WhopSDK - module Resources - class Referrals - # The Referrals API covers your Whop partner activity: the users you referred onto - # Whop, the businesses you referred and the earnings generated from their - # processing volume, and the partner leaderboard. - # - # Use it to enroll as a Whop partner, list the users you referred, list your - # referred businesses and review their earnings, and see the partner leaderboard. - class Partners - # Enrolls the calling user in the Whop partner program, making their business - # referrals eligible for earnings. Idempotent — enrolling again keeps the original - # enrollment time. - sig do - params(request_options: WhopSDK::RequestOptions::OrHash).returns( - WhopSDK::Models::Referrals::PartnerCreateResponse - ) - end - def create(request_options: {}) - end - - # @api private - sig { params(client: WhopSDK::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end - end -end diff --git a/sig/whop_sdk/client.rbs b/sig/whop_sdk/client.rbs index a3ef5e41..94fdab79 100644 --- a/sig/whop_sdk/client.rbs +++ b/sig/whop_sdk/client.rbs @@ -108,7 +108,7 @@ module WhopSDK attr_reader payouts: WhopSDK::Resources::Payouts - attr_reader referrals: WhopSDK::Resources::Referrals + attr_reader partners: WhopSDK::Resources::Partners attr_reader cards: WhopSDK::Resources::Cards diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index 7acd7cc7..fbca643f 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -559,6 +559,14 @@ module WhopSDK class PageInfo = WhopSDK::Models::PageInfo + class PartnerCreateParams = WhopSDK::Models::PartnerCreateParams + + class PartnerLeaderboardParams = WhopSDK::Models::PartnerLeaderboardParams + + class PartnerReferredUsersParams = WhopSDK::Models::PartnerReferredUsersParams + + module Partners = WhopSDK::Models::Partners + class Payment = WhopSDK::Models::Payment class PaymentCreatedWebhookEvent = WhopSDK::Models::PaymentCreatedWebhookEvent @@ -669,10 +677,6 @@ module WhopSDK module ReceiptTaxBehavior = WhopSDK::Models::ReceiptTaxBehavior - class ReferralReferredUsersParams = WhopSDK::Models::ReferralReferredUsersParams - - module Referrals = WhopSDK::Models::Referrals - class RefundCreatedWebhookEvent = WhopSDK::Models::RefundCreatedWebhookEvent class RefundListParams = WhopSDK::Models::RefundListParams diff --git a/sig/whop_sdk/models/partner_create_params.rbs b/sig/whop_sdk/models/partner_create_params.rbs new file mode 100644 index 00000000..e9728e98 --- /dev/null +++ b/sig/whop_sdk/models/partner_create_params.rbs @@ -0,0 +1,15 @@ +module WhopSDK + module Models + type partner_create_params = + { } & WhopSDK::Internal::Type::request_parameters + + class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + def initialize: (?request_options: WhopSDK::request_opts) -> void + + def to_hash: -> { request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/partner_create_response.rbs b/sig/whop_sdk/models/partner_create_response.rbs new file mode 100644 index 00000000..13501815 --- /dev/null +++ b/sig/whop_sdk/models/partner_create_response.rbs @@ -0,0 +1,19 @@ +module WhopSDK + module Models + type partner_create_response = + { referral_link: String, whop_partner_enabled_at: Time } + + class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor referral_link: String + + attr_accessor whop_partner_enabled_at: Time + + def initialize: ( + referral_link: String, + whop_partner_enabled_at: Time + ) -> void + + def to_hash: -> { referral_link: String, whop_partner_enabled_at: Time } + end + end +end diff --git a/sig/whop_sdk/models/partner_leaderboard_params.rbs b/sig/whop_sdk/models/partner_leaderboard_params.rbs new file mode 100644 index 00000000..2db37578 --- /dev/null +++ b/sig/whop_sdk/models/partner_leaderboard_params.rbs @@ -0,0 +1,42 @@ +module WhopSDK + module Models + type partner_leaderboard_params = + { period: WhopSDK::Models::PartnerLeaderboardParams::period } + & WhopSDK::Internal::Type::request_parameters + + class PartnerLeaderboardParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_reader period: WhopSDK::Models::PartnerLeaderboardParams::period? + + def period=: ( + WhopSDK::Models::PartnerLeaderboardParams::period + ) -> WhopSDK::Models::PartnerLeaderboardParams::period + + def initialize: ( + ?period: WhopSDK::Models::PartnerLeaderboardParams::period, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + period: WhopSDK::Models::PartnerLeaderboardParams::period, + request_options: WhopSDK::RequestOptions + } + + type period = :day | :month | :year | :last_30_days | :all_time + + module Period + extend WhopSDK::Internal::Type::Enum + + DAY: :day + MONTH: :month + YEAR: :year + LAST_30_DAYS: :last_30_days + ALL_TIME: :all_time + + def self?.values: -> ::Array[WhopSDK::Models::PartnerLeaderboardParams::period] + end + end + end +end diff --git a/sig/whop_sdk/models/partner_leaderboard_response.rbs b/sig/whop_sdk/models/partner_leaderboard_response.rbs new file mode 100644 index 00000000..d4335eb6 --- /dev/null +++ b/sig/whop_sdk/models/partner_leaderboard_response.rbs @@ -0,0 +1,219 @@ +module WhopSDK + module Models + type partner_leaderboard_response = + { + leaders: ::Array[WhopSDK::Models::PartnerLeaderboardResponse::Leader], + me: WhopSDK::Models::PartnerLeaderboardResponse::Me? + } + + class PartnerLeaderboardResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor leaders: ::Array[WhopSDK::Models::PartnerLeaderboardResponse::Leader] + + attr_accessor me: WhopSDK::Models::PartnerLeaderboardResponse::Me? + + def initialize: ( + leaders: ::Array[WhopSDK::Models::PartnerLeaderboardResponse::Leader], + me: WhopSDK::Models::PartnerLeaderboardResponse::Me? + ) -> void + + def to_hash: -> { + leaders: ::Array[WhopSDK::Models::PartnerLeaderboardResponse::Leader], + me: WhopSDK::Models::PartnerLeaderboardResponse::Me? + } + + type leader = + { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::PartnerLeaderboardResponse::Leader::User? + } + + class Leader < WhopSDK::Internal::Type::BaseModel + attr_accessor first_referral_started_at: Time + + attr_accessor rank: Integer + + attr_accessor total_earnings_usd: String + + attr_accessor total_volume_usd: String + + attr_accessor user: WhopSDK::Models::PartnerLeaderboardResponse::Leader::User? + + def initialize: ( + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::PartnerLeaderboardResponse::Leader::User? + ) -> void + + def to_hash: -> { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::PartnerLeaderboardResponse::Leader::User? + } + + type user = + { + city: String?, + country: String?, + id: String, + name: String?, + profile_picture: WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture, + username: String + } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor name: String? + + attr_reader profile_picture: WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture? + + def profile_picture=: ( + WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture + ) -> WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + city: String?, + country: String?, + ?id: String, + ?name: String?, + ?profile_picture: WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::ProfilePicture, + ?username: String + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + id: String, + name: String?, + profile_picture: WhopSDK::Models::PartnerLeaderboardResponse::Leader::User::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 + + type me = + { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::PartnerLeaderboardResponse::Me::User? + } + + class Me < WhopSDK::Internal::Type::BaseModel + attr_accessor first_referral_started_at: Time + + attr_accessor rank: Integer + + attr_accessor total_earnings_usd: String + + attr_accessor total_volume_usd: String + + attr_accessor user: WhopSDK::Models::PartnerLeaderboardResponse::Me::User? + + def initialize: ( + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::PartnerLeaderboardResponse::Me::User? + ) -> void + + def to_hash: -> { + first_referral_started_at: Time, + rank: Integer, + total_earnings_usd: String, + total_volume_usd: String, + user: WhopSDK::Models::PartnerLeaderboardResponse::Me::User? + } + + type user = + { + city: String?, + country: String?, + id: String, + name: String?, + profile_picture: WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture, + username: String + } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor name: String? + + attr_reader profile_picture: WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture? + + def profile_picture=: ( + WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture + ) -> WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + city: String?, + country: String?, + ?id: String, + ?name: String?, + ?profile_picture: WhopSDK::Models::PartnerLeaderboardResponse::Me::User::ProfilePicture, + ?username: String + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + id: String, + name: String?, + profile_picture: WhopSDK::Models::PartnerLeaderboardResponse::Me::User::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 + end +end diff --git a/sig/whop_sdk/models/referral_referred_users_params.rbs b/sig/whop_sdk/models/partner_referred_users_params.rbs similarity index 92% rename from sig/whop_sdk/models/referral_referred_users_params.rbs rename to sig/whop_sdk/models/partner_referred_users_params.rbs index d0da687f..4217be0d 100644 --- a/sig/whop_sdk/models/referral_referred_users_params.rbs +++ b/sig/whop_sdk/models/partner_referred_users_params.rbs @@ -1,6 +1,6 @@ module WhopSDK module Models - type referral_referred_users_params = + type partner_referred_users_params = { after: String, before: String, @@ -11,7 +11,7 @@ module WhopSDK } & WhopSDK::Internal::Type::request_parameters - class ReferralReferredUsersParams < WhopSDK::Internal::Type::BaseModel + class PartnerReferredUsersParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters diff --git a/sig/whop_sdk/models/referral_referred_users_response.rbs b/sig/whop_sdk/models/partner_referred_users_response.rbs similarity index 61% rename from sig/whop_sdk/models/referral_referred_users_response.rbs rename to sig/whop_sdk/models/partner_referred_users_response.rbs index b6fbfb1b..0e40f7d3 100644 --- a/sig/whop_sdk/models/referral_referred_users_response.rbs +++ b/sig/whop_sdk/models/partner_referred_users_response.rbs @@ -1,31 +1,31 @@ module WhopSDK module Models - type referral_referred_users_response = + type partner_referred_users_response = { - data: ::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data], - page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + data: ::Array[WhopSDK::Models::PartnerReferredUsersResponse::Data], + page_info: WhopSDK::Models::PartnerReferredUsersResponse::PageInfo } - class ReferralReferredUsersResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor data: ::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data] + class PartnerReferredUsersResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::PartnerReferredUsersResponse::Data] - attr_accessor page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + attr_accessor page_info: WhopSDK::Models::PartnerReferredUsersResponse::PageInfo def initialize: ( - data: ::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data], - page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + data: ::Array[WhopSDK::Models::PartnerReferredUsersResponse::Data], + page_info: WhopSDK::Models::PartnerReferredUsersResponse::PageInfo ) -> void def to_hash: -> { - data: ::Array[WhopSDK::Models::ReferralReferredUsersResponse::Data], - page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo + data: ::Array[WhopSDK::Models::PartnerReferredUsersResponse::Data], + page_info: WhopSDK::Models::PartnerReferredUsersResponse::PageInfo } type data = { total_earnings_usd: String, total_volume_usd: String, - user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + user: WhopSDK::Models::PartnerReferredUsersResponse::Data::User } class Data < WhopSDK::Internal::Type::BaseModel @@ -33,18 +33,18 @@ module WhopSDK attr_accessor total_volume_usd: String - attr_accessor user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + attr_accessor user: WhopSDK::Models::PartnerReferredUsersResponse::Data::User def initialize: ( total_earnings_usd: String, total_volume_usd: String, - user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + user: WhopSDK::Models::PartnerReferredUsersResponse::Data::User ) -> void def to_hash: -> { total_earnings_usd: String, total_volume_usd: String, - user: WhopSDK::Models::ReferralReferredUsersResponse::Data::User + user: WhopSDK::Models::PartnerReferredUsersResponse::Data::User } type user = @@ -54,7 +54,7 @@ module WhopSDK city: String?, country: String?, name: String?, - profile_picture: WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + profile_picture: WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture } class User < WhopSDK::Internal::Type::BaseModel @@ -68,11 +68,11 @@ module WhopSDK attr_accessor name: String? - attr_reader profile_picture: WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture? + attr_reader profile_picture: WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture? def profile_picture=: ( - WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture - ) -> WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture + ) -> WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture def initialize: ( id: String, @@ -80,7 +80,7 @@ module WhopSDK ?city: String?, ?country: String?, ?name: String?, - ?profile_picture: WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + ?profile_picture: WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture ) -> void def to_hash: -> { @@ -89,7 +89,7 @@ module WhopSDK city: String?, country: String?, name: String?, - profile_picture: WhopSDK::Models::ReferralReferredUsersResponse::Data::User::ProfilePicture + profile_picture: WhopSDK::Models::PartnerReferredUsersResponse::Data::User::ProfilePicture } type profile_picture = { url: String? } diff --git a/sig/whop_sdk/models/referrals/business_list_params.rbs b/sig/whop_sdk/models/partners/business_list_params.rbs similarity index 61% rename from sig/whop_sdk/models/referrals/business_list_params.rbs rename to sig/whop_sdk/models/partners/business_list_params.rbs index 9b8d3850..8f39caf3 100644 --- a/sig/whop_sdk/models/referrals/business_list_params.rbs +++ b/sig/whop_sdk/models/partners/business_list_params.rbs @@ -1,21 +1,21 @@ module WhopSDK module Models - module Referrals + module Partners type business_list_params = { after: String, before: String, created_after: String, created_before: String, - direction: WhopSDK::Models::Referrals::BusinessListParams::direction, + direction: WhopSDK::Models::Partners::BusinessListParams::direction, first: Integer, has_earnings: bool, last: Integer, - order: WhopSDK::Models::Referrals::BusinessListParams::order, + order: WhopSDK::Models::Partners::BusinessListParams::order, referred_user_id: String, referred_username: String, - status: WhopSDK::Models::Referrals::BusinessListParams::status, - tier: WhopSDK::Models::Referrals::BusinessListParams::tier + status: WhopSDK::Models::Partners::BusinessListParams::status, + tier: WhopSDK::Models::Partners::BusinessListParams::tier } & WhopSDK::Internal::Type::request_parameters @@ -39,11 +39,11 @@ module WhopSDK def created_before=: (String) -> String - attr_reader direction: WhopSDK::Models::Referrals::BusinessListParams::direction? + attr_reader direction: WhopSDK::Models::Partners::BusinessListParams::direction? def direction=: ( - WhopSDK::Models::Referrals::BusinessListParams::direction - ) -> WhopSDK::Models::Referrals::BusinessListParams::direction + WhopSDK::Models::Partners::BusinessListParams::direction + ) -> WhopSDK::Models::Partners::BusinessListParams::direction attr_reader first: Integer? @@ -57,11 +57,11 @@ module WhopSDK def last=: (Integer) -> Integer - attr_reader order: WhopSDK::Models::Referrals::BusinessListParams::order? + attr_reader order: WhopSDK::Models::Partners::BusinessListParams::order? def order=: ( - WhopSDK::Models::Referrals::BusinessListParams::order - ) -> WhopSDK::Models::Referrals::BusinessListParams::order + WhopSDK::Models::Partners::BusinessListParams::order + ) -> WhopSDK::Models::Partners::BusinessListParams::order attr_reader referred_user_id: String? @@ -71,32 +71,32 @@ module WhopSDK def referred_username=: (String) -> String - attr_reader status: WhopSDK::Models::Referrals::BusinessListParams::status? + attr_reader status: WhopSDK::Models::Partners::BusinessListParams::status? def status=: ( - WhopSDK::Models::Referrals::BusinessListParams::status - ) -> WhopSDK::Models::Referrals::BusinessListParams::status + WhopSDK::Models::Partners::BusinessListParams::status + ) -> WhopSDK::Models::Partners::BusinessListParams::status - attr_reader tier: WhopSDK::Models::Referrals::BusinessListParams::tier? + attr_reader tier: WhopSDK::Models::Partners::BusinessListParams::tier? def tier=: ( - WhopSDK::Models::Referrals::BusinessListParams::tier - ) -> WhopSDK::Models::Referrals::BusinessListParams::tier + WhopSDK::Models::Partners::BusinessListParams::tier + ) -> WhopSDK::Models::Partners::BusinessListParams::tier def initialize: ( ?after: String, ?before: String, ?created_after: String, ?created_before: String, - ?direction: WhopSDK::Models::Referrals::BusinessListParams::direction, + ?direction: WhopSDK::Models::Partners::BusinessListParams::direction, ?first: Integer, ?has_earnings: bool, ?last: Integer, - ?order: WhopSDK::Models::Referrals::BusinessListParams::order, + ?order: WhopSDK::Models::Partners::BusinessListParams::order, ?referred_user_id: String, ?referred_username: String, - ?status: WhopSDK::Models::Referrals::BusinessListParams::status, - ?tier: WhopSDK::Models::Referrals::BusinessListParams::tier, + ?status: WhopSDK::Models::Partners::BusinessListParams::status, + ?tier: WhopSDK::Models::Partners::BusinessListParams::tier, ?request_options: WhopSDK::request_opts ) -> void @@ -105,15 +105,15 @@ module WhopSDK before: String, created_after: String, created_before: String, - direction: WhopSDK::Models::Referrals::BusinessListParams::direction, + direction: WhopSDK::Models::Partners::BusinessListParams::direction, first: Integer, has_earnings: bool, last: Integer, - order: WhopSDK::Models::Referrals::BusinessListParams::order, + order: WhopSDK::Models::Partners::BusinessListParams::order, referred_user_id: String, referred_username: String, - status: WhopSDK::Models::Referrals::BusinessListParams::status, - tier: WhopSDK::Models::Referrals::BusinessListParams::tier, + status: WhopSDK::Models::Partners::BusinessListParams::status, + tier: WhopSDK::Models::Partners::BusinessListParams::tier, request_options: WhopSDK::RequestOptions } @@ -125,7 +125,7 @@ module WhopSDK ASC: :asc DESC: :desc - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListParams::direction] + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessListParams::direction] end type order = @@ -146,7 +146,7 @@ module WhopSDK VOLUME_USD: :volume_usd EARNINGS_USD: :earnings_usd - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListParams::order] + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessListParams::order] end type status = :active | :removed @@ -157,7 +157,7 @@ module WhopSDK ACTIVE: :active REMOVED: :removed - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListParams::status] + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessListParams::status] end type tier = :first | :second @@ -168,7 +168,7 @@ module WhopSDK FIRST: :first SECOND: :second - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListParams::tier] + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessListParams::tier] end end end diff --git a/sig/whop_sdk/models/referrals/business_list_response.rbs b/sig/whop_sdk/models/partners/business_list_response.rbs similarity index 54% rename from sig/whop_sdk/models/referrals/business_list_response.rbs rename to sig/whop_sdk/models/partners/business_list_response.rbs index 6cbcf9c5..e26191b8 100644 --- a/sig/whop_sdk/models/referrals/business_list_response.rbs +++ b/sig/whop_sdk/models/partners/business_list_response.rbs @@ -1,39 +1,39 @@ module WhopSDK module Models - module Referrals + module Partners type business_list_response = { id: String, - account: WhopSDK::Models::Referrals::BusinessListResponse::Account?, + account: WhopSDK::Models::Partners::BusinessListResponse::Account?, created_at: Time, - earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, - first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner?, - my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier, - object: WhopSDK::Models::Referrals::BusinessListResponse::object, - owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner?, + earnings_usd: WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Partners::BusinessListResponse::my_partner_tier, + object: WhopSDK::Models::Partners::BusinessListResponse::object, + owner: WhopSDK::Models::Partners::BusinessListResponse::Owner?, payout_percentage: Float, referral_expires_at: Time?, referral_started_at: Time?, - status: WhopSDK::Models::Referrals::BusinessListResponse::status, - volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + status: WhopSDK::Models::Partners::BusinessListResponse::status, + volume_usd: WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd } class BusinessListResponse < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor account: WhopSDK::Models::Referrals::BusinessListResponse::Account? + attr_accessor account: WhopSDK::Models::Partners::BusinessListResponse::Account? attr_accessor created_at: Time - attr_accessor earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd + attr_accessor earnings_usd: WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd - attr_accessor first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner? + attr_accessor first_tier_partner: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner? - attr_accessor my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier + attr_accessor my_partner_tier: WhopSDK::Models::Partners::BusinessListResponse::my_partner_tier - attr_accessor object: WhopSDK::Models::Referrals::BusinessListResponse::object + attr_accessor object: WhopSDK::Models::Partners::BusinessListResponse::object - attr_accessor owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner? + attr_accessor owner: WhopSDK::Models::Partners::BusinessListResponse::Owner? attr_accessor payout_percentage: Float @@ -41,40 +41,40 @@ module WhopSDK attr_accessor referral_started_at: Time? - attr_accessor status: WhopSDK::Models::Referrals::BusinessListResponse::status + attr_accessor status: WhopSDK::Models::Partners::BusinessListResponse::status - attr_accessor volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + attr_accessor volume_usd: WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd def initialize: ( id: String, - account: WhopSDK::Models::Referrals::BusinessListResponse::Account?, + account: WhopSDK::Models::Partners::BusinessListResponse::Account?, created_at: Time, - earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, - first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner?, - my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier, - object: WhopSDK::Models::Referrals::BusinessListResponse::object, - owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner?, + earnings_usd: WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Partners::BusinessListResponse::my_partner_tier, + object: WhopSDK::Models::Partners::BusinessListResponse::object, + owner: WhopSDK::Models::Partners::BusinessListResponse::Owner?, payout_percentage: Float, referral_expires_at: Time?, referral_started_at: Time?, - status: WhopSDK::Models::Referrals::BusinessListResponse::status, - volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + status: WhopSDK::Models::Partners::BusinessListResponse::status, + volume_usd: WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd ) -> void def to_hash: -> { id: String, - account: WhopSDK::Models::Referrals::BusinessListResponse::Account?, + account: WhopSDK::Models::Partners::BusinessListResponse::Account?, created_at: Time, - earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, - first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner?, - my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier, - object: WhopSDK::Models::Referrals::BusinessListResponse::object, - owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner?, + earnings_usd: WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Partners::BusinessListResponse::my_partner_tier, + object: WhopSDK::Models::Partners::BusinessListResponse::object, + owner: WhopSDK::Models::Partners::BusinessListResponse::Owner?, payout_percentage: Float, referral_expires_at: Time?, referral_started_at: Time?, - status: WhopSDK::Models::Referrals::BusinessListResponse::status, - volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd + status: WhopSDK::Models::Partners::BusinessListResponse::status, + volume_usd: WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd } type account = @@ -127,7 +127,7 @@ module WhopSDK { id: String, name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + profile_picture: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture, username: String } @@ -136,21 +136,21 @@ module WhopSDK attr_accessor name: String? - attr_accessor profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture + attr_accessor profile_picture: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture attr_accessor username: String def initialize: ( id: String, name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + profile_picture: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture, username: String ) -> void def to_hash: -> { id: String, name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner::ProfilePicture, + profile_picture: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner::ProfilePicture, username: String } @@ -173,24 +173,24 @@ module WhopSDK FIRST: :first SECOND: :second - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListResponse::my_partner_tier] + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessListResponse::my_partner_tier] end - type object = :business_referral + type object = :partner_business module Object extend WhopSDK::Internal::Type::Enum - BUSINESS_REFERRAL: :business_referral + PARTNER_BUSINESS: :partner_business - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListResponse::object] + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessListResponse::object] end type owner = { id: String, name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + profile_picture: WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture, username: String } @@ -199,21 +199,21 @@ module WhopSDK attr_accessor name: String? - attr_accessor profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture + attr_accessor profile_picture: WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture attr_accessor username: String def initialize: ( id: String, name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + profile_picture: WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture, username: String ) -> void def to_hash: -> { id: String, name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessListResponse::Owner::ProfilePicture, + profile_picture: WhopSDK::Models::Partners::BusinessListResponse::Owner::ProfilePicture, username: String } @@ -236,7 +236,7 @@ module WhopSDK ACTIVE: :active REMOVED: :removed - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessListResponse::status] + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessListResponse::status] end type volume_usd = diff --git a/sig/whop_sdk/models/referrals/business_retrieve_params.rbs b/sig/whop_sdk/models/partners/business_retrieve_params.rbs similarity index 96% rename from sig/whop_sdk/models/referrals/business_retrieve_params.rbs rename to sig/whop_sdk/models/partners/business_retrieve_params.rbs index 2e77fe58..b9db1250 100644 --- a/sig/whop_sdk/models/referrals/business_retrieve_params.rbs +++ b/sig/whop_sdk/models/partners/business_retrieve_params.rbs @@ -1,6 +1,6 @@ module WhopSDK module Models - module Referrals + module Partners type business_retrieve_params = { id: String } & WhopSDK::Internal::Type::request_parameters diff --git a/sig/whop_sdk/models/partners/business_retrieve_response.rbs b/sig/whop_sdk/models/partners/business_retrieve_response.rbs new file mode 100644 index 00000000..990d6bac --- /dev/null +++ b/sig/whop_sdk/models/partners/business_retrieve_response.rbs @@ -0,0 +1,677 @@ +module WhopSDK + module Models + module Partners + type business_retrieve_response = + { + id: String, + account: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Partners::BusinessRetrieveResponse::my_partner_tier, + object: WhopSDK::Models::Partners::BusinessRetrieveResponse::object, + owner: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::status, + volume_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd + } + + class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account? + + attr_accessor created_at: Time + + attr_accessor earnings_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd + + attr_accessor first_tier_partner: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner? + + attr_accessor my_partner_tier: WhopSDK::Models::Partners::BusinessRetrieveResponse::my_partner_tier + + attr_accessor object: WhopSDK::Models::Partners::BusinessRetrieveResponse::object + + attr_accessor owner: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner? + + attr_accessor payout_percentage: Float + + attr_accessor referral_expires_at: Time? + + attr_accessor referral_started_at: Time? + + attr_accessor status: WhopSDK::Models::Partners::BusinessRetrieveResponse::status + + attr_accessor volume_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd + + def initialize: ( + id: String, + account: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Partners::BusinessRetrieveResponse::my_partner_tier, + object: WhopSDK::Models::Partners::BusinessRetrieveResponse::object, + owner: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::status, + volume_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd + ) -> void + + def to_hash: -> { + id: String, + account: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account?, + created_at: Time, + earnings_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner?, + my_partner_tier: WhopSDK::Models::Partners::BusinessRetrieveResponse::my_partner_tier, + object: WhopSDK::Models::Partners::BusinessRetrieveResponse::object, + owner: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner?, + payout_percentage: Float, + referral_expires_at: Time?, + referral_started_at: Time?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::status, + volume_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd + } + + type account = + { + id: String, + capabilities: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities?, + logo_url: String?, + recommended_actions: ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction]?, + required_actions: ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction]?, + route: String, + title: String + } + + class Account < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor capabilities: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities? + + attr_accessor logo_url: String? + + attr_accessor recommended_actions: ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction]? + + attr_accessor required_actions: ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction]? + + attr_accessor route: String + + attr_accessor title: String + + def initialize: ( + id: String, + capabilities: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities?, + logo_url: String?, + recommended_actions: ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction]?, + required_actions: ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction]?, + route: String, + title: String + ) -> void + + def to_hash: -> { + id: String, + capabilities: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities?, + logo_url: String?, + recommended_actions: ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction]?, + required_actions: ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction]?, + route: String, + title: String + } + + type capabilities = + { + accept_bank_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::transfer + } + + class Capabilities < WhopSDK::Internal::Type::BaseModel + attr_accessor accept_bank_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments + + attr_accessor accept_bnpl_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments + + attr_accessor accept_card_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments + + attr_accessor bank_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::bank_deposit + + attr_accessor card_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_deposit + + attr_accessor card_issuing: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_issuing + + attr_accessor crypto_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit + + attr_accessor crypto_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_payout + + attr_accessor instant_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::instant_payout + + attr_accessor standard_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::standard_payout + + attr_accessor transfer: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::transfer + + def initialize: ( + accept_bank_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::transfer + ) -> void + + def to_hash: -> { + accept_bank_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, + accept_bnpl_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, + accept_card_payments: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, + bank_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, + card_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_deposit, + card_issuing: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_issuing, + crypto_deposit: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, + crypto_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, + instant_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::instant_payout, + standard_payout: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::standard_payout, + transfer: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::transfer + } + + type accept_bank_payments = :active | :inactive | :pending + + module AcceptBankPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments] + end + + type accept_bnpl_payments = :active | :inactive | :pending + + module AcceptBnplPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments] + end + + type accept_card_payments = :active | :inactive | :pending + + module AcceptCardPayments + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments] + end + + type bank_deposit = :active | :inactive | :pending + + module BankDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::bank_deposit] + end + + type card_deposit = :active | :inactive | :pending + + module CardDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_deposit] + end + + type card_issuing = :active | :inactive | :pending + + module CardIssuing + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::card_issuing] + end + + type crypto_deposit = :active | :inactive | :pending + + module CryptoDeposit + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit] + end + + type crypto_payout = :active | :inactive | :pending + + module CryptoPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::crypto_payout] + end + + type instant_payout = :active | :inactive | :pending + + module InstantPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::instant_payout] + end + + type standard_payout = :active | :inactive | :pending + + module StandardPayout + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::standard_payout] + end + + type transfer = :active | :inactive | :pending + + module Transfer + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + INACTIVE: :inactive + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::Capabilities::transfer] + end + end + + type recommended_action = + { + action: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::status, + title: String + } + + class RecommendedAction < WhopSDK::Internal::Type::BaseModel + attr_accessor action: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::action + + attr_accessor blocked_capabilities: ::Array[String] + + attr_accessor cta: String + + attr_accessor cta_label: String + + attr_accessor description: String + + attr_accessor icon_url: String? + + attr_accessor impact_score: Integer? + + attr_accessor reasoning: String? + + attr_accessor status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::status + + attr_accessor title: String + + def initialize: ( + action: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::status, + title: String + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::action, + blocked_capabilities: ::Array[String], + cta: String, + cta_label: String, + description: String, + icon_url: String?, + impact_score: Integer?, + reasoning: String?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::status, + title: String + } + + type action = + :theme_business + | :create_product + | :create_plan + | :verify_identity + | :connect_affiliate_program + | :create_promotion + | :setup_tracking_pixel + | :migrate_from_stripe + | :accept_first_payment + | :launch_first_ad + | :invite_team_member + | :enable_tax_collection + | :create_card + | :join_whop_university + | :apply_for_financing + + module Action + extend WhopSDK::Internal::Type::Enum + + THEME_BUSINESS: :theme_business + CREATE_PRODUCT: :create_product + CREATE_PLAN: :create_plan + VERIFY_IDENTITY: :verify_identity + CONNECT_AFFILIATE_PROGRAM: :connect_affiliate_program + CREATE_PROMOTION: :create_promotion + SETUP_TRACKING_PIXEL: :setup_tracking_pixel + MIGRATE_FROM_STRIPE: :migrate_from_stripe + ACCEPT_FIRST_PAYMENT: :accept_first_payment + LAUNCH_FIRST_AD: :launch_first_ad + INVITE_TEAM_MEMBER: :invite_team_member + ENABLE_TAX_COLLECTION: :enable_tax_collection + CREATE_CARD: :create_card + JOIN_WHOP_UNIVERSITY: :join_whop_university + APPLY_FOR_FINANCING: :apply_for_financing + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::action] + end + + type status = :optional + + module Status + extend WhopSDK::Internal::Type::Enum + + OPTIONAL: :optional + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RecommendedAction::status] + end + end + + type required_action = + { + action: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::status, + title: String + } + + class RequiredAction < WhopSDK::Internal::Type::BaseModel + attr_accessor action: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::action + + attr_accessor blocked_capabilities: ::Array[String] + + attr_accessor cta: String? + + attr_accessor cta_label: String + + attr_accessor description: String + + attr_accessor icon_url: String? + + attr_accessor status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::status + + attr_accessor title: String + + def initialize: ( + action: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::status, + title: String + ) -> void + + def to_hash: -> { + action: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::action, + blocked_capabilities: ::Array[String], + cta: String?, + cta_label: String, + description: String, + icon_url: String?, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::status, + title: String + } + + type action = + :deposit_funds + | :submit_information_request + | :verify_identity + | :connect_fulfillment_tracker + + module Action + extend WhopSDK::Internal::Type::Enum + + DEPOSIT_FUNDS: :deposit_funds + SUBMIT_INFORMATION_REQUEST: :submit_information_request + VERIFY_IDENTITY: :verify_identity + CONNECT_FULFILLMENT_TRACKER: :connect_fulfillment_tracker + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::action] + end + + type status = :required | :pending + + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRED: :required + PENDING: :pending + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::Account::RequiredAction::status] + end + end + end + + type earnings_usd = + { completed: String, pending: String, total: String } + + class EarningsUsd < WhopSDK::Internal::Type::BaseModel + attr_accessor completed: String + + attr_accessor pending: String + + attr_accessor total: String + + def initialize: ( + completed: String, + pending: String, + total: String + ) -> void + + def to_hash: -> { completed: String, pending: String, total: String } + end + + type first_tier_partner = + { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, + username: String + } + + class FirstTierPartner < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + profile_picture: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, + username: String + ) -> void + + def to_hash: -> { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner::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 + + type my_partner_tier = :first | :second + + module MyPartnerTier + extend WhopSDK::Internal::Type::Enum + + FIRST: :first + SECOND: :second + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::my_partner_tier] + end + + type object = :partner_business + + module Object + extend WhopSDK::Internal::Type::Enum + + PARTNER_BUSINESS: :partner_business + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::object] + end + + type owner = + { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture, + username: String + } + + class Owner < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture + + attr_accessor username: String + + def initialize: ( + id: String, + name: String?, + profile_picture: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::ProfilePicture, + username: String + ) -> void + + def to_hash: -> { + id: String, + name: String?, + profile_picture: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner::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 + + type status = :active | :removed + + module Status + extend WhopSDK::Internal::Type::Enum + + ACTIVE: :active + REMOVED: :removed + + def self?.values: -> ::Array[WhopSDK::Models::Partners::BusinessRetrieveResponse::status] + end + + type volume_usd = + { attributed: String, awaiting_settlement: String, settled: String } + + class VolumeUsd < WhopSDK::Internal::Type::BaseModel + attr_accessor attributed: String + + attr_accessor awaiting_settlement: String + + attr_accessor settled: String + + def initialize: ( + attributed: String, + awaiting_settlement: String, + settled: String + ) -> void + + def to_hash: -> { + attributed: String, + awaiting_settlement: String, + settled: String + } + end + end + end + end +end diff --git a/sig/whop_sdk/models/referrals/businesses/earning_list_params.rbs b/sig/whop_sdk/models/partners/businesses/earning_list_params.rbs similarity index 60% rename from sig/whop_sdk/models/referrals/businesses/earning_list_params.rbs rename to sig/whop_sdk/models/partners/businesses/earning_list_params.rbs index f5cd431d..cd701cf7 100644 --- a/sig/whop_sdk/models/referrals/businesses/earning_list_params.rbs +++ b/sig/whop_sdk/models/partners/businesses/earning_list_params.rbs @@ -1,6 +1,6 @@ module WhopSDK module Models - module Referrals + module Partners module Businesses type earning_list_params = { @@ -9,11 +9,11 @@ module WhopSDK before: String, created_after: String, created_before: String, - direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction, + direction: WhopSDK::Models::Partners::Businesses::EarningListParams::direction, first: Integer, last: Integer, - order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order, - status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status + order: WhopSDK::Models::Partners::Businesses::EarningListParams::order, + status: WhopSDK::Models::Partners::Businesses::EarningListParams::status } & WhopSDK::Internal::Type::request_parameters @@ -39,11 +39,11 @@ module WhopSDK def created_before=: (String) -> String - attr_reader direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction? + attr_reader direction: WhopSDK::Models::Partners::Businesses::EarningListParams::direction? def direction=: ( - WhopSDK::Models::Referrals::Businesses::EarningListParams::direction - ) -> WhopSDK::Models::Referrals::Businesses::EarningListParams::direction + WhopSDK::Models::Partners::Businesses::EarningListParams::direction + ) -> WhopSDK::Models::Partners::Businesses::EarningListParams::direction attr_reader first: Integer? @@ -53,17 +53,17 @@ module WhopSDK def last=: (Integer) -> Integer - attr_reader order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order? + attr_reader order: WhopSDK::Models::Partners::Businesses::EarningListParams::order? def order=: ( - WhopSDK::Models::Referrals::Businesses::EarningListParams::order - ) -> WhopSDK::Models::Referrals::Businesses::EarningListParams::order + WhopSDK::Models::Partners::Businesses::EarningListParams::order + ) -> WhopSDK::Models::Partners::Businesses::EarningListParams::order - attr_reader status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status? + attr_reader status: WhopSDK::Models::Partners::Businesses::EarningListParams::status? def status=: ( - WhopSDK::Models::Referrals::Businesses::EarningListParams::status - ) -> WhopSDK::Models::Referrals::Businesses::EarningListParams::status + WhopSDK::Models::Partners::Businesses::EarningListParams::status + ) -> WhopSDK::Models::Partners::Businesses::EarningListParams::status def initialize: ( id: String, @@ -71,11 +71,11 @@ module WhopSDK ?before: String, ?created_after: String, ?created_before: String, - ?direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction, + ?direction: WhopSDK::Models::Partners::Businesses::EarningListParams::direction, ?first: Integer, ?last: Integer, - ?order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order, - ?status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status, + ?order: WhopSDK::Models::Partners::Businesses::EarningListParams::order, + ?status: WhopSDK::Models::Partners::Businesses::EarningListParams::status, ?request_options: WhopSDK::request_opts ) -> void @@ -85,11 +85,11 @@ module WhopSDK before: String, created_after: String, created_before: String, - direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction, + direction: WhopSDK::Models::Partners::Businesses::EarningListParams::direction, first: Integer, last: Integer, - order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order, - status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status, + order: WhopSDK::Models::Partners::Businesses::EarningListParams::order, + status: WhopSDK::Models::Partners::Businesses::EarningListParams::status, request_options: WhopSDK::RequestOptions } @@ -101,7 +101,7 @@ module WhopSDK ASC: :asc DESC: :desc - def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListParams::direction] + def self?.values: -> ::Array[WhopSDK::Models::Partners::Businesses::EarningListParams::direction] end type order = @@ -115,7 +115,7 @@ module WhopSDK TRANSACTION_AMOUNT: :transaction_amount PAYOUT_AT: :payout_at - def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListParams::order] + def self?.values: -> ::Array[WhopSDK::Models::Partners::Businesses::EarningListParams::order] end type status = @@ -130,7 +130,7 @@ module WhopSDK CANCELED: :canceled REVERSED: :reversed - def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListParams::status] + def self?.values: -> ::Array[WhopSDK::Models::Partners::Businesses::EarningListParams::status] end end end diff --git a/sig/whop_sdk/models/referrals/businesses/earning_list_response.rbs b/sig/whop_sdk/models/partners/businesses/earning_list_response.rbs similarity index 59% rename from sig/whop_sdk/models/referrals/businesses/earning_list_response.rbs rename to sig/whop_sdk/models/partners/businesses/earning_list_response.rbs index 03985c4e..d111503c 100644 --- a/sig/whop_sdk/models/referrals/businesses/earning_list_response.rbs +++ b/sig/whop_sdk/models/partners/businesses/earning_list_response.rbs @@ -1,29 +1,29 @@ module WhopSDK module Models - module Referrals + module Partners module Businesses type earning_list_response = { id: String?, - account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account?, + account: WhopSDK::Models::Partners::Businesses::EarningListResponse::Account?, cancelation_reason: String?, commission_amount_usd: String?, created_at: Time, - financial_activity: ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]?, - object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::object, + financial_activity: ::Array[WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity]?, + object: WhopSDK::Models::Partners::Businesses::EarningListResponse::object, payout_at: Time?, payout_percentage: Float?, - product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product?, - resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource?, + product: WhopSDK::Models::Partners::Businesses::EarningListResponse::Product?, + resource: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource?, second_tier: bool, - status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::status, + status: WhopSDK::Models::Partners::Businesses::EarningListResponse::status, transaction_amount_usd: String } class EarningListResponse < WhopSDK::Internal::Type::BaseModel attr_accessor id: String? - attr_accessor account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account? + attr_accessor account: WhopSDK::Models::Partners::Businesses::EarningListResponse::Account? attr_accessor cancelation_reason: String? @@ -31,55 +31,55 @@ module WhopSDK attr_accessor created_at: Time - attr_accessor financial_activity: ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]? + attr_accessor financial_activity: ::Array[WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity]? - attr_accessor object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::object + attr_accessor object: WhopSDK::Models::Partners::Businesses::EarningListResponse::object attr_accessor payout_at: Time? attr_accessor payout_percentage: Float? - attr_accessor product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product? + attr_accessor product: WhopSDK::Models::Partners::Businesses::EarningListResponse::Product? - attr_accessor resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource? + attr_accessor resource: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource? attr_accessor second_tier: bool - attr_accessor status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::status + attr_accessor status: WhopSDK::Models::Partners::Businesses::EarningListResponse::status attr_accessor transaction_amount_usd: String def initialize: ( id: String?, - account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account?, + account: WhopSDK::Models::Partners::Businesses::EarningListResponse::Account?, cancelation_reason: String?, commission_amount_usd: String?, created_at: Time, - financial_activity: ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]?, - object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::object, + financial_activity: ::Array[WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity]?, + object: WhopSDK::Models::Partners::Businesses::EarningListResponse::object, payout_at: Time?, payout_percentage: Float?, - product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product?, - resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource?, + product: WhopSDK::Models::Partners::Businesses::EarningListResponse::Product?, + resource: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource?, second_tier: bool, - status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::status, + status: WhopSDK::Models::Partners::Businesses::EarningListResponse::status, transaction_amount_usd: String ) -> void def to_hash: -> { id: String?, - account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account?, + account: WhopSDK::Models::Partners::Businesses::EarningListResponse::Account?, cancelation_reason: String?, commission_amount_usd: String?, created_at: Time, - financial_activity: ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]?, - object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::object, + financial_activity: ::Array[WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity]?, + object: WhopSDK::Models::Partners::Businesses::EarningListResponse::object, payout_at: Time?, payout_percentage: Float?, - product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product?, - resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource?, + product: WhopSDK::Models::Partners::Businesses::EarningListResponse::Product?, + resource: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource?, second_tier: bool, - status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::status, + status: WhopSDK::Models::Partners::Businesses::EarningListResponse::status, transaction_amount_usd: String } @@ -117,7 +117,7 @@ module WhopSDK category: String?, created_at: Time?, currency: String, - type: WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_ + type: WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::type_ } class FinancialActivity < WhopSDK::Internal::Type::BaseModel @@ -131,7 +131,7 @@ module WhopSDK attr_accessor currency: String - attr_accessor type: WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_ + attr_accessor type: WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::type_ def initialize: ( amount: String, @@ -139,7 +139,7 @@ module WhopSDK category: String?, created_at: Time?, currency: String, - type: WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_ + type: WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::type_ ) -> void def to_hash: -> { @@ -148,7 +148,7 @@ module WhopSDK category: String?, created_at: Time?, currency: String, - type: WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_ + type: WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::type_ } type type_ = :income | :expense @@ -159,18 +159,18 @@ module WhopSDK INCOME: :income EXPENSE: :expense - def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity::type_] + def self?.values: -> ::Array[WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity::type_] end end - type object = :business_referral_earning + type object = :partner_business_earning module Object extend WhopSDK::Internal::Type::Enum - BUSINESS_REFERRAL_EARNING: :business_referral_earning + PARTNER_BUSINESS_EARNING: :partner_business_earning - def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::object] + def self?.values: -> ::Array[WhopSDK::Models::Partners::Businesses::EarningListResponse::object] end type product = { id: String, route: String, title: String } @@ -190,12 +190,12 @@ module WhopSDK type resource = { id: String, - alternative_payment_method: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, + alternative_payment_method: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, brand: String?, created_at: Time, currency: String, :last4 => String?, - object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object, + object: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::object, payment_method_type: String?, processor: String? } @@ -203,7 +203,7 @@ module WhopSDK class Resource < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor alternative_payment_method: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod? + attr_accessor alternative_payment_method: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod? attr_accessor brand: String? @@ -213,7 +213,7 @@ module WhopSDK attr_accessor last4: String? - attr_accessor object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object + attr_accessor object: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::object attr_accessor payment_method_type: String? @@ -221,24 +221,24 @@ module WhopSDK def initialize: ( id: String, - alternative_payment_method: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, + alternative_payment_method: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, brand: String?, created_at: Time, currency: String, last4: String?, - object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object, + object: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::object, payment_method_type: String?, processor: String? ) -> void def to_hash: -> { id: String, - alternative_payment_method: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, + alternative_payment_method: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::AlternativePaymentMethod?, brand: String?, created_at: Time, currency: String, :last4 => String?, - object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object, + object: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::object, payment_method_type: String?, processor: String? } @@ -263,7 +263,7 @@ module WhopSDK RECEIPT: :receipt - def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource::object] + def self?.values: -> ::Array[WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource::object] end end @@ -279,7 +279,7 @@ module WhopSDK CANCELED: :canceled REVERSED: :reversed - def self?.values: -> ::Array[WhopSDK::Models::Referrals::Businesses::EarningListResponse::status] + def self?.values: -> ::Array[WhopSDK::Models::Partners::Businesses::EarningListResponse::status] end end end diff --git a/sig/whop_sdk/models/referrals/business_leaderboard_params.rbs b/sig/whop_sdk/models/referrals/business_leaderboard_params.rbs deleted file mode 100644 index c7089b47..00000000 --- a/sig/whop_sdk/models/referrals/business_leaderboard_params.rbs +++ /dev/null @@ -1,46 +0,0 @@ -module WhopSDK - module Models - module Referrals - type business_leaderboard_params = - { - period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period - } - & WhopSDK::Internal::Type::request_parameters - - class BusinessLeaderboardParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - attr_reader period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period? - - def period=: ( - WhopSDK::Models::Referrals::BusinessLeaderboardParams::period - ) -> WhopSDK::Models::Referrals::BusinessLeaderboardParams::period - - def initialize: ( - ?period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period, - ?request_options: WhopSDK::request_opts - ) -> void - - def to_hash: -> { - period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period, - request_options: WhopSDK::RequestOptions - } - - type period = :day | :month | :year | :last_30_days | :all_time - - module Period - extend WhopSDK::Internal::Type::Enum - - DAY: :day - MONTH: :month - YEAR: :year - LAST_30_DAYS: :last_30_days - ALL_TIME: :all_time - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardParams::period] - end - end - end - end -end diff --git a/sig/whop_sdk/models/referrals/business_leaderboard_response.rbs b/sig/whop_sdk/models/referrals/business_leaderboard_response.rbs deleted file mode 100644 index 00ff7df6..00000000 --- a/sig/whop_sdk/models/referrals/business_leaderboard_response.rbs +++ /dev/null @@ -1,221 +0,0 @@ -module WhopSDK - module Models - module Referrals - type business_leaderboard_response = - { - leaders: ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader], - me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me? - } - - class BusinessLeaderboardResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor leaders: ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader] - - attr_accessor me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me? - - def initialize: ( - leaders: ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader], - me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me? - ) -> void - - def to_hash: -> { - leaders: ::Array[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader], - me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me? - } - - type leader = - { - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User? - } - - class Leader < WhopSDK::Internal::Type::BaseModel - attr_accessor first_referral_started_at: Time - - attr_accessor rank: Integer - - attr_accessor total_earnings_usd: String - - attr_accessor total_volume_usd: String - - attr_accessor user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User? - - def initialize: ( - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User? - ) -> void - - def to_hash: -> { - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User? - } - - type user = - { - city: String?, - country: String?, - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, - username: String - } - - class User < WhopSDK::Internal::Type::BaseModel - attr_accessor city: String? - - attr_accessor country: String? - - attr_reader id: String? - - def id=: (String) -> String - - attr_accessor name: String? - - attr_reader profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture? - - def profile_picture=: ( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture - ) -> WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture - - attr_reader username: String? - - def username=: (String) -> String - - def initialize: ( - city: String?, - country: String?, - ?id: String, - ?name: String?, - ?profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, - ?username: String - ) -> void - - def to_hash: -> { - city: String?, - country: String?, - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::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 - - type me = - { - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User? - } - - class Me < WhopSDK::Internal::Type::BaseModel - attr_accessor first_referral_started_at: Time - - attr_accessor rank: Integer - - attr_accessor total_earnings_usd: String - - attr_accessor total_volume_usd: String - - attr_accessor user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User? - - def initialize: ( - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User? - ) -> void - - def to_hash: -> { - first_referral_started_at: Time, - rank: Integer, - total_earnings_usd: String, - total_volume_usd: String, - user: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User? - } - - type user = - { - city: String?, - country: String?, - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, - username: String - } - - class User < WhopSDK::Internal::Type::BaseModel - attr_accessor city: String? - - attr_accessor country: String? - - attr_reader id: String? - - def id=: (String) -> String - - attr_accessor name: String? - - attr_reader profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture? - - def profile_picture=: ( - WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture - ) -> WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture - - attr_reader username: String? - - def username=: (String) -> String - - def initialize: ( - city: String?, - country: String?, - ?id: String, - ?name: String?, - ?profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::ProfilePicture, - ?username: String - ) -> void - - def to_hash: -> { - city: String?, - country: String?, - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me::User::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 - end - end -end diff --git a/sig/whop_sdk/models/referrals/business_retrieve_response.rbs b/sig/whop_sdk/models/referrals/business_retrieve_response.rbs deleted file mode 100644 index a0950883..00000000 --- a/sig/whop_sdk/models/referrals/business_retrieve_response.rbs +++ /dev/null @@ -1,677 +0,0 @@ -module WhopSDK - module Models - module Referrals - type business_retrieve_response = - { - id: String, - account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account?, - created_at: Time, - earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, - first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner?, - my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier, - object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::object, - owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner?, - payout_percentage: Float, - referral_expires_at: Time?, - referral_started_at: Time?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::status, - volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd - } - - class BusinessRetrieveResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account? - - attr_accessor created_at: Time - - attr_accessor earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd - - attr_accessor first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner? - - attr_accessor my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier - - attr_accessor object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::object - - attr_accessor owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner? - - attr_accessor payout_percentage: Float - - attr_accessor referral_expires_at: Time? - - attr_accessor referral_started_at: Time? - - attr_accessor status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::status - - attr_accessor volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd - - def initialize: ( - id: String, - account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account?, - created_at: Time, - earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, - first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner?, - my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier, - object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::object, - owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner?, - payout_percentage: Float, - referral_expires_at: Time?, - referral_started_at: Time?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::status, - volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd - ) -> void - - def to_hash: -> { - id: String, - account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account?, - created_at: Time, - earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, - first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner?, - my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier, - object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::object, - owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner?, - payout_percentage: Float, - referral_expires_at: Time?, - referral_started_at: Time?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::status, - volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd - } - - type account = - { - id: String, - capabilities: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities?, - logo_url: String?, - recommended_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction]?, - required_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction]?, - route: String, - title: String - } - - class Account < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor capabilities: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities? - - attr_accessor logo_url: String? - - attr_accessor recommended_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction]? - - attr_accessor required_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction]? - - attr_accessor route: String - - attr_accessor title: String - - def initialize: ( - id: String, - capabilities: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities?, - logo_url: String?, - recommended_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction]?, - required_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction]?, - route: String, - title: String - ) -> void - - def to_hash: -> { - id: String, - capabilities: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities?, - logo_url: String?, - recommended_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction]?, - required_actions: ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction]?, - route: String, - title: String - } - - type capabilities = - { - accept_bank_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, - accept_bnpl_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, - accept_card_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, - bank_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, - card_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit, - card_issuing: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing, - crypto_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, - crypto_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, - instant_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout, - standard_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout, - transfer: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer - } - - class Capabilities < WhopSDK::Internal::Type::BaseModel - attr_accessor accept_bank_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments - - attr_accessor accept_bnpl_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments - - attr_accessor accept_card_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments - - attr_accessor bank_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit - - attr_accessor card_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit - - attr_accessor card_issuing: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing - - attr_accessor crypto_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit - - attr_accessor crypto_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout - - attr_accessor instant_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout - - attr_accessor standard_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout - - attr_accessor transfer: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer - - def initialize: ( - accept_bank_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, - accept_bnpl_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, - accept_card_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, - bank_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, - card_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit, - card_issuing: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing, - crypto_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, - crypto_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, - instant_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout, - standard_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout, - transfer: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer - ) -> void - - def to_hash: -> { - accept_bank_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments, - accept_bnpl_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments, - accept_card_payments: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments, - bank_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit, - card_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit, - card_issuing: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing, - crypto_deposit: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit, - crypto_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout, - instant_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout, - standard_payout: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout, - transfer: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer - } - - type accept_bank_payments = :active | :inactive | :pending - - module AcceptBankPayments - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bank_payments] - end - - type accept_bnpl_payments = :active | :inactive | :pending - - module AcceptBnplPayments - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_bnpl_payments] - end - - type accept_card_payments = :active | :inactive | :pending - - module AcceptCardPayments - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::accept_card_payments] - end - - type bank_deposit = :active | :inactive | :pending - - module BankDeposit - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::bank_deposit] - end - - type card_deposit = :active | :inactive | :pending - - module CardDeposit - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_deposit] - end - - type card_issuing = :active | :inactive | :pending - - module CardIssuing - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::card_issuing] - end - - type crypto_deposit = :active | :inactive | :pending - - module CryptoDeposit - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_deposit] - end - - type crypto_payout = :active | :inactive | :pending - - module CryptoPayout - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::crypto_payout] - end - - type instant_payout = :active | :inactive | :pending - - module InstantPayout - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::instant_payout] - end - - type standard_payout = :active | :inactive | :pending - - module StandardPayout - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::standard_payout] - end - - type transfer = :active | :inactive | :pending - - module Transfer - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - INACTIVE: :inactive - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::Capabilities::transfer] - end - end - - type recommended_action = - { - action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action, - blocked_capabilities: ::Array[String], - cta: String, - cta_label: String, - description: String, - icon_url: String?, - impact_score: Integer?, - reasoning: String?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status, - title: String - } - - class RecommendedAction < WhopSDK::Internal::Type::BaseModel - attr_accessor action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action - - attr_accessor blocked_capabilities: ::Array[String] - - attr_accessor cta: String - - attr_accessor cta_label: String - - attr_accessor description: String - - attr_accessor icon_url: String? - - attr_accessor impact_score: Integer? - - attr_accessor reasoning: String? - - attr_accessor status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status - - attr_accessor title: String - - def initialize: ( - action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action, - blocked_capabilities: ::Array[String], - cta: String, - cta_label: String, - description: String, - icon_url: String?, - impact_score: Integer?, - reasoning: String?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status, - title: String - ) -> void - - def to_hash: -> { - action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action, - blocked_capabilities: ::Array[String], - cta: String, - cta_label: String, - description: String, - icon_url: String?, - impact_score: Integer?, - reasoning: String?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status, - title: String - } - - type action = - :theme_business - | :create_product - | :create_plan - | :verify_identity - | :connect_affiliate_program - | :create_promotion - | :setup_tracking_pixel - | :migrate_from_stripe - | :accept_first_payment - | :launch_first_ad - | :invite_team_member - | :enable_tax_collection - | :create_card - | :join_whop_university - | :apply_for_financing - - module Action - extend WhopSDK::Internal::Type::Enum - - THEME_BUSINESS: :theme_business - CREATE_PRODUCT: :create_product - CREATE_PLAN: :create_plan - VERIFY_IDENTITY: :verify_identity - CONNECT_AFFILIATE_PROGRAM: :connect_affiliate_program - CREATE_PROMOTION: :create_promotion - SETUP_TRACKING_PIXEL: :setup_tracking_pixel - MIGRATE_FROM_STRIPE: :migrate_from_stripe - ACCEPT_FIRST_PAYMENT: :accept_first_payment - LAUNCH_FIRST_AD: :launch_first_ad - INVITE_TEAM_MEMBER: :invite_team_member - ENABLE_TAX_COLLECTION: :enable_tax_collection - CREATE_CARD: :create_card - JOIN_WHOP_UNIVERSITY: :join_whop_university - APPLY_FOR_FINANCING: :apply_for_financing - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::action] - end - - type status = :optional - - module Status - extend WhopSDK::Internal::Type::Enum - - OPTIONAL: :optional - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RecommendedAction::status] - end - end - - type required_action = - { - action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action, - blocked_capabilities: ::Array[String], - cta: String?, - cta_label: String, - description: String, - icon_url: String?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status, - title: String - } - - class RequiredAction < WhopSDK::Internal::Type::BaseModel - attr_accessor action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action - - attr_accessor blocked_capabilities: ::Array[String] - - attr_accessor cta: String? - - attr_accessor cta_label: String - - attr_accessor description: String - - attr_accessor icon_url: String? - - attr_accessor status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status - - attr_accessor title: String - - def initialize: ( - action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action, - blocked_capabilities: ::Array[String], - cta: String?, - cta_label: String, - description: String, - icon_url: String?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status, - title: String - ) -> void - - def to_hash: -> { - action: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action, - blocked_capabilities: ::Array[String], - cta: String?, - cta_label: String, - description: String, - icon_url: String?, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status, - title: String - } - - type action = - :deposit_funds - | :submit_information_request - | :verify_identity - | :connect_fulfillment_tracker - - module Action - extend WhopSDK::Internal::Type::Enum - - DEPOSIT_FUNDS: :deposit_funds - SUBMIT_INFORMATION_REQUEST: :submit_information_request - VERIFY_IDENTITY: :verify_identity - CONNECT_FULFILLMENT_TRACKER: :connect_fulfillment_tracker - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::action] - end - - type status = :required | :pending - - module Status - extend WhopSDK::Internal::Type::Enum - - REQUIRED: :required - PENDING: :pending - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account::RequiredAction::status] - end - end - end - - type earnings_usd = - { completed: String, pending: String, total: String } - - class EarningsUsd < WhopSDK::Internal::Type::BaseModel - attr_accessor completed: String - - attr_accessor pending: String - - attr_accessor total: String - - def initialize: ( - completed: String, - pending: String, - total: String - ) -> void - - def to_hash: -> { completed: String, pending: String, total: String } - end - - type first_tier_partner = - { - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, - username: String - } - - class FirstTierPartner < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String? - - attr_accessor profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture - - attr_accessor username: String - - def initialize: ( - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::ProfilePicture, - username: String - ) -> void - - def to_hash: -> { - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner::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 - - type my_partner_tier = :first | :second - - module MyPartnerTier - extend WhopSDK::Internal::Type::Enum - - FIRST: :first - SECOND: :second - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::my_partner_tier] - end - - type object = :business_referral - - module Object - extend WhopSDK::Internal::Type::Enum - - BUSINESS_REFERRAL: :business_referral - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::object] - end - - type owner = - { - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture, - username: String - } - - class Owner < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String? - - attr_accessor profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture - - attr_accessor username: String - - def initialize: ( - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::ProfilePicture, - username: String - ) -> void - - def to_hash: -> { - id: String, - name: String?, - profile_picture: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner::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 - - type status = :active | :removed - - module Status - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - REMOVED: :removed - - def self?.values: -> ::Array[WhopSDK::Models::Referrals::BusinessRetrieveResponse::status] - end - - type volume_usd = - { attributed: String, awaiting_settlement: String, settled: String } - - class VolumeUsd < WhopSDK::Internal::Type::BaseModel - attr_accessor attributed: String - - attr_accessor awaiting_settlement: String - - attr_accessor settled: String - - def initialize: ( - attributed: String, - awaiting_settlement: String, - settled: String - ) -> void - - def to_hash: -> { - attributed: String, - awaiting_settlement: String, - settled: String - } - end - end - end - end -end diff --git a/sig/whop_sdk/models/referrals/partner_create_params.rbs b/sig/whop_sdk/models/referrals/partner_create_params.rbs deleted file mode 100644 index 56cf18f0..00000000 --- a/sig/whop_sdk/models/referrals/partner_create_params.rbs +++ /dev/null @@ -1,17 +0,0 @@ -module WhopSDK - module Models - module Referrals - type partner_create_params = - { } & WhopSDK::Internal::Type::request_parameters - - class PartnerCreateParams < WhopSDK::Internal::Type::BaseModel - extend WhopSDK::Internal::Type::RequestParameters::Converter - include WhopSDK::Internal::Type::RequestParameters - - def initialize: (?request_options: WhopSDK::request_opts) -> void - - def to_hash: -> { request_options: WhopSDK::RequestOptions } - end - end - end -end diff --git a/sig/whop_sdk/models/referrals/partner_create_response.rbs b/sig/whop_sdk/models/referrals/partner_create_response.rbs deleted file mode 100644 index 73f93cad..00000000 --- a/sig/whop_sdk/models/referrals/partner_create_response.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module WhopSDK - module Models - module Referrals - type partner_create_response = - { referral_link: String, whop_partner_enabled_at: Time } - - class PartnerCreateResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor referral_link: String - - attr_accessor whop_partner_enabled_at: Time - - def initialize: ( - referral_link: String, - whop_partner_enabled_at: Time - ) -> void - - def to_hash: -> { referral_link: String, whop_partner_enabled_at: Time } - end - end - end -end diff --git a/sig/whop_sdk/resources/partners.rbs b/sig/whop_sdk/resources/partners.rbs new file mode 100644 index 00000000..ba3f30d5 --- /dev/null +++ b/sig/whop_sdk/resources/partners.rbs @@ -0,0 +1,28 @@ +module WhopSDK + module Resources + class Partners + attr_reader businesses: WhopSDK::Resources::Partners::Businesses + + def create: ( + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::PartnerCreateResponse + + def leaderboard: ( + ?period: WhopSDK::Models::PartnerLeaderboardParams::period, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::PartnerLeaderboardResponse + + def referred_users: ( + ?after: String, + ?before: String, + ?first: Integer, + ?has_businesses: bool, + ?has_earning_businesses: bool, + ?last: Integer, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::PartnerReferredUsersResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/partners/businesses.rbs b/sig/whop_sdk/resources/partners/businesses.rbs new file mode 100644 index 00000000..4f4ef986 --- /dev/null +++ b/sig/whop_sdk/resources/partners/businesses.rbs @@ -0,0 +1,33 @@ +module WhopSDK + module Resources + class Partners + class Businesses + attr_reader earnings: WhopSDK::Resources::Partners::Businesses::Earnings + + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::Partners::BusinessRetrieveResponse + + def list: ( + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::Partners::BusinessListParams::direction, + ?first: Integer, + ?has_earnings: bool, + ?last: Integer, + ?order: WhopSDK::Models::Partners::BusinessListParams::order, + ?referred_user_id: String, + ?referred_username: String, + ?status: WhopSDK::Models::Partners::BusinessListParams::status, + ?tier: WhopSDK::Models::Partners::BusinessListParams::tier, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::Partners::BusinessListResponse] + + def initialize: (client: WhopSDK::Client) -> void + end + end + end +end diff --git a/sig/whop_sdk/resources/referrals/businesses/earnings.rbs b/sig/whop_sdk/resources/partners/businesses/earnings.rbs similarity index 54% rename from sig/whop_sdk/resources/referrals/businesses/earnings.rbs rename to sig/whop_sdk/resources/partners/businesses/earnings.rbs index fc424b90..4c0d3fe9 100644 --- a/sig/whop_sdk/resources/referrals/businesses/earnings.rbs +++ b/sig/whop_sdk/resources/partners/businesses/earnings.rbs @@ -1,6 +1,6 @@ module WhopSDK module Resources - class Referrals + class Partners class Businesses class Earnings def list: ( @@ -9,13 +9,13 @@ module WhopSDK ?before: String, ?created_after: String, ?created_before: String, - ?direction: WhopSDK::Models::Referrals::Businesses::EarningListParams::direction, + ?direction: WhopSDK::Models::Partners::Businesses::EarningListParams::direction, ?first: Integer, ?last: Integer, - ?order: WhopSDK::Models::Referrals::Businesses::EarningListParams::order, - ?status: WhopSDK::Models::Referrals::Businesses::EarningListParams::status, + ?order: WhopSDK::Models::Partners::Businesses::EarningListParams::order, + ?status: WhopSDK::Models::Partners::Businesses::EarningListParams::status, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::Referrals::Businesses::EarningListResponse] + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::Partners::Businesses::EarningListResponse] def initialize: (client: WhopSDK::Client) -> void end diff --git a/sig/whop_sdk/resources/referrals.rbs b/sig/whop_sdk/resources/referrals.rbs deleted file mode 100644 index 87b39701..00000000 --- a/sig/whop_sdk/resources/referrals.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module WhopSDK - module Resources - class Referrals - attr_reader businesses: WhopSDK::Resources::Referrals::Businesses - - attr_reader partners: WhopSDK::Resources::Referrals::Partners - - def referred_users: ( - ?after: String, - ?before: String, - ?first: Integer, - ?has_businesses: bool, - ?has_earning_businesses: bool, - ?last: Integer, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::ReferralReferredUsersResponse - - def initialize: (client: WhopSDK::Client) -> void - end - end -end diff --git a/sig/whop_sdk/resources/referrals/businesses.rbs b/sig/whop_sdk/resources/referrals/businesses.rbs deleted file mode 100644 index c0d96321..00000000 --- a/sig/whop_sdk/resources/referrals/businesses.rbs +++ /dev/null @@ -1,38 +0,0 @@ -module WhopSDK - module Resources - class Referrals - class Businesses - attr_reader earnings: WhopSDK::Resources::Referrals::Businesses::Earnings - - def retrieve: ( - String id, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::Referrals::BusinessRetrieveResponse - - def list: ( - ?after: String, - ?before: String, - ?created_after: String, - ?created_before: String, - ?direction: WhopSDK::Models::Referrals::BusinessListParams::direction, - ?first: Integer, - ?has_earnings: bool, - ?last: Integer, - ?order: WhopSDK::Models::Referrals::BusinessListParams::order, - ?referred_user_id: String, - ?referred_username: String, - ?status: WhopSDK::Models::Referrals::BusinessListParams::status, - ?tier: WhopSDK::Models::Referrals::BusinessListParams::tier, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::Referrals::BusinessListResponse] - - def leaderboard: ( - ?period: WhopSDK::Models::Referrals::BusinessLeaderboardParams::period, - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::Referrals::BusinessLeaderboardResponse - - def initialize: (client: WhopSDK::Client) -> void - end - end - end -end diff --git a/sig/whop_sdk/resources/referrals/partners.rbs b/sig/whop_sdk/resources/referrals/partners.rbs deleted file mode 100644 index d4da1e94..00000000 --- a/sig/whop_sdk/resources/referrals/partners.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module WhopSDK - module Resources - class Referrals - class Partners - def create: ( - ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::Referrals::PartnerCreateResponse - - def initialize: (client: WhopSDK::Client) -> void - end - end - end -end diff --git a/test/whop_sdk/resource_namespaces.rb b/test/whop_sdk/resource_namespaces.rb index d746d3ad..6a733833 100644 --- a/test/whop_sdk/resource_namespaces.rb +++ b/test/whop_sdk/resource_namespaces.rb @@ -12,14 +12,14 @@ module Affiliates module Businesses end - module Payouts - end - - module Referrals + module Partners module Businesses end end + module Payouts + end + module Workforce end end diff --git a/test/whop_sdk/resources/partners/businesses/earnings_test.rb b/test/whop_sdk/resources/partners/businesses/earnings_test.rb new file mode 100644 index 00000000..0a40ce13 --- /dev/null +++ b/test/whop_sdk/resources/partners/businesses/earnings_test.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class WhopSDK::Test::Resources::Partners::Businesses::EarningsTest < WhopSDK::Test::ResourceTest + def test_list + skip("Mock server tests are disabled") + + response = @whop.partners.businesses.earnings.list("id") + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::Partners::Businesses::EarningListResponse + end + + assert_pattern do + row => { + id: String | nil, + account: WhopSDK::Models::Partners::Businesses::EarningListResponse::Account | nil, + cancelation_reason: String | nil, + commission_amount_usd: String | nil, + created_at: Time, + financial_activity: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Partners::Businesses::EarningListResponse::FinancialActivity]) | nil, + object: WhopSDK::Models::Partners::Businesses::EarningListResponse::Object, + payout_at: Time | nil, + payout_percentage: Float | nil, + product: WhopSDK::Models::Partners::Businesses::EarningListResponse::Product | nil, + resource: WhopSDK::Models::Partners::Businesses::EarningListResponse::Resource | nil, + second_tier: WhopSDK::Internal::Type::Boolean, + status: WhopSDK::Models::Partners::Businesses::EarningListResponse::Status, + transaction_amount_usd: String + } + end + end +end diff --git a/test/whop_sdk/resources/partners/businesses_test.rb b/test/whop_sdk/resources/partners/businesses_test.rb new file mode 100644 index 00000000..18bcadbf --- /dev/null +++ b/test/whop_sdk/resources/partners/businesses_test.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class WhopSDK::Test::Resources::Partners::BusinessesTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.partners.businesses.retrieve("id") + + assert_pattern do + response => WhopSDK::Models::Partners::BusinessRetrieveResponse + end + + assert_pattern do + response => { + id: String, + account: WhopSDK::Models::Partners::BusinessRetrieveResponse::Account | nil, + created_at: Time, + earnings_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Partners::BusinessRetrieveResponse::FirstTierPartner | nil, + my_partner_tier: WhopSDK::Models::Partners::BusinessRetrieveResponse::MyPartnerTier, + object: WhopSDK::Models::Partners::BusinessRetrieveResponse::Object, + owner: WhopSDK::Models::Partners::BusinessRetrieveResponse::Owner | nil, + payout_percentage: Float, + referral_expires_at: Time | nil, + referral_started_at: Time | nil, + status: WhopSDK::Models::Partners::BusinessRetrieveResponse::Status, + volume_usd: WhopSDK::Models::Partners::BusinessRetrieveResponse::VolumeUsd + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.partners.businesses.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::Partners::BusinessListResponse + end + + assert_pattern do + row => { + id: String, + account: WhopSDK::Models::Partners::BusinessListResponse::Account | nil, + created_at: Time, + earnings_usd: WhopSDK::Models::Partners::BusinessListResponse::EarningsUsd, + first_tier_partner: WhopSDK::Models::Partners::BusinessListResponse::FirstTierPartner | nil, + my_partner_tier: WhopSDK::Models::Partners::BusinessListResponse::MyPartnerTier, + object: WhopSDK::Models::Partners::BusinessListResponse::Object, + owner: WhopSDK::Models::Partners::BusinessListResponse::Owner | nil, + payout_percentage: Float, + referral_expires_at: Time | nil, + referral_started_at: Time | nil, + status: WhopSDK::Models::Partners::BusinessListResponse::Status, + volume_usd: WhopSDK::Models::Partners::BusinessListResponse::VolumeUsd + } + end + end +end diff --git a/test/whop_sdk/resources/partners_test.rb b/test/whop_sdk/resources/partners_test.rb new file mode 100644 index 00000000..43e5887e --- /dev/null +++ b/test/whop_sdk/resources/partners_test.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::PartnersTest < WhopSDK::Test::ResourceTest + def test_create + skip("Mock server tests are disabled") + + response = @whop.partners.create + + assert_pattern do + response => WhopSDK::Models::PartnerCreateResponse + end + + assert_pattern do + response => { + referral_link: String, + whop_partner_enabled_at: Time + } + end + end + + def test_leaderboard + skip("Mock server tests are disabled") + + response = @whop.partners.leaderboard + + assert_pattern do + response => WhopSDK::Models::PartnerLeaderboardResponse + end + + assert_pattern do + response => { + leaders: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PartnerLeaderboardResponse::Leader]), + me: WhopSDK::Models::PartnerLeaderboardResponse::Me | nil + } + end + end + + def test_referred_users + skip("Mock server tests are disabled") + + response = @whop.partners.referred_users + + assert_pattern do + response => WhopSDK::Models::PartnerReferredUsersResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::PartnerReferredUsersResponse::Data]), + page_info: WhopSDK::Models::PartnerReferredUsersResponse::PageInfo + } + end + end +end diff --git a/test/whop_sdk/resources/referrals/businesses/earnings_test.rb b/test/whop_sdk/resources/referrals/businesses/earnings_test.rb deleted file mode 100644 index 4d0122f2..00000000 --- a/test/whop_sdk/resources/referrals/businesses/earnings_test.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../../test_helper" - -class WhopSDK::Test::Resources::Referrals::Businesses::EarningsTest < WhopSDK::Test::ResourceTest - def test_list - skip("Mock server tests are disabled") - - response = @whop.referrals.businesses.earnings.list("id") - - assert_pattern do - response => WhopSDK::Internal::CursorPage - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => WhopSDK::Models::Referrals::Businesses::EarningListResponse - end - - assert_pattern do - row => { - id: String | nil, - account: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Account | nil, - cancelation_reason: String | nil, - commission_amount_usd: String | nil, - created_at: Time, - financial_activity: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::Businesses::EarningListResponse::FinancialActivity]) | nil, - object: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Object, - payout_at: Time | nil, - payout_percentage: Float | nil, - product: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Product | nil, - resource: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Resource | nil, - second_tier: WhopSDK::Internal::Type::Boolean, - status: WhopSDK::Models::Referrals::Businesses::EarningListResponse::Status, - transaction_amount_usd: String - } - end - end -end diff --git a/test/whop_sdk/resources/referrals/businesses_test.rb b/test/whop_sdk/resources/referrals/businesses_test.rb deleted file mode 100644 index 377200ab..00000000 --- a/test/whop_sdk/resources/referrals/businesses_test.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class WhopSDK::Test::Resources::Referrals::BusinessesTest < WhopSDK::Test::ResourceTest - def test_retrieve - skip("Mock server tests are disabled") - - response = @whop.referrals.businesses.retrieve("id") - - assert_pattern do - response => WhopSDK::Models::Referrals::BusinessRetrieveResponse - end - - assert_pattern do - response => { - id: String, - account: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Account | nil, - created_at: Time, - earnings_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::EarningsUsd, - first_tier_partner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::FirstTierPartner | nil, - my_partner_tier: WhopSDK::Models::Referrals::BusinessRetrieveResponse::MyPartnerTier, - object: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Object, - owner: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Owner | nil, - payout_percentage: Float, - referral_expires_at: Time | nil, - referral_started_at: Time | nil, - status: WhopSDK::Models::Referrals::BusinessRetrieveResponse::Status, - volume_usd: WhopSDK::Models::Referrals::BusinessRetrieveResponse::VolumeUsd - } - end - end - - def test_list - skip("Mock server tests are disabled") - - response = @whop.referrals.businesses.list - - assert_pattern do - response => WhopSDK::Internal::CursorPage - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => WhopSDK::Models::Referrals::BusinessListResponse - end - - assert_pattern do - row => { - id: String, - account: WhopSDK::Models::Referrals::BusinessListResponse::Account | nil, - created_at: Time, - earnings_usd: WhopSDK::Models::Referrals::BusinessListResponse::EarningsUsd, - first_tier_partner: WhopSDK::Models::Referrals::BusinessListResponse::FirstTierPartner | nil, - my_partner_tier: WhopSDK::Models::Referrals::BusinessListResponse::MyPartnerTier, - object: WhopSDK::Models::Referrals::BusinessListResponse::Object, - owner: WhopSDK::Models::Referrals::BusinessListResponse::Owner | nil, - payout_percentage: Float, - referral_expires_at: Time | nil, - referral_started_at: Time | nil, - status: WhopSDK::Models::Referrals::BusinessListResponse::Status, - volume_usd: WhopSDK::Models::Referrals::BusinessListResponse::VolumeUsd - } - end - end - - def test_leaderboard - skip("Mock server tests are disabled") - - response = @whop.referrals.businesses.leaderboard - - assert_pattern do - response => WhopSDK::Models::Referrals::BusinessLeaderboardResponse - end - - assert_pattern do - response => { - leaders: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader]), - me: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Me | nil - } - end - end -end diff --git a/test/whop_sdk/resources/referrals/partners_test.rb b/test/whop_sdk/resources/referrals/partners_test.rb deleted file mode 100644 index c6bb02db..00000000 --- a/test/whop_sdk/resources/referrals/partners_test.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class WhopSDK::Test::Resources::Referrals::PartnersTest < WhopSDK::Test::ResourceTest - def test_create - skip("Mock server tests are disabled") - - response = @whop.referrals.partners.create - - assert_pattern do - response => WhopSDK::Models::Referrals::PartnerCreateResponse - end - - assert_pattern do - response => { - referral_link: String, - whop_partner_enabled_at: Time - } - end - end -end diff --git a/test/whop_sdk/resources/referrals_test.rb b/test/whop_sdk/resources/referrals_test.rb deleted file mode 100644 index d5c4cd7e..00000000 --- a/test/whop_sdk/resources/referrals_test.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class WhopSDK::Test::Resources::ReferralsTest < WhopSDK::Test::ResourceTest - def test_referred_users - skip("Mock server tests are disabled") - - response = @whop.referrals.referred_users - - assert_pattern do - response => WhopSDK::Models::ReferralReferredUsersResponse - end - - assert_pattern do - response => { - data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::ReferralReferredUsersResponse::Data]), - page_info: WhopSDK::Models::ReferralReferredUsersResponse::PageInfo - } - end - end -end From 2e06e3b4829ea661e3742c92b757aa0b582074fc Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 08:57:42 +0000 Subject: [PATCH 24/34] Show "under review" instead of "Get verified" while KYC docs are being reviewed Stainless-Generated-From: 06a0a266960114b19ffcca22fe2af58a634b76a4 --- .../models/verification_create_response.rb | 19 ++++++----- .../models/verification_list_response.rb | 19 ++++++----- .../models/verification_retrieve_response.rb | 19 ++++++----- .../models/verification_update_response.rb | 19 ++++++----- .../models/verification_create_response.rbi | 32 ++++++++++++------- .../models/verification_list_response.rbi | 32 ++++++++++++------- .../models/verification_retrieve_response.rbi | 32 ++++++++++++------- .../models/verification_update_response.rbi | 32 ++++++++++++------- .../models/verification_create_response.rbs | 8 ++++- .../models/verification_list_response.rbs | 8 ++++- .../models/verification_retrieve_response.rbs | 8 ++++- .../models/verification_update_response.rbs | 8 ++++- 12 files changed, 152 insertions(+), 84 deletions(-) diff --git a/lib/whop_sdk/models/verification_create_response.rb b/lib/whop_sdk/models/verification_create_response.rb index abbd0a03..d39e58a9 100644 --- a/lib/whop_sdk/models/verification_create_response.rb +++ b/lib/whop_sdk/models/verification_create_response.rb @@ -90,10 +90,11 @@ class VerificationCreateResponse < WhopSDK::Internal::Type::BaseModel # @!attribute status # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. # # @return [Symbol, WhopSDK::Models::VerificationCreateResponse::Status, nil] optional :status, enum: -> { WhopSDK::Models::VerificationCreateResponse::Status } @@ -377,10 +378,11 @@ module Status end # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. # # @see WhopSDK::Models::VerificationCreateResponse#status module Status @@ -388,6 +390,7 @@ module Status NOT_STARTED = :not_started PENDING = :pending + PROCESSING = :processing APPROVED = :approved REJECTED = :rejected ACTION_REQUIRED = :action_required diff --git a/lib/whop_sdk/models/verification_list_response.rb b/lib/whop_sdk/models/verification_list_response.rb index 8e51a4cf..fb1c959a 100644 --- a/lib/whop_sdk/models/verification_list_response.rb +++ b/lib/whop_sdk/models/verification_list_response.rb @@ -99,10 +99,11 @@ class Data < WhopSDK::Internal::Type::BaseModel # @!attribute status # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. # # @return [Symbol, WhopSDK::Models::VerificationListResponse::Data::Status, nil] optional :status, enum: -> { WhopSDK::Models::VerificationListResponse::Data::Status } @@ -386,10 +387,11 @@ module Status end # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. # # @see WhopSDK::Models::VerificationListResponse::Data#status module Status @@ -397,6 +399,7 @@ module Status NOT_STARTED = :not_started PENDING = :pending + PROCESSING = :processing APPROVED = :approved REJECTED = :rejected ACTION_REQUIRED = :action_required diff --git a/lib/whop_sdk/models/verification_retrieve_response.rb b/lib/whop_sdk/models/verification_retrieve_response.rb index e627df4b..c043b604 100644 --- a/lib/whop_sdk/models/verification_retrieve_response.rb +++ b/lib/whop_sdk/models/verification_retrieve_response.rb @@ -90,10 +90,11 @@ class VerificationRetrieveResponse < WhopSDK::Internal::Type::BaseModel # @!attribute status # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. # # @return [Symbol, WhopSDK::Models::VerificationRetrieveResponse::Status, nil] optional :status, enum: -> { WhopSDK::Models::VerificationRetrieveResponse::Status } @@ -377,10 +378,11 @@ module Status end # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. # # @see WhopSDK::Models::VerificationRetrieveResponse#status module Status @@ -388,6 +390,7 @@ module Status NOT_STARTED = :not_started PENDING = :pending + PROCESSING = :processing APPROVED = :approved REJECTED = :rejected ACTION_REQUIRED = :action_required diff --git a/lib/whop_sdk/models/verification_update_response.rb b/lib/whop_sdk/models/verification_update_response.rb index e9a65c1d..9920b366 100644 --- a/lib/whop_sdk/models/verification_update_response.rb +++ b/lib/whop_sdk/models/verification_update_response.rb @@ -90,10 +90,11 @@ class VerificationUpdateResponse < WhopSDK::Internal::Type::BaseModel # @!attribute status # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. # # @return [Symbol, WhopSDK::Models::VerificationUpdateResponse::Status, nil] optional :status, enum: -> { WhopSDK::Models::VerificationUpdateResponse::Status } @@ -377,10 +378,11 @@ module Status end # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. # # @see WhopSDK::Models::VerificationUpdateResponse#status module Status @@ -388,6 +390,7 @@ module Status NOT_STARTED = :not_started PENDING = :pending + PROCESSING = :processing APPROVED = :approved REJECTED = :rejected ACTION_REQUIRED = :action_required diff --git a/rbi/whop_sdk/models/verification_create_response.rbi b/rbi/whop_sdk/models/verification_create_response.rbi index 4bdb53c8..ac951ddd 100644 --- a/rbi/whop_sdk/models/verification_create_response.rbi +++ b/rbi/whop_sdk/models/verification_create_response.rbi @@ -135,10 +135,11 @@ module WhopSDK attr_accessor :session_url # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. sig do returns( T.nilable( @@ -222,10 +223,11 @@ module WhopSDK # Expires 7 days after creation. session_url: nil, # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. status: nil, # When the verification profile was last updated, as an ISO 8601 timestamp. updated_at: nil @@ -703,10 +705,11 @@ module WhopSDK end # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. module Status extend WhopSDK::Internal::Type::Enum @@ -726,6 +729,11 @@ module WhopSDK :pending, WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol ) + PROCESSING = + T.let( + :processing, + WhopSDK::Models::VerificationCreateResponse::Status::TaggedSymbol + ) APPROVED = T.let( :approved, diff --git a/rbi/whop_sdk/models/verification_list_response.rbi b/rbi/whop_sdk/models/verification_list_response.rbi index 92ff1758..13dfb13a 100644 --- a/rbi/whop_sdk/models/verification_list_response.rbi +++ b/rbi/whop_sdk/models/verification_list_response.rbi @@ -179,10 +179,11 @@ module WhopSDK attr_accessor :session_url # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. sig do returns( T.nilable( @@ -269,10 +270,11 @@ module WhopSDK # Expires 7 days after creation. session_url: nil, # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. status: nil, # When the verification profile was last updated, as an ISO 8601 timestamp. updated_at: nil @@ -755,10 +757,11 @@ module WhopSDK end # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. module Status extend WhopSDK::Internal::Type::Enum @@ -781,6 +784,11 @@ module WhopSDK :pending, WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol ) + PROCESSING = + T.let( + :processing, + WhopSDK::Models::VerificationListResponse::Data::Status::TaggedSymbol + ) APPROVED = T.let( :approved, diff --git a/rbi/whop_sdk/models/verification_retrieve_response.rbi b/rbi/whop_sdk/models/verification_retrieve_response.rbi index 485b5ef3..11baa5ad 100644 --- a/rbi/whop_sdk/models/verification_retrieve_response.rbi +++ b/rbi/whop_sdk/models/verification_retrieve_response.rbi @@ -137,10 +137,11 @@ module WhopSDK attr_accessor :session_url # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. sig do returns( T.nilable( @@ -226,10 +227,11 @@ module WhopSDK # Expires 7 days after creation. session_url: nil, # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. status: nil, # When the verification profile was last updated, as an ISO 8601 timestamp. updated_at: nil @@ -707,10 +709,11 @@ module WhopSDK end # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. module Status extend WhopSDK::Internal::Type::Enum @@ -730,6 +733,11 @@ module WhopSDK :pending, WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol ) + PROCESSING = + T.let( + :processing, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) APPROVED = T.let( :approved, diff --git a/rbi/whop_sdk/models/verification_update_response.rbi b/rbi/whop_sdk/models/verification_update_response.rbi index 2bfd1b49..ae11c5cf 100644 --- a/rbi/whop_sdk/models/verification_update_response.rbi +++ b/rbi/whop_sdk/models/verification_update_response.rbi @@ -135,10 +135,11 @@ module WhopSDK attr_accessor :session_url # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. sig do returns( T.nilable( @@ -222,10 +223,11 @@ module WhopSDK # Expires 7 days after creation. session_url: nil, # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. status: nil, # When the verification profile was last updated, as an ISO 8601 timestamp. updated_at: nil @@ -703,10 +705,11 @@ module WhopSDK end # Current verification state. `not_started` before any session has been created; - # `pending` while a session is in progress; `action_required` when items in - # `requested_information` need answers before review can continue; `approved` once - # verification succeeds; `rejected` if it fails. Call the Create Verification - # endpoint again to start a new session. + # `pending` while a session is in progress and needs the user's input; + # `processing` while the provider reviews submitted documents — nothing to do but + # wait; `action_required` when items in `requested_information` need answers + # before review can continue; `approved` once verification succeeds; `rejected` if + # it fails. Call the Create Verification endpoint again to start a new session. module Status extend WhopSDK::Internal::Type::Enum @@ -726,6 +729,11 @@ module WhopSDK :pending, WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol ) + PROCESSING = + T.let( + :processing, + WhopSDK::Models::VerificationUpdateResponse::Status::TaggedSymbol + ) APPROVED = T.let( :approved, diff --git a/sig/whop_sdk/models/verification_create_response.rbs b/sig/whop_sdk/models/verification_create_response.rbs index 17aeeaf7..3b890ddc 100644 --- a/sig/whop_sdk/models/verification_create_response.rbs +++ b/sig/whop_sdk/models/verification_create_response.rbs @@ -315,13 +315,19 @@ module WhopSDK end type status = - :not_started | :pending | :approved | :rejected | :action_required + :not_started + | :pending + | :processing + | :approved + | :rejected + | :action_required module Status extend WhopSDK::Internal::Type::Enum NOT_STARTED: :not_started PENDING: :pending + PROCESSING: :processing APPROVED: :approved REJECTED: :rejected ACTION_REQUIRED: :action_required diff --git a/sig/whop_sdk/models/verification_list_response.rbs b/sig/whop_sdk/models/verification_list_response.rbs index a3eb2f90..caf01217 100644 --- a/sig/whop_sdk/models/verification_list_response.rbs +++ b/sig/whop_sdk/models/verification_list_response.rbs @@ -333,13 +333,19 @@ module WhopSDK end type status = - :not_started | :pending | :approved | :rejected | :action_required + :not_started + | :pending + | :processing + | :approved + | :rejected + | :action_required module Status extend WhopSDK::Internal::Type::Enum NOT_STARTED: :not_started PENDING: :pending + PROCESSING: :processing APPROVED: :approved REJECTED: :rejected ACTION_REQUIRED: :action_required diff --git a/sig/whop_sdk/models/verification_retrieve_response.rbs b/sig/whop_sdk/models/verification_retrieve_response.rbs index c44602fa..79e710ec 100644 --- a/sig/whop_sdk/models/verification_retrieve_response.rbs +++ b/sig/whop_sdk/models/verification_retrieve_response.rbs @@ -315,13 +315,19 @@ module WhopSDK end type status = - :not_started | :pending | :approved | :rejected | :action_required + :not_started + | :pending + | :processing + | :approved + | :rejected + | :action_required module Status extend WhopSDK::Internal::Type::Enum NOT_STARTED: :not_started PENDING: :pending + PROCESSING: :processing APPROVED: :approved REJECTED: :rejected ACTION_REQUIRED: :action_required diff --git a/sig/whop_sdk/models/verification_update_response.rbs b/sig/whop_sdk/models/verification_update_response.rbs index f0092948..1cc6100b 100644 --- a/sig/whop_sdk/models/verification_update_response.rbs +++ b/sig/whop_sdk/models/verification_update_response.rbs @@ -315,13 +315,19 @@ module WhopSDK end type status = - :not_started | :pending | :approved | :rejected | :action_required + :not_started + | :pending + | :processing + | :approved + | :rejected + | :action_required module Status extend WhopSDK::Internal::Type::Enum NOT_STARTED: :not_started PENDING: :pending + PROCESSING: :processing APPROVED: :approved REJECTED: :rejected ACTION_REQUIRED: :action_required From fa01f017ded989b151caa67305fa5b77ebd0053d Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 09:31:36 +0000 Subject: [PATCH 25/34] Let platforms supply the company tax ID on verification so it skips the EIN RFI Stainless-Generated-From: e9468e26e4e4cb2e639dc7cb30a11e29eca4c330 --- .../models/verification_create_params.rb | 38 ++++++++-- .../models/verification_update_params.rb | 46 ++++++++++- .../models/verification_create_params.rbi | 50 +++++++++++- .../models/verification_update_params.rbi | 76 +++++++++++++++++-- .../models/verification_create_params.rbs | 14 ++++ .../models/verification_update_params.rbs | 40 ++++++++-- 6 files changed, 240 insertions(+), 24 deletions(-) diff --git a/lib/whop_sdk/models/verification_create_params.rb b/lib/whop_sdk/models/verification_create_params.rb index c33b5985..b7f496c5 100644 --- a/lib/whop_sdk/models/verification_create_params.rb +++ b/lib/whop_sdk/models/verification_create_params.rb @@ -78,6 +78,14 @@ class Individual < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :business_structure, String + # @!attribute business_tax_identification_number + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + # + # @return [String, nil] + optional :business_tax_identification_number, String + # @!attribute business_website # Business website URL. Whop store pages are not accepted. # @@ -142,12 +150,15 @@ class Individual < WhopSDK::Internal::Type::BaseModel optional :phone, String # @!attribute tax_identification_number - # SSN or ITIN. Tokenized in transit and never stored raw. + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. # # @return [String, nil] optional :tax_identification_number, String - # @!method initialize(address: nil, business_name: nil, business_structure: nil, business_website: nil, country: nil, date_of_birth: nil, document_type: nil, documents: nil, first_name: nil, kind: nil, last_name: nil, phone: nil, tax_identification_number: nil) + # @!method initialize(address: nil, business_name: nil, business_structure: nil, business_tax_identification_number: nil, business_website: nil, country: nil, date_of_birth: nil, document_type: nil, documents: nil, first_name: nil, kind: nil, last_name: nil, phone: nil, tax_identification_number: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::VerificationCreateParams::Body::Individual} for more details. # @@ -166,6 +177,8 @@ class Individual < WhopSDK::Internal::Type::BaseModel # # @param business_structure [String] Entity type for sole proprietors, such as `single_member_llc`. Supported values # + # @param business_tax_identification_number [String] The business ID number of the company, as appropriate for the company's country. + # # @param business_website [String] Business website URL. Whop store pages are not accepted. # # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. @@ -184,7 +197,7 @@ class Individual < WhopSDK::Internal::Type::BaseModel # # @param phone [String] # - # @param tax_identification_number [String] SSN or ITIN. Tokenized in transit and never stored raw. + # @param tax_identification_number [String] The government-issued ID number of the person being verified — the individual fo # @see WhopSDK::Models::VerificationCreateParams::Body::Individual#address class Address < WhopSDK::Internal::Type::BaseModel @@ -288,6 +301,14 @@ class Business < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :business_structure, String + # @!attribute business_tax_identification_number + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + # + # @return [String, nil] + optional :business_tax_identification_number, String + # @!attribute business_website # Business website URL. Whop store pages are not accepted. # @@ -313,12 +334,15 @@ class Business < WhopSDK::Internal::Type::BaseModel optional :place_of_incorporation, String # @!attribute tax_identification_number - # EIN. Tokenized in transit and never stored raw. + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. # # @return [String, nil] optional :tax_identification_number, String - # @!method initialize(address: nil, business_name: nil, business_structure: nil, business_website: nil, country: nil, kind: nil, place_of_incorporation: nil, tax_identification_number: nil) + # @!method initialize(address: nil, business_name: nil, business_structure: nil, business_tax_identification_number: nil, business_website: nil, country: nil, kind: nil, place_of_incorporation: nil, tax_identification_number: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::VerificationCreateParams::Body::Business} for more details. # @@ -332,6 +356,8 @@ class Business < WhopSDK::Internal::Type::BaseModel # # @param business_structure [String] Legal entity structure of the business, such as `private_corporation` or `sole_p # + # @param business_tax_identification_number [String] The business ID number of the company, as appropriate for the company's country. + # # @param business_website [String] Business website URL. Whop store pages are not accepted. # # @param country [String] Country of incorporation as a two-letter ISO 3166-1 country code. @@ -340,7 +366,7 @@ class Business < WhopSDK::Internal::Type::BaseModel # # @param place_of_incorporation [String] State or region where the business is incorporated. # - # @param tax_identification_number [String] EIN. Tokenized in transit and never stored raw. + # @param tax_identification_number [String] The government-issued ID number of the person being verified — the individual fo # @see WhopSDK::Models::VerificationCreateParams::Body::Business#address class Address < WhopSDK::Internal::Type::BaseModel diff --git a/lib/whop_sdk/models/verification_update_params.rb b/lib/whop_sdk/models/verification_update_params.rb index ed165859..d0fc7c6f 100644 --- a/lib/whop_sdk/models/verification_update_params.rb +++ b/lib/whop_sdk/models/verification_update_params.rb @@ -41,6 +41,14 @@ module Body variant -> { WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification } class UpdateIndividualVerification < WhopSDK::Internal::Type::BaseModel + # @!attribute business_tax_identification_number + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + # + # @return [String, nil] + optional :business_tax_identification_number, String + # @!attribute country # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. # @@ -80,7 +88,16 @@ class UpdateIndividualVerification < WhopSDK::Internal::Type::BaseModel optional :requested_information, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] } - # @!method initialize(country: nil, date_of_birth: nil, first_name: nil, last_name: nil, personal_address: nil, requested_information: nil) + # @!attribute tax_identification_number + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. + # + # @return [String, nil] + optional :tax_identification_number, String + + # @!method initialize(business_tax_identification_number: nil, country: nil, date_of_birth: nil, first_name: nil, last_name: nil, personal_address: nil, requested_information: nil, tax_identification_number: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification} # for more details. @@ -88,6 +105,8 @@ class UpdateIndividualVerification < WhopSDK::Internal::Type::BaseModel # Fields that can be updated on an individual (KYC) verification. At least one # field is required. # + # @param business_tax_identification_number [String] The business ID number of the company, as appropriate for the company's country. + # # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. # # @param date_of_birth [String] Formatted as `YYYY-MM-DD`. @@ -99,6 +118,8 @@ class UpdateIndividualVerification < WhopSDK::Internal::Type::BaseModel # @param personal_address [WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress] Personal address for the individual. # # @param requested_information [Array] Answers to items returned in `requested_information`. Each entry must include th + # + # @param tax_identification_number [String] The government-issued ID number of the person being verified — the individual fo # @see WhopSDK::Models::VerificationUpdateParams::Body::UpdateIndividualVerification#personal_address class PersonalAddress < WhopSDK::Internal::Type::BaseModel @@ -329,6 +350,14 @@ class UpdateBusinessVerification < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :business_structure, String + # @!attribute business_tax_identification_number + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + # + # @return [String, nil] + optional :business_tax_identification_number, String + # @!attribute country # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. # @@ -345,7 +374,16 @@ class UpdateBusinessVerification < WhopSDK::Internal::Type::BaseModel optional :requested_information, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] } - # @!method initialize(business_address: nil, business_name: nil, business_structure: nil, country: nil, requested_information: nil) + # @!attribute tax_identification_number + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. + # + # @return [String, nil] + optional :tax_identification_number, String + + # @!method initialize(business_address: nil, business_name: nil, business_structure: nil, business_tax_identification_number: nil, country: nil, requested_information: nil, tax_identification_number: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification} # for more details. @@ -359,9 +397,13 @@ class UpdateBusinessVerification < WhopSDK::Internal::Type::BaseModel # # @param business_structure [String] Legal entity structure of the business, such as `private_corporation` or `sole_p # + # @param business_tax_identification_number [String] The business ID number of the company, as appropriate for the company's country. + # # @param country [String] Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. # # @param requested_information [Array] Answers to items returned in `requested_information`. Each entry must include th + # + # @param tax_identification_number [String] The government-issued ID number of the person being verified — the individual fo # @see WhopSDK::Models::VerificationUpdateParams::Body::UpdateBusinessVerification#business_address class BusinessAddress < WhopSDK::Internal::Type::BaseModel diff --git a/rbi/whop_sdk/models/verification_create_params.rbi b/rbi/whop_sdk/models/verification_create_params.rbi index 3e2b8d4d..ccb23a1a 100644 --- a/rbi/whop_sdk/models/verification_create_params.rbi +++ b/rbi/whop_sdk/models/verification_create_params.rbi @@ -139,6 +139,15 @@ module WhopSDK sig { params(business_structure: String).void } attr_writer :business_structure + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + sig { returns(T.nilable(String)) } + attr_reader :business_tax_identification_number + + sig { params(business_tax_identification_number: String).void } + attr_writer :business_tax_identification_number + # Business website URL. Whop store pages are not accepted. sig { returns(T.nilable(String)) } attr_reader :business_website @@ -233,7 +242,10 @@ module WhopSDK sig { params(phone: String).void } attr_writer :phone - # SSN or ITIN. Tokenized in transit and never stored raw. + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. sig { returns(T.nilable(String)) } attr_reader :tax_identification_number @@ -254,6 +266,7 @@ module WhopSDK WhopSDK::VerificationCreateParams::Body::Individual::Address::OrHash, business_name: String, business_structure: String, + business_tax_identification_number: String, business_website: String, country: String, date_of_birth: String, @@ -276,6 +289,10 @@ module WhopSDK # vary by country of incorporation — see # [Business structures](/developer/verification/business-structures). business_structure: nil, + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + business_tax_identification_number: nil, # Business website URL. Whop store pages are not accepted. business_website: nil, # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. @@ -303,7 +320,10 @@ module WhopSDK kind: nil, last_name: nil, phone: nil, - # SSN or ITIN. Tokenized in transit and never stored raw. + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. tax_identification_number: nil ) end @@ -315,6 +335,7 @@ module WhopSDK WhopSDK::VerificationCreateParams::Body::Individual::Address, business_name: String, business_structure: String, + business_tax_identification_number: String, business_website: String, country: String, date_of_birth: String, @@ -545,6 +566,15 @@ module WhopSDK sig { params(business_structure: String).void } attr_writer :business_structure + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + sig { returns(T.nilable(String)) } + attr_reader :business_tax_identification_number + + sig { params(business_tax_identification_number: String).void } + attr_writer :business_tax_identification_number + # Business website URL. Whop store pages are not accepted. sig { returns(T.nilable(String)) } attr_reader :business_website @@ -584,7 +614,10 @@ module WhopSDK sig { params(place_of_incorporation: String).void } attr_writer :place_of_incorporation - # EIN. Tokenized in transit and never stored raw. + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. sig { returns(T.nilable(String)) } attr_reader :tax_identification_number @@ -600,6 +633,7 @@ module WhopSDK WhopSDK::VerificationCreateParams::Body::Business::Address::OrHash, business_name: String, business_structure: String, + business_tax_identification_number: String, business_website: String, country: String, kind: @@ -616,6 +650,10 @@ module WhopSDK # `sole_proprietorship`. Supported values vary by country of incorporation — see # [Business structures](/developer/verification/business-structures). business_structure: nil, + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + business_tax_identification_number: nil, # Business website URL. Whop store pages are not accepted. business_website: nil, # Country of incorporation as a two-letter ISO 3166-1 country code. @@ -624,7 +662,10 @@ module WhopSDK kind: nil, # State or region where the business is incorporated. place_of_incorporation: nil, - # EIN. Tokenized in transit and never stored raw. + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. tax_identification_number: nil ) end @@ -636,6 +677,7 @@ module WhopSDK WhopSDK::VerificationCreateParams::Body::Business::Address, business_name: String, business_structure: String, + business_tax_identification_number: String, business_website: String, country: String, kind: diff --git a/rbi/whop_sdk/models/verification_update_params.rbi b/rbi/whop_sdk/models/verification_update_params.rbi index abd97063..b1dff2aa 100644 --- a/rbi/whop_sdk/models/verification_update_params.rbi +++ b/rbi/whop_sdk/models/verification_update_params.rbi @@ -84,6 +84,15 @@ module WhopSDK ) end + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + sig { returns(T.nilable(String)) } + attr_reader :business_tax_identification_number + + sig { params(business_tax_identification_number: String).void } + attr_writer :business_tax_identification_number + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. sig { returns(T.nilable(String)) } attr_reader :country @@ -153,10 +162,21 @@ module WhopSDK end attr_writer :requested_information + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. + sig { returns(T.nilable(String)) } + attr_reader :tax_identification_number + + sig { params(tax_identification_number: String).void } + attr_writer :tax_identification_number + # Fields that can be updated on an individual (KYC) verification. At least one # field is required. sig do params( + business_tax_identification_number: String, country: String, date_of_birth: String, first_name: String, @@ -166,10 +186,15 @@ module WhopSDK requested_information: T::Array[ WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation::OrHash - ] + ], + tax_identification_number: String ).returns(T.attached_class) end def self.new( + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + business_tax_identification_number: nil, # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. country: nil, # Formatted as `YYYY-MM-DD`. @@ -182,13 +207,19 @@ module WhopSDK # the requested item `id` and exactly one answer payload matching the item's # `type`: `value` for `text`, `date`, or `phone`; `address` for `address`; `files` # for `files`. - requested_information: nil + requested_information: nil, + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. + tax_identification_number: nil ) end sig do override.returns( { + business_tax_identification_number: String, country: String, date_of_birth: String, first_name: String, @@ -198,7 +229,8 @@ module WhopSDK requested_information: T::Array[ WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation - ] + ], + tax_identification_number: String } ) end @@ -669,6 +701,15 @@ module WhopSDK sig { params(business_structure: String).void } attr_writer :business_structure + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + sig { returns(T.nilable(String)) } + attr_reader :business_tax_identification_number + + sig { params(business_tax_identification_number: String).void } + attr_writer :business_tax_identification_number + # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. sig { returns(T.nilable(String)) } attr_reader :country @@ -701,6 +742,16 @@ module WhopSDK end attr_writer :requested_information + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. + sig { returns(T.nilable(String)) } + attr_reader :tax_identification_number + + sig { params(tax_identification_number: String).void } + attr_writer :tax_identification_number + # Fields that can be updated on a business entity (KYB) verification. At least one # field is required. sig do @@ -709,11 +760,13 @@ module WhopSDK WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress::OrHash, business_name: String, business_structure: String, + business_tax_identification_number: String, country: String, requested_information: T::Array[ WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation::OrHash - ] + ], + tax_identification_number: String ).returns(T.attached_class) end def self.new( @@ -725,13 +778,22 @@ module WhopSDK # `sole_proprietorship`. Supported values vary by country of incorporation — see # [Business structures](/developer/verification/business-structures). business_structure: nil, + # The business ID number of the company, as appropriate for the company's country. + # Examples are an Employer Identification Number (EIN) in the US, a Business + # Number in Canada, or a Company Number in the UK. + business_tax_identification_number: nil, # Two-letter ISO 3166-1 country code, for example `US`, `DE`, or `GB`. country: nil, # Answers to items returned in `requested_information`. Each entry must include # the requested item `id` and exactly one answer payload matching the item's # `type`: `value` for `text`, `date`, or `phone`; `address` for `address`; `files` # for `files`. - requested_information: nil + requested_information: nil, + # The government-issued ID number of the person being verified — the individual + # for a KYC verification, or the business representative for a KYB verification — + # as appropriate for their country. Examples are a Social Security Number (SSN) in + # the US, or a Social Insurance Number in Canada. + tax_identification_number: nil ) end @@ -742,11 +804,13 @@ module WhopSDK WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, business_name: String, business_structure: String, + business_tax_identification_number: String, country: String, requested_information: T::Array[ WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation - ] + ], + tax_identification_number: String } ) end diff --git a/sig/whop_sdk/models/verification_create_params.rbs b/sig/whop_sdk/models/verification_create_params.rbs index 7af93cd8..f6bb130c 100644 --- a/sig/whop_sdk/models/verification_create_params.rbs +++ b/sig/whop_sdk/models/verification_create_params.rbs @@ -39,6 +39,7 @@ module WhopSDK address: WhopSDK::VerificationCreateParams::Body::Individual::Address, business_name: String, business_structure: String, + business_tax_identification_number: String, business_website: String, country: String, date_of_birth: String, @@ -66,6 +67,10 @@ module WhopSDK def business_structure=: (String) -> String + attr_reader business_tax_identification_number: String? + + def business_tax_identification_number=: (String) -> String + attr_reader business_website: String? def business_website=: (String) -> String @@ -114,6 +119,7 @@ module WhopSDK ?address: WhopSDK::VerificationCreateParams::Body::Individual::Address, ?business_name: String, ?business_structure: String, + ?business_tax_identification_number: String, ?business_website: String, ?country: String, ?date_of_birth: String, @@ -130,6 +136,7 @@ module WhopSDK address: WhopSDK::VerificationCreateParams::Body::Individual::Address, business_name: String, business_structure: String, + business_tax_identification_number: String, business_website: String, country: String, date_of_birth: String, @@ -226,6 +233,7 @@ module WhopSDK address: WhopSDK::VerificationCreateParams::Body::Business::Address, business_name: String, business_structure: String, + business_tax_identification_number: String, business_website: String, country: String, kind: WhopSDK::Models::VerificationCreateParams::Body::Business::kind, @@ -248,6 +256,10 @@ module WhopSDK def business_structure=: (String) -> String + attr_reader business_tax_identification_number: String? + + def business_tax_identification_number=: (String) -> String + attr_reader business_website: String? def business_website=: (String) -> String @@ -274,6 +286,7 @@ module WhopSDK ?address: WhopSDK::VerificationCreateParams::Body::Business::Address, ?business_name: String, ?business_structure: String, + ?business_tax_identification_number: String, ?business_website: String, ?country: String, ?kind: WhopSDK::Models::VerificationCreateParams::Body::Business::kind, @@ -285,6 +298,7 @@ module WhopSDK address: WhopSDK::VerificationCreateParams::Body::Business::Address, business_name: String, business_structure: String, + business_tax_identification_number: String, business_website: String, country: String, kind: WhopSDK::Models::VerificationCreateParams::Body::Business::kind, diff --git a/sig/whop_sdk/models/verification_update_params.rbs b/sig/whop_sdk/models/verification_update_params.rbs index 2a59da70..8239d963 100644 --- a/sig/whop_sdk/models/verification_update_params.rbs +++ b/sig/whop_sdk/models/verification_update_params.rbs @@ -36,15 +36,21 @@ module WhopSDK type update_individual_verification = { + business_tax_identification_number: String, country: String, date_of_birth: String, first_name: String, last_name: String, personal_address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, - requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation], + tax_identification_number: String } class UpdateIndividualVerification < WhopSDK::Internal::Type::BaseModel + attr_reader business_tax_identification_number: String? + + def business_tax_identification_number=: (String) -> String + attr_reader country: String? def country=: (String) -> String @@ -73,22 +79,30 @@ module WhopSDK ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] ) -> ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + attr_reader tax_identification_number: String? + + def tax_identification_number=: (String) -> String + def initialize: ( + ?business_tax_identification_number: String, ?country: String, ?date_of_birth: String, ?first_name: String, ?last_name: String, ?personal_address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, - ?requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + ?requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation], + ?tax_identification_number: String ) -> void def to_hash: -> { + business_tax_identification_number: String, country: String, date_of_birth: String, first_name: String, last_name: String, personal_address: WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::PersonalAddress, - requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation] + requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateIndividualVerification::RequestedInformation], + tax_identification_number: String } type personal_address = @@ -307,8 +321,10 @@ module WhopSDK business_address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, business_name: String, business_structure: String, + business_tax_identification_number: String, country: String, - requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation], + tax_identification_number: String } class UpdateBusinessVerification < WhopSDK::Internal::Type::BaseModel @@ -326,6 +342,10 @@ module WhopSDK def business_structure=: (String) -> String + attr_reader business_tax_identification_number: String? + + def business_tax_identification_number=: (String) -> String + attr_reader country: String? def country=: (String) -> String @@ -336,20 +356,28 @@ module WhopSDK ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] ) -> ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + attr_reader tax_identification_number: String? + + def tax_identification_number=: (String) -> String + def initialize: ( ?business_address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, ?business_name: String, ?business_structure: String, + ?business_tax_identification_number: String, ?country: String, - ?requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + ?requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation], + ?tax_identification_number: String ) -> void def to_hash: -> { business_address: WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::BusinessAddress, business_name: String, business_structure: String, + business_tax_identification_number: String, country: String, - requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation] + requested_information: ::Array[WhopSDK::VerificationUpdateParams::Body::UpdateBusinessVerification::RequestedInformation], + tax_identification_number: String } type business_address = From e3af90fc145ef5282b605f50631fbf5771489bef Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 17:18:23 +0000 Subject: [PATCH 26/34] feat(ads): move onboarding product picker to REST and show product gallery images Stainless-Generated-From: 111dc7540e93fed1b5941a78960b72aa749145a3 --- lib/whop_sdk/models/product.rb | 10 +++- lib/whop_sdk/models/product_list_item.rb | 47 ++++++++++++++- rbi/whop_sdk/models/product.rbi | 22 ++++++- rbi/whop_sdk/models/product_list_item.rbi | 71 +++++++++++++++++++++++ sig/whop_sdk/models/product.rbs | 12 +++- sig/whop_sdk/models/product_list_item.rbs | 23 ++++++++ test/whop_sdk/resources/products_test.rb | 1 + 7 files changed, 179 insertions(+), 7 deletions(-) diff --git a/lib/whop_sdk/models/product.rb b/lib/whop_sdk/models/product.rb index a70e992b..f5322dd7 100644 --- a/lib/whop_sdk/models/product.rb +++ b/lib/whop_sdk/models/product.rb @@ -257,6 +257,12 @@ class GalleryImage < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute content_type + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + # + # @return [String, nil] + required :content_type, String, nil?: true + # @!attribute url # A pre-optimized URL for rendering this attachment on the client. This should be # used for displaying attachments in apps. @@ -264,7 +270,7 @@ class GalleryImage < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :url, String, nil?: true - # @!method initialize(id:, url:) + # @!method initialize(id:, content_type:, url:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::Product::GalleryImage} for more details. # @@ -272,6 +278,8 @@ class GalleryImage < WhopSDK::Internal::Type::BaseModel # # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re # + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + # # @param url [String, nil] A pre-optimized URL for rendering this attachment on the client. This should be end diff --git a/lib/whop_sdk/models/product_list_item.rb b/lib/whop_sdk/models/product_list_item.rb index 6714645e..01d18679 100644 --- a/lib/whop_sdk/models/product_list_item.rb +++ b/lib/whop_sdk/models/product_list_item.rb @@ -22,6 +22,12 @@ class ProductListItem < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :external_identifier, String, nil?: true + # @!attribute gallery_images + # The gallery images for this product, ordered by position. + # + # @return [Array] + required :gallery_images, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::ProductListItem::GalleryImage] } + # @!attribute headline # A short marketing headline displayed prominently on the product's product page. # @@ -82,7 +88,7 @@ class ProductListItem < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Visibility] required :visibility, enum: -> { WhopSDK::Visibility } - # @!method initialize(id:, created_at:, external_identifier:, headline:, member_count:, metadata:, published_reviews_count:, route:, title:, updated_at:, verified:, visibility:) + # @!method initialize(id:, created_at:, external_identifier:, gallery_images:, headline:, member_count:, metadata:, published_reviews_count:, route:, title:, updated_at:, verified:, visibility:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::ProductListItem} for more details. # @@ -95,6 +101,8 @@ class ProductListItem < WhopSDK::Internal::Type::BaseModel # # @param external_identifier [String, nil] External identifier for the product. Providing it on a product creation endpoint # + # @param gallery_images [Array] The gallery images for this product, ordered by position. + # # @param headline [String, nil] A short marketing headline displayed prominently on the product's product page. # # @param member_count [Integer] Active memberships for this product. Returns `0` if the account has disabled pub @@ -112,6 +120,43 @@ class ProductListItem < WhopSDK::Internal::Type::BaseModel # @param verified [Boolean] Whether this company has been verified by Whop's trust and safety team. # # @param visibility [Symbol, WhopSDK::Models::Visibility] Controls whether the product is visible to customers. When set to 'hidden', the + + class GalleryImage < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # Represents a unique identifier that is Base64 obfuscated. It is often used to + # refetch an object or as key for a cache. The ID type appears in a JSON response + # as a String; however, it is not intended to be human-readable. When expected as + # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) + # input value will be accepted as an ID. + # + # @return [String] + required :id, String + + # @!attribute content_type + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + # + # @return [String, nil] + required :content_type, String, nil?: true + + # @!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(id:, content_type:, url:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ProductListItem::GalleryImage} for more details. + # + # Represents an image attachment + # + # @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re + # + # @param content_type [String, nil] Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + # + # @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/rbi/whop_sdk/models/product.rbi b/rbi/whop_sdk/models/product.rbi index d47a0087..77b94a38 100644 --- a/rbi/whop_sdk/models/product.rbi +++ b/rbi/whop_sdk/models/product.rbi @@ -313,6 +313,10 @@ module WhopSDK sig { returns(String) } attr_accessor :id + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + sig { returns(T.nilable(String)) } + attr_accessor :content_type + # 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)) } @@ -320,7 +324,11 @@ module WhopSDK # Represents an image attachment sig do - params(id: String, url: T.nilable(String)).returns(T.attached_class) + params( + id: String, + content_type: T.nilable(String), + url: T.nilable(String) + ).returns(T.attached_class) end def self.new( # Represents a unique identifier that is Base64 obfuscated. It is often used to @@ -329,13 +337,23 @@ module WhopSDK # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) # input value will be accepted as an ID. id:, + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + content_type:, # 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({ id: String, url: T.nilable(String) }) } + sig do + override.returns( + { + id: String, + content_type: T.nilable(String), + url: T.nilable(String) + } + ) + end def to_hash end end diff --git a/rbi/whop_sdk/models/product_list_item.rbi b/rbi/whop_sdk/models/product_list_item.rbi index 9c27cd44..b03f4d3e 100644 --- a/rbi/whop_sdk/models/product_list_item.rbi +++ b/rbi/whop_sdk/models/product_list_item.rbi @@ -21,6 +21,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :external_identifier + # The gallery images for this product, ordered by position. + sig { returns(T::Array[WhopSDK::ProductListItem::GalleryImage]) } + attr_accessor :gallery_images + # A short marketing headline displayed prominently on the product's product page. sig { returns(T.nilable(String)) } attr_accessor :headline @@ -70,6 +74,8 @@ module WhopSDK id: String, created_at: Time, external_identifier: T.nilable(String), + gallery_images: + T::Array[WhopSDK::ProductListItem::GalleryImage::OrHash], headline: T.nilable(String), member_count: Integer, metadata: T.nilable(T::Hash[Symbol, T.anything]), @@ -89,6 +95,8 @@ module WhopSDK # External identifier for the product. Providing it on a product creation endpoint # updates the existing product with this identifier instead of creating a new one. external_identifier:, + # The gallery images for this product, ordered by position. + gallery_images:, # A short marketing headline displayed prominently on the product's product page. headline:, # Active memberships for this product. Returns `0` if the account has disabled @@ -122,6 +130,7 @@ module WhopSDK id: String, created_at: Time, external_identifier: T.nilable(String), + gallery_images: T::Array[WhopSDK::ProductListItem::GalleryImage], headline: T.nilable(String), member_count: Integer, metadata: T.nilable(T::Hash[Symbol, T.anything]), @@ -136,6 +145,68 @@ module WhopSDK end def to_hash end + + class GalleryImage < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::ProductListItem::GalleryImage, + WhopSDK::Internal::AnyHash + ) + end + + # Represents a unique identifier that is Base64 obfuscated. It is often used to + # refetch an object or as key for a cache. The ID type appears in a JSON response + # as a String; however, it is not intended to be human-readable. When expected as + # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) + # input value will be accepted as an ID. + sig { returns(String) } + attr_accessor :id + + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + sig { returns(T.nilable(String)) } + attr_accessor :content_type + + # 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 + + # Represents an image attachment + sig do + params( + id: String, + content_type: T.nilable(String), + url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Represents a unique identifier that is Base64 obfuscated. It is often used to + # refetch an object or as key for a cache. The ID type appears in a JSON response + # as a String; however, it is not intended to be human-readable. When expected as + # an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) + # input value will be accepted as an ID. + id:, + # Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + content_type:, + # A pre-optimized URL for rendering this attachment on the client. This should be + # used for displaying attachments in apps. + url: + ) + end + + sig do + override.returns( + { + id: String, + content_type: T.nilable(String), + url: T.nilable(String) + } + ) + end + def to_hash + end + end end end end diff --git a/sig/whop_sdk/models/product.rbs b/sig/whop_sdk/models/product.rbs index 2adeb5bc..d8853645 100644 --- a/sig/whop_sdk/models/product.rbs +++ b/sig/whop_sdk/models/product.rbs @@ -145,16 +145,22 @@ module WhopSDK def to_hash: -> { id: String, route: String, title: String } end - type gallery_image = { id: String, url: String? } + type gallery_image = { id: String, content_type: String?, url: String? } class GalleryImage < WhopSDK::Internal::Type::BaseModel attr_accessor id: String + attr_accessor content_type: String? + attr_accessor url: String? - def initialize: (id: String, url: String?) -> void + def initialize: ( + id: String, + content_type: String?, + url: String? + ) -> void - def to_hash: -> { id: String, url: String? } + def to_hash: -> { id: String, content_type: String?, url: String? } end type owner_user = { id: String, name: String?, username: String } diff --git a/sig/whop_sdk/models/product_list_item.rbs b/sig/whop_sdk/models/product_list_item.rbs index bba61a27..1d43d78c 100644 --- a/sig/whop_sdk/models/product_list_item.rbs +++ b/sig/whop_sdk/models/product_list_item.rbs @@ -5,6 +5,7 @@ module WhopSDK id: String, created_at: Time, external_identifier: String?, + gallery_images: ::Array[WhopSDK::ProductListItem::GalleryImage], headline: String?, member_count: Integer, metadata: ::Hash[Symbol, top]?, @@ -23,6 +24,8 @@ module WhopSDK attr_accessor external_identifier: String? + attr_accessor gallery_images: ::Array[WhopSDK::ProductListItem::GalleryImage] + attr_accessor headline: String? attr_accessor member_count: Integer @@ -45,6 +48,7 @@ module WhopSDK id: String, created_at: Time, external_identifier: String?, + gallery_images: ::Array[WhopSDK::ProductListItem::GalleryImage], headline: String?, member_count: Integer, metadata: ::Hash[Symbol, top]?, @@ -60,6 +64,7 @@ module WhopSDK id: String, created_at: Time, external_identifier: String?, + gallery_images: ::Array[WhopSDK::ProductListItem::GalleryImage], headline: String?, member_count: Integer, metadata: ::Hash[Symbol, top]?, @@ -70,6 +75,24 @@ module WhopSDK verified: bool, visibility: WhopSDK::Models::visibility } + + type gallery_image = { id: String, content_type: String?, url: String? } + + class GalleryImage < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor content_type: String? + + attr_accessor url: String? + + def initialize: ( + id: String, + content_type: String?, + url: String? + ) -> void + + def to_hash: -> { id: String, content_type: String?, url: String? } + end end end end diff --git a/test/whop_sdk/resources/products_test.rb b/test/whop_sdk/resources/products_test.rb index c5c2a153..a1c6827d 100644 --- a/test/whop_sdk/resources/products_test.rb +++ b/test/whop_sdk/resources/products_test.rb @@ -141,6 +141,7 @@ def test_list_required_params id: String, created_at: Time, external_identifier: String | nil, + gallery_images: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::ProductListItem::GalleryImage]), headline: String | nil, member_count: Integer, metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, From ae7b8f9d6d41021bec12020c279c8fb91ff98da5 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 21:47:48 +0000 Subject: [PATCH 27/34] fix(ads): let platforms set connected accounts' ads billing to platform balance via API key Stainless-Generated-From: 19abd730cbe1b259276d8cb1d0a9ae68c5ea477c --- lib/whop_sdk/resources/accounts/preferences.rb | 6 +++--- rbi/whop_sdk/resources/accounts/preferences.rbi | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/whop_sdk/resources/accounts/preferences.rb b/lib/whop_sdk/resources/accounts/preferences.rb index e037cbc6..5df258ea 100644 --- a/lib/whop_sdk/resources/accounts/preferences.rb +++ b/lib/whop_sdk/resources/accounts/preferences.rb @@ -40,9 +40,9 @@ def retrieve(account_id, params = {}) # always requires a `primary` entry. `backup` is optional when the primary is # `platform_balance` — omitting it removes any configured card — while a `card` # primary requires a `platform_balance` backup. A `platform_balance` entry may - # omit `id` to use the account's default Whop balance. Changing which funding - # sources are configured requires a user token, while account API keys may only - # swap `primary` and `backup`. + # omit `id` to use the account's default Whop balance. Configuring a `card` + # requires a user token; account API keys can set up platform-balance billing, + # remove a configured card, and swap `primary` and `backup`. # # @overload update(account_id, ads_payment_methods: nil, request_options: {}) # diff --git a/rbi/whop_sdk/resources/accounts/preferences.rbi b/rbi/whop_sdk/resources/accounts/preferences.rbi index 71dd2280..7856dfa8 100644 --- a/rbi/whop_sdk/resources/accounts/preferences.rbi +++ b/rbi/whop_sdk/resources/accounts/preferences.rbi @@ -31,9 +31,9 @@ module WhopSDK # always requires a `primary` entry. `backup` is optional when the primary is # `platform_balance` — omitting it removes any configured card — while a `card` # primary requires a `platform_balance` backup. A `platform_balance` entry may - # omit `id` to use the account's default Whop balance. Changing which funding - # sources are configured requires a user token, while account API keys may only - # swap `primary` and `backup`. + # omit `id` to use the account's default Whop balance. Configuring a `card` + # requires a user token; account API keys can set up platform-balance billing, + # remove a configured card, and swap `primary` and `backup`. sig do params( account_id: String, From c4f52503969c1165b85630f6b1ffc826334b9c29 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 14 Jul 2026 22:40:21 +0000 Subject: [PATCH 28/34] Accept a custom event name directly in the conversions API (ENG-24406) Stainless-Generated-From: 71e0e9d904883cd940d0ab550f23951161c6de8a --- lib/whop_sdk/models/event_create_params.rb | 30 +++------- lib/whop_sdk/resources/events.rb | 2 +- rbi/whop_sdk/models/event_create_params.rbi | 64 +++++---------------- rbi/whop_sdk/resources/events.rbi | 8 ++- sig/whop_sdk/models/event_create_params.rbs | 35 ++--------- sig/whop_sdk/resources/events.rbs | 2 +- test/whop_sdk/resources/events_test.rb | 2 +- 7 files changed, 34 insertions(+), 109 deletions(-) diff --git a/lib/whop_sdk/models/event_create_params.rb b/lib/whop_sdk/models/event_create_params.rb index a599fb3e..3603556a 100644 --- a/lib/whop_sdk/models/event_create_params.rb +++ b/lib/whop_sdk/models/event_create_params.rb @@ -14,10 +14,14 @@ class EventCreateParams < WhopSDK::Internal::Type::BaseModel required :account_id, String # @!attribute event_name - # The type of conversion or engagement event + # The type of event. # - # @return [Symbol, WhopSDK::Models::EventCreateParams::EventName] - required :event_name, enum: -> { WhopSDK::EventCreateParams::EventName } + # Use a standard event (lead, submit_application, contact, complete_registration, + # schedule, view_content, add_to_cart) or pass your own name directly for a custom + # event. + # + # @return [String] + required :event_name, String # @!attribute action_source # The channel where an event originated @@ -122,7 +126,7 @@ class EventCreateParams < WhopSDK::Internal::Type::BaseModel # # @param account_id [String] The account to associate with this event. # - # @param event_name [Symbol, WhopSDK::Models::EventCreateParams::EventName] The type of conversion or engagement event + # @param event_name [String] The type of event. # # @param action_source [Symbol, WhopSDK::Models::EventCreateParams::ActionSource, nil] The channel where an event originated # @@ -158,24 +162,6 @@ class EventCreateParams < WhopSDK::Internal::Type::BaseModel # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - # The type of conversion or engagement event - module EventName - extend WhopSDK::Internal::Type::Enum - - LEAD = :lead - SUBMIT_APPLICATION = :submit_application - CONTACT = :contact - COMPLETE_REGISTRATION = :complete_registration - SCHEDULE = :schedule - VIEW_CONTENT = :view_content - ADD_TO_CART = :add_to_cart - CUSTOM = :custom - PAGE = :page - - # @!method self.values - # @return [Array] - end - # The channel where an event originated module ActionSource extend WhopSDK::Internal::Type::Enum diff --git a/lib/whop_sdk/resources/events.rb b/lib/whop_sdk/resources/events.rb index 160171a7..00e252b4 100644 --- a/lib/whop_sdk/resources/events.rb +++ b/lib/whop_sdk/resources/events.rb @@ -19,7 +19,7 @@ class Events # # @param account_id [String] The account to associate with this event. # - # @param event_name [Symbol, WhopSDK::Models::EventCreateParams::EventName] The type of conversion or engagement event + # @param event_name [String] The type of event. # # @param action_source [Symbol, WhopSDK::Models::EventCreateParams::ActionSource, nil] The channel where an event originated # diff --git a/rbi/whop_sdk/models/event_create_params.rbi b/rbi/whop_sdk/models/event_create_params.rbi index 8972ebe6..f36e2bc9 100644 --- a/rbi/whop_sdk/models/event_create_params.rbi +++ b/rbi/whop_sdk/models/event_create_params.rbi @@ -15,8 +15,12 @@ module WhopSDK sig { returns(String) } attr_accessor :account_id - # The type of conversion or engagement event - sig { returns(WhopSDK::EventCreateParams::EventName::OrSymbol) } + # The type of event. + # + # Use a standard event (lead, submit_application, contact, complete_registration, + # schedule, view_content, add_to_cart) or pass your own name directly for a custom + # event. + sig { returns(String) } attr_accessor :event_name # The channel where an event originated @@ -101,7 +105,7 @@ module WhopSDK sig do params( account_id: String, - event_name: WhopSDK::EventCreateParams::EventName::OrSymbol, + event_name: String, action_source: T.nilable(WhopSDK::EventCreateParams::ActionSource::OrSymbol), context: T.nilable(WhopSDK::EventCreateParams::Context::OrHash), @@ -125,7 +129,11 @@ module WhopSDK def self.new( # The account to associate with this event. account_id:, - # The type of conversion or engagement event + # The type of event. + # + # Use a standard event (lead, submit_application, contact, complete_registration, + # schedule, view_content, add_to_cart) or pass your own name directly for a custom + # event. event_name:, # The channel where an event originated action_source: nil, @@ -168,7 +176,7 @@ module WhopSDK override.returns( { account_id: String, - event_name: WhopSDK::EventCreateParams::EventName::OrSymbol, + event_name: String, action_source: T.nilable(WhopSDK::EventCreateParams::ActionSource::OrSymbol), context: T.nilable(WhopSDK::EventCreateParams::Context), @@ -193,52 +201,6 @@ module WhopSDK def to_hash end - # The type of conversion or engagement event - module EventName - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::EventCreateParams::EventName) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - LEAD = T.let(:lead, WhopSDK::EventCreateParams::EventName::TaggedSymbol) - SUBMIT_APPLICATION = - T.let( - :submit_application, - WhopSDK::EventCreateParams::EventName::TaggedSymbol - ) - CONTACT = - T.let(:contact, WhopSDK::EventCreateParams::EventName::TaggedSymbol) - COMPLETE_REGISTRATION = - T.let( - :complete_registration, - WhopSDK::EventCreateParams::EventName::TaggedSymbol - ) - SCHEDULE = - T.let(:schedule, WhopSDK::EventCreateParams::EventName::TaggedSymbol) - VIEW_CONTENT = - T.let( - :view_content, - WhopSDK::EventCreateParams::EventName::TaggedSymbol - ) - ADD_TO_CART = - T.let( - :add_to_cart, - WhopSDK::EventCreateParams::EventName::TaggedSymbol - ) - CUSTOM = - T.let(:custom, WhopSDK::EventCreateParams::EventName::TaggedSymbol) - PAGE = T.let(:page, WhopSDK::EventCreateParams::EventName::TaggedSymbol) - - sig do - override.returns( - T::Array[WhopSDK::EventCreateParams::EventName::TaggedSymbol] - ) - end - def self.values - end - end - # The channel where an event originated module ActionSource extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/resources/events.rbi b/rbi/whop_sdk/resources/events.rbi index 6c3d8e0c..c0f18675 100644 --- a/rbi/whop_sdk/resources/events.rbi +++ b/rbi/whop_sdk/resources/events.rbi @@ -14,7 +14,7 @@ module WhopSDK sig do params( account_id: String, - event_name: WhopSDK::EventCreateParams::EventName::OrSymbol, + event_name: String, action_source: T.nilable(WhopSDK::EventCreateParams::ActionSource::OrSymbol), context: T.nilable(WhopSDK::EventCreateParams::Context::OrHash), @@ -38,7 +38,11 @@ module WhopSDK def create( # The account to associate with this event. account_id:, - # The type of conversion or engagement event + # The type of event. + # + # Use a standard event (lead, submit_application, contact, complete_registration, + # schedule, view_content, add_to_cart) or pass your own name directly for a custom + # event. event_name:, # The channel where an event originated action_source: nil, diff --git a/sig/whop_sdk/models/event_create_params.rbs b/sig/whop_sdk/models/event_create_params.rbs index 809343bf..55e8a4a0 100644 --- a/sig/whop_sdk/models/event_create_params.rbs +++ b/sig/whop_sdk/models/event_create_params.rbs @@ -3,7 +3,7 @@ module WhopSDK type event_create_params = { account_id: String, - event_name: WhopSDK::Models::EventCreateParams::event_name, + event_name: String, action_source: WhopSDK::Models::EventCreateParams::action_source?, context: WhopSDK::EventCreateParams::Context?, currency: WhopSDK::Models::EventCreateParams::currency?, @@ -29,7 +29,7 @@ module WhopSDK attr_accessor account_id: String - attr_accessor event_name: WhopSDK::Models::EventCreateParams::event_name + attr_accessor event_name: String attr_accessor action_source: WhopSDK::Models::EventCreateParams::action_source? @@ -65,7 +65,7 @@ module WhopSDK def initialize: ( account_id: String, - event_name: WhopSDK::Models::EventCreateParams::event_name, + event_name: String, ?action_source: WhopSDK::Models::EventCreateParams::action_source?, ?context: WhopSDK::EventCreateParams::Context?, ?currency: WhopSDK::Models::EventCreateParams::currency?, @@ -87,7 +87,7 @@ module WhopSDK def to_hash: -> { account_id: String, - event_name: WhopSDK::Models::EventCreateParams::event_name, + event_name: String, action_source: WhopSDK::Models::EventCreateParams::action_source?, context: WhopSDK::EventCreateParams::Context?, currency: WhopSDK::Models::EventCreateParams::currency?, @@ -107,33 +107,6 @@ module WhopSDK request_options: WhopSDK::RequestOptions } - type event_name = - :lead - | :submit_application - | :contact - | :complete_registration - | :schedule - | :view_content - | :add_to_cart - | :custom - | :page - - module EventName - extend WhopSDK::Internal::Type::Enum - - LEAD: :lead - SUBMIT_APPLICATION: :submit_application - CONTACT: :contact - COMPLETE_REGISTRATION: :complete_registration - SCHEDULE: :schedule - VIEW_CONTENT: :view_content - ADD_TO_CART: :add_to_cart - CUSTOM: :custom - PAGE: :page - - def self?.values: -> ::Array[WhopSDK::Models::EventCreateParams::event_name] - end - type action_source = :email | :website diff --git a/sig/whop_sdk/resources/events.rbs b/sig/whop_sdk/resources/events.rbs index ff1121a8..807c459e 100644 --- a/sig/whop_sdk/resources/events.rbs +++ b/sig/whop_sdk/resources/events.rbs @@ -3,7 +3,7 @@ module WhopSDK class Events def create: ( account_id: String, - event_name: WhopSDK::Models::EventCreateParams::event_name, + event_name: String, ?action_source: WhopSDK::Models::EventCreateParams::action_source?, ?context: WhopSDK::EventCreateParams::Context?, ?currency: WhopSDK::Models::EventCreateParams::currency?, diff --git a/test/whop_sdk/resources/events_test.rb b/test/whop_sdk/resources/events_test.rb index 1f8ad67e..1a685321 100644 --- a/test/whop_sdk/resources/events_test.rb +++ b/test/whop_sdk/resources/events_test.rb @@ -6,7 +6,7 @@ class WhopSDK::Test::Resources::EventsTest < WhopSDK::Test::ResourceTest def test_create_required_params skip("Mock server tests are disabled") - response = @whop.events.create(account_id: "account_id", event_name: :lead) + response = @whop.events.create(account_id: "account_id", event_name: "course_completed") assert_pattern do response => WhopSDK::Models::EventCreateResponse From a8de26b12f039780158899d7770678d4ae284b62 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 15 Jul 2026 00:16:53 +0000 Subject: [PATCH 29/34] Offramps blocked on the account owner end terminally with funds resting in the owner's balance Stainless-Generated-From: 98e72bfe9fade488a24b27b732d67fe52895fe41 --- lib/whop_sdk/models/payout_create_response.rb | 1 + rbi/whop_sdk/models/payout_create_response.rbi | 5 +++++ sig/whop_sdk/models/payout_create_response.rbs | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/whop_sdk/models/payout_create_response.rb b/lib/whop_sdk/models/payout_create_response.rb index e61ea76a..1a0d42b5 100644 --- a/lib/whop_sdk/models/payout_create_response.rb +++ b/lib/whop_sdk/models/payout_create_response.rb @@ -173,6 +173,7 @@ module Status REQUESTED = :requested IN_TRANSIT = :in_transit + DENIED = :denied COMPLETED = :completed FAILED = :failed CANCELED = :canceled diff --git a/rbi/whop_sdk/models/payout_create_response.rbi b/rbi/whop_sdk/models/payout_create_response.rbi index a62cf134..b739c2f9 100644 --- a/rbi/whop_sdk/models/payout_create_response.rbi +++ b/rbi/whop_sdk/models/payout_create_response.rbi @@ -321,6 +321,11 @@ module WhopSDK :in_transit, WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol ) + DENIED = + T.let( + :denied, + WhopSDK::Models::PayoutCreateResponse::Status::TaggedSymbol + ) COMPLETED = T.let( :completed, diff --git a/sig/whop_sdk/models/payout_create_response.rbs b/sig/whop_sdk/models/payout_create_response.rbs index 35b11fb4..b0c1640d 100644 --- a/sig/whop_sdk/models/payout_create_response.rbs +++ b/sig/whop_sdk/models/payout_create_response.rbs @@ -121,13 +121,15 @@ module WhopSDK def self?.values: -> ::Array[WhopSDK::Models::PayoutCreateResponse::speed] end - type status = :requested | :in_transit | :completed | :failed | :canceled + type status = + :requested | :in_transit | :denied | :completed | :failed | :canceled module Status extend WhopSDK::Internal::Type::Enum REQUESTED: :requested IN_TRANSIT: :in_transit + DENIED: :denied COMPLETED: :completed FAILED: :failed CANCELED: :canceled From d6f12b0496940d57b7b5d2110c7b4aa2d307be8c Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 15 Jul 2026 02:00:15 +0000 Subject: [PATCH 30/34] feat(ads): target ads by dropping a pin on a map & add audience size Stainless-Generated-From: a4bd86bd31a12230f5415b7fc36928dfc6f40e83 --- lib/whop_sdk/models/ad_group.rb | 3 ++- lib/whop_sdk/models/ad_group_create_params.rb | 6 +++++- lib/whop_sdk/models/ad_group_update_params.rb | 6 +++++- rbi/whop_sdk/models/ad_group.rbi | 6 ++++-- rbi/whop_sdk/models/ad_group_create_params.rbi | 12 ++++++++++-- rbi/whop_sdk/models/ad_group_update_params.rbi | 12 ++++++++++-- rbi/whop_sdk/resources/ad_groups.rbi | 12 ++++++++++-- 7 files changed, 46 insertions(+), 11 deletions(-) diff --git a/lib/whop_sdk/models/ad_group.rb b/lib/whop_sdk/models/ad_group.rb index 4b5c8aaf..80c36ed5 100644 --- a/lib/whop_sdk/models/ad_group.rb +++ b/lib/whop_sdk/models/ad_group.rb @@ -296,7 +296,8 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # @!attribute regions # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. - # US-CA), cities, zips. + # US-CA), cities, zips, and custom_locations (pin + radius: { latitude, longitude, + # radius, distance_unit, name }). # # @return [Object] required :regions, WhopSDK::Internal::Type::Unknown diff --git a/lib/whop_sdk/models/ad_group_create_params.rb b/lib/whop_sdk/models/ad_group_create_params.rb index ba3d9dad..3fc291be 100644 --- a/lib/whop_sdk/models/ad_group_create_params.rb +++ b/lib/whop_sdk/models/ad_group_create_params.rb @@ -138,7 +138,11 @@ class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute regions # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, + # custom_locations } }. custom_locations entries are pin + radius: { latitude, + # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name + # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 + # custom locations across include and exclude. # # @return [Object, nil] optional :regions, WhopSDK::Internal::Type::Unknown diff --git a/lib/whop_sdk/models/ad_group_update_params.rb b/lib/whop_sdk/models/ad_group_update_params.rb index b2f0e2d7..114f638a 100644 --- a/lib/whop_sdk/models/ad_group_update_params.rb +++ b/lib/whop_sdk/models/ad_group_update_params.rb @@ -130,7 +130,11 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # @!attribute regions # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, + # custom_locations } }. custom_locations entries are pin + radius: { latitude, + # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name + # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 + # custom locations across include and exclude. # # @return [Object, nil] optional :regions, WhopSDK::Internal::Type::Unknown diff --git a/rbi/whop_sdk/models/ad_group.rbi b/rbi/whop_sdk/models/ad_group.rbi index 529b6fa7..27788033 100644 --- a/rbi/whop_sdk/models/ad_group.rbi +++ b/rbi/whop_sdk/models/ad_group.rbi @@ -210,7 +210,8 @@ module WhopSDK attr_accessor :reach # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. - # US-CA), cities, zips. + # US-CA), cities, zips, and custom_locations (pin + radius: { latitude, longitude, + # radius, distance_unit, name }). sig { returns(T.anything) } attr_accessor :regions @@ -459,7 +460,8 @@ module WhopSDK # The number of unique people who saw this. reach:, # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. - # US-CA), cities, zips. + # US-CA), cities, zips, and custom_locations (pin + radius: { latitude, longitude, + # radius, distance_unit, name }). regions:, # The Whop pixel conversion event whose attributed count represents results — the # optimization goal, or the highest-volume attributed event for campaigns that diff --git a/rbi/whop_sdk/models/ad_group_create_params.rbi b/rbi/whop_sdk/models/ad_group_create_params.rbi index 1ff2d788..efc0a293 100644 --- a/rbi/whop_sdk/models/ad_group_create_params.rbi +++ b/rbi/whop_sdk/models/ad_group_create_params.rbi @@ -191,7 +191,11 @@ module WhopSDK attr_writer :placements # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, + # custom_locations } }. custom_locations entries are pin + radius: { latitude, + # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name + # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 + # custom locations across include and exclude. sig { returns(T.nilable(T.anything)) } attr_reader :regions @@ -314,7 +318,11 @@ module WhopSDK # - `whatsapp`: `status` placements: nil, # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, + # custom_locations } }. custom_locations entries are pin + radius: { latitude, + # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name + # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 + # custom locations across include and exclude. regions: nil, # Schedule start, ISO 8601. starts_at: nil, diff --git a/rbi/whop_sdk/models/ad_group_update_params.rbi b/rbi/whop_sdk/models/ad_group_update_params.rbi index 237a78c9..2cfe014b 100644 --- a/rbi/whop_sdk/models/ad_group_update_params.rbi +++ b/rbi/whop_sdk/models/ad_group_update_params.rbi @@ -182,7 +182,11 @@ module WhopSDK attr_writer :placements # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, + # custom_locations } }. custom_locations entries are pin + radius: { latitude, + # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name + # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 + # custom locations across include and exclude. sig { returns(T.nilable(T.anything)) } attr_reader :regions @@ -300,7 +304,11 @@ module WhopSDK # - `whatsapp`: `status` placements: nil, # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, + # custom_locations } }. custom_locations entries are pin + radius: { latitude, + # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name + # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 + # custom locations across include and exclude. regions: nil, # Schedule start, ISO 8601. starts_at: nil, diff --git a/rbi/whop_sdk/resources/ad_groups.rbi b/rbi/whop_sdk/resources/ad_groups.rbi index a14f5573..b1c7f55d 100644 --- a/rbi/whop_sdk/resources/ad_groups.rbi +++ b/rbi/whop_sdk/resources/ad_groups.rbi @@ -105,7 +105,11 @@ module WhopSDK # - `whatsapp`: `status` placements: nil, # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, + # custom_locations } }. custom_locations entries are pin + radius: { latitude, + # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name + # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 + # custom locations across include and exclude. regions: nil, # Schedule start, ISO 8601. starts_at: nil, @@ -230,7 +234,11 @@ module WhopSDK # - `whatsapp`: `status` placements: nil, # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips } }. + # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, + # custom_locations } }. custom_locations entries are pin + radius: { latitude, + # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name + # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 + # custom locations across include and exclude. regions: nil, # Schedule start, ISO 8601. starts_at: nil, From 3d9463b2c0360bb5e355d73fbf34738f590b3840 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 15 Jul 2026 03:21:42 +0000 Subject: [PATCH 31/34] feat(invoices): expose invoice line items on the public REST API Stainless-Generated-From: c7d611fb011bef148ca9b31f1e012af76f96acff --- lib/whop_sdk/models/invoice.rb | 56 ++++++++++++++++- lib/whop_sdk/models/invoice_list_item.rb | 56 ++++++++++++++++- rbi/whop_sdk/models/invoice.rbi | 74 ++++++++++++++++++++++ rbi/whop_sdk/models/invoice_list_item.rbi | 77 +++++++++++++++++++++++ sig/whop_sdk/models/invoice.rbs | 42 +++++++++++++ sig/whop_sdk/models/invoice_list_item.rbs | 42 +++++++++++++ test/whop_sdk/resources/invoices_test.rb | 4 ++ 7 files changed, 349 insertions(+), 2 deletions(-) diff --git a/lib/whop_sdk/models/invoice.rb b/lib/whop_sdk/models/invoice.rb index 6165b051..ac5ba64f 100644 --- a/lib/whop_sdk/models/invoice.rb +++ b/lib/whop_sdk/models/invoice.rb @@ -42,6 +42,12 @@ class Invoice < WhopSDK::Internal::Type::BaseModel # @return [String] required :fetch_invoice_token, String + # @!attribute line_items + # Optional line items that break down the invoice total into individual charges. + # + # @return [Array] + required :line_items, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Invoice::LineItem] } + # @!attribute number # The sequential invoice number for display purposes. # @@ -61,7 +67,7 @@ class Invoice < WhopSDK::Internal::Type::BaseModel # @return [WhopSDK::Models::Invoice::User, nil] required :user, -> { WhopSDK::Invoice::User }, nil?: true - # @!method initialize(id:, created_at:, current_plan:, due_date:, email_address:, fetch_invoice_token:, number:, status:, user:) + # @!method initialize(id:, created_at:, current_plan:, due_date:, email_address:, fetch_invoice_token:, line_items:, number:, status:, user:) # Some parameter documentations has been truncated, see {WhopSDK::Models::Invoice} # for more details. # @@ -81,6 +87,8 @@ class Invoice < WhopSDK::Internal::Type::BaseModel # # @param fetch_invoice_token [String] A signed token that allows fetching invoice data publicly without authentication # + # @param line_items [Array] Optional line items that break down the invoice total into individual charges. + # # @param number [String] The sequential invoice number for display purposes. # # @param status [Symbol, WhopSDK::Models::InvoiceStatus] The current payment status of the invoice, such as draft, open, paid, or void. @@ -121,6 +129,52 @@ class CurrentPlan < WhopSDK::Internal::Type::BaseModel # @param formatted_price [String] The formatted price (including currency) for the plan. end + class LineItem < WhopSDK::Internal::Type::BaseModel + # @!attribute label + # The label or description for this line item. + # + # @return [String] + required :label, String + + # @!attribute position + # The display order of this line item within the invoice. + # + # @return [Integer] + required :position, Integer + + # @!attribute quantity + # The quantity of this line item. + # + # @return [Float] + required :quantity, Float + + # @!attribute total + # The computed total for this line item (quantity \* unit_price). + # + # @return [Float] + required :total, Float + + # @!attribute unit_price + # The unit price for this line item. + # + # @return [Float] + required :unit_price, Float + + # @!method initialize(label:, position:, quantity:, total:, unit_price:) + # A line item on an invoice, representing a single charge with a label, quantity, + # and unit price. + # + # @param label [String] The label or description for this line item. + # + # @param position [Integer] The display order of this line item within the invoice. + # + # @param quantity [Float] The quantity of this line item. + # + # @param total [Float] The computed total for this line item (quantity \* unit_price). + # + # @param unit_price [Float] The unit price for this line item. + end + # @see WhopSDK::Models::Invoice#user class User < WhopSDK::Internal::Type::BaseModel # @!attribute id diff --git a/lib/whop_sdk/models/invoice_list_item.rb b/lib/whop_sdk/models/invoice_list_item.rb index ee564803..d637ac6c 100644 --- a/lib/whop_sdk/models/invoice_list_item.rb +++ b/lib/whop_sdk/models/invoice_list_item.rb @@ -42,6 +42,12 @@ class InvoiceListItem < WhopSDK::Internal::Type::BaseModel # @return [String] required :fetch_invoice_token, String + # @!attribute line_items + # Optional line items that break down the invoice total into individual charges. + # + # @return [Array] + required :line_items, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceListItem::LineItem] } + # @!attribute number # The sequential invoice number for display purposes. # @@ -61,7 +67,7 @@ class InvoiceListItem < WhopSDK::Internal::Type::BaseModel # @return [WhopSDK::Models::InvoiceListItem::User, nil] required :user, -> { WhopSDK::InvoiceListItem::User }, nil?: true - # @!method initialize(id:, created_at:, current_plan:, due_date:, email_address:, fetch_invoice_token:, number:, status:, user:) + # @!method initialize(id:, created_at:, current_plan:, due_date:, email_address:, fetch_invoice_token:, line_items:, number:, status:, user:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::InvoiceListItem} for more details. # @@ -81,6 +87,8 @@ class InvoiceListItem < WhopSDK::Internal::Type::BaseModel # # @param fetch_invoice_token [String] A signed token that allows fetching invoice data publicly without authentication # + # @param line_items [Array] Optional line items that break down the invoice total into individual charges. + # # @param number [String] The sequential invoice number for display purposes. # # @param status [Symbol, WhopSDK::Models::InvoiceStatus] The current payment status of the invoice, such as draft, open, paid, or void. @@ -121,6 +129,52 @@ class CurrentPlan < WhopSDK::Internal::Type::BaseModel # @param formatted_price [String] The formatted price (including currency) for the plan. end + class LineItem < WhopSDK::Internal::Type::BaseModel + # @!attribute label + # The label or description for this line item. + # + # @return [String] + required :label, String + + # @!attribute position + # The display order of this line item within the invoice. + # + # @return [Integer] + required :position, Integer + + # @!attribute quantity + # The quantity of this line item. + # + # @return [Float] + required :quantity, Float + + # @!attribute total + # The computed total for this line item (quantity \* unit_price). + # + # @return [Float] + required :total, Float + + # @!attribute unit_price + # The unit price for this line item. + # + # @return [Float] + required :unit_price, Float + + # @!method initialize(label:, position:, quantity:, total:, unit_price:) + # A line item on an invoice, representing a single charge with a label, quantity, + # and unit price. + # + # @param label [String] The label or description for this line item. + # + # @param position [Integer] The display order of this line item within the invoice. + # + # @param quantity [Float] The quantity of this line item. + # + # @param total [Float] The computed total for this line item (quantity \* unit_price). + # + # @param unit_price [Float] The unit price for this line item. + end + # @see WhopSDK::Models::InvoiceListItem#user class User < WhopSDK::Internal::Type::BaseModel # @!attribute id diff --git a/rbi/whop_sdk/models/invoice.rbi b/rbi/whop_sdk/models/invoice.rbi index ad29dff6..760e685f 100644 --- a/rbi/whop_sdk/models/invoice.rbi +++ b/rbi/whop_sdk/models/invoice.rbi @@ -36,6 +36,10 @@ module WhopSDK sig { returns(String) } attr_accessor :fetch_invoice_token + # Optional line items that break down the invoice total into individual charges. + sig { returns(T::Array[WhopSDK::Invoice::LineItem]) } + attr_accessor :line_items + # The sequential invoice number for display purposes. sig { returns(String) } attr_accessor :number @@ -63,6 +67,7 @@ module WhopSDK due_date: T.nilable(Time), email_address: T.nilable(String), fetch_invoice_token: String, + line_items: T::Array[WhopSDK::Invoice::LineItem::OrHash], number: String, status: WhopSDK::InvoiceStatus::OrSymbol, user: T.nilable(WhopSDK::Invoice::User::OrHash) @@ -84,6 +89,8 @@ module WhopSDK # A signed token that allows fetching invoice data publicly without # authentication. fetch_invoice_token:, + # Optional line items that break down the invoice total into individual charges. + line_items:, # The sequential invoice number for display purposes. number:, # The current payment status of the invoice, such as draft, open, paid, or void. @@ -103,6 +110,7 @@ module WhopSDK due_date: T.nilable(Time), email_address: T.nilable(String), fetch_invoice_token: String, + line_items: T::Array[WhopSDK::Invoice::LineItem], number: String, status: WhopSDK::InvoiceStatus::TaggedSymbol, user: T.nilable(WhopSDK::Invoice::User) @@ -163,6 +171,72 @@ module WhopSDK end end + class LineItem < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Invoice::LineItem, WhopSDK::Internal::AnyHash) + end + + # The label or description for this line item. + sig { returns(String) } + attr_accessor :label + + # The display order of this line item within the invoice. + sig { returns(Integer) } + attr_accessor :position + + # The quantity of this line item. + sig { returns(Float) } + attr_accessor :quantity + + # The computed total for this line item (quantity \* unit_price). + sig { returns(Float) } + attr_accessor :total + + # The unit price for this line item. + sig { returns(Float) } + attr_accessor :unit_price + + # A line item on an invoice, representing a single charge with a label, quantity, + # and unit price. + sig do + params( + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + ).returns(T.attached_class) + end + def self.new( + # The label or description for this line item. + label:, + # The display order of this line item within the invoice. + position:, + # The quantity of this line item. + quantity:, + # The computed total for this line item (quantity \* unit_price). + total:, + # The unit price for this line item. + unit_price: + ) + end + + sig do + override.returns( + { + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + } + ) + end + def to_hash + end + end + class User < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/whop_sdk/models/invoice_list_item.rbi b/rbi/whop_sdk/models/invoice_list_item.rbi index ad4f4bbe..a4f16df3 100644 --- a/rbi/whop_sdk/models/invoice_list_item.rbi +++ b/rbi/whop_sdk/models/invoice_list_item.rbi @@ -40,6 +40,10 @@ module WhopSDK sig { returns(String) } attr_accessor :fetch_invoice_token + # Optional line items that break down the invoice total into individual charges. + sig { returns(T::Array[WhopSDK::InvoiceListItem::LineItem]) } + attr_accessor :line_items + # The sequential invoice number for display purposes. sig { returns(String) } attr_accessor :number @@ -69,6 +73,7 @@ module WhopSDK due_date: T.nilable(Time), email_address: T.nilable(String), fetch_invoice_token: String, + line_items: T::Array[WhopSDK::InvoiceListItem::LineItem::OrHash], number: String, status: WhopSDK::InvoiceStatus::OrSymbol, user: T.nilable(WhopSDK::InvoiceListItem::User::OrHash) @@ -90,6 +95,8 @@ module WhopSDK # A signed token that allows fetching invoice data publicly without # authentication. fetch_invoice_token:, + # Optional line items that break down the invoice total into individual charges. + line_items:, # The sequential invoice number for display purposes. number:, # The current payment status of the invoice, such as draft, open, paid, or void. @@ -109,6 +116,7 @@ module WhopSDK due_date: T.nilable(Time), email_address: T.nilable(String), fetch_invoice_token: String, + line_items: T::Array[WhopSDK::InvoiceListItem::LineItem], number: String, status: WhopSDK::InvoiceStatus::TaggedSymbol, user: T.nilable(WhopSDK::InvoiceListItem::User) @@ -172,6 +180,75 @@ module WhopSDK end end + class LineItem < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::InvoiceListItem::LineItem, + WhopSDK::Internal::AnyHash + ) + end + + # The label or description for this line item. + sig { returns(String) } + attr_accessor :label + + # The display order of this line item within the invoice. + sig { returns(Integer) } + attr_accessor :position + + # The quantity of this line item. + sig { returns(Float) } + attr_accessor :quantity + + # The computed total for this line item (quantity \* unit_price). + sig { returns(Float) } + attr_accessor :total + + # The unit price for this line item. + sig { returns(Float) } + attr_accessor :unit_price + + # A line item on an invoice, representing a single charge with a label, quantity, + # and unit price. + sig do + params( + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + ).returns(T.attached_class) + end + def self.new( + # The label or description for this line item. + label:, + # The display order of this line item within the invoice. + position:, + # The quantity of this line item. + quantity:, + # The computed total for this line item (quantity \* unit_price). + total:, + # The unit price for this line item. + unit_price: + ) + end + + sig do + override.returns( + { + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + } + ) + end + def to_hash + end + end + class User < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/sig/whop_sdk/models/invoice.rbs b/sig/whop_sdk/models/invoice.rbs index d6548e65..f52ed9cd 100644 --- a/sig/whop_sdk/models/invoice.rbs +++ b/sig/whop_sdk/models/invoice.rbs @@ -8,6 +8,7 @@ module WhopSDK due_date: Time?, email_address: String?, fetch_invoice_token: String, + line_items: ::Array[WhopSDK::Invoice::LineItem], number: String, status: WhopSDK::Models::invoice_status, user: WhopSDK::Invoice::User? @@ -26,6 +27,8 @@ module WhopSDK attr_accessor fetch_invoice_token: String + attr_accessor line_items: ::Array[WhopSDK::Invoice::LineItem] + attr_accessor number: String attr_accessor status: WhopSDK::Models::invoice_status @@ -39,6 +42,7 @@ module WhopSDK due_date: Time?, email_address: String?, fetch_invoice_token: String, + line_items: ::Array[WhopSDK::Invoice::LineItem], number: String, status: WhopSDK::Models::invoice_status, user: WhopSDK::Invoice::User? @@ -51,6 +55,7 @@ module WhopSDK due_date: Time?, email_address: String?, fetch_invoice_token: String, + line_items: ::Array[WhopSDK::Invoice::LineItem], number: String, status: WhopSDK::Models::invoice_status, user: WhopSDK::Invoice::User? @@ -83,6 +88,43 @@ module WhopSDK } end + type line_item = + { + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + } + + class LineItem < WhopSDK::Internal::Type::BaseModel + attr_accessor label: String + + attr_accessor position: Integer + + attr_accessor quantity: Float + + attr_accessor total: Float + + attr_accessor unit_price: Float + + def initialize: ( + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + ) -> void + + def to_hash: -> { + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + } + end + type user = { id: String, name: String?, username: String } class User < WhopSDK::Internal::Type::BaseModel diff --git a/sig/whop_sdk/models/invoice_list_item.rbs b/sig/whop_sdk/models/invoice_list_item.rbs index e5ba76e0..a7405cc5 100644 --- a/sig/whop_sdk/models/invoice_list_item.rbs +++ b/sig/whop_sdk/models/invoice_list_item.rbs @@ -8,6 +8,7 @@ module WhopSDK due_date: Time?, email_address: String?, fetch_invoice_token: String, + line_items: ::Array[WhopSDK::InvoiceListItem::LineItem], number: String, status: WhopSDK::Models::invoice_status, user: WhopSDK::InvoiceListItem::User? @@ -26,6 +27,8 @@ module WhopSDK attr_accessor fetch_invoice_token: String + attr_accessor line_items: ::Array[WhopSDK::InvoiceListItem::LineItem] + attr_accessor number: String attr_accessor status: WhopSDK::Models::invoice_status @@ -39,6 +42,7 @@ module WhopSDK due_date: Time?, email_address: String?, fetch_invoice_token: String, + line_items: ::Array[WhopSDK::InvoiceListItem::LineItem], number: String, status: WhopSDK::Models::invoice_status, user: WhopSDK::InvoiceListItem::User? @@ -51,6 +55,7 @@ module WhopSDK due_date: Time?, email_address: String?, fetch_invoice_token: String, + line_items: ::Array[WhopSDK::InvoiceListItem::LineItem], number: String, status: WhopSDK::Models::invoice_status, user: WhopSDK::InvoiceListItem::User? @@ -83,6 +88,43 @@ module WhopSDK } end + type line_item = + { + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + } + + class LineItem < WhopSDK::Internal::Type::BaseModel + attr_accessor label: String + + attr_accessor position: Integer + + attr_accessor quantity: Float + + attr_accessor total: Float + + attr_accessor unit_price: Float + + def initialize: ( + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + ) -> void + + def to_hash: -> { + label: String, + position: Integer, + quantity: Float, + total: Float, + unit_price: Float + } + end + type user = { id: String, name: String?, username: String } class User < WhopSDK::Internal::Type::BaseModel diff --git a/test/whop_sdk/resources/invoices_test.rb b/test/whop_sdk/resources/invoices_test.rb index 2c0c4f92..93383442 100644 --- a/test/whop_sdk/resources/invoices_test.rb +++ b/test/whop_sdk/resources/invoices_test.rb @@ -28,6 +28,7 @@ def test_create_required_params due_date: Time | nil, email_address: String | nil, fetch_invoice_token: String, + line_items: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Invoice::LineItem]), number: String, status: WhopSDK::InvoiceStatus, user: WhopSDK::Invoice::User | nil @@ -52,6 +53,7 @@ def test_retrieve due_date: Time | nil, email_address: String | nil, fetch_invoice_token: String, + line_items: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Invoice::LineItem]), number: String, status: WhopSDK::InvoiceStatus, user: WhopSDK::Invoice::User | nil @@ -76,6 +78,7 @@ def test_update due_date: Time | nil, email_address: String | nil, fetch_invoice_token: String, + line_items: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Invoice::LineItem]), number: String, status: WhopSDK::InvoiceStatus, user: WhopSDK::Invoice::User | nil @@ -107,6 +110,7 @@ def test_list due_date: Time | nil, email_address: String | nil, fetch_invoice_token: String, + line_items: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceListItem::LineItem]), number: String, status: WhopSDK::InvoiceStatus, user: WhopSDK::InvoiceListItem::User | nil From 470637d729ff39d82bc491e85ca43279d1ae1481 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 15 Jul 2026 05:52:25 +0000 Subject: [PATCH 32/34] feat(ads): target ads by interests, behaviors, and demographics Stainless-Generated-From: 073d027e160776cb0939b5855d0fcb0cb7fc8325 --- lib/whop_sdk/models/ad_group.rb | 22 ++++++--- lib/whop_sdk/models/ad_group_create_params.rb | 29 ++++++++---- lib/whop_sdk/models/ad_group_update_params.rb | 29 ++++++++---- lib/whop_sdk/resources/ad_groups.rb | 12 +++-- rbi/whop_sdk/models/ad_group.rbi | 28 +++++++++--- .../models/ad_group_create_params.rbi | 45 ++++++++++++++----- .../models/ad_group_update_params.rbi | 45 ++++++++++++++----- rbi/whop_sdk/resources/ad_groups.rbi | 40 ++++++++++++----- sig/whop_sdk/models/ad_group.rbs | 5 +++ .../models/ad_group_create_params.rbs | 7 +++ .../models/ad_group_update_params.rbs | 7 +++ sig/whop_sdk/resources/ad_groups.rbs | 2 + test/whop_sdk/resources/ad_groups_test.rb | 6 +++ 13 files changed, 210 insertions(+), 67 deletions(-) diff --git a/lib/whop_sdk/models/ad_group.rb b/lib/whop_sdk/models/ad_group.rb index 80c36ed5..052d65c2 100644 --- a/lib/whop_sdk/models/ad_group.rb +++ b/lib/whop_sdk/models/ad_group.rb @@ -201,6 +201,15 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # @return [Float, nil] required :desired_cost_per_result, Float, nil?: true + # @!attribute detailed_targeting + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where demographics type is one of + # life_events, industries, income, family_statuses. Incompatible with + # demographics.automatic (Advantage+) and Special Ad Category campaigns. + # + # @return [Object] + required :detailed_targeting, WhopSDK::Internal::Type::Unknown + # @!attribute devices # Device targeting: platforms and operating systems. # @@ -295,9 +304,10 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel required :reach, Float # @!attribute regions - # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. - # US-CA), cities, zips, and custom_locations (pin + radius: { latitude, longitude, - # radius, distance_unit, name }). + # Geo targeting: include/exclude countries, country_groups (include-only Meta + # groups like worldwide — global reach), regions (ISO 3166-2 states, e.g. US-CA), + # cities, zips, and custom_locations (pin + radius: { latitude, longitude, radius, + # distance_unit, name }). # # @return [Object] required :regions, WhopSDK::Internal::Type::Unknown @@ -399,7 +409,7 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # @return [Float] required :viewed_contents, Float - # @!method initialize(id:, ad_campaign:, added_to_carts:, audiences:, bid_type:, budget_amount:, budget_type:, click_through_rate:, clicks:, completed_registrations:, contacts:, conversion_event:, conversion_location:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, custom_conversions:, custom_event_counts:, delivery_status:, demographics:, desired_cost_per_result:, devices:, dynamic_creative:, ends_at:, frequency:, frequency_cap:, impressions:, issues:, languages:, leads:, message_apps:, minimum_daily_spend:, optimization_goal:, placements:, purchase_value:, purchases:, reach:, regions:, result_event:, result_event_name:, results:, return_on_ad_spend:, schedules:, spend:, spend_currency:, starts_at:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, viewed_contents:) + # @!method initialize(id:, ad_campaign:, added_to_carts:, audiences:, bid_type:, budget_amount:, budget_type:, click_through_rate:, clicks:, completed_registrations:, contacts:, conversion_event:, conversion_location:, cost_per_added_to_cart:, cost_per_click:, cost_per_completed_registration:, cost_per_contact:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, cost_per_schedule:, cost_per_submitted_application:, cost_per_viewed_content:, created_at:, custom_conversions:, custom_event_counts:, delivery_status:, demographics:, desired_cost_per_result:, detailed_targeting:, devices:, dynamic_creative:, ends_at:, frequency:, frequency_cap:, impressions:, issues:, languages:, leads:, message_apps:, minimum_daily_spend:, optimization_goal:, placements:, purchase_value:, purchases:, reach:, regions:, result_event:, result_event_name:, results:, return_on_ad_spend:, schedules:, spend:, spend_currency:, starts_at:, status:, submitted_applications:, title:, unique_click_through_rate:, unique_clicks:, updated_at:, viewed_contents:) # Some parameter documentations has been truncated, see {WhopSDK::Models::AdGroup} # for more details. # @@ -463,6 +473,8 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # # @param desired_cost_per_result [Float, nil] Target/cap cost for average_target / maximum_target. # + # @param detailed_targeting [Object] Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], demograp + # # @param devices [Object] Device targeting: platforms and operating systems. # # @param dynamic_creative [Boolean] Whether ads within this ad group have their creatives and copy dynamically AB te @@ -495,7 +507,7 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # # @param reach [Float] The number of unique people who saw this. # - # @param regions [Object] Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. US-CA + # @param regions [Object] Geo targeting: include/exclude countries, country_groups (include-only Meta grou # # @param result_event [Symbol, WhopSDK::Models::AdGroup::ResultEvent, nil] The Whop pixel conversion event whose attributed count represents results — the # diff --git a/lib/whop_sdk/models/ad_group_create_params.rb b/lib/whop_sdk/models/ad_group_create_params.rb index 3fc291be..52205b23 100644 --- a/lib/whop_sdk/models/ad_group_create_params.rb +++ b/lib/whop_sdk/models/ad_group_create_params.rb @@ -65,6 +65,17 @@ class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel # @return [Float, nil] optional :desired_cost_per_result, Float + # @!attribute detailed_targeting + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where type is one of life_events, industries, + # income, family_statuses. IDs come from Meta's targeting taxonomy. At most 100 + # entries per section. Incompatible with demographics.automatic (Advantage+) and + # Special Ad Category campaigns. Sending the field states complete intent — + # omitted sections clear their stored entries. + # + # @return [Object, nil] + optional :detailed_targeting, WhopSDK::Internal::Type::Unknown + # @!attribute devices # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. # @@ -137,12 +148,12 @@ class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel optional :placements, WhopSDK::Internal::Type::Unknown # @!attribute regions - # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, - # custom_locations } }. custom_locations entries are pin + radius: { latitude, - # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name - # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 - # custom locations across include and exclude. + # Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups + # (include-only, e.g. 'worldwide' for global reach), regions (ISO 3166-2 states, + # e.g. US-CA), cities (keyed), zips, custom_locations } }. custom_locations + # entries are pin + radius: { latitude, longitude, radius, distance_unit ('mile' + # default, or 'kilometer'), name (optional label) }. Radius 1-50 miles or 1-80 km; + # at most 200 custom locations across include and exclude. # # @return [Object, nil] optional :regions, WhopSDK::Internal::Type::Unknown @@ -165,7 +176,7 @@ class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :title, String - # @!method initialize(ad_campaign_id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, devices: nil, dynamic_creative: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) + # @!method initialize(ad_campaign_id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, detailed_targeting: nil, devices: nil, dynamic_creative: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdGroupCreateParams} for more details. # @@ -187,6 +198,8 @@ class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel # # @param desired_cost_per_result [Float] Target/cap cost for average_target / maximum_target. # + # @param detailed_targeting [Object] Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], demograp + # # @param devices [Object] Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. # # @param dynamic_creative [Boolean] Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; immutab @@ -205,7 +218,7 @@ class AdGroupCreateParams < WhopSDK::Internal::Type::BaseModel # # @param placements [Object] 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to # - # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), regions (states/pr + # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups (in # # @param starts_at [String] Schedule start, ISO 8601. # diff --git a/lib/whop_sdk/models/ad_group_update_params.rb b/lib/whop_sdk/models/ad_group_update_params.rb index 114f638a..b37da426 100644 --- a/lib/whop_sdk/models/ad_group_update_params.rb +++ b/lib/whop_sdk/models/ad_group_update_params.rb @@ -64,6 +64,17 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Float, nil] optional :desired_cost_per_result, Float + # @!attribute detailed_targeting + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where type is one of life_events, industries, + # income, family_statuses. IDs come from Meta's targeting taxonomy. At most 100 + # entries per section. Incompatible with demographics.automatic (Advantage+) and + # Special Ad Category campaigns. Sending the field states complete intent — + # omitted sections clear their stored entries. + # + # @return [Object, nil] + optional :detailed_targeting, WhopSDK::Internal::Type::Unknown + # @!attribute devices # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. # @@ -129,12 +140,12 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel optional :placements, WhopSDK::Internal::Type::Unknown # @!attribute regions - # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, - # custom_locations } }. custom_locations entries are pin + radius: { latitude, - # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name - # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 - # custom locations across include and exclude. + # Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups + # (include-only, e.g. 'worldwide' for global reach), regions (ISO 3166-2 states, + # e.g. US-CA), cities (keyed), zips, custom_locations } }. custom_locations + # entries are pin + radius: { latitude, longitude, radius, distance_unit ('mile' + # default, or 'kilometer'), name (optional label) }. Radius 1-50 miles or 1-80 km; + # at most 200 custom locations across include and exclude. # # @return [Object, nil] optional :regions, WhopSDK::Internal::Type::Unknown @@ -157,7 +168,7 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :title, String - # @!method initialize(id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, devices: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) + # @!method initialize(id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, detailed_targeting: nil, devices: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdGroupUpdateParams} for more details. # @@ -179,6 +190,8 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param desired_cost_per_result [Float] Target/cap cost for average_target / maximum_target. # + # @param detailed_targeting [Object] Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], demograp + # # @param devices [Object] Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. # # @param ends_at [String] Schedule end, ISO 8601. @@ -195,7 +208,7 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param placements [Object] 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to # - # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), regions (states/pr + # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups (in # # @param starts_at [String] Schedule start, ISO 8601. # diff --git a/lib/whop_sdk/resources/ad_groups.rb b/lib/whop_sdk/resources/ad_groups.rb index 3b969a9a..87faac94 100644 --- a/lib/whop_sdk/resources/ad_groups.rb +++ b/lib/whop_sdk/resources/ad_groups.rb @@ -16,7 +16,7 @@ class AdGroups # # Creates an ad group (ad set) in a campaign. # - # @overload create(ad_campaign_id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, devices: nil, dynamic_creative: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) + # @overload create(ad_campaign_id:, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, detailed_targeting: nil, devices: nil, dynamic_creative: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) # # @param ad_campaign_id [String] The ad campaign to create the ad group in. # @@ -36,6 +36,8 @@ class AdGroups # # @param desired_cost_per_result [Float] Target/cap cost for average_target / maximum_target. # + # @param detailed_targeting [Object] Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], demograp + # # @param devices [Object] Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. # # @param dynamic_creative [Boolean] Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; immutab @@ -54,7 +56,7 @@ class AdGroups # # @param placements [Object] 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to # - # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), regions (states/pr + # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups (in # # @param starts_at [String] Schedule start, ISO 8601. # @@ -112,7 +114,7 @@ def retrieve(id, params = {}) # # Updates an ad group's editable fields. Only the keys you send are changed. # - # @overload update(id, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, devices: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) + # @overload update(id, audiences: nil, bid_type: nil, budget_amount: nil, budget_type: nil, conversion_event: nil, conversion_location: nil, demographics: nil, desired_cost_per_result: nil, detailed_targeting: nil, devices: nil, ends_at: nil, frequency_cap: nil, languages: nil, message_apps: nil, minimum_daily_spend: nil, optimization_goal: nil, placements: nil, regions: nil, starts_at: nil, status: nil, title: nil, request_options: {}) # # @param id [String] The ad group ID. # @@ -132,6 +134,8 @@ def retrieve(id, params = {}) # # @param desired_cost_per_result [Float] Target/cap cost for average_target / maximum_target. # + # @param detailed_targeting [Object] Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], demograp + # # @param devices [Object] Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. # # @param ends_at [String] Schedule end, ISO 8601. @@ -148,7 +152,7 @@ def retrieve(id, params = {}) # # @param placements [Object] 'automatic' (Advantage+) or a list of { platform, positions }. Omit positions to # - # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), regions (states/pr + # @param regions [Object] Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups (in # # @param starts_at [String] Schedule start, ISO 8601. # diff --git a/rbi/whop_sdk/models/ad_group.rbi b/rbi/whop_sdk/models/ad_group.rbi index 27788033..2e168678 100644 --- a/rbi/whop_sdk/models/ad_group.rbi +++ b/rbi/whop_sdk/models/ad_group.rbi @@ -148,6 +148,13 @@ module WhopSDK sig { returns(T.nilable(Float)) } attr_accessor :desired_cost_per_result + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where demographics type is one of + # life_events, industries, income, family_statuses. Incompatible with + # demographics.automatic (Advantage+) and Special Ad Category campaigns. + sig { returns(T.anything) } + attr_accessor :detailed_targeting + # Device targeting: platforms and operating systems. sig { returns(T.anything) } attr_accessor :devices @@ -209,9 +216,10 @@ module WhopSDK sig { returns(Float) } attr_accessor :reach - # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. - # US-CA), cities, zips, and custom_locations (pin + radius: { latitude, longitude, - # radius, distance_unit, name }). + # Geo targeting: include/exclude countries, country_groups (include-only Meta + # groups like worldwide — global reach), regions (ISO 3166-2 states, e.g. US-CA), + # cities, zips, and custom_locations (pin + radius: { latitude, longitude, radius, + # distance_unit, name }). sig { returns(T.anything) } attr_accessor :regions @@ -318,6 +326,7 @@ module WhopSDK delivery_status: WhopSDK::AdGroup::DeliveryStatus::OrSymbol, demographics: T.anything, desired_cost_per_result: T.nilable(Float), + detailed_targeting: T.anything, devices: T.anything, dynamic_creative: T::Boolean, ends_at: T.nilable(String), @@ -430,6 +439,11 @@ module WhopSDK demographics:, # Target/cap cost for average_target / maximum_target. desired_cost_per_result:, + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where demographics type is one of + # life_events, industries, income, family_statuses. Incompatible with + # demographics.automatic (Advantage+) and Special Ad Category campaigns. + detailed_targeting:, # Device targeting: platforms and operating systems. devices:, # Whether ads within this ad group have their creatives and copy dynamically AB @@ -459,9 +473,10 @@ module WhopSDK purchases:, # The number of unique people who saw this. reach:, - # Geo targeting: include/exclude countries, regions (ISO 3166-2 states, e.g. - # US-CA), cities, zips, and custom_locations (pin + radius: { latitude, longitude, - # radius, distance_unit, name }). + # Geo targeting: include/exclude countries, country_groups (include-only Meta + # groups like worldwide — global reach), regions (ISO 3166-2 states, e.g. US-CA), + # cities, zips, and custom_locations (pin + radius: { latitude, longitude, radius, + # distance_unit, name }). regions:, # The Whop pixel conversion event whose attributed count represents results — the # optimization goal, or the highest-volume attributed event for campaigns that @@ -538,6 +553,7 @@ module WhopSDK delivery_status: WhopSDK::AdGroup::DeliveryStatus::TaggedSymbol, demographics: T.anything, desired_cost_per_result: T.nilable(Float), + detailed_targeting: T.anything, devices: T.anything, dynamic_creative: T::Boolean, ends_at: T.nilable(String), diff --git a/rbi/whop_sdk/models/ad_group_create_params.rbi b/rbi/whop_sdk/models/ad_group_create_params.rbi index efc0a293..d8315e79 100644 --- a/rbi/whop_sdk/models/ad_group_create_params.rbi +++ b/rbi/whop_sdk/models/ad_group_create_params.rbi @@ -100,6 +100,18 @@ module WhopSDK sig { params(desired_cost_per_result: Float).void } attr_writer :desired_cost_per_result + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where type is one of life_events, industries, + # income, family_statuses. IDs come from Meta's targeting taxonomy. At most 100 + # entries per section. Incompatible with demographics.automatic (Advantage+) and + # Special Ad Category campaigns. Sending the field states complete intent — + # omitted sections clear their stored entries. + sig { returns(T.nilable(T.anything)) } + attr_reader :detailed_targeting + + sig { params(detailed_targeting: T.anything).void } + attr_writer :detailed_targeting + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. sig { returns(T.nilable(T.anything)) } attr_reader :devices @@ -190,12 +202,12 @@ module WhopSDK sig { params(placements: T.anything).void } attr_writer :placements - # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, - # custom_locations } }. custom_locations entries are pin + radius: { latitude, - # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name - # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 - # custom locations across include and exclude. + # Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups + # (include-only, e.g. 'worldwide' for global reach), regions (ISO 3166-2 states, + # e.g. US-CA), cities (keyed), zips, custom_locations } }. custom_locations + # entries are pin + radius: { latitude, longitude, radius, distance_unit ('mile' + # default, or 'kilometer'), name (optional label) }. Radius 1-50 miles or 1-80 km; + # at most 200 custom locations across include and exclude. sig { returns(T.nilable(T.anything)) } attr_reader :regions @@ -243,6 +255,7 @@ module WhopSDK WhopSDK::AdGroupCreateParams::ConversionLocation::OrSymbol, demographics: T.anything, desired_cost_per_result: Float, + detailed_targeting: T.anything, devices: T.anything, dynamic_creative: T::Boolean, ends_at: String, @@ -283,6 +296,13 @@ module WhopSDK demographics: nil, # Target/cap cost for average_target / maximum_target. desired_cost_per_result: nil, + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where type is one of life_events, industries, + # income, family_statuses. IDs come from Meta's targeting taxonomy. At most 100 + # entries per section. Incompatible with demographics.automatic (Advantage+) and + # Special Ad Category campaigns. Sending the field states complete intent — + # omitted sections clear their stored entries. + detailed_targeting: nil, # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. devices: nil, # Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; @@ -317,12 +337,12 @@ module WhopSDK # - `threads`: `threads_stream` # - `whatsapp`: `status` placements: nil, - # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, - # custom_locations } }. custom_locations entries are pin + radius: { latitude, - # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name - # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 - # custom locations across include and exclude. + # Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups + # (include-only, e.g. 'worldwide' for global reach), regions (ISO 3166-2 states, + # e.g. US-CA), cities (keyed), zips, custom_locations } }. custom_locations + # entries are pin + radius: { latitude, longitude, radius, distance_unit ('mile' + # default, or 'kilometer'), name (optional label) }. Radius 1-50 miles or 1-80 km; + # at most 200 custom locations across include and exclude. regions: nil, # Schedule start, ISO 8601. starts_at: nil, @@ -353,6 +373,7 @@ module WhopSDK WhopSDK::AdGroupCreateParams::ConversionLocation::OrSymbol, demographics: T.anything, desired_cost_per_result: Float, + detailed_targeting: T.anything, devices: T.anything, dynamic_creative: T::Boolean, ends_at: String, diff --git a/rbi/whop_sdk/models/ad_group_update_params.rbi b/rbi/whop_sdk/models/ad_group_update_params.rbi index 2cfe014b..4920fb2f 100644 --- a/rbi/whop_sdk/models/ad_group_update_params.rbi +++ b/rbi/whop_sdk/models/ad_group_update_params.rbi @@ -99,6 +99,18 @@ module WhopSDK sig { params(desired_cost_per_result: Float).void } attr_writer :desired_cost_per_result + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where type is one of life_events, industries, + # income, family_statuses. IDs come from Meta's targeting taxonomy. At most 100 + # entries per section. Incompatible with demographics.automatic (Advantage+) and + # Special Ad Category campaigns. Sending the field states complete intent — + # omitted sections clear their stored entries. + sig { returns(T.nilable(T.anything)) } + attr_reader :detailed_targeting + + sig { params(detailed_targeting: T.anything).void } + attr_writer :detailed_targeting + # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. sig { returns(T.nilable(T.anything)) } attr_reader :devices @@ -181,12 +193,12 @@ module WhopSDK sig { params(placements: T.anything).void } attr_writer :placements - # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, - # custom_locations } }. custom_locations entries are pin + radius: { latitude, - # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name - # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 - # custom locations across include and exclude. + # Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups + # (include-only, e.g. 'worldwide' for global reach), regions (ISO 3166-2 states, + # e.g. US-CA), cities (keyed), zips, custom_locations } }. custom_locations + # entries are pin + radius: { latitude, longitude, radius, distance_unit ('mile' + # default, or 'kilometer'), name (optional label) }. Radius 1-50 miles or 1-80 km; + # at most 200 custom locations across include and exclude. sig { returns(T.nilable(T.anything)) } attr_reader :regions @@ -234,6 +246,7 @@ module WhopSDK WhopSDK::AdGroupUpdateParams::ConversionLocation::OrSymbol, demographics: T.anything, desired_cost_per_result: Float, + detailed_targeting: T.anything, devices: T.anything, ends_at: String, frequency_cap: T.anything, @@ -272,6 +285,13 @@ module WhopSDK demographics: nil, # Target/cap cost for average_target / maximum_target. desired_cost_per_result: nil, + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where type is one of life_events, industries, + # income, family_statuses. IDs come from Meta's targeting taxonomy. At most 100 + # entries per section. Incompatible with demographics.automatic (Advantage+) and + # Special Ad Category campaigns. Sending the field states complete intent — + # omitted sections clear their stored entries. + detailed_targeting: nil, # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. devices: nil, # Schedule end, ISO 8601. @@ -303,12 +323,12 @@ module WhopSDK # - `threads`: `threads_stream` # - `whatsapp`: `status` placements: nil, - # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, - # custom_locations } }. custom_locations entries are pin + radius: { latitude, - # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name - # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 - # custom locations across include and exclude. + # Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups + # (include-only, e.g. 'worldwide' for global reach), regions (ISO 3166-2 states, + # e.g. US-CA), cities (keyed), zips, custom_locations } }. custom_locations + # entries are pin + radius: { latitude, longitude, radius, distance_unit ('mile' + # default, or 'kilometer'), name (optional label) }. Radius 1-50 miles or 1-80 km; + # at most 200 custom locations across include and exclude. regions: nil, # Schedule start, ISO 8601. starts_at: nil, @@ -339,6 +359,7 @@ module WhopSDK WhopSDK::AdGroupUpdateParams::ConversionLocation::OrSymbol, demographics: T.anything, desired_cost_per_result: Float, + detailed_targeting: T.anything, devices: T.anything, ends_at: String, frequency_cap: T.anything, diff --git a/rbi/whop_sdk/resources/ad_groups.rbi b/rbi/whop_sdk/resources/ad_groups.rbi index b1c7f55d..d4dffeca 100644 --- a/rbi/whop_sdk/resources/ad_groups.rbi +++ b/rbi/whop_sdk/resources/ad_groups.rbi @@ -30,6 +30,7 @@ module WhopSDK WhopSDK::AdGroupCreateParams::ConversionLocation::OrSymbol, demographics: T.anything, desired_cost_per_result: Float, + detailed_targeting: T.anything, devices: T.anything, dynamic_creative: T::Boolean, ends_at: String, @@ -70,6 +71,13 @@ module WhopSDK demographics: nil, # Target/cap cost for average_target / maximum_target. desired_cost_per_result: nil, + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where type is one of life_events, industries, + # income, family_statuses. IDs come from Meta's targeting taxonomy. At most 100 + # entries per section. Incompatible with demographics.automatic (Advantage+) and + # Special Ad Category campaigns. Sending the field states complete intent — + # omitted sections clear their stored entries. + detailed_targeting: nil, # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. devices: nil, # Run Meta dynamic (Advantage+) creative for this ad set. Set at creation; @@ -104,12 +112,12 @@ module WhopSDK # - `threads`: `threads_stream` # - `whatsapp`: `status` placements: nil, - # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, - # custom_locations } }. custom_locations entries are pin + radius: { latitude, - # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name - # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 - # custom locations across include and exclude. + # Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups + # (include-only, e.g. 'worldwide' for global reach), regions (ISO 3166-2 states, + # e.g. US-CA), cities (keyed), zips, custom_locations } }. custom_locations + # entries are pin + radius: { latitude, longitude, radius, distance_unit ('mile' + # default, or 'kilometer'), name (optional label) }. Radius 1-50 miles or 1-80 km; + # at most 200 custom locations across include and exclude. regions: nil, # Schedule start, ISO 8601. starts_at: nil, @@ -163,6 +171,7 @@ module WhopSDK WhopSDK::AdGroupUpdateParams::ConversionLocation::OrSymbol, demographics: T.anything, desired_cost_per_result: Float, + detailed_targeting: T.anything, devices: T.anything, ends_at: String, frequency_cap: T.anything, @@ -202,6 +211,13 @@ module WhopSDK demographics: nil, # Target/cap cost for average_target / maximum_target. desired_cost_per_result: nil, + # Detailed targeting: { interests: [{id, name}], behaviors: [{id, name}], + # demographics: [{id, name, type}] } where type is one of life_events, industries, + # income, family_statuses. IDs come from Meta's targeting taxonomy. At most 100 + # entries per section. Incompatible with demographics.automatic (Advantage+) and + # Special Ad Category campaigns. Sending the field states complete intent — + # omitted sections clear their stored entries. + detailed_targeting: nil, # Device targeting: { platforms, operating_systems: [{ os, minimum_version }] }. devices: nil, # Schedule end, ISO 8601. @@ -233,12 +249,12 @@ module WhopSDK # - `threads`: `threads_stream` # - `whatsapp`: `status` placements: nil, - # Geo targeting: { include / exclude: { countries (ISO 3166-1), regions - # (states/provinces as ISO 3166-2, e.g. US-CA), cities (keyed), zips, - # custom_locations } }. custom_locations entries are pin + radius: { latitude, - # longitude, radius, distance_unit ('mile' default, or 'kilometer'), name - # (optional display label) }. Radius must be 1-50 miles or 1-80 km; at most 200 - # custom locations across include and exclude. + # Geo targeting: { include / exclude: { countries (ISO 3166-1), country_groups + # (include-only, e.g. 'worldwide' for global reach), regions (ISO 3166-2 states, + # e.g. US-CA), cities (keyed), zips, custom_locations } }. custom_locations + # entries are pin + radius: { latitude, longitude, radius, distance_unit ('mile' + # default, or 'kilometer'), name (optional label) }. Radius 1-50 miles or 1-80 km; + # at most 200 custom locations across include and exclude. regions: nil, # Schedule start, ISO 8601. starts_at: nil, diff --git a/sig/whop_sdk/models/ad_group.rbs b/sig/whop_sdk/models/ad_group.rbs index 3f7741e7..86583ea5 100644 --- a/sig/whop_sdk/models/ad_group.rbs +++ b/sig/whop_sdk/models/ad_group.rbs @@ -32,6 +32,7 @@ module WhopSDK delivery_status: WhopSDK::Models::AdGroup::delivery_status, demographics: top, desired_cost_per_result: Float?, + detailed_targeting: top, devices: top, dynamic_creative: bool, ends_at: String?, @@ -127,6 +128,8 @@ module WhopSDK attr_accessor desired_cost_per_result: Float? + attr_accessor detailed_targeting: top + attr_accessor devices: top attr_accessor dynamic_creative: bool @@ -222,6 +225,7 @@ module WhopSDK delivery_status: WhopSDK::Models::AdGroup::delivery_status, demographics: top, desired_cost_per_result: Float?, + detailed_targeting: top, devices: top, dynamic_creative: bool, ends_at: String?, @@ -287,6 +291,7 @@ module WhopSDK delivery_status: WhopSDK::Models::AdGroup::delivery_status, demographics: top, desired_cost_per_result: Float?, + detailed_targeting: top, devices: top, dynamic_creative: bool, ends_at: String?, diff --git a/sig/whop_sdk/models/ad_group_create_params.rbs b/sig/whop_sdk/models/ad_group_create_params.rbs index 743aa521..a1b38c41 100644 --- a/sig/whop_sdk/models/ad_group_create_params.rbs +++ b/sig/whop_sdk/models/ad_group_create_params.rbs @@ -11,6 +11,7 @@ module WhopSDK conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location, demographics: top, desired_cost_per_result: Float, + detailed_targeting: top, devices: top, dynamic_creative: bool, ends_at: String, @@ -69,6 +70,10 @@ module WhopSDK def desired_cost_per_result=: (Float) -> Float + attr_reader detailed_targeting: top? + + def detailed_targeting=: (top) -> top + attr_reader devices: top? def devices=: (top) -> top @@ -135,6 +140,7 @@ module WhopSDK ?conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location, ?demographics: top, ?desired_cost_per_result: Float, + ?detailed_targeting: top, ?devices: top, ?dynamic_creative: bool, ?ends_at: String, @@ -161,6 +167,7 @@ module WhopSDK conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location, demographics: top, desired_cost_per_result: Float, + detailed_targeting: top, devices: top, dynamic_creative: bool, ends_at: String, diff --git a/sig/whop_sdk/models/ad_group_update_params.rbs b/sig/whop_sdk/models/ad_group_update_params.rbs index 3723d9f2..233cc096 100644 --- a/sig/whop_sdk/models/ad_group_update_params.rbs +++ b/sig/whop_sdk/models/ad_group_update_params.rbs @@ -11,6 +11,7 @@ module WhopSDK conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location, demographics: top, desired_cost_per_result: Float, + detailed_targeting: top, devices: top, ends_at: String, frequency_cap: top, @@ -68,6 +69,10 @@ module WhopSDK def desired_cost_per_result=: (Float) -> Float + attr_reader detailed_targeting: top? + + def detailed_targeting=: (top) -> top + attr_reader devices: top? def devices=: (top) -> top @@ -130,6 +135,7 @@ module WhopSDK ?conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location, ?demographics: top, ?desired_cost_per_result: Float, + ?detailed_targeting: top, ?devices: top, ?ends_at: String, ?frequency_cap: top, @@ -155,6 +161,7 @@ module WhopSDK conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location, demographics: top, desired_cost_per_result: Float, + detailed_targeting: top, devices: top, ends_at: String, frequency_cap: top, diff --git a/sig/whop_sdk/resources/ad_groups.rbs b/sig/whop_sdk/resources/ad_groups.rbs index 635da56a..c7e5145c 100644 --- a/sig/whop_sdk/resources/ad_groups.rbs +++ b/sig/whop_sdk/resources/ad_groups.rbs @@ -11,6 +11,7 @@ module WhopSDK ?conversion_location: WhopSDK::Models::AdGroupCreateParams::conversion_location, ?demographics: top, ?desired_cost_per_result: Float, + ?detailed_targeting: top, ?devices: top, ?dynamic_creative: bool, ?ends_at: String, @@ -45,6 +46,7 @@ module WhopSDK ?conversion_location: WhopSDK::Models::AdGroupUpdateParams::conversion_location, ?demographics: top, ?desired_cost_per_result: Float, + ?detailed_targeting: top, ?devices: top, ?ends_at: String, ?frequency_cap: top, diff --git a/test/whop_sdk/resources/ad_groups_test.rb b/test/whop_sdk/resources/ad_groups_test.rb index 794e3dda..9826412f 100644 --- a/test/whop_sdk/resources/ad_groups_test.rb +++ b/test/whop_sdk/resources/ad_groups_test.rb @@ -44,6 +44,7 @@ def test_create_required_params delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, + detailed_targeting: WhopSDK::Internal::Type::Unknown, devices: WhopSDK::Internal::Type::Unknown, dynamic_creative: WhopSDK::Internal::Type::Boolean, ends_at: String | nil, @@ -121,6 +122,7 @@ def test_retrieve delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, + detailed_targeting: WhopSDK::Internal::Type::Unknown, devices: WhopSDK::Internal::Type::Unknown, dynamic_creative: WhopSDK::Internal::Type::Boolean, ends_at: String | nil, @@ -198,6 +200,7 @@ def test_update delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, + detailed_targeting: WhopSDK::Internal::Type::Unknown, devices: WhopSDK::Internal::Type::Unknown, dynamic_creative: WhopSDK::Internal::Type::Boolean, ends_at: String | nil, @@ -282,6 +285,7 @@ def test_list delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, + detailed_targeting: WhopSDK::Internal::Type::Unknown, devices: WhopSDK::Internal::Type::Unknown, dynamic_creative: WhopSDK::Internal::Type::Boolean, ends_at: String | nil, @@ -369,6 +373,7 @@ def test_pause delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, + detailed_targeting: WhopSDK::Internal::Type::Unknown, devices: WhopSDK::Internal::Type::Unknown, dynamic_creative: WhopSDK::Internal::Type::Boolean, ends_at: String | nil, @@ -446,6 +451,7 @@ def test_unpause delivery_status: WhopSDK::AdGroup::DeliveryStatus, demographics: WhopSDK::Internal::Type::Unknown, desired_cost_per_result: Float | nil, + detailed_targeting: WhopSDK::Internal::Type::Unknown, devices: WhopSDK::Internal::Type::Unknown, dynamic_creative: WhopSDK::Internal::Type::Boolean, ends_at: String | nil, From 5a5353bd1909c964061adec13e4d08c8f96d463e Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 15 Jul 2026 06:00:34 +0000 Subject: [PATCH 33/34] feature(ads): Add error status to social_accounts rest API and surface to users Stainless-Generated-From: 6184a1c8509994bdca1c5f9977aea1520a27a914 --- lib/whop_sdk/models/social_account.rb | 11 ++++++++++- rbi/whop_sdk/models/social_account.rbi | 10 ++++++++++ sig/whop_sdk/models/social_account.rbs | 5 +++++ test/whop_sdk/resources/social_accounts_test.rb | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/whop_sdk/models/social_account.rb b/lib/whop_sdk/models/social_account.rb index 05235b9c..9d1f51d5 100644 --- a/lib/whop_sdk/models/social_account.rb +++ b/lib/whop_sdk/models/social_account.rb @@ -10,6 +10,13 @@ class SocialAccount < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute error + # Why this social account currently can't be used for advertising — a failed share + # or a Meta-side restriction. Null when the account is healthy. + # + # @return [String, nil] + required :error, String, nil?: true + # @!attribute external_id # The platform-specific ID for this social account. # @@ -59,12 +66,14 @@ class SocialAccount < WhopSDK::Internal::Type::BaseModel # @return [Boolean] required :verified, WhopSDK::Internal::Type::Boolean - # @!method initialize(id:, external_id:, name:, platform:, profile_picture_url:, scopes:, url:, username:, verified:) + # @!method initialize(id:, error:, external_id:, name:, platform:, profile_picture_url:, scopes:, url:, username:, verified:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::SocialAccount} for more details. # # @param id [String] Unique identifier for the social account. # + # @param error [String, nil] Why this social account currently can't be used for advertising — a failed share + # # @param external_id [String, nil] The platform-specific ID for this social account. # # @param name [String, nil] The display name of the social account on the platform. diff --git a/rbi/whop_sdk/models/social_account.rbi b/rbi/whop_sdk/models/social_account.rbi index d46f1271..c9fcb228 100644 --- a/rbi/whop_sdk/models/social_account.rbi +++ b/rbi/whop_sdk/models/social_account.rbi @@ -12,6 +12,11 @@ module WhopSDK sig { returns(String) } attr_accessor :id + # Why this social account currently can't be used for advertising — a failed share + # or a Meta-side restriction. Null when the account is healthy. + sig { returns(T.nilable(String)) } + attr_accessor :error + # The platform-specific ID for this social account. sig { returns(T.nilable(String)) } attr_accessor :external_id @@ -48,6 +53,7 @@ module WhopSDK sig do params( id: String, + error: T.nilable(String), external_id: T.nilable(String), name: T.nilable(String), platform: WhopSDK::SocialAccount::Platform::OrSymbol, @@ -61,6 +67,9 @@ module WhopSDK def self.new( # Unique identifier for the social account. id:, + # Why this social account currently can't be used for advertising — a failed share + # or a Meta-side restriction. Null when the account is healthy. + error:, # The platform-specific ID for this social account. external_id:, # The display name of the social account on the platform. @@ -85,6 +94,7 @@ module WhopSDK override.returns( { id: String, + error: T.nilable(String), external_id: T.nilable(String), name: T.nilable(String), platform: WhopSDK::SocialAccount::Platform::TaggedSymbol, diff --git a/sig/whop_sdk/models/social_account.rbs b/sig/whop_sdk/models/social_account.rbs index e93c905a..c667d465 100644 --- a/sig/whop_sdk/models/social_account.rbs +++ b/sig/whop_sdk/models/social_account.rbs @@ -3,6 +3,7 @@ module WhopSDK type social_account = { id: String, + error: String?, external_id: String?, name: String?, platform: WhopSDK::Models::SocialAccount::platform, @@ -16,6 +17,8 @@ module WhopSDK class SocialAccount < WhopSDK::Internal::Type::BaseModel attr_accessor id: String + attr_accessor error: String? + attr_accessor external_id: String? attr_accessor name: String? @@ -34,6 +37,7 @@ module WhopSDK def initialize: ( id: String, + error: String?, external_id: String?, name: String?, platform: WhopSDK::Models::SocialAccount::platform, @@ -46,6 +50,7 @@ module WhopSDK def to_hash: -> { id: String, + error: String?, external_id: String?, name: String?, platform: WhopSDK::Models::SocialAccount::platform, diff --git a/test/whop_sdk/resources/social_accounts_test.rb b/test/whop_sdk/resources/social_accounts_test.rb index d9ae4d53..5a4e75a2 100644 --- a/test/whop_sdk/resources/social_accounts_test.rb +++ b/test/whop_sdk/resources/social_accounts_test.rb @@ -15,6 +15,7 @@ def test_create_required_params assert_pattern do response => { id: String, + error: String | nil, external_id: String | nil, name: String | nil, platform: WhopSDK::SocialAccount::Platform, @@ -46,6 +47,7 @@ def test_list assert_pattern do row => { id: String, + error: String | nil, external_id: String | nil, name: String | nil, platform: WhopSDK::SocialAccount::Platform, From 3b61937671a7ea6ddd27ac34b8e9d241e531d1c3 Mon Sep 17 00:00:00 2001 From: Guillermo del Molino <59506882+g-delmo@users.noreply.github.com> Date: Thu, 30 Jul 2026 12:57:50 -0400 Subject: [PATCH 34/34] Lock Ruby SDK verification dependencies --- Gemfile.lock | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 6ab022b6..73c4b4a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,6 +14,8 @@ PATH whop_sdk (0.0.41) cgi connection_pool + jwt + openssl standardwebhooks GEM @@ -73,6 +75,8 @@ GEM concurrent-ruby (~> 1.0) io-event (1.11.2) json (2.15.2) + jwt (2.10.2) + base64 language_server-protocol (3.17.0.5) lint_roller (1.1.0) listen (3.9.0) @@ -91,6 +95,7 @@ GEM minitest (~> 5.0) mutex_m (0.3.0) netrc (0.11.0) + openssl (3.2.0) parallel (1.27.0) parser (3.3.10.0) ast (~> 2.4.1) @@ -207,11 +212,13 @@ PLATFORMS DEPENDENCIES async + jwt minitest minitest-focus minitest-hooks minitest-proveit minitest-rg + openssl rake rbs redcarpet