Class: WhopSDK::Resources::Apps
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Apps
- Defined in:
- lib/whop_sdk/resources/apps.rb
Instance Method Summary collapse
-
#create(company_id: , name: , base_url: nil, request_options: {}) ⇒ WhopSDK::Models::App
Create a new App.
-
#initialize(client:) ⇒ Apps
constructor
private
A new instance of Apps.
-
#list(after: nil, before: nil, company_id: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, verified_apps_only: nil, view_type: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::AppListResponse>
Some parameter documentations has been truncated, see Models::AppListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::App
Retrieves an app by ID.
-
#update(id, app_store_description: nil, base_url: nil, dashboard_path: nil, description: nil, discover_path: nil, experience_path: nil, icon: nil, name: nil, required_scopes: nil, status: nil, request_options: {}) ⇒ WhopSDK::Models::App
Update an existing App.
Constructor Details
#initialize(client:) ⇒ Apps
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 Apps.
148 149 150 |
# File 'lib/whop_sdk/resources/apps.rb', line 148 def initialize(client:) @client = client end |
Instance Method Details
#create(company_id: , name: , base_url: nil, request_options: {}) ⇒ WhopSDK::Models::App
Create a new App
Required permissions:
-
‘developer:create_app`
-
‘developer:manage_api_key`
26 27 28 29 |
# File 'lib/whop_sdk/resources/apps.rb', line 26 def create(params) parsed, = WhopSDK::AppCreateParams.dump_request(params) @client.request(method: :post, path: "apps", body: parsed, model: WhopSDK::App, options: ) end |
#list(after: nil, before: nil, company_id: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, verified_apps_only: nil, view_type: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::AppListResponse>
Some parameter documentations has been truncated, see Models::AppListParams for more details.
Fetches a list of apps
133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/whop_sdk/resources/apps.rb', line 133 def list(params = {}) parsed, = WhopSDK::AppListParams.dump_request(params) @client.request( method: :get, path: "apps", query: parsed, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::AppListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::App
Retrieves an app by ID
Required permissions:
-
‘developer:manage_api_key`
45 46 47 48 49 50 51 52 |
# File 'lib/whop_sdk/resources/apps.rb', line 45 def retrieve(id, params = {}) @client.request( method: :get, path: ["apps/%1$s", id], model: WhopSDK::App, options: params[:request_options] ) end |
#update(id, app_store_description: nil, base_url: nil, dashboard_path: nil, description: nil, discover_path: nil, experience_path: nil, icon: nil, name: nil, required_scopes: nil, status: nil, request_options: {}) ⇒ WhopSDK::Models::App
Update an existing App
Required permissions:
-
‘developer:update_app`
-
‘developer:manage_api_key`
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/whop_sdk/resources/apps.rb', line 90 def update(id, params = {}) parsed, = WhopSDK::AppUpdateParams.dump_request(params) @client.request( method: :patch, path: ["apps/%1$s", id], body: parsed, model: WhopSDK::App, options: ) end |