Class: WhopSDK::Resources::AppBuilds

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

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:



139
140
141
# File 'lib/whop_sdk/resources/app_builds.rb', line 139

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.

Creates a new app build

Required permissions:

  • ‘developer:manage_builds`

Parameters:

Returns:

See Also:



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

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>

Lists app builds for an app

Required permissions:

  • ‘developer:manage_builds`

Parameters:

  • app_id (String)

    The ID of the app to filter app builds by

  • 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)

    The minimum creation date to filter by

  • created_before (Time, nil)

    The maximum creation date to filter by

  • 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:



100
101
102
103
104
105
106
107
108
109
110
# File 'lib/whop_sdk/resources/app_builds.rb', line 100

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

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

Promotes an app build to production

Required permissions:

  • ‘developer:manage_builds`

Parameters:

  • id (String)

    The ID of the app build to promote.

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

Returns:

See Also:



127
128
129
130
131
132
133
134
# File 'lib/whop_sdk/resources/app_builds.rb', line 127

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 an app build by ID

Required permissions:

  • ‘developer:manage_builds`

Parameters:

Returns:

See Also:



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

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