Class: WhopSDK::Resources::Reviews

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Reviews

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

Parameters:



63
64
65
# File 'lib/whop_sdk/resources/reviews.rb', line 63

def initialize(client:)
  @client = client
end

Instance Method Details

#list(product_id: , after: nil, before: nil, first: nil, last: nil, max_stars: nil, min_stars: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ReviewListResponse>

List all reviews

Parameters:

  • product_id (String)

    The ID of the product

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

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

  • max_stars (Integer, nil)

    The maximum star rating of the review (inclusive)

  • min_stars (Integer, nil)

    The minimum star rating of the review (inclusive)

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

Returns:

See Also:



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/whop_sdk/resources/reviews.rb', line 48

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

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

Retrieve a review by its ID

Parameters:

Returns:

See Also:



16
17
18
19
20
21
22
23
# File 'lib/whop_sdk/resources/reviews.rb', line 16

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