Class: WhopSDK::Resources::Bounties
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Bounties
- Defined in:
- lib/whop_sdk/resources/bounties.rb
Overview
Bounties
Instance Method Summary collapse
-
#create(base_unit_amount:, currency:, description:, title:, accepted_submissions_limit: nil, allowed_country_codes: nil, experience_id: nil, origin_account_id: nil, post_markdown_content: nil, post_title: nil, request_options: {}) ⇒ WhopSDK::Models::BountyCreateResponse
Some parameter documentations has been truncated, see Models::BountyCreateParams for more details.
-
#initialize(client:) ⇒ Bounties
constructor
private
A new instance of Bounties.
-
#list(after: nil, before: nil, direction: nil, experience_id: nil, first: nil, last: nil, status: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::BountyListResponse>
Some parameter documentations has been truncated, see Models::BountyListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::BountyRetrieveResponse
Retrieves a workforce bounty for the current authenticated user.
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.
119 120 121 |
# File 'lib/whop_sdk/resources/bounties.rb', line 119 def initialize(client:) @client = client end |
Instance Method Details
#create(base_unit_amount:, currency:, description:, title:, accepted_submissions_limit: nil, allowed_country_codes: nil, experience_id: nil, origin_account_id: nil, post_markdown_content: nil, post_title: nil, request_options: {}) ⇒ WhopSDK::Models::BountyCreateResponse
Some parameter documentations has been truncated, see Models::BountyCreateParams for more details.
Create a new workforce bounty by funding a dedicated bounty pool.
Required permissions:
-
‘bounty:create`
D
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/whop_sdk/resources/bounties.rb', line 44 def create(params) parsed, = WhopSDK::BountyCreateParams.dump_request(params) @client.request( method: :post, path: "bounties", body: parsed, model: WhopSDK::Models::BountyCreateResponse, options: ) end |
#list(after: nil, before: nil, direction: nil, experience_id: nil, first: nil, last: nil, status: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::BountyListResponse>
Some parameter documentations has been truncated, see Models::BountyListParams for more details.
Returns a paginated list of workforce bounties. When experienceId is provided, returns bounties scoped to that experience. When omitted, returns bounties with no experience.
103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/whop_sdk/resources/bounties.rb', line 103 def list(params = {}) parsed, = WhopSDK::BountyListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "bounties", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::BountyListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::BountyRetrieveResponse
Retrieves a workforce bounty for the current authenticated user.
66 67 68 69 70 71 72 73 |
# File 'lib/whop_sdk/resources/bounties.rb', line 66 def retrieve(id, params = {}) @client.request( method: :get, path: ["bounties/%1$s", id], model: WhopSDK::Models::BountyRetrieveResponse, options: params[:request_options] ) end |