Class: WhopSDK::Resources::Workforce::Bounties

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/workforce/bounties.rb,
sig/whop_sdk/resources/workforce/bounties.rbs

Overview

A Workforce Bounty is a paid task posted by an account or user. The reward is held in escrow when the bounty publishes, workers submit proof of completed work, and each accepted submission is paid out until every winner slot fills.

Use the Workforce Bounties API to list an account's bounties for reporting or dashboards, list the bounties a user can work or has participated in, and retrieve a single bounty by ID.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Bounties

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

Parameters:



91
92
93
# File 'lib/whop_sdk/resources/workforce/bounties.rb', line 91

def initialize(client:)
  @client = client
end

Instance Method Details

#list(account_id: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, status: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::Workforce::WorkforceBountyListItem>

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

Lists workforce bounties visible to the credential. Account API keys return the account's bounties, scheduled drafts included; user tokens return the bounties the user can see and work. Pass account_id to view one account's bounties as a team member (or a connected account of the caller's), or user_id (your own) to list the bounties you participated in.

Parameters:

  • account_id (String)

    Scope the list to this account (biz_ tag). Requires read access to the account

  • after (String)

    Cursor to paginate forwards from.

  • before (String)

    Cursor to paginate backwards from.

  • created_after (String)

    Only bounties created after this ISO 8601 timestamp.

  • created_before (String)

    Only bounties created before this ISO 8601 timestamp.

  • direction (Symbol, WhopSDK::Models::Workforce::BountyListParams::Direction)

    Sort direction.

  • first (Integer)

    Number of bounties to return from the start of the window.

  • last (Integer)

    Number of bounties to return from the end of the window.

  • order (Symbol, WhopSDK::Models::Workforce::BountyListParams::Order)

    Sort field.

  • query (String)

    Substring match on the bounty title or ID.

  • status (Symbol, WhopSDK::Models::Workforce::BountyListParams::Status)

    Filter by lifecycle state.

  • user_id (String)

    List the bounties this user participated in (user_ tag). Must be the authentic

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

Returns:

See Also:



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/whop_sdk/resources/workforce/bounties.rb', line 75

def list(params = {})
  parsed, options = WhopSDK::Workforce::BountyListParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "workforce/bounties",
    query: query,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Workforce::WorkforceBountyListItem,
    options: options
  )
end

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

Retrieves one workforce bounty by ID. The bounty must be visible to the credential; bounties outside the caller's scope return 404.

Parameters:

Returns:

See Also:



26
27
28
29
30
31
32
33
# File 'lib/whop_sdk/resources/workforce/bounties.rb', line 26

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