Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"standardwebhooks": ">= 1.0"
}
},
"originGitCommit": "22b3e2486cd3162724999db3ec87536875f54cce",
"originGitCommit": "773623581af8feff5f48dd06991be2cacc1828f5",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "1.0.14",
Expand Down
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

209 changes: 60 additions & 149 deletions lib/whop_sdk.rb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/whop_sdk/ad_campaigns/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ def delete(request_options: {}, **params)
end

# Updates an ad campaign's editable fields (title, budget, schedule, bid strategy, special ad categories, and,
# before launch, budget optimization), and launches a draft campaign by setting status to active. Objective,
# budget type and desired cost per result are fixed at creation and cannot be changed.
# before launch, budget type and budget optimization), and launches a draft campaign by setting status to active.
# Objective and desired cost per result are fixed at creation and cannot be changed.
#
# @param request_options [Hash]
# @param params [Whop_sdk::AdCampaigns::Types::UpdateAdCampaignsRequest]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class UpdateAdCampaignsRequest < Internal::Types::Model

field :budget_optimization, -> { Whop_sdk::AdCampaigns::Types::UpdateAdCampaignsRequestBudgetOptimization }, optional: true, nullable: false

field :budget_type, -> { Whop_sdk::AdCampaigns::Types::UpdateAdCampaignsRequestBudgetType }, optional: true, nullable: false

field :ends_at, -> { String }, optional: true, nullable: false

field :special_ad_categories, -> { Internal::Types::Array[Whop_sdk::AdCampaigns::Types::UpdateAdCampaignsRequestSpecialAdCategoriesItem] }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module Whop_sdk
module AdCampaigns
module Types
module UpdateAdCampaignsRequestBudgetType
extend Whop_sdk::Internal::Types::Enum

DAILY = "daily"
LIFETIME = "lifetime"
end
end
end
end
4 changes: 2 additions & 2 deletions lib/whop_sdk/ads/types/create_ads_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class CreateAdsRequest < Internal::Types::Model

field :descriptions, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :existing_post_id, -> { String }, optional: true, nullable: false

field :headlines, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :lead_form, -> { Whop_sdk::Ads::Types::CreateAdsRequestLeadForm }, optional: true, nullable: false
Expand All @@ -24,8 +26,6 @@ class CreateAdsRequest < Internal::Types::Model

field :multi_advertiser_ads, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :post_id, -> { String }, optional: true, nullable: false

field :post_source, -> { Whop_sdk::Ads::Types::CreateAdsRequestPostSource }, optional: true, nullable: false

field :primary_texts, -> { Internal::Types::Array[String] }, optional: true, nullable: false
Expand Down
4 changes: 2 additions & 2 deletions lib/whop_sdk/ads/types/update_ads_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class UpdateAdsRequest < Internal::Types::Model

field :descriptions, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :existing_post_id, -> { String }, optional: true, nullable: false

field :headlines, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :lead_form, -> { Whop_sdk::Ads::Types::UpdateAdsRequestLeadForm }, optional: true, nullable: false
Expand All @@ -22,8 +24,6 @@ class UpdateAdsRequest < Internal::Types::Model

field :multi_advertiser_ads, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :post_id, -> { String }, optional: true, nullable: false

field :post_source, -> { Whop_sdk::Ads::Types::UpdateAdsRequestPostSource }, optional: true, nullable: false

field :primary_texts, -> { Internal::Types::Array[String] }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module CreateAPIKeysRequestAPIVersionDate
TWO_THOUSAND_TWENTY_SIX0814 = "2026-08-14"
TWO_THOUSAND_TWENTY_SIX0821 = "2026-08-21"
TWO_THOUSAND_TWENTY_SIX08211 = "2026-08-21-1"
TWO_THOUSAND_TWENTY_SIX0825 = "2026-08-25"
TWO_THOUSAND_TWENTY_SIX08251 = "2026-08-25-1"
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module UpdateAPIKeysRequestAPIVersionDate
TWO_THOUSAND_TWENTY_SIX0814 = "2026-08-14"
TWO_THOUSAND_TWENTY_SIX0821 = "2026-08-21"
TWO_THOUSAND_TWENTY_SIX08211 = "2026-08-21-1"
TWO_THOUSAND_TWENTY_SIX0825 = "2026-08-25"
TWO_THOUSAND_TWENTY_SIX08251 = "2026-08-25-1"
end
end
end
Expand Down
52 changes: 0 additions & 52 deletions lib/whop_sdk/checkout_sessions/client.rb

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 1 addition & 11 deletions lib/whop_sdk/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Client
# @param max_retries [Integer]
#
# @return [void]
def initialize(token:, base_url: nil, api_version_date: "2026-08-21-1", idempotency_key: nil, max_retries: 2)
def initialize(token:, base_url: nil, api_version_date: "2026-08-25-1", idempotency_key: nil, max_retries: 2)
headers = {
"X-Fern-Language" => "Ruby",
Authorization: "Bearer #{token}",
Expand Down Expand Up @@ -124,11 +124,6 @@ def checkout_configurations
@checkout_configurations ||= Whop_sdk::CheckoutConfigurations::Client.new(client: @raw_client)
end

# @return [Whop_sdk::CheckoutSessions::Client]
def checkout_sessions
@checkout_sessions ||= Whop_sdk::CheckoutSessions::Client.new(client: @raw_client)
end

# @return [Whop_sdk::Companies::Client]
def companies
@companies ||= Whop_sdk::Companies::Client.new(client: @raw_client)
Expand Down Expand Up @@ -428,10 +423,5 @@ def verifications
def webhooks
@webhooks ||= Whop_sdk::Webhooks::Client.new(client: @raw_client)
end

# @return [Whop_sdk::Withdrawals::Client]
def withdrawals
@withdrawals ||= Whop_sdk::Withdrawals::Client.new(client: @raw_client)
end
end
end
64 changes: 64 additions & 0 deletions lib/whop_sdk/files/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,70 @@ def initialize(client:)
@client = client
end

# Returns the files with the given IDs, newest first — fetch a batch in one request instead of retrieving each
# file individually. Only files you created are returned; IDs that do not exist, or that another credential
# created, are omitted. A request for up to 100 IDs answers in a single page by default; a larger batch pages at
# up to 100 files per response — follow `page_info` with the same `file_ids` to walk the rest.
#
# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String, nil] :file_ids
# @option params [Whop_sdk::Files::Types::ListFilesRequestOrder, nil] :order
# @option params [Whop_sdk::Files::Types::ListFilesRequestDirection, nil] :direction
# @option params [Integer, nil] :first
# @option params [String, nil] :after
# @option params [Integer, nil] :last
# @option params [String, nil] :before
#
# @example
# client.files.list(file_ids: ["file_xxxxxxxxxxxxx"])
#
# @return [Whop_sdk::Files::Types::ListFilesResponse]
def list(request_options: {}, **params)
params = Whop_sdk::Internal::Types::Utils.normalize_keys(params)
query_params = {}
query_params["file_ids"] = params[:file_ids] if params.key?(:file_ids)
query_params["order"] = params[:order] if params.key?(:order)
query_params["direction"] = params[:direction] if params.key?(:direction)
query_params["first"] = params[:first] if params.key?(:first)
query_params["after"] = params[:after] if params.key?(:after)
query_params["last"] = params[:last] if params.key?(:last)
query_params["before"] = params[:before] if params.key?(:before)

Whop_sdk::Internal::CursorItemIterator.new(
cursor_field: :end_cursor,
item_field: :data,
initial_cursor: query_params["after"]
) do |next_cursor|
query_params["after"] = next_cursor
request = Whop_sdk::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "files",
query: query_params,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Whop_sdk::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
parsed_response = Whop_sdk::Files::Types::ListFilesResponse.load(response.body)
[parsed_response, response]
else
error_class = Whop_sdk::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end
end

# Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to `upload_url`
# (single-part), or to each of `multipart_upload_urls` and then call Complete File Multipart Upload. Once the
# bytes land the file becomes `ready`, and its ID can be attached wherever a file is accepted — account legal
Expand Down
23 changes: 23 additions & 0 deletions lib/whop_sdk/files/types/list_files_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module Whop_sdk
module Files
module Types
class ListFilesRequest < Internal::Types::Model
field :file_ids, -> { String }, optional: true, nullable: false

field :order, -> { Whop_sdk::Files::Types::ListFilesRequestOrder }, optional: true, nullable: false

field :direction, -> { Whop_sdk::Files::Types::ListFilesRequestDirection }, optional: true, nullable: false

field :first, -> { Integer }, optional: true, nullable: false

field :after, -> { String }, optional: true, nullable: false

field :last, -> { Integer }, optional: true, nullable: false

field :before, -> { String }, optional: true, nullable: false
end
end
end
end
14 changes: 14 additions & 0 deletions lib/whop_sdk/files/types/list_files_request_direction.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module Whop_sdk
module Files
module Types
module ListFilesRequestDirection
extend Whop_sdk::Internal::Types::Enum

ASC = "asc"
DESC = "desc"
end
end
end
end
13 changes: 13 additions & 0 deletions lib/whop_sdk/files/types/list_files_request_order.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Whop_sdk
module Files
module Types
module ListFilesRequestOrder
extend Whop_sdk::Internal::Types::Enum

CREATED_AT = "created_at"
end
end
end
end
Loading
Loading