Class: Algolia::Recommend::BaseSearchParams

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/models/recommend/base_search_params.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BaseSearchParams

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/algolia/models/recommend/base_search_params.rb', line 200

def initialize(attributes = {})
  unless attributes.is_a?(Hash)
    raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::BaseSearchParams` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) do |(k, v), h|
    unless self.class.attribute_map.key?(k.to_sym)
      raise ArgumentError,
            "`#{k}` is not a valid attribute in `Algolia::BaseSearchParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end

    h[k.to_sym] = v
  end

  if attributes.key?(:query)
    self.query = attributes[:query]
  end

  if attributes.key?(:similar_query)
    self.similar_query = attributes[:similar_query]
  end

  if attributes.key?(:filters)
    self.filters = attributes[:filters]
  end

  if attributes.key?(:facet_filters)
    self.facet_filters = attributes[:facet_filters]
  end

  if attributes.key?(:optional_filters)
    self.optional_filters = attributes[:optional_filters]
  end

  if attributes.key?(:numeric_filters)
    self.numeric_filters = attributes[:numeric_filters]
  end

  if attributes.key?(:tag_filters)
    self.tag_filters = attributes[:tag_filters]
  end

  if attributes.key?(:sum_or_filters_scores)
    self.sum_or_filters_scores = attributes[:sum_or_filters_scores]
  end

  if attributes.key?(:restrict_searchable_attributes)
    if (value = attributes[:restrict_searchable_attributes]).is_a?(Array)
      self.restrict_searchable_attributes = value
    end
  end

  if attributes.key?(:facets)
    if (value = attributes[:facets]).is_a?(Array)
      self.facets = value
    end
  end

  if attributes.key?(:faceting_after_distinct)
    self.faceting_after_distinct = attributes[:faceting_after_distinct]
  end

  if attributes.key?(:page)
    self.page = attributes[:page]
  end

  if attributes.key?(:offset)
    self.offset = attributes[:offset]
  end

  if attributes.key?(:length)
    self.length = attributes[:length]
  end

  if attributes.key?(:around_lat_lng)
    self.around_lat_lng = attributes[:around_lat_lng]
  end

  if attributes.key?(:around_lat_lng_via_ip)
    self.around_lat_lng_via_ip = attributes[:around_lat_lng_via_ip]
  end

  if attributes.key?(:around_radius)
    self.around_radius = attributes[:around_radius]
  end

  if attributes.key?(:around_precision)
    self.around_precision = attributes[:around_precision]
  end

  if attributes.key?(:minimum_around_radius)
    self.minimum_around_radius = attributes[:minimum_around_radius]
  end

  if attributes.key?(:inside_bounding_box)
    if (value = attributes[:inside_bounding_box]).is_a?(Array)
      self.inside_bounding_box = value
    end
  end

  if attributes.key?(:inside_polygon)
    if (value = attributes[:inside_polygon]).is_a?(Array)
      self.inside_polygon = value
    end
  end

  if attributes.key?(:natural_languages)
    if (value = attributes[:natural_languages]).is_a?(Array)
      self.natural_languages = value
    end
  end

  if attributes.key?(:rule_contexts)
    if (value = attributes[:rule_contexts]).is_a?(Array)
      self.rule_contexts = value
    end
  end

  if attributes.key?(:personalization_impact)
    self.personalization_impact = attributes[:personalization_impact]
  end

  if attributes.key?(:user_token)
    self.user_token = attributes[:user_token]
  end

  if attributes.key?(:get_ranking_info)
    self.get_ranking_info = attributes[:get_ranking_info]
  end

  if attributes.key?(:explain)
    if (value = attributes[:explain]).is_a?(Array)
      self.explain = value
    end
  end

  if attributes.key?(:synonyms)
    self.synonyms = attributes[:synonyms]
  end

  if attributes.key?(:click_analytics)
    self.click_analytics = attributes[:click_analytics]
  end

  if attributes.key?(:analytics)
    self.analytics = attributes[:analytics]
  end

  if attributes.key?(:analytics_tags)
    if (value = attributes[:analytics_tags]).is_a?(Array)
      self.analytics_tags = value
    end
  end

  if attributes.key?(:percentile_computation)
    self.percentile_computation = attributes[:percentile_computation]
  end

  if attributes.key?(:enable_ab_test)
    self.enable_ab_test = attributes[:enable_ab_test]
  end
end

Instance Attribute Details

#analyticsObject

Indicates whether this query will be included in [analytics](www.algolia.com/doc/guides/search-analytics/guides/exclude-queries/).



91
92
93
# File 'lib/algolia/models/recommend/base_search_params.rb', line 91

def analytics
  @analytics
end

#analytics_tagsObject

Tags to apply to the query for [segmenting analytics data](www.algolia.com/doc/guides/search-analytics/guides/segments/).



94
95
96
# File 'lib/algolia/models/recommend/base_search_params.rb', line 94

def analytics_tags
  @analytics_tags
end

#around_lat_lngObject

Search for entries [around a central location](www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filter-around-a-central-point), enabling a geographical search within a circular area.



48
49
50
# File 'lib/algolia/models/recommend/base_search_params.rb', line 48

def around_lat_lng
  @around_lat_lng
end

#around_lat_lng_via_ipObject

Search for entries around a location. The location is automatically computed from the requester’s IP address.



51
52
53
# File 'lib/algolia/models/recommend/base_search_params.rb', line 51

def around_lat_lng_via_ip
  @around_lat_lng_via_ip
end

#around_precisionObject

Returns the value of attribute around_precision.



55
56
57
# File 'lib/algolia/models/recommend/base_search_params.rb', line 55

def around_precision
  @around_precision
end

#around_radiusObject

Returns the value of attribute around_radius.



53
54
55
# File 'lib/algolia/models/recommend/base_search_params.rb', line 53

def around_radius
  @around_radius
end

#click_analyticsObject

Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).



88
89
90
# File 'lib/algolia/models/recommend/base_search_params.rb', line 88

def click_analytics
  @click_analytics
end

#enable_ab_testObject

Incidates whether this search will be considered in A/B testing.



100
101
102
# File 'lib/algolia/models/recommend/base_search_params.rb', line 100

def enable_ab_test
  @enable_ab_test
end

#explainObject

Enriches the API’s response with information about how the query was processed.



82
83
84
# File 'lib/algolia/models/recommend/base_search_params.rb', line 82

def explain
  @explain
end

#facet_filtersObject

Returns the value of attribute facet_filters.



18
19
20
# File 'lib/algolia/models/recommend/base_search_params.rb', line 18

def facet_filters
  @facet_filters
end

#faceting_after_distinctObject

Forces faceting to be applied after [de-duplication](www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the ‘afterDistinct` [modifier](www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.



36
37
38
# File 'lib/algolia/models/recommend/base_search_params.rb', line 36

def faceting_after_distinct
  @faceting_after_distinct
end

#facetsObject

Returns [facets](www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values.



33
34
35
# File 'lib/algolia/models/recommend/base_search_params.rb', line 33

def facets
  @facets
end

#filtersObject

[Filter](www.algolia.com/doc/guides/managing-results/refine-results/filtering/) the query with numeric, facet, or tag filters.



16
17
18
# File 'lib/algolia/models/recommend/base_search_params.rb', line 16

def filters
  @filters
end

#get_ranking_infoObject



79
80
81
# File 'lib/algolia/models/recommend/base_search_params.rb', line 79

def get_ranking_info
  @get_ranking_info
end

#inside_bounding_boxObject



61
62
63
# File 'lib/algolia/models/recommend/base_search_params.rb', line 61

def inside_bounding_box
  @inside_bounding_box
end

#inside_polygonObject



64
65
66
# File 'lib/algolia/models/recommend/base_search_params.rb', line 64

def inside_polygon
  @inside_polygon
end

#lengthObject

Sets the number of hits to retrieve (for use with ‘offset`). > Note: Using `page` and `hitsPerPage` is the recommended method for [paging results](www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length).



45
46
47
# File 'lib/algolia/models/recommend/base_search_params.rb', line 45

def length
  @length
end

#minimum_around_radiusObject

Minimum radius (in meters) used for a geographical search when ‘aroundRadius` isn’t set.



58
59
60
# File 'lib/algolia/models/recommend/base_search_params.rb', line 58

def minimum_around_radius
  @minimum_around_radius
end

#natural_languagesObject

Changes the default values of parameters that work best for a natural language query, such as ‘ignorePlurals`, `removeStopWords`, `removeWordsIfNoResults`, `analyticsTags`, and `ruleContexts`. These parameters work well together when the query consists of fuller natural language strings instead of keywords, for example when processing voice search queries.



67
68
69
# File 'lib/algolia/models/recommend/base_search_params.rb', line 67

def natural_languages
  @natural_languages
end

#numeric_filtersObject

Returns the value of attribute numeric_filters.



22
23
24
# File 'lib/algolia/models/recommend/base_search_params.rb', line 22

def numeric_filters
  @numeric_filters
end

#offsetObject

Specifies the offset of the first hit to return. > Note: Using ‘page` and `hitsPerPage` is the recommended method for [paging results](www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length).



42
43
44
# File 'lib/algolia/models/recommend/base_search_params.rb', line 42

def offset
  @offset
end

#optional_filtersObject

Returns the value of attribute optional_filters.



20
21
22
# File 'lib/algolia/models/recommend/base_search_params.rb', line 20

def optional_filters
  @optional_filters
end

#pageObject

Page to retrieve (the first page is ‘0`, not `1`).



39
40
41
# File 'lib/algolia/models/recommend/base_search_params.rb', line 39

def page
  @page
end

#percentile_computationObject

Whether to include or exclude a query from the processing-time percentile computation.



97
98
99
# File 'lib/algolia/models/recommend/base_search_params.rb', line 97

def percentile_computation
  @percentile_computation
end

#personalization_impactObject



73
74
75
# File 'lib/algolia/models/recommend/base_search_params.rb', line 73

def personalization_impact
  @personalization_impact
end

#queryObject

Text to search for in an index.



10
11
12
# File 'lib/algolia/models/recommend/base_search_params.rb', line 10

def query
  @query
end

#restrict_searchable_attributesObject

Restricts a query to only look at a subset of your [searchable attributes](www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).



30
31
32
# File 'lib/algolia/models/recommend/base_search_params.rb', line 30

def restrict_searchable_attributes
  @restrict_searchable_attributes
end

#rule_contextsObject



70
71
72
# File 'lib/algolia/models/recommend/base_search_params.rb', line 70

def rule_contexts
  @rule_contexts
end

#similar_queryObject

Overrides the query parameter and performs a more generic search.



13
14
15
# File 'lib/algolia/models/recommend/base_search_params.rb', line 13

def similar_query
  @similar_query
end

#sum_or_filters_scoresObject

Determines how to calculate [filter scores](www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). If ‘false`, maximum score is kept. If `true`, score is summed.



27
28
29
# File 'lib/algolia/models/recommend/base_search_params.rb', line 27

def sum_or_filters_scores
  @sum_or_filters_scores
end

#synonymsObject

Whether to take into account an index’s synonyms for a particular search.



85
86
87
# File 'lib/algolia/models/recommend/base_search_params.rb', line 85

def synonyms
  @synonyms
end

#tag_filtersObject

Returns the value of attribute tag_filters.



24
25
26
# File 'lib/algolia/models/recommend/base_search_params.rb', line 24

def tag_filters
  @tag_filters
end

#user_tokenObject

Associates a [user token](www.algolia.com/doc/guides/sending-events/concepts/usertoken/) with the current search.



76
77
78
# File 'lib/algolia/models/recommend/base_search_params.rb', line 76

def user_token
  @user_token
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/algolia/models/recommend/base_search_params.rb', line 478

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Algolia::Recommend.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



142
143
144
# File 'lib/algolia/models/recommend/base_search_params.rb', line 142

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/algolia/models/recommend/base_search_params.rb', line 103

def self.attribute_map
  {
    :query => :query,
    :similar_query => :similarQuery,
    :filters => :filters,
    :facet_filters => :facetFilters,
    :optional_filters => :optionalFilters,
    :numeric_filters => :numericFilters,
    :tag_filters => :tagFilters,
    :sum_or_filters_scores => :sumOrFiltersScores,
    :restrict_searchable_attributes => :restrictSearchableAttributes,
    :facets => :facets,
    :faceting_after_distinct => :facetingAfterDistinct,
    :page => :page,
    :offset => :offset,
    :length => :length,
    :around_lat_lng => :aroundLatLng,
    :around_lat_lng_via_ip => :aroundLatLngViaIP,
    :around_radius => :aroundRadius,
    :around_precision => :aroundPrecision,
    :minimum_around_radius => :minimumAroundRadius,
    :inside_bounding_box => :insideBoundingBox,
    :inside_polygon => :insidePolygon,
    :natural_languages => :naturalLanguages,
    :rule_contexts => :ruleContexts,
    :personalization_impact => :personalizationImpact,
    :user_token => :userToken,
    :get_ranking_info => :getRankingInfo,
    :explain => :explain,
    :synonyms => :synonyms,
    :click_analytics => :clickAnalytics,
    :analytics => :analytics,
    :analytics_tags => :analyticsTags,
    :percentile_computation => :percentileComputation,
    :enable_ab_test => :enableABTest
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/algolia/models/recommend/base_search_params.rb', line 453

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  types_mapping.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash[key.to_s] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



191
192
193
194
195
196
# File 'lib/algolia/models/recommend/base_search_params.rb', line 191

def self.openapi_all_of
  [
    :BaseSearchParamsWithoutQuery,
    :SearchParamsQuery
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



186
187
188
# File 'lib/algolia/models/recommend/base_search_params.rb', line 186

def self.openapi_nullable
  Set.new([])
end

.types_mappingObject

Attribute type mapping.



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
# File 'lib/algolia/models/recommend/base_search_params.rb', line 147

def self.types_mapping
  {
    :query => :String,
    :similar_query => :String,
    :filters => :String,
    :facet_filters => :FacetFilters,
    :optional_filters => :OptionalFilters,
    :numeric_filters => :NumericFilters,
    :tag_filters => :TagFilters,
    :sum_or_filters_scores => :Boolean,
    :restrict_searchable_attributes => :'Array<String>',
    :facets => :'Array<String>',
    :faceting_after_distinct => :Boolean,
    :page => :Integer,
    :offset => :Integer,
    :length => :Integer,
    :around_lat_lng => :String,
    :around_lat_lng_via_ip => :Boolean,
    :around_radius => :AroundRadius,
    :around_precision => :AroundPrecision,
    :minimum_around_radius => :Integer,
    :inside_bounding_box => :'Array<Array<Float>>',
    :inside_polygon => :'Array<Array<Float>>',
    :natural_languages => :'Array<String>',
    :rule_contexts => :'Array<String>',
    :personalization_impact => :Integer,
    :user_token => :String,
    :get_ranking_info => :Boolean,
    :explain => :'Array<String>',
    :synonyms => :Boolean,
    :click_analytics => :Boolean,
    :analytics => :Boolean,
    :analytics_tags => :'Array<String>',
    :percentile_computation => :Boolean,
    :enable_ab_test => :Boolean
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/algolia/models/recommend/base_search_params.rb', line 398

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    query == other.query &&
    similar_query == other.similar_query &&
    filters == other.filters &&
    facet_filters == other.facet_filters &&
    optional_filters == other.optional_filters &&
    numeric_filters == other.numeric_filters &&
    tag_filters == other.tag_filters &&
    sum_or_filters_scores == other.sum_or_filters_scores &&
    restrict_searchable_attributes == other.restrict_searchable_attributes &&
    facets == other.facets &&
    faceting_after_distinct == other.faceting_after_distinct &&
    page == other.page &&
    offset == other.offset &&
    length == other.length &&
    around_lat_lng == other.around_lat_lng &&
    around_lat_lng_via_ip == other.around_lat_lng_via_ip &&
    around_radius == other.around_radius &&
    around_precision == other.around_precision &&
    minimum_around_radius == other.minimum_around_radius &&
    inside_bounding_box == other.inside_bounding_box &&
    inside_polygon == other.inside_polygon &&
    natural_languages == other.natural_languages &&
    rule_contexts == other.rule_contexts &&
    personalization_impact == other.personalization_impact &&
    user_token == other.user_token &&
    get_ranking_info == other.get_ranking_info &&
    explain == other.explain &&
    synonyms == other.synonyms &&
    click_analytics == other.click_analytics &&
    analytics == other.analytics &&
    analytics_tags == other.analytics_tags &&
    percentile_computation == other.percentile_computation &&
    enable_ab_test == other.enable_ab_test
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/algolia/models/recommend/base_search_params.rb', line 549

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


439
440
441
# File 'lib/algolia/models/recommend/base_search_params.rb', line 439

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



445
446
447
448
# File 'lib/algolia/models/recommend/base_search_params.rb', line 445

def hash
  [query, similar_query, filters, facet_filters, optional_filters, numeric_filters, tag_filters, sum_or_filters_scores, restrict_searchable_attributes, facets,
   faceting_after_distinct, page, offset, length, around_lat_lng, around_lat_lng_via_ip, around_radius, around_precision, minimum_around_radius, inside_bounding_box, inside_polygon, natural_languages, rule_contexts, personalization_impact, user_token, get_ranking_info, explain, synonyms, click_analytics, analytics, analytics_tags, percentile_computation, enable_ab_test].hash
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



525
526
527
# File 'lib/algolia/models/recommend/base_search_params.rb', line 525

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



531
532
533
534
535
536
537
538
539
540
541
542
543
# File 'lib/algolia/models/recommend/base_search_params.rb', line 531

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



519
520
521
# File 'lib/algolia/models/recommend/base_search_params.rb', line 519

def to_s
  to_hash.to_s
end