Class: WhopSDK::Resources::Accounts
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Accounts
- Defined in:
- lib/whop_sdk/resources/accounts.rb
Instance Method Summary collapse
-
#create(email: nil, metadata: nil, request_options: {}) ⇒ WhopSDK::Models::Account
Some parameter documentations has been truncated, see Models::AccountCreateParams for more details.
-
#initialize(client:) ⇒ Accounts
constructor
private
A new instance of Accounts.
-
#list(page: nil, per: nil, request_options: {}) ⇒ WhopSDK::Models::AccountListResponse
Some parameter documentations has been truncated, see Models::AccountListParams for more details.
-
#me(request_options: {}) ⇒ WhopSDK::Models::Account
Retrieves the business account associated with the current business account API key.
-
#retrieve(account_id, request_options: {}) ⇒ WhopSDK::Models::Account
Retrieves a single account visible to the credential, including its crypto wallet.
-
#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: {}) ⇒ WhopSDK::Models::Account
Some parameter documentations has been truncated, see Models::AccountUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Accounts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Accounts.
163 164 165 |
# File 'lib/whop_sdk/resources/accounts.rb', line 163 def initialize(client:) @client = client end |
Instance Method Details
#create(email: nil, metadata: nil, request_options: {}) ⇒ WhopSDK::Models::Account
Some parameter documentations has been truncated, see Models::AccountCreateParams for more details.
Creates an account. User tokens create business accounts; business account API keys create connected accounts.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/whop_sdk/resources/accounts.rb', line 23 def create(params = {}) parsed, = WhopSDK::AccountCreateParams.dump_request(params) @client.request( method: :post, path: "accounts", body: parsed, model: WhopSDK::Account, options: ) end |
#list(page: nil, per: nil, request_options: {}) ⇒ WhopSDK::Models::AccountListResponse
Some parameter documentations has been truncated, see 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.
129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/whop_sdk/resources/accounts.rb', line 129 def list(params = {}) parsed, = WhopSDK::AccountListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "accounts", query: query, model: WhopSDK::Models::AccountListResponse, options: ) end |
#me(request_options: {}) ⇒ WhopSDK::Models::Account
Retrieves the business account associated with the current business account API key.
151 152 153 154 155 156 157 158 |
# File 'lib/whop_sdk/resources/accounts.rb', line 151 def me(params = {}) @client.request( method: :get, path: "accounts/me", model: WhopSDK::Account, options: params[:request_options] ) end |
#retrieve(account_id, request_options: {}) ⇒ WhopSDK::Models::Account
Retrieves a single account visible to the credential, including its crypto wallet.
46 47 48 49 50 51 52 53 |
# File 'lib/whop_sdk/resources/accounts.rb', line 46 def retrieve(account_id, params = {}) @client.request( method: :get, path: ["accounts/%1$s", account_id], model: WhopSDK::Account, options: params[:request_options] ) end |
#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: {}) ⇒ WhopSDK::Models::Account
Some parameter documentations has been truncated, see Models::AccountUpdateParams for more details.
Updates an account. User tokens can update business accounts; business account API keys can update connected accounts.
100 101 102 103 104 105 106 107 108 109 |
# File 'lib/whop_sdk/resources/accounts.rb', line 100 def update(account_id, params = {}) parsed, = WhopSDK::AccountUpdateParams.dump_request(params) @client.request( method: :patch, path: ["accounts/%1$s", account_id], body: parsed, model: WhopSDK::Account, options: ) end |