Class: WhopSDK::Resources::CompanyTokenTransactions
- Inherits:
-
Object
- Object
- WhopSDK::Resources::CompanyTokenTransactions
- Defined in:
- lib/whop_sdk/resources/company_token_transactions.rb
Overview
Company token transactions
Instance Method Summary collapse
-
#create(body:, request_options: {}) ⇒ WhopSDK::Models::CompanyTokenTransaction
Create a token transaction to add, subtract, or transfer tokens for a member within a company.
-
#initialize(client:) ⇒ CompanyTokenTransactions
constructor
private
A new instance of CompanyTokenTransactions.
-
#list(company_id:, after: nil, before: nil, first: nil, last: nil, transaction_type: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::CompanyTokenTransactionListResponse>
Returns a paginated list of token transactions for a user or company, depending on the authenticated actor, with optional filtering by user and transaction type.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::CompanyTokenTransaction
Retrieves the details of an existing company token transaction.
Constructor Details
#initialize(client:) ⇒ CompanyTokenTransactions
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 CompanyTokenTransactions.
109 110 111 |
# File 'lib/whop_sdk/resources/company_token_transactions.rb', line 109 def initialize(client:) @client = client end |
Instance Method Details
#create(body:, request_options: {}) ⇒ WhopSDK::Models::CompanyTokenTransaction
Create a token transaction to add, subtract, or transfer tokens for a member within a company.
Required permissions:
-
‘company_token_transaction:create`
-
‘member:basic:read`
-
‘company:basic:read`
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/whop_sdk/resources/company_token_transactions.rb', line 25 def create(params) parsed, = WhopSDK::CompanyTokenTransactionCreateParams.dump_request(params) @client.request( method: :post, path: "company_token_transactions", body: parsed[:body], model: WhopSDK::CompanyTokenTransaction, options: ) end |
#list(company_id:, after: nil, before: nil, first: nil, last: nil, transaction_type: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::CompanyTokenTransactionListResponse>
Returns a paginated list of token transactions for a user or company, depending on the authenticated actor, with optional filtering by user and transaction type.
Required permissions:
-
‘company_token_transaction:read`
-
‘member:basic:read`
-
‘company:basic:read`
93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/whop_sdk/resources/company_token_transactions.rb', line 93 def list(params) parsed, = WhopSDK::CompanyTokenTransactionListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "company_token_transactions", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::CompanyTokenTransactionListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::CompanyTokenTransaction
Retrieves the details of an existing company token transaction.
Required permissions:
-
‘company_token_transaction:read`
-
‘member:basic:read`
-
‘company:basic:read`
53 54 55 56 57 58 59 60 |
# File 'lib/whop_sdk/resources/company_token_transactions.rb', line 53 def retrieve(id, params = {}) @client.request( method: :get, path: ["company_token_transactions/%1$s", id], model: WhopSDK::CompanyTokenTransaction, options: params[:request_options] ) end |