Class: Repull::ReviewsApi
- Inherits:
-
Object
- Object
- Repull::ReviewsApi
- Defined in:
- lib/repull/api/reviews_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_review(id, opts = {}) ⇒ Review
Get review Returns one review (the bare ‘Review` object — NOT wrapped in `{ data: … }`).
-
#get_review_with_http_info(id, opts = {}) ⇒ Array<(Review, Integer, Hash)>
Get review Returns one review (the bare `Review` object — NOT wrapped in `{ data: … }`).
-
#initialize(api_client = ApiClient.default) ⇒ ReviewsApi
constructor
A new instance of ReviewsApi.
-
#list_reviews(opts = {}) ⇒ ReviewListResponse
List reviews Cursor-paginated guest + host review stream for the workspace.
-
#list_reviews_with_http_info(opts = {}) ⇒ Array<(ReviewListResponse, Integer, Hash)>
List reviews Cursor-paginated guest + host review stream for the workspace.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ReviewsApi
Returns a new instance of ReviewsApi.
19 20 21 |
# File 'lib/repull/api/reviews_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/repull/api/reviews_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_review(id, opts = {}) ⇒ Review
Get review Returns one review (the bare ‘Review` object — NOT wrapped in `{ data: … }`). Scoped to the authenticated workspace via the listings join — reviews that don’t belong to the workspace return 404 (we don’t differentiate to avoid leaking other customers’ ids).
28 29 30 31 |
# File 'lib/repull/api/reviews_api.rb', line 28 def get_review(id, opts = {}) data, _status_code, _headers = get_review_with_http_info(id, opts) data end |
#get_review_with_http_info(id, opts = {}) ⇒ Array<(Review, Integer, Hash)>
Get review Returns one review (the bare `Review` object — NOT wrapped in `{ data: … }`). Scoped to the authenticated workspace via the listings join — reviews that don't belong to the workspace return 404 (we don't differentiate to avoid leaking other customers' ids).
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/repull/api/reviews_api.rb', line 39 def get_review_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ReviewsApi.get_review ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ReviewsApi.get_review" end # resource path local_var_path = '/v1/reviews/{id}'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Review' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ReviewsApi.get_review", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ReviewsApi#get_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_reviews(opts = {}) ⇒ ReviewListResponse
List reviews Cursor-paginated guest + host review stream for the workspace. Backed by main vanio’s unified ‘reviews` table (populated by per-channel backfill crons), so this surface returns the complete cross-channel history — separate from `/v1/channels/airbnb/reviews` which hits Airbnb live. Filters: `platform` (`airbnb`|`booking`|`vrbo`), `listing_id` (internal Repull listing id), `rating_min` / `rating_max` (inclusive bounds, 0..5), `status` (`responded`|`unanswered`|`all`), `reviewer_role` (`guest` (default) | `host` | `all`).
101 102 103 104 |
# File 'lib/repull/api/reviews_api.rb', line 101 def list_reviews(opts = {}) data, _status_code, _headers = list_reviews_with_http_info(opts) data end |
#list_reviews_with_http_info(opts = {}) ⇒ Array<(ReviewListResponse, Integer, Hash)>
List reviews Cursor-paginated guest + host review stream for the workspace. Backed by main vanio's unified `reviews` table (populated by per-channel backfill crons), so this surface returns the complete cross-channel history — separate from `/v1/channels/airbnb/reviews` which hits Airbnb live. Filters: `platform` (`airbnb`|`booking`|`vrbo`), `listing_id` (internal Repull listing id), `rating_min` / `rating_max` (inclusive bounds, 0..5), `status` (`responded`|`unanswered`|`all`), `reviewer_role` (`guest` (default) | `host` | `all`).
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/repull/api/reviews_api.rb', line 119 def list_reviews_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ReviewsApi.list_reviews ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReviewsApi.list_reviews, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReviewsApi.list_reviews, must be greater than or equal to 1.' end allowable_values = ["airbnb", "booking", "vrbo"] if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform']) fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'rating_min'].nil? && opts[:'rating_min'] > 5 fail ArgumentError, 'invalid value for "opts[:"rating_min"]" when calling ReviewsApi.list_reviews, must be smaller than or equal to 5.' end if @api_client.config.client_side_validation && !opts[:'rating_min'].nil? && opts[:'rating_min'] < 0 fail ArgumentError, 'invalid value for "opts[:"rating_min"]" when calling ReviewsApi.list_reviews, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'rating_max'].nil? && opts[:'rating_max'] > 5 fail ArgumentError, 'invalid value for "opts[:"rating_max"]" when calling ReviewsApi.list_reviews, must be smaller than or equal to 5.' end if @api_client.config.client_side_validation && !opts[:'rating_max'].nil? && opts[:'rating_max'] < 0 fail ArgumentError, 'invalid value for "opts[:"rating_max"]" when calling ReviewsApi.list_reviews, must be greater than or equal to 0.' end allowable_values = ["responded", "unanswered", "all"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end allowable_values = ["guest", "host", "all"] if @api_client.config.client_side_validation && opts[:'reviewer_role'] && !allowable_values.include?(opts[:'reviewer_role']) fail ArgumentError, "invalid value for \"reviewer_role\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/reviews' # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil? query_params[:'listingId'] = opts[:'listing_id'] if !opts[:'listing_id'].nil? query_params[:'rating_min'] = opts[:'rating_min'] if !opts[:'rating_min'].nil? query_params[:'rating_max'] = opts[:'rating_max'] if !opts[:'rating_max'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'reviewerRole'] = opts[:'reviewer_role'] if !opts[:'reviewer_role'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ReviewListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ReviewsApi.list_reviews", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ReviewsApi#list_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |