whop_sdk 0.0.37 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +61 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +76 -10
- data/lib/whop_sdk/helpers/verify_user_token.rb +166 -34
- data/lib/whop_sdk/models/ad_campaign_list_params.rb +101 -0
- data/lib/whop_sdk/models/ad_campaign_list_response.rb +126 -0
- data/lib/whop_sdk/models/ad_campaign_pause_params.rb +20 -0
- data/lib/whop_sdk/models/ad_campaign_pause_response.rb +328 -0
- data/lib/whop_sdk/models/ad_campaign_retrieve_params.rb +20 -0
- data/lib/whop_sdk/models/ad_campaign_retrieve_response.rb +328 -0
- data/lib/whop_sdk/models/ad_campaign_unpause_params.rb +20 -0
- data/lib/whop_sdk/models/ad_campaign_unpause_response.rb +328 -0
- data/lib/whop_sdk/models/ad_campaign_update_params.rb +33 -0
- data/lib/whop_sdk/models/ad_campaign_update_response.rb +328 -0
- data/lib/whop_sdk/models/ad_group_delete_params.rb +20 -0
- data/lib/whop_sdk/models/ad_group_delete_response.rb +8 -0
- data/lib/whop_sdk/models/ad_group_list_params.rb +109 -0
- data/lib/whop_sdk/models/ad_group_list_response.rb +118 -0
- data/lib/whop_sdk/models/ad_group_retrieve_params.rb +20 -0
- data/lib/whop_sdk/models/ad_group_retrieve_response.rb +140 -0
- data/lib/whop_sdk/models/ad_group_update_params.rb +3207 -0
- data/lib/whop_sdk/models/ad_group_update_response.rb +140 -0
- data/lib/whop_sdk/models/ad_list_params.rb +115 -0
- data/lib/whop_sdk/models/ad_list_response.rb +89 -0
- data/lib/whop_sdk/models/ad_report_retrieve_params.rb +77 -0
- data/lib/whop_sdk/models/ad_report_retrieve_response.rb +312 -0
- data/lib/whop_sdk/models/ad_retrieve_params.rb +20 -0
- data/lib/whop_sdk/models/ad_retrieve_response.rb +133 -0
- data/lib/whop_sdk/models/authorized_user_roles.rb +1 -0
- data/lib/whop_sdk/models/bounty_create_params.rb +105 -0
- data/lib/whop_sdk/models/bounty_create_response.rb +126 -0
- data/lib/whop_sdk/models/bounty_list_params.rb +85 -0
- data/lib/whop_sdk/models/bounty_list_response.rb +126 -0
- data/lib/whop_sdk/models/bounty_retrieve_params.rb +20 -0
- data/lib/whop_sdk/models/bounty_retrieve_response.rb +126 -0
- data/lib/whop_sdk/models/checkout_configuration.rb +20 -2
- data/lib/whop_sdk/models/checkout_configuration_create_params.rb +97 -23
- data/lib/whop_sdk/models/checkout_configuration_list_response.rb +20 -2
- data/lib/whop_sdk/models/company_create_api_key_params.rb +109 -0
- data/lib/whop_sdk/models/company_create_api_key_response.rb +35 -0
- data/lib/whop_sdk/models/conversion_create_params.rb +462 -0
- data/lib/whop_sdk/models/conversion_create_response.rb +19 -0
- data/lib/whop_sdk/models/currency.rb +1 -0
- data/lib/whop_sdk/models/file_create_params.rb +22 -1
- data/lib/whop_sdk/models/file_create_response.rb +26 -3
- data/lib/whop_sdk/models/file_retrieve_response.rb +26 -3
- data/lib/whop_sdk/models/forum_post_list_params.rb +9 -1
- data/lib/whop_sdk/models/forum_update_params.rb +10 -1
- data/lib/whop_sdk/models/invoice_create_params.rb +36 -18
- data/lib/whop_sdk/models/invoice_update_params.rb +29 -7
- data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +2 -2
- data/lib/whop_sdk/models/membership.rb +11 -1
- data/lib/whop_sdk/models/membership_list_response.rb +11 -1
- data/lib/whop_sdk/models/payment.rb +47 -2
- data/lib/whop_sdk/models/payment_list_response.rb +29 -2
- data/lib/whop_sdk/models/payment_method_types.rb +16 -0
- data/lib/whop_sdk/models/payment_refund_params.rb +4 -3
- data/lib/whop_sdk/models/payout_account_retrieve_response.rb +2 -2
- data/lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb +2 -2
- data/lib/whop_sdk/models/plan.rb +12 -3
- data/lib/whop_sdk/models/plan_create_params.rb +26 -6
- data/lib/whop_sdk/models/plan_list_response.rb +12 -3
- data/lib/whop_sdk/models/plan_update_params.rb +26 -6
- data/lib/whop_sdk/models/support_channel_list_params.rb +31 -9
- data/lib/whop_sdk/models/user_retrieve_params.rb +14 -1
- data/lib/whop_sdk/models/{user_update_profile_params.rb → user_update_params.rb} +24 -7
- data/lib/whop_sdk/models/verification_list_response.rb +2 -2
- data/lib/whop_sdk/models/verification_retrieve_response.rb +2 -2
- data/lib/whop_sdk/models/verification_status.rb +1 -0
- data/lib/whop_sdk/models/verification_succeeded_webhook_event.rb +2 -2
- data/lib/whop_sdk/models.rb +35 -1
- data/lib/whop_sdk/resources/ad_campaigns.rb +163 -0
- data/lib/whop_sdk/resources/ad_groups.rb +151 -0
- data/lib/whop_sdk/resources/ad_reports.rb +59 -0
- data/lib/whop_sdk/resources/ads.rb +88 -0
- data/lib/whop_sdk/resources/bounties.rb +124 -0
- data/lib/whop_sdk/resources/companies.rb +34 -0
- data/lib/whop_sdk/resources/conversions.rb +67 -0
- data/lib/whop_sdk/resources/files.rb +3 -1
- data/lib/whop_sdk/resources/forum_posts.rb +3 -1
- data/lib/whop_sdk/resources/forums.rb +3 -1
- data/lib/whop_sdk/resources/invoices.rb +9 -2
- data/lib/whop_sdk/resources/payments.rb +1 -1
- data/lib/whop_sdk/resources/plans.rb +6 -2
- data/lib/whop_sdk/resources/support_channels.rb +6 -4
- data/lib/whop_sdk/resources/users.rb +49 -37
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +41 -1
- data/rbi/whop_sdk/client.rbi +24 -0
- data/rbi/whop_sdk/models/ad_campaign_list_params.rbi +142 -0
- data/rbi/whop_sdk/models/ad_campaign_list_response.rbi +239 -0
- data/rbi/whop_sdk/models/ad_campaign_pause_params.rbi +35 -0
- data/rbi/whop_sdk/models/ad_campaign_pause_response.rbi +668 -0
- data/rbi/whop_sdk/models/ad_campaign_retrieve_params.rbi +35 -0
- data/rbi/whop_sdk/models/ad_campaign_retrieve_response.rbi +679 -0
- data/rbi/whop_sdk/models/ad_campaign_unpause_params.rbi +35 -0
- data/rbi/whop_sdk/models/ad_campaign_unpause_response.rbi +675 -0
- data/rbi/whop_sdk/models/ad_campaign_update_params.rbi +51 -0
- data/rbi/whop_sdk/models/ad_campaign_update_response.rbi +670 -0
- data/rbi/whop_sdk/models/ad_group_delete_params.rbi +35 -0
- data/rbi/whop_sdk/models/ad_group_delete_response.rbi +8 -0
- data/rbi/whop_sdk/models/ad_group_list_params.rbi +145 -0
- data/rbi/whop_sdk/models/ad_group_list_response.rbi +228 -0
- data/rbi/whop_sdk/models/ad_group_retrieve_params.rbi +35 -0
- data/rbi/whop_sdk/models/ad_group_retrieve_response.rbi +277 -0
- data/rbi/whop_sdk/models/ad_group_update_params.rbi +6133 -0
- data/rbi/whop_sdk/models/ad_group_update_response.rbi +274 -0
- data/rbi/whop_sdk/models/ad_list_params.rbi +146 -0
- data/rbi/whop_sdk/models/ad_list_response.rbi +146 -0
- data/rbi/whop_sdk/models/ad_report_retrieve_params.rbi +99 -0
- data/rbi/whop_sdk/models/ad_report_retrieve_response.rbi +629 -0
- data/rbi/whop_sdk/models/ad_retrieve_params.rbi +35 -0
- data/rbi/whop_sdk/models/ad_retrieve_response.rbi +245 -0
- data/rbi/whop_sdk/models/authorized_user_roles.rbi +2 -0
- data/rbi/whop_sdk/models/bounty_create_params.rbi +129 -0
- data/rbi/whop_sdk/models/bounty_create_response.rbi +196 -0
- data/rbi/whop_sdk/models/bounty_list_params.rbi +115 -0
- data/rbi/whop_sdk/models/bounty_list_response.rbi +189 -0
- data/rbi/whop_sdk/models/bounty_retrieve_params.rbi +35 -0
- data/rbi/whop_sdk/models/bounty_retrieve_response.rbi +199 -0
- data/rbi/whop_sdk/models/checkout_configuration.rbi +20 -0
- data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +84 -16
- data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +20 -0
- data/rbi/whop_sdk/models/company_create_api_key_params.rbi +184 -0
- data/rbi/whop_sdk/models/company_create_api_key_response.rbi +51 -0
- data/rbi/whop_sdk/models/conversion_create_params.rbi +661 -0
- data/rbi/whop_sdk/models/conversion_create_response.rbi +31 -0
- data/rbi/whop_sdk/models/currency.rbi +1 -0
- data/rbi/whop_sdk/models/file_create_params.rbi +41 -1
- data/rbi/whop_sdk/models/file_create_response.rbi +52 -5
- data/rbi/whop_sdk/models/file_retrieve_response.rbi +53 -5
- data/rbi/whop_sdk/models/forum_post_list_params.rbi +8 -0
- data/rbi/whop_sdk/models/forum_update_params.rbi +10 -0
- data/rbi/whop_sdk/models/invoice_create_params.rbi +46 -26
- data/rbi/whop_sdk/models/invoice_update_params.rbi +28 -6
- data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +2 -2
- data/rbi/whop_sdk/models/membership.rbi +12 -0
- data/rbi/whop_sdk/models/membership_list_response.rbi +12 -0
- data/rbi/whop_sdk/models/payment.rbi +57 -3
- data/rbi/whop_sdk/models/payment_list_response.rbi +37 -3
- data/rbi/whop_sdk/models/payment_method_types.rbi +31 -0
- data/rbi/whop_sdk/models/payment_refund_params.rbi +6 -4
- data/rbi/whop_sdk/models/payout_account_retrieve_response.rbi +2 -2
- data/rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi +2 -2
- data/rbi/whop_sdk/models/plan.rbi +12 -2
- data/rbi/whop_sdk/models/plan_create_params.rbi +22 -4
- data/rbi/whop_sdk/models/plan_list_response.rbi +12 -2
- data/rbi/whop_sdk/models/plan_update_params.rbi +22 -4
- data/rbi/whop_sdk/models/support_channel_list_params.rbi +50 -8
- data/rbi/whop_sdk/models/user_retrieve_params.rbi +18 -2
- data/rbi/whop_sdk/models/{user_update_profile_params.rbi → user_update_params.rbi} +25 -9
- data/rbi/whop_sdk/models/verification_list_response.rbi +2 -2
- data/rbi/whop_sdk/models/verification_retrieve_response.rbi +2 -2
- data/rbi/whop_sdk/models/verification_status.rbi +2 -0
- data/rbi/whop_sdk/models/verification_succeeded_webhook_event.rbi +2 -2
- data/rbi/whop_sdk/models.rbi +35 -1
- data/rbi/whop_sdk/resources/ad_campaigns.rbi +134 -0
- data/rbi/whop_sdk/resources/ad_groups.rbi +139 -0
- data/rbi/whop_sdk/resources/ad_reports.rbi +55 -0
- data/rbi/whop_sdk/resources/ads.rbi +81 -0
- data/rbi/whop_sdk/resources/bounties.rbi +116 -0
- data/rbi/whop_sdk/resources/companies.rbi +32 -0
- data/rbi/whop_sdk/resources/conversions.rbi +71 -0
- data/rbi/whop_sdk/resources/files.rbi +5 -0
- data/rbi/whop_sdk/resources/forum_posts.rbi +3 -0
- data/rbi/whop_sdk/resources/forums.rbi +4 -0
- data/rbi/whop_sdk/resources/invoices.rbi +10 -1
- data/rbi/whop_sdk/resources/payments.rbi +3 -2
- data/rbi/whop_sdk/resources/plans.rbi +6 -0
- data/rbi/whop_sdk/resources/support_channels.rbi +8 -3
- data/rbi/whop_sdk/resources/users.rbi +42 -29
- data/sig/whop_sdk/client.rbs +12 -0
- data/sig/whop_sdk/models/ad_campaign_list_params.rbs +82 -0
- data/sig/whop_sdk/models/ad_campaign_list_response.rbs +98 -0
- data/sig/whop_sdk/models/ad_campaign_pause_params.rbs +20 -0
- data/sig/whop_sdk/models/ad_campaign_pause_response.rbs +232 -0
- data/sig/whop_sdk/models/ad_campaign_retrieve_params.rbs +20 -0
- data/sig/whop_sdk/models/ad_campaign_retrieve_response.rbs +232 -0
- data/sig/whop_sdk/models/ad_campaign_unpause_params.rbs +20 -0
- data/sig/whop_sdk/models/ad_campaign_unpause_response.rbs +232 -0
- data/sig/whop_sdk/models/ad_campaign_update_params.rbs +28 -0
- data/sig/whop_sdk/models/ad_campaign_update_response.rbs +232 -0
- data/sig/whop_sdk/models/ad_group_delete_params.rbs +20 -0
- data/sig/whop_sdk/models/ad_group_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/ad_group_list_params.rbs +87 -0
- data/sig/whop_sdk/models/ad_group_list_response.rbs +93 -0
- data/sig/whop_sdk/models/ad_group_retrieve_params.rbs +20 -0
- data/sig/whop_sdk/models/ad_group_retrieve_response.rbs +108 -0
- data/sig/whop_sdk/models/ad_group_update_params.rbs +2439 -0
- data/sig/whop_sdk/models/ad_group_update_response.rbs +108 -0
- data/sig/whop_sdk/models/ad_list_params.rbs +87 -0
- data/sig/whop_sdk/models/ad_list_response.rbs +72 -0
- data/sig/whop_sdk/models/ad_report_retrieve_params.rbs +56 -0
- data/sig/whop_sdk/models/ad_report_retrieve_response.rbs +278 -0
- data/sig/whop_sdk/models/ad_retrieve_params.rbs +20 -0
- data/sig/whop_sdk/models/ad_retrieve_response.rbs +102 -0
- data/sig/whop_sdk/models/authorized_user_roles.rbs +2 -0
- data/sig/whop_sdk/models/bounty_create_params.rbs +71 -0
- data/sig/whop_sdk/models/bounty_create_response.rbs +93 -0
- data/sig/whop_sdk/models/bounty_list_params.rbs +67 -0
- data/sig/whop_sdk/models/bounty_list_response.rbs +93 -0
- data/sig/whop_sdk/models/bounty_retrieve_params.rbs +20 -0
- data/sig/whop_sdk/models/bounty_retrieve_response.rbs +93 -0
- data/sig/whop_sdk/models/checkout_configuration.rbs +10 -0
- data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +51 -16
- data/sig/whop_sdk/models/checkout_configuration_list_response.rbs +10 -0
- data/sig/whop_sdk/models/company_create_api_key_params.rbs +83 -0
- data/sig/whop_sdk/models/company_create_api_key_response.rbs +18 -0
- data/sig/whop_sdk/models/conversion_create_params.rbs +349 -0
- data/sig/whop_sdk/models/conversion_create_response.rbs +13 -0
- data/sig/whop_sdk/models/currency.rbs +2 -0
- data/sig/whop_sdk/models/file_create_params.rbs +20 -1
- data/sig/whop_sdk/models/file_create_response.rbs +19 -3
- data/sig/whop_sdk/models/file_retrieve_response.rbs +19 -3
- data/sig/whop_sdk/models/forum_post_list_params.rbs +5 -0
- data/sig/whop_sdk/models/forum_update_params.rbs +5 -0
- data/sig/whop_sdk/models/invoice_create_params.rbs +24 -14
- data/sig/whop_sdk/models/invoice_update_params.rbs +15 -5
- data/sig/whop_sdk/models/membership.rbs +5 -0
- data/sig/whop_sdk/models/membership_list_response.rbs +5 -0
- data/sig/whop_sdk/models/payment.rbs +25 -3
- data/sig/whop_sdk/models/payment_list_response.rbs +15 -3
- data/sig/whop_sdk/models/payment_method_types.rbs +32 -0
- data/sig/whop_sdk/models/plan.rbs +5 -0
- data/sig/whop_sdk/models/plan_create_params.rbs +14 -4
- data/sig/whop_sdk/models/plan_list_response.rbs +5 -0
- data/sig/whop_sdk/models/plan_update_params.rbs +14 -4
- data/sig/whop_sdk/models/support_channel_list_params.rbs +23 -6
- data/sig/whop_sdk/models/user_retrieve_params.rbs +10 -2
- data/sig/whop_sdk/models/{user_update_profile_params.rbs → user_update_params.rbs} +16 -6
- data/sig/whop_sdk/models/verification_status.rbs +2 -0
- data/sig/whop_sdk/models.rbs +35 -1
- data/sig/whop_sdk/resources/ad_campaigns.rbs +41 -0
- data/sig/whop_sdk/resources/ad_groups.rbs +40 -0
- data/sig/whop_sdk/resources/ad_reports.rbs +18 -0
- data/sig/whop_sdk/resources/ads.rbs +26 -0
- data/sig/whop_sdk/resources/bounties.rbs +37 -0
- data/sig/whop_sdk/resources/companies.rbs +9 -0
- data/sig/whop_sdk/resources/conversions.rbs +25 -0
- data/sig/whop_sdk/resources/files.rbs +1 -0
- data/sig/whop_sdk/resources/forum_posts.rbs +1 -0
- data/sig/whop_sdk/resources/forums.rbs +1 -0
- data/sig/whop_sdk/resources/invoices.rbs +2 -0
- data/sig/whop_sdk/resources/plans.rbs +2 -0
- data/sig/whop_sdk/resources/support_channels.rbs +2 -1
- data/sig/whop_sdk/resources/users.rbs +11 -8
- metadata +125 -5
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Resources
|
|
5
|
+
# Ad campaigns
|
|
6
|
+
class AdCampaigns
|
|
7
|
+
# Retrieves a single ad campaign by its unique identifier.
|
|
8
|
+
#
|
|
9
|
+
# Required permissions:
|
|
10
|
+
#
|
|
11
|
+
# - `ad_campaign:basic:read`
|
|
12
|
+
#
|
|
13
|
+
# @overload retrieve(id, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param id [String] The unique identifier of the ad campaign.
|
|
16
|
+
#
|
|
17
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
18
|
+
#
|
|
19
|
+
# @return [WhopSDK::Models::AdCampaignRetrieveResponse]
|
|
20
|
+
#
|
|
21
|
+
# @see WhopSDK::Models::AdCampaignRetrieveParams
|
|
22
|
+
def retrieve(id, params = {})
|
|
23
|
+
@client.request(
|
|
24
|
+
method: :get,
|
|
25
|
+
path: ["ad_campaigns/%1$s", id],
|
|
26
|
+
model: WhopSDK::Models::AdCampaignRetrieveResponse,
|
|
27
|
+
options: params[:request_options]
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Some parameter documentations has been truncated, see
|
|
32
|
+
# {WhopSDK::Models::AdCampaignUpdateParams} for more details.
|
|
33
|
+
#
|
|
34
|
+
# Updates an ad campaign synchronously.
|
|
35
|
+
#
|
|
36
|
+
# Required permissions:
|
|
37
|
+
#
|
|
38
|
+
# - `ad_campaign:update`
|
|
39
|
+
#
|
|
40
|
+
# @overload update(id, budget: nil, request_options: {})
|
|
41
|
+
#
|
|
42
|
+
# @param id [String] The unique identifier of the ad campaign to update.
|
|
43
|
+
#
|
|
44
|
+
# @param budget [Float, nil] The campaign budget in dollars. The interpretation (daily or lifetime) follows t
|
|
45
|
+
#
|
|
46
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
47
|
+
#
|
|
48
|
+
# @return [WhopSDK::Models::AdCampaignUpdateResponse]
|
|
49
|
+
#
|
|
50
|
+
# @see WhopSDK::Models::AdCampaignUpdateParams
|
|
51
|
+
def update(id, params = {})
|
|
52
|
+
parsed, options = WhopSDK::AdCampaignUpdateParams.dump_request(params)
|
|
53
|
+
@client.request(
|
|
54
|
+
method: :patch,
|
|
55
|
+
path: ["ad_campaigns/%1$s", id],
|
|
56
|
+
body: parsed,
|
|
57
|
+
model: WhopSDK::Models::AdCampaignUpdateResponse,
|
|
58
|
+
options: options
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Returns a paginated list of ad campaigns for a company, with optional filtering
|
|
63
|
+
# by status, and creation date.
|
|
64
|
+
#
|
|
65
|
+
# Required permissions:
|
|
66
|
+
#
|
|
67
|
+
# - `ad_campaign:basic:read`
|
|
68
|
+
#
|
|
69
|
+
# @overload list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, first: nil, last: nil, query: nil, status: nil, request_options: {})
|
|
70
|
+
#
|
|
71
|
+
# @param company_id [String] The unique identifier of the company to list ad campaigns for.
|
|
72
|
+
#
|
|
73
|
+
# @param after [String, nil] Returns the elements in the list that come after the specified cursor.
|
|
74
|
+
#
|
|
75
|
+
# @param before [String, nil] Returns the elements in the list that come before the specified cursor.
|
|
76
|
+
#
|
|
77
|
+
# @param created_after [Time, nil] Only return ad campaigns created after this timestamp.
|
|
78
|
+
#
|
|
79
|
+
# @param created_before [Time, nil] Only return ad campaigns created before this timestamp.
|
|
80
|
+
#
|
|
81
|
+
# @param first [Integer, nil] Returns the first _n_ elements from the list.
|
|
82
|
+
#
|
|
83
|
+
# @param last [Integer, nil] Returns the last _n_ elements from the list.
|
|
84
|
+
#
|
|
85
|
+
# @param query [String, nil] Case-insensitive substring match against the campaign title.
|
|
86
|
+
#
|
|
87
|
+
# @param status [Symbol, WhopSDK::Models::AdCampaignListParams::Status, nil] The status of an ad campaign.
|
|
88
|
+
#
|
|
89
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
90
|
+
#
|
|
91
|
+
# @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::AdCampaignListResponse>]
|
|
92
|
+
#
|
|
93
|
+
# @see WhopSDK::Models::AdCampaignListParams
|
|
94
|
+
def list(params)
|
|
95
|
+
parsed, options = WhopSDK::AdCampaignListParams.dump_request(params)
|
|
96
|
+
query = WhopSDK::Internal::Util.encode_query_params(parsed)
|
|
97
|
+
@client.request(
|
|
98
|
+
method: :get,
|
|
99
|
+
path: "ad_campaigns",
|
|
100
|
+
query: query,
|
|
101
|
+
page: WhopSDK::Internal::CursorPage,
|
|
102
|
+
model: WhopSDK::Models::AdCampaignListResponse,
|
|
103
|
+
options: options
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Pauses an ad campaign, optionally until a specific date.
|
|
108
|
+
#
|
|
109
|
+
# Required permissions:
|
|
110
|
+
#
|
|
111
|
+
# - `ad_campaign:update`
|
|
112
|
+
#
|
|
113
|
+
# @overload pause(id, request_options: {})
|
|
114
|
+
#
|
|
115
|
+
# @param id [String] The unique identifier of the ad campaign to pause.
|
|
116
|
+
#
|
|
117
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
118
|
+
#
|
|
119
|
+
# @return [WhopSDK::Models::AdCampaignPauseResponse]
|
|
120
|
+
#
|
|
121
|
+
# @see WhopSDK::Models::AdCampaignPauseParams
|
|
122
|
+
def pause(id, params = {})
|
|
123
|
+
@client.request(
|
|
124
|
+
method: :post,
|
|
125
|
+
path: ["ad_campaigns/%1$s/pause", id],
|
|
126
|
+
model: WhopSDK::Models::AdCampaignPauseResponse,
|
|
127
|
+
options: params[:request_options]
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Resumes a paused ad campaign.
|
|
132
|
+
#
|
|
133
|
+
# Required permissions:
|
|
134
|
+
#
|
|
135
|
+
# - `ad_campaign:update`
|
|
136
|
+
#
|
|
137
|
+
# @overload unpause(id, request_options: {})
|
|
138
|
+
#
|
|
139
|
+
# @param id [String] The unique identifier of the ad campaign to unpause.
|
|
140
|
+
#
|
|
141
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
142
|
+
#
|
|
143
|
+
# @return [WhopSDK::Models::AdCampaignUnpauseResponse]
|
|
144
|
+
#
|
|
145
|
+
# @see WhopSDK::Models::AdCampaignUnpauseParams
|
|
146
|
+
def unpause(id, params = {})
|
|
147
|
+
@client.request(
|
|
148
|
+
method: :post,
|
|
149
|
+
path: ["ad_campaigns/%1$s/unpause", id],
|
|
150
|
+
model: WhopSDK::Models::AdCampaignUnpauseResponse,
|
|
151
|
+
options: params[:request_options]
|
|
152
|
+
)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# @api private
|
|
156
|
+
#
|
|
157
|
+
# @param client [WhopSDK::Client]
|
|
158
|
+
def initialize(client:)
|
|
159
|
+
@client = client
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Resources
|
|
5
|
+
# Ad groups
|
|
6
|
+
class AdGroups
|
|
7
|
+
# Retrieves a single ad group by its unique identifier.
|
|
8
|
+
#
|
|
9
|
+
# Required permissions:
|
|
10
|
+
#
|
|
11
|
+
# - `ad_campaign:basic:read`
|
|
12
|
+
#
|
|
13
|
+
# @overload retrieve(id, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param id [String] The unique identifier of the ad group.
|
|
16
|
+
#
|
|
17
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
18
|
+
#
|
|
19
|
+
# @return [WhopSDK::Models::AdGroupRetrieveResponse]
|
|
20
|
+
#
|
|
21
|
+
# @see WhopSDK::Models::AdGroupRetrieveParams
|
|
22
|
+
def retrieve(id, params = {})
|
|
23
|
+
@client.request(
|
|
24
|
+
method: :get,
|
|
25
|
+
path: ["ad_groups/%1$s", id],
|
|
26
|
+
model: WhopSDK::Models::AdGroupRetrieveResponse,
|
|
27
|
+
options: params[:request_options]
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Updates an existing ad group.
|
|
32
|
+
#
|
|
33
|
+
# Required permissions:
|
|
34
|
+
#
|
|
35
|
+
# - `ad_campaign:update`
|
|
36
|
+
# - `ad_campaign:basic:read`
|
|
37
|
+
#
|
|
38
|
+
# @overload update(id, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, request_options: {})
|
|
39
|
+
#
|
|
40
|
+
# @param id [String] The unique identifier of the ad group to update.
|
|
41
|
+
#
|
|
42
|
+
# @param budget [Float, nil] Budget amount in dollars.
|
|
43
|
+
#
|
|
44
|
+
# @param budget_type [Symbol, WhopSDK::Models::AdGroupUpdateParams::BudgetType, nil] The budget type for an ad campaign or ad group.
|
|
45
|
+
#
|
|
46
|
+
# @param config [WhopSDK::Models::AdGroupUpdateParams::Config, nil] Unified ad group configuration (bidding, optimization, targeting).
|
|
47
|
+
#
|
|
48
|
+
# @param daily_budget [Float, nil] Daily budget in dollars.
|
|
49
|
+
#
|
|
50
|
+
# @param name [String, nil] Human-readable ad group name.
|
|
51
|
+
#
|
|
52
|
+
# @param platform_config [WhopSDK::Models::AdGroupUpdateParams::PlatformConfig, nil] Platform-specific ad group configuration.
|
|
53
|
+
#
|
|
54
|
+
# @param status [Symbol, WhopSDK::Models::AdGroupUpdateParams::Status, nil] The status of an external ad group.
|
|
55
|
+
#
|
|
56
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
57
|
+
#
|
|
58
|
+
# @return [WhopSDK::Models::AdGroupUpdateResponse]
|
|
59
|
+
#
|
|
60
|
+
# @see WhopSDK::Models::AdGroupUpdateParams
|
|
61
|
+
def update(id, params = {})
|
|
62
|
+
parsed, options = WhopSDK::AdGroupUpdateParams.dump_request(params)
|
|
63
|
+
@client.request(
|
|
64
|
+
method: :patch,
|
|
65
|
+
path: ["ad_groups/%1$s", id],
|
|
66
|
+
body: parsed,
|
|
67
|
+
model: WhopSDK::Models::AdGroupUpdateResponse,
|
|
68
|
+
options: options
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Returns a paginated list of ad groups scoped by campaign or company, with
|
|
73
|
+
# optional filtering by status and creation date.
|
|
74
|
+
#
|
|
75
|
+
# Required permissions:
|
|
76
|
+
#
|
|
77
|
+
# - `ad_campaign:basic:read`
|
|
78
|
+
#
|
|
79
|
+
# @overload list(after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, last: nil, query: nil, status: nil, request_options: {})
|
|
80
|
+
#
|
|
81
|
+
# @param after [String, nil] Returns the elements in the list that come after the specified cursor.
|
|
82
|
+
#
|
|
83
|
+
# @param before [String, nil] Returns the elements in the list that come before the specified cursor.
|
|
84
|
+
#
|
|
85
|
+
# @param campaign_id [String, nil] Filter by campaign. Provide exactly one of campaign_id or company_id.
|
|
86
|
+
#
|
|
87
|
+
# @param company_id [String, nil] Filter by company. Provide exactly one of campaign_id or company_id.
|
|
88
|
+
#
|
|
89
|
+
# @param created_after [Time, nil] Only return ad groups created after this timestamp.
|
|
90
|
+
#
|
|
91
|
+
# @param created_before [Time, nil] Only return ad groups created before this timestamp.
|
|
92
|
+
#
|
|
93
|
+
# @param first [Integer, nil] Returns the first _n_ elements from the list.
|
|
94
|
+
#
|
|
95
|
+
# @param last [Integer, nil] Returns the last _n_ elements from the list.
|
|
96
|
+
#
|
|
97
|
+
# @param query [String, nil] Case-insensitive substring match against the ad group name.
|
|
98
|
+
#
|
|
99
|
+
# @param status [Symbol, WhopSDK::Models::AdGroupListParams::Status, nil] The status of an external ad group.
|
|
100
|
+
#
|
|
101
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
102
|
+
#
|
|
103
|
+
# @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::AdGroupListResponse>]
|
|
104
|
+
#
|
|
105
|
+
# @see WhopSDK::Models::AdGroupListParams
|
|
106
|
+
def list(params = {})
|
|
107
|
+
parsed, options = WhopSDK::AdGroupListParams.dump_request(params)
|
|
108
|
+
query = WhopSDK::Internal::Util.encode_query_params(parsed)
|
|
109
|
+
@client.request(
|
|
110
|
+
method: :get,
|
|
111
|
+
path: "ad_groups",
|
|
112
|
+
query: query,
|
|
113
|
+
page: WhopSDK::Internal::CursorPage,
|
|
114
|
+
model: WhopSDK::Models::AdGroupListResponse,
|
|
115
|
+
options: options
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Soft-deletes an ad group.
|
|
120
|
+
#
|
|
121
|
+
# Required permissions:
|
|
122
|
+
#
|
|
123
|
+
# - `ad_campaign:update`
|
|
124
|
+
#
|
|
125
|
+
# @overload delete(id, request_options: {})
|
|
126
|
+
#
|
|
127
|
+
# @param id [String] The unique identifier of the ad group to delete.
|
|
128
|
+
#
|
|
129
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
130
|
+
#
|
|
131
|
+
# @return [Boolean]
|
|
132
|
+
#
|
|
133
|
+
# @see WhopSDK::Models::AdGroupDeleteParams
|
|
134
|
+
def delete(id, params = {})
|
|
135
|
+
@client.request(
|
|
136
|
+
method: :delete,
|
|
137
|
+
path: ["ad_groups/%1$s", id],
|
|
138
|
+
model: WhopSDK::Internal::Type::Boolean,
|
|
139
|
+
options: params[:request_options]
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# @api private
|
|
144
|
+
#
|
|
145
|
+
# @param client [WhopSDK::Client]
|
|
146
|
+
def initialize(client:)
|
|
147
|
+
@client = client
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Resources
|
|
5
|
+
# Ad reports
|
|
6
|
+
class AdReports
|
|
7
|
+
# Some parameter documentations has been truncated, see
|
|
8
|
+
# {WhopSDK::Models::AdReportRetrieveParams} for more details.
|
|
9
|
+
#
|
|
10
|
+
# Performance report for an ad campaign, ad group, or ad. Returns aggregate totals
|
|
11
|
+
# and an optional per-day breakdown. Exactly one of `adCampaignId`, `adGroupId`,
|
|
12
|
+
# or `adId` must be provided.
|
|
13
|
+
#
|
|
14
|
+
# Required permissions:
|
|
15
|
+
#
|
|
16
|
+
# - `ad_campaign:stats:read`
|
|
17
|
+
#
|
|
18
|
+
# @overload retrieve(from:, to:, ad_campaign_id: nil, ad_group_id: nil, ad_id: nil, currency: nil, include_daily: nil, request_options: {})
|
|
19
|
+
#
|
|
20
|
+
# @param from [Time] Inclusive start of the reporting window.
|
|
21
|
+
#
|
|
22
|
+
# @param to [Time] Inclusive end of the reporting window.
|
|
23
|
+
#
|
|
24
|
+
# @param ad_campaign_id [String, nil] The unique identifier of an ad campaign. Mutually exclusive with `adGroupId` and
|
|
25
|
+
#
|
|
26
|
+
# @param ad_group_id [String, nil] The unique identifier of an ad group. Mutually exclusive with `adCampaignId` and
|
|
27
|
+
#
|
|
28
|
+
# @param ad_id [String, nil] The unique identifier of an ad. Mutually exclusive with `adCampaignId` and `adGr
|
|
29
|
+
#
|
|
30
|
+
# @param currency [String, nil] ISO 4217 currency code to report `spend` in. Defaults to the company's ads repor
|
|
31
|
+
#
|
|
32
|
+
# @param include_daily [Boolean, nil] When true, includes a per-day breakdown alongside the summary.
|
|
33
|
+
#
|
|
34
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
35
|
+
#
|
|
36
|
+
# @return [WhopSDK::Models::AdReportRetrieveResponse]
|
|
37
|
+
#
|
|
38
|
+
# @see WhopSDK::Models::AdReportRetrieveParams
|
|
39
|
+
def retrieve(params)
|
|
40
|
+
parsed, options = WhopSDK::AdReportRetrieveParams.dump_request(params)
|
|
41
|
+
query = WhopSDK::Internal::Util.encode_query_params(parsed)
|
|
42
|
+
@client.request(
|
|
43
|
+
method: :get,
|
|
44
|
+
path: "ad_reports",
|
|
45
|
+
query: query,
|
|
46
|
+
model: WhopSDK::Models::AdReportRetrieveResponse,
|
|
47
|
+
options: options
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# @api private
|
|
52
|
+
#
|
|
53
|
+
# @param client [WhopSDK::Client]
|
|
54
|
+
def initialize(client:)
|
|
55
|
+
@client = client
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Resources
|
|
5
|
+
# Ads
|
|
6
|
+
class Ads
|
|
7
|
+
# Retrieve an ad by its unique identifier.
|
|
8
|
+
#
|
|
9
|
+
# Required permissions:
|
|
10
|
+
#
|
|
11
|
+
# - `ad_campaign:basic:read`
|
|
12
|
+
#
|
|
13
|
+
# @overload retrieve(id, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param id [String] The unique identifier of the ad.
|
|
16
|
+
#
|
|
17
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
18
|
+
#
|
|
19
|
+
# @return [WhopSDK::Models::AdRetrieveResponse]
|
|
20
|
+
#
|
|
21
|
+
# @see WhopSDK::Models::AdRetrieveParams
|
|
22
|
+
def retrieve(id, params = {})
|
|
23
|
+
@client.request(
|
|
24
|
+
method: :get,
|
|
25
|
+
path: ["ads/%1$s", id],
|
|
26
|
+
model: WhopSDK::Models::AdRetrieveResponse,
|
|
27
|
+
options: params[:request_options]
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Some parameter documentations has been truncated, see
|
|
32
|
+
# {WhopSDK::Models::AdListParams} for more details.
|
|
33
|
+
#
|
|
34
|
+
# List ads scoped by ad group, campaign, or company.
|
|
35
|
+
#
|
|
36
|
+
# Required permissions:
|
|
37
|
+
#
|
|
38
|
+
# - `ad_campaign:basic:read`
|
|
39
|
+
#
|
|
40
|
+
# @overload list(ad_group_id: nil, after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, last: nil, status: nil, request_options: {})
|
|
41
|
+
#
|
|
42
|
+
# @param ad_group_id [String, nil] Filter by ad group. Provide exactly one of ad*group_id, campaign_id, or company*
|
|
43
|
+
#
|
|
44
|
+
# @param after [String, nil] Returns the elements in the list that come after the specified cursor.
|
|
45
|
+
#
|
|
46
|
+
# @param before [String, nil] Returns the elements in the list that come before the specified cursor.
|
|
47
|
+
#
|
|
48
|
+
# @param campaign_id [String, nil] Filter by campaign. Provide exactly one of ad*group_id, campaign_id, or company*
|
|
49
|
+
#
|
|
50
|
+
# @param company_id [String, nil] Filter by company. Provide exactly one of ad_group_id, campaign_id, or company_i
|
|
51
|
+
#
|
|
52
|
+
# @param created_after [Time, nil] Only return ads created after this timestamp.
|
|
53
|
+
#
|
|
54
|
+
# @param created_before [Time, nil] Only return ads created before this timestamp.
|
|
55
|
+
#
|
|
56
|
+
# @param first [Integer, nil] Returns the first _n_ elements from the list.
|
|
57
|
+
#
|
|
58
|
+
# @param last [Integer, nil] Returns the last _n_ elements from the list.
|
|
59
|
+
#
|
|
60
|
+
# @param status [Symbol, WhopSDK::Models::AdListParams::Status, nil] The status of an external ad.
|
|
61
|
+
#
|
|
62
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
63
|
+
#
|
|
64
|
+
# @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::AdListResponse>]
|
|
65
|
+
#
|
|
66
|
+
# @see WhopSDK::Models::AdListParams
|
|
67
|
+
def list(params = {})
|
|
68
|
+
parsed, options = WhopSDK::AdListParams.dump_request(params)
|
|
69
|
+
query = WhopSDK::Internal::Util.encode_query_params(parsed)
|
|
70
|
+
@client.request(
|
|
71
|
+
method: :get,
|
|
72
|
+
path: "ads",
|
|
73
|
+
query: query,
|
|
74
|
+
page: WhopSDK::Internal::CursorPage,
|
|
75
|
+
model: WhopSDK::Models::AdListResponse,
|
|
76
|
+
options: options
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @api private
|
|
81
|
+
#
|
|
82
|
+
# @param client [WhopSDK::Client]
|
|
83
|
+
def initialize(client:)
|
|
84
|
+
@client = client
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Resources
|
|
5
|
+
# Bounties
|
|
6
|
+
class Bounties
|
|
7
|
+
# Some parameter documentations has been truncated, see
|
|
8
|
+
# {WhopSDK::Models::BountyCreateParams} for more details.
|
|
9
|
+
#
|
|
10
|
+
# Create a new workforce bounty by funding a dedicated bounty pool.
|
|
11
|
+
#
|
|
12
|
+
# Required permissions:
|
|
13
|
+
#
|
|
14
|
+
# - `bounty:create`
|
|
15
|
+
#
|
|
16
|
+
# @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: {})
|
|
17
|
+
#
|
|
18
|
+
# @param base_unit_amount [Float] The amount paid to each approved submission. The total bounty pool funded is thi
|
|
19
|
+
#
|
|
20
|
+
# @param currency [Symbol, WhopSDK::Models::Currency] The currency for the bounty pool funding amount.
|
|
21
|
+
#
|
|
22
|
+
# @param description [String] The description of the bounty.
|
|
23
|
+
#
|
|
24
|
+
# @param title [String] The title of the bounty.
|
|
25
|
+
#
|
|
26
|
+
# @param accepted_submissions_limit [Integer, nil] The number of submissions that can be approved before the bounty closes. Default
|
|
27
|
+
#
|
|
28
|
+
# @param allowed_country_codes [Array<String>, nil] The ISO3166 country codes where this bounty should be visible. Empty means globa
|
|
29
|
+
#
|
|
30
|
+
# @param experience_id [String, nil] An optional experience to scope the bounty to.
|
|
31
|
+
#
|
|
32
|
+
# @param origin_account_id [String, nil] The user (user*\*) or company (biz*\*) tag whose balance funds this bounty pool.
|
|
33
|
+
# D
|
|
34
|
+
#
|
|
35
|
+
# @param post_markdown_content [String, nil] Optional markdown body for the anchor forum post. Falls back to the bounty descr
|
|
36
|
+
#
|
|
37
|
+
# @param post_title [String, nil] Optional title for the anchor forum post. Falls back to the bounty title when om
|
|
38
|
+
#
|
|
39
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
40
|
+
#
|
|
41
|
+
# @return [WhopSDK::Models::BountyCreateResponse]
|
|
42
|
+
#
|
|
43
|
+
# @see WhopSDK::Models::BountyCreateParams
|
|
44
|
+
def create(params)
|
|
45
|
+
parsed, options = WhopSDK::BountyCreateParams.dump_request(params)
|
|
46
|
+
@client.request(
|
|
47
|
+
method: :post,
|
|
48
|
+
path: "bounties",
|
|
49
|
+
body: parsed,
|
|
50
|
+
model: WhopSDK::Models::BountyCreateResponse,
|
|
51
|
+
options: options
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Retrieves a workforce bounty for the current authenticated user.
|
|
56
|
+
#
|
|
57
|
+
# @overload retrieve(id, request_options: {})
|
|
58
|
+
#
|
|
59
|
+
# @param id [String] The unique identifier of the workforce bounty to retrieve.
|
|
60
|
+
#
|
|
61
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
62
|
+
#
|
|
63
|
+
# @return [WhopSDK::Models::BountyRetrieveResponse]
|
|
64
|
+
#
|
|
65
|
+
# @see WhopSDK::Models::BountyRetrieveParams
|
|
66
|
+
def retrieve(id, params = {})
|
|
67
|
+
@client.request(
|
|
68
|
+
method: :get,
|
|
69
|
+
path: ["bounties/%1$s", id],
|
|
70
|
+
model: WhopSDK::Models::BountyRetrieveResponse,
|
|
71
|
+
options: params[:request_options]
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Some parameter documentations has been truncated, see
|
|
76
|
+
# {WhopSDK::Models::BountyListParams} for more details.
|
|
77
|
+
#
|
|
78
|
+
# Returns a paginated list of workforce bounties. When experienceId is provided,
|
|
79
|
+
# returns bounties scoped to that experience. When omitted, returns bounties with
|
|
80
|
+
# no experience.
|
|
81
|
+
#
|
|
82
|
+
# @overload list(after: nil, before: nil, direction: nil, experience_id: nil, first: nil, last: nil, status: nil, request_options: {})
|
|
83
|
+
#
|
|
84
|
+
# @param after [String, nil] Returns the elements in the list that come after the specified cursor.
|
|
85
|
+
#
|
|
86
|
+
# @param before [String, nil] Returns the elements in the list that come before the specified cursor.
|
|
87
|
+
#
|
|
88
|
+
# @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort.
|
|
89
|
+
#
|
|
90
|
+
# @param experience_id [String, nil] The experience to list bounties for. When omitted, returns bounties with no expe
|
|
91
|
+
#
|
|
92
|
+
# @param first [Integer, nil] Returns the first _n_ elements from the list.
|
|
93
|
+
#
|
|
94
|
+
# @param last [Integer, nil] Returns the last _n_ elements from the list.
|
|
95
|
+
#
|
|
96
|
+
# @param status [Symbol, WhopSDK::Models::BountyListParams::Status, nil] The available bounty statuses to choose from.
|
|
97
|
+
#
|
|
98
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
99
|
+
#
|
|
100
|
+
# @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::BountyListResponse>]
|
|
101
|
+
#
|
|
102
|
+
# @see WhopSDK::Models::BountyListParams
|
|
103
|
+
def list(params = {})
|
|
104
|
+
parsed, options = WhopSDK::BountyListParams.dump_request(params)
|
|
105
|
+
query = WhopSDK::Internal::Util.encode_query_params(parsed)
|
|
106
|
+
@client.request(
|
|
107
|
+
method: :get,
|
|
108
|
+
path: "bounties",
|
|
109
|
+
query: query,
|
|
110
|
+
page: WhopSDK::Internal::CursorPage,
|
|
111
|
+
model: WhopSDK::Models::BountyListResponse,
|
|
112
|
+
options: options
|
|
113
|
+
)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# @api private
|
|
117
|
+
#
|
|
118
|
+
# @param client [WhopSDK::Client]
|
|
119
|
+
def initialize(client:)
|
|
120
|
+
@client = client
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -170,6 +170,40 @@ module WhopSDK
|
|
|
170
170
|
)
|
|
171
171
|
end
|
|
172
172
|
|
|
173
|
+
# Some parameter documentations has been truncated, see
|
|
174
|
+
# {WhopSDK::Models::CompanyCreateAPIKeyParams} for more details.
|
|
175
|
+
#
|
|
176
|
+
# Create an API key for a connected account (child company) owned by a parent
|
|
177
|
+
# company.
|
|
178
|
+
#
|
|
179
|
+
# @overload create_api_key(parent_company_id, child_company_id:, name: nil, permissions: nil, role: nil, request_options: {})
|
|
180
|
+
#
|
|
181
|
+
# @param parent_company_id [String] The unique identifier of the parent platform company (e.g. 'biz_xxx').
|
|
182
|
+
#
|
|
183
|
+
# @param child_company_id [String] The unique identifier of the connected account to create the API key for (e.g. '
|
|
184
|
+
#
|
|
185
|
+
# @param name [String, nil] A human-readable name for the API key, such as 'Production API Key'.
|
|
186
|
+
#
|
|
187
|
+
# @param permissions [Array<WhopSDK::Models::CompanyCreateAPIKeyParams::Permission>, nil] Granular permission statements defining which actions this API key can perform.
|
|
188
|
+
#
|
|
189
|
+
# @param role [Symbol, WhopSDK::Models::CompanyCreateAPIKeyParams::Role, nil] The different system roles that can be assigned.
|
|
190
|
+
#
|
|
191
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
192
|
+
#
|
|
193
|
+
# @return [WhopSDK::Models::CompanyCreateAPIKeyResponse]
|
|
194
|
+
#
|
|
195
|
+
# @see WhopSDK::Models::CompanyCreateAPIKeyParams
|
|
196
|
+
def create_api_key(parent_company_id, params)
|
|
197
|
+
parsed, options = WhopSDK::CompanyCreateAPIKeyParams.dump_request(params)
|
|
198
|
+
@client.request(
|
|
199
|
+
method: :post,
|
|
200
|
+
path: ["companies/%1$s/api_keys", parent_company_id],
|
|
201
|
+
body: parsed,
|
|
202
|
+
model: WhopSDK::Models::CompanyCreateAPIKeyResponse,
|
|
203
|
+
options: options
|
|
204
|
+
)
|
|
205
|
+
end
|
|
206
|
+
|
|
173
207
|
# @api private
|
|
174
208
|
#
|
|
175
209
|
# @param client [WhopSDK::Client]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Resources
|
|
5
|
+
# Conversions
|
|
6
|
+
class Conversions
|
|
7
|
+
# Track a conversion or engagement event for a company.
|
|
8
|
+
#
|
|
9
|
+
# Required permissions:
|
|
10
|
+
#
|
|
11
|
+
# - `event:create`
|
|
12
|
+
#
|
|
13
|
+
# @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: {})
|
|
14
|
+
#
|
|
15
|
+
# @param company_id [String] The company to associate with this event.
|
|
16
|
+
#
|
|
17
|
+
# @param event_name [Symbol, WhopSDK::Models::ConversionCreateParams::EventName] The type of event.
|
|
18
|
+
#
|
|
19
|
+
# @param action_source [Symbol, WhopSDK::Models::ConversionCreateParams::ActionSource, nil] The channel where an event originated
|
|
20
|
+
#
|
|
21
|
+
# @param context [WhopSDK::Models::ConversionCreateParams::Context, nil] Tracking and attribution context.
|
|
22
|
+
#
|
|
23
|
+
# @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform
|
|
24
|
+
#
|
|
25
|
+
# @param custom_name [String, nil] Custom event name when event_name is 'custom'.
|
|
26
|
+
#
|
|
27
|
+
# @param event_id [String, nil] Client-provided identifier for deduplication. Generated if omitted.
|
|
28
|
+
#
|
|
29
|
+
# @param event_time [Time, nil] When the event occurred. Defaults to now.
|
|
30
|
+
#
|
|
31
|
+
# @param plan_id [String, nil] The plan associated with the event.
|
|
32
|
+
#
|
|
33
|
+
# @param product_id [String, nil] The product associated with the event.
|
|
34
|
+
#
|
|
35
|
+
# @param referrer_url [String, nil] The referring URL.
|
|
36
|
+
#
|
|
37
|
+
# @param url [String, nil] The URL where the event occurred.
|
|
38
|
+
#
|
|
39
|
+
# @param user [WhopSDK::Models::ConversionCreateParams::User, nil] User identity and profile data.
|
|
40
|
+
#
|
|
41
|
+
# @param value [Float, nil] Monetary value associated with the event.
|
|
42
|
+
#
|
|
43
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
44
|
+
#
|
|
45
|
+
# @return [WhopSDK::Models::ConversionCreateResponse]
|
|
46
|
+
#
|
|
47
|
+
# @see WhopSDK::Models::ConversionCreateParams
|
|
48
|
+
def create(params)
|
|
49
|
+
parsed, options = WhopSDK::ConversionCreateParams.dump_request(params)
|
|
50
|
+
@client.request(
|
|
51
|
+
method: :post,
|
|
52
|
+
path: "conversions",
|
|
53
|
+
body: parsed,
|
|
54
|
+
model: WhopSDK::Models::ConversionCreateResponse,
|
|
55
|
+
options: options
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# @api private
|
|
60
|
+
#
|
|
61
|
+
# @param client [WhopSDK::Client]
|
|
62
|
+
def initialize(client:)
|
|
63
|
+
@client = client
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|