Class: WhopSDK::Resources::Reviews
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Reviews
- Defined in:
- lib/whop_sdk/resources/reviews.rb
Overview
Reviews
Instance Method Summary collapse
-
#initialize(client:) ⇒ Reviews
constructor
private
A new instance of Reviews.
-
#list(product_id:, after: nil, before: nil, created_after: nil, created_before: nil, first: nil, last: nil, max_stars: nil, min_stars: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ReviewListResponse>
Returns a paginated list of customer reviews for a specific product, with optional filtering by star rating and creation date.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::ReviewRetrieveResponse
Retrieves the details of an existing review.
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.
71 72 73 |
# File 'lib/whop_sdk/resources/reviews.rb', line 71 def initialize(client:) @client = client end |
Instance Method Details
#list(product_id:, after: nil, before: nil, created_after: nil, created_before: nil, first: nil, last: nil, max_stars: nil, min_stars: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ReviewListResponse>
Returns a paginated list of customer reviews for a specific product, with optional filtering by star rating and creation date.
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/whop_sdk/resources/reviews.rb', line 55 def list(params) parsed, = WhopSDK::ReviewListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "reviews", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::ReviewListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::ReviewRetrieveResponse
Retrieves the details of an existing review.
18 19 20 21 22 23 24 25 |
# File 'lib/whop_sdk/resources/reviews.rb', line 18 def retrieve(id, params = {}) @client.request( method: :get, path: ["reviews/%1$s", id], model: WhopSDK::Models::ReviewRetrieveResponse, options: params[:request_options] ) end |