Class: WhopSDK::Resources::AppBuilds

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/app_builds.rb

Overview

App builds

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AppBuilds

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 AppBuilds.

Parameters:



147
148
149
# File 'lib/whop_sdk/resources/app_builds.rb', line 147

def initialize(client:)
  @client = client
end

Instance Method Details

#create(attachment:, checksum:, platform:, ai_prompt_id: nil, app_id: nil, supported_app_view_types: nil, request_options: {}) ⇒ WhopSDK::Models::AppBuild

Some parameter documentations has been truncated, see Models::AppBuildCreateParams for more details.

Upload a new build artifact for an app. The build must include a compiled code bundle for the specified platform.

Required permissions:

  • ‘developer:manage_builds`

Parameters:

  • attachment (WhopSDK::Models::AppBuildCreateParams::Attachment)

    The build file to upload. For iOS and Android, this should be a .zip archive con

  • checksum (String)

    A client-generated checksum of the build file, used to verify file integrity whe

  • platform (Symbol, WhopSDK::Models::AppBuildPlatforms)

    The target platform for the build. Accepted values: ios, android, web.

  • ai_prompt_id (String, nil)

    The identifier of the AI prompt that generated this build, if applicable.

  • app_id (String, nil)

    The unique identifier of the app to create the build for. Defaults to the app as

  • supported_app_view_types (Array<Symbol, WhopSDK::Models::AppViewType>, nil)

    The view types this build supports. A build can support multiple view types but

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
# File 'lib/whop_sdk/resources/app_builds.rb', line 36

def create(params)
  parsed, options = WhopSDK::AppBuildCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "app_builds",
    body: parsed,
    model: WhopSDK::AppBuild,
    options: options
  )
end

#list(app_id:, after: nil, before: nil, created_after: nil, created_before: nil, first: nil, last: nil, platform: nil, status: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::AppBuildListResponse>

Returns a paginated list of build artifacts for a given app, with optional filtering by platform, status, and creation date.

Required permissions:

  • ‘developer:manage_builds`

Parameters:

  • app_id (String)

    The unique identifier of the app to list builds for.

  • after (String, nil)

    Returns the elements in the list that come after the specified cursor.

  • before (String, nil)

    Returns the elements in the list that come before the specified cursor.

  • created_after (Time, nil)

    Only return builds created after this timestamp.

  • created_before (Time, nil)

    Only return builds created before this timestamp.

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

  • platform (Symbol, WhopSDK::Models::AppBuildPlatforms, nil)

    The different platforms an app build can target.

  • status (Symbol, WhopSDK::Models::AppBuildStatuses, nil)

    The different statuses an AppBuild can be in.

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/whop_sdk/resources/app_builds.rb', line 103

def list(params)
  parsed, options = WhopSDK::AppBuildListParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "app_builds",
    query: query,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Models::AppBuildListResponse,
    options: options
  )
end

#promote(id, request_options: {}) ⇒ WhopSDK::Models::AppBuild

Some parameter documentations has been truncated, see Models::AppBuildPromoteParams for more details.

Promote an approved or draft app build to production so it becomes the active version served to users.

Required permissions:

  • ‘developer:manage_builds`

Parameters:

  • id (String)

    The unique identifier of the app build to promote to production, starting with ‘

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



135
136
137
138
139
140
141
142
# File 'lib/whop_sdk/resources/app_builds.rb', line 135

def promote(id, params = {})
  @client.request(
    method: :post,
    path: ["app_builds/%1$s/promote", id],
    model: WhopSDK::AppBuild,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::AppBuild

Retrieves the details of an existing app build.

Required permissions:

  • ‘developer:manage_builds`

Parameters:

  • id (String)

    The unique identifier of the app build to retrieve.

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



62
63
64
65
66
67
68
69
# File 'lib/whop_sdk/resources/app_builds.rb', line 62

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["app_builds/%1$s", id],
    model: WhopSDK::AppBuild,
    options: params[:request_options]
  )
end