Class: Repull::AtlasApi
- Inherits:
-
Object
- Object
- Repull::AtlasApi
- Defined in:
- lib/repull/api/atlas_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_listing_segments(id, opts = {}) ⇒ ListingSegmentsResponse
Atlas DNA segment intelligence for a listing Aggregates Atlas DNA segment signal (quality tier, design style, bedrooms) across the listing’s geographic neighborhood (default: 5km radius) or the whole city, so consumers can answer: - What segments dominate my market? - Which segment does my listing match best? - What’s the ADR uplift for moving up a tier? DNA coverage is still ramping — segments are scored asynchronously.
-
#get_listing_segments_with_http_info(id, opts = {}) ⇒ Array<(ListingSegmentsResponse, Integer, Hash)>
Atlas DNA segment intelligence for a listing Aggregates Atlas DNA segment signal (quality tier, design style, bedrooms) across the listing's geographic neighborhood (default: 5km radius) or the whole city, so consumers can answer: - What segments dominate my market? - Which segment does my listing match best? - What's the ADR uplift for moving up a tier? DNA coverage is still ramping — segments are scored asynchronously.
-
#initialize(api_client = ApiClient.default) ⇒ AtlasApi
constructor
A new instance of AtlasApi.
-
#list_listing_comps(id, opts = {}) ⇒ ListingCompsResponse
Comp set for a listing (with daily nightly pricing) Returns the actual comp set for a listing — the underlying competitor listings (with daily nightly pricing), not just the aggregated ‘compSummary` from `/pricing`.
-
#list_listing_comps_with_http_info(id, opts = {}) ⇒ Array<(ListingCompsResponse, Integer, Hash)>
Comp set for a listing (with daily nightly pricing) Returns the actual comp set for a listing — the underlying competitor listings (with daily nightly pricing), not just the aggregated `compSummary` from `/pricing`.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/repull/api/atlas_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_listing_segments(id, opts = {}) ⇒ ListingSegmentsResponse
Atlas DNA segment intelligence for a listing Aggregates Atlas DNA segment signal (quality tier, design style, bedrooms) across the listing’s geographic neighborhood (default: 5km radius) or the whole city, so consumers can answer: - What segments dominate my market? - Which segment does my listing match best? - What’s the ADR uplift for moving up a tier? DNA coverage is still ramping — segments are scored asynchronously. Cities and radii without scored comps return ‘totalCompsAnalyzed: 0` plus a `low_dna_coverage` recommendation rather than fabricated data.
29 30 31 32 |
# File 'lib/repull/api/atlas_api.rb', line 29 def get_listing_segments(id, opts = {}) data, _status_code, _headers = get_listing_segments_with_http_info(id, opts) data end |
#get_listing_segments_with_http_info(id, opts = {}) ⇒ Array<(ListingSegmentsResponse, Integer, Hash)>
Atlas DNA segment intelligence for a listing Aggregates Atlas DNA segment signal (quality tier, design style, bedrooms) across the listing's geographic neighborhood (default: 5km radius) or the whole city, so consumers can answer: - What segments dominate my market? - Which segment does my listing match best? - What's the ADR uplift for moving up a tier? DNA coverage is still ramping — segments are scored asynchronously. Cities and radii without scored comps return `totalCompsAnalyzed: 0` plus a `low_dna_coverage` recommendation rather than fabricated data.
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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/repull/api/atlas_api.rb', line 41 def get_listing_segments_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AtlasApi.get_listing_segments ...' 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 AtlasApi.get_listing_segments" end allowable_values = ["comp_set", "market"] if @api_client.config.client_side_validation && opts[:'level'] && !allowable_values.include?(opts[:'level']) fail ArgumentError, "invalid value for \"level\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'radius_km'].nil? && opts[:'radius_km'] > 50 fail ArgumentError, 'invalid value for "opts[:"radius_km"]" when calling AtlasApi.get_listing_segments, must be smaller than or equal to 50.' end if @api_client.config.client_side_validation && !opts[:'radius_km'].nil? && opts[:'radius_km'] < 0.5 fail ArgumentError, 'invalid value for "opts[:"radius_km"]" when calling AtlasApi.get_listing_segments, must be greater than or equal to 0.5.' end # resource path local_var_path = '/v1/listings/{id}/segments'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'level'] = opts[:'level'] if !opts[:'level'].nil? query_params[:'radius_km'] = opts[:'radius_km'] if !opts[:'radius_km'].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'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListingSegmentsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AtlasApi.get_listing_segments", :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: AtlasApi#get_listing_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_listing_comps(id, opts = {}) ⇒ ListingCompsResponse
Comp set for a listing (with daily nightly pricing) Returns the actual comp set for a listing — the underlying competitor listings (with daily nightly pricing), not just the aggregated ‘compSummary` from `/pricing`. Each comp comes back with distance, bedrooms, ratings, lat/lng, platform link, and a per-day rate/availability series for the requested window. Powered by Atlas. Comps with no coordinates are excluded — there’s no way to rank them by distance. Listings without coordinates return ‘data: []` and a `warning` field.
112 113 114 115 |
# File 'lib/repull/api/atlas_api.rb', line 112 def list_listing_comps(id, opts = {}) data, _status_code, _headers = list_listing_comps_with_http_info(id, opts) data end |
#list_listing_comps_with_http_info(id, opts = {}) ⇒ Array<(ListingCompsResponse, Integer, Hash)>
Comp set for a listing (with daily nightly pricing) Returns the actual comp set for a listing — the underlying competitor listings (with daily nightly pricing), not just the aggregated `compSummary` from `/pricing`. Each comp comes back with distance, bedrooms, ratings, lat/lng, platform link, and a per-day rate/availability series for the requested window. Powered by Atlas. Comps with no coordinates are excluded — there's no way to rank them by distance. Listings without coordinates return `data: []` and a `warning` field.
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 |
# File 'lib/repull/api/atlas_api.rb', line 126 def list_listing_comps_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AtlasApi.list_listing_comps ...' 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 AtlasApi.list_listing_comps" end if @api_client.config.client_side_validation && !opts[:'radius_km'].nil? && opts[:'radius_km'] > 50 fail ArgumentError, 'invalid value for "opts[:"radius_km"]" when calling AtlasApi.list_listing_comps, must be smaller than or equal to 50.' end if @api_client.config.client_side_validation && !opts[:'radius_km'].nil? && opts[:'radius_km'] < 0.5 fail ArgumentError, 'invalid value for "opts[:"radius_km"]" when calling AtlasApi.list_listing_comps, must be greater than or equal to 0.5.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AtlasApi.list_listing_comps, 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 AtlasApi.list_listing_comps, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/listings/{id}/comps'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'radius_km'] = opts[:'radius_km'] if !opts[:'radius_km'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].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'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListingCompsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AtlasApi.list_listing_comps", :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: AtlasApi#list_listing_comps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |