algolia 3.35.1 → 3.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7319119e646ce2ddd4ae9c3752f51e2c43c9b749692366b39923e76739d35a3
4
- data.tar.gz: b0a4f259d562b26a79823bd7a88e7609012a542e92c40ebe92446594fa50e7d4
3
+ metadata.gz: ae127d06f4d82e06e99b2697521f170d54e77851e47dc1e3b63014000914eb6e
4
+ data.tar.gz: cbaea35422d64b83c629bd92bd7e978fee9da387de753674e56bd10bfb8d428f
5
5
  SHA512:
6
- metadata.gz: 41c7e5e8a0886a04a85e57c22284c691b7c5fd4a99bcd48735ec689c67f0e56338d95a5217a0a0d3551c483ac7f1b7fae0e5a3e7bd5cf5cd9dbebf5bd3b1439f
7
- data.tar.gz: 4cae09ffbd9b1d8bbbd4b07846f1f0ed773db05534a6f7a4639412a95ad6753fe340439892e272bfa709dbb2e137f88e1c34dd29e69180d34799c4b79aa47e86
6
+ metadata.gz: 734675dad4d3917bb2670bf4de13d2f4e7dae27e381987c95128eb5d2a6fb79255bfb866654fe9dd4cc3bc79da00938db29d112620aab1d9c2e0d9720ec67288
7
+ data.tar.gz: ac63fcdc27e5162fcd044b0f4936e92c9dea875d4ddb1f7a510c1ca6985336a4d824fab90780ec5d96206176c1814d0feae3b061d141f244c6350e574fdfe760
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [3.36.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.35.1...3.36.0)
2
+
3
+ - [93c834fee](https://github.com/algolia/api-clients-automation/commit/93c834fee) feat(specs): add optional feedID to composition result set ([#5991](https://github.com/algolia/api-clients-automation/pull/5991)) by [@gavinwade12](https://github.com/gavinwade12/)
4
+ - [9aafd690b](https://github.com/algolia/api-clients-automation/commit/9aafd690b) fix(specs): invalid API format for multi feed in Comp API ([#5993](https://github.com/algolia/api-clients-automation/pull/5993)) by [@ClaraMuller](https://github.com/ClaraMuller/)
5
+
1
6
  ## [3.35.1](https://github.com/algolia/algoliasearch-client-ruby/compare/3.35.0...3.35.1)
2
7
 
3
8
  - [46be49a3f](https://github.com/algolia/api-clients-automation/commit/46be49a3f) docs(specs): align with style guides ([#5930](https://github.com/algolia/api-clients-automation/pull/5930)) by [@kai687](https://github.com/kai687/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.35.1)
4
+ algolia (3.36.0)
5
5
  base64 (>= 0.2.0, < 1)
6
6
  faraday (>= 1.0.1, < 3.0)
7
7
  faraday-net_http_persistent (>= 0.15, < 3)
@@ -0,0 +1,209 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
+
5
+ require "date"
6
+ require "time"
7
+
8
+ module Algolia
9
+ module Composition
10
+ # Feed formatted as an injection.
11
+ class FeedInjection
12
+ attr_accessor :injection
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :injection => :injection
18
+ }
19
+ end
20
+
21
+ # Attribute type mapping.
22
+ def self.types_mapping
23
+ {
24
+ :injection => :"Injection"
25
+ }
26
+ end
27
+
28
+ # List of attributes with nullable: true
29
+ def self.openapi_nullable
30
+ Set.new(
31
+ []
32
+ )
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ if (!attributes.is_a?(Hash))
39
+ raise(
40
+ ArgumentError,
41
+ "The input argument (attributes) must be a hash in `Algolia::FeedInjection` initialize method"
42
+ )
43
+ end
44
+
45
+ # check to see if the attribute exists and convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h|
47
+ if (!self.class.attribute_map.key?(k.to_sym))
48
+ raise(
49
+ ArgumentError,
50
+ "`#{k}` is not a valid attribute in `Algolia::FeedInjection`. Please check the name to make sure it's valid. List of attributes: " +
51
+ self.class.attribute_map.keys.inspect
52
+ )
53
+ end
54
+
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:injection)
59
+ self.injection = attributes[:injection]
60
+ else
61
+ self.injection = nil
62
+ end
63
+ end
64
+
65
+ # Checks equality by comparing each attribute.
66
+ # @param [Object] Object to be compared
67
+ def ==(other)
68
+ return true if self.equal?(other)
69
+ self.class == other.class &&
70
+ injection == other.injection
71
+ end
72
+
73
+ # @see the `==` method
74
+ # @param [Object] Object to be compared
75
+ def eql?(other)
76
+ self == other
77
+ end
78
+
79
+ # Calculates hash code according to all attributes.
80
+ # @return [Integer] Hash code
81
+ def hash
82
+ [injection].hash
83
+ end
84
+
85
+ # Builds the object from hash
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ # @return [Object] Returns the model itself
88
+ def self.build_from_hash(attributes)
89
+ return nil unless attributes.is_a?(Hash)
90
+ attributes = attributes.transform_keys(&:to_sym)
91
+ transformed_hash = {}
92
+ types_mapping.each_pair do |key, type|
93
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
94
+ transformed_hash[key.to_sym] = nil
95
+ elsif type =~ /\AArray<(.*)>/i
96
+ # check to ensure the input is an array given that the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[attribute_map[key]].is_a?(Array)
99
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
100
+ _deserialize(::Regexp.last_match(1), v)
101
+ }
102
+ end
103
+ elsif !attributes[attribute_map[key]].nil?
104
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
105
+ end
106
+ end
107
+
108
+ new(transformed_hash)
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def self._deserialize(type, value)
116
+ case type.to_sym
117
+ when :Time
118
+ Time.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :Boolean
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+
134
+ when :Object
135
+ # generic object (usually a Hash), return directly
136
+ value
137
+ when /\AArray<(?<inner_type>.+)>\z/
138
+ inner_type = Regexp.last_match[:inner_type]
139
+ value.map { |v| _deserialize(inner_type, v) }
140
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
141
+ k_type = Regexp.last_match[:k_type]
142
+ v_type = Regexp.last_match[:v_type]
143
+ {}.tap do |hash|
144
+ value.each do |k, v|
145
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
146
+ end
147
+ end
148
+ # model
149
+ else
150
+ # models (e.g. Pet) or oneOf
151
+ klass = Algolia::Composition.const_get(type)
152
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
153
+ .build_from_hash(value)
154
+ end
155
+ end
156
+
157
+ # Returns the string representation of the object
158
+ # @return [String] String presentation of the object
159
+ def to_s
160
+ to_hash.to_s
161
+ end
162
+
163
+ # to_body is an alias to to_hash (backward compatibility)
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_body
166
+ to_hash
167
+ end
168
+
169
+ def to_json(*_args)
170
+ to_hash.to_json
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to?(:to_hash)
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+ end
208
+ end
209
+ end
@@ -25,7 +25,7 @@ module Algolia
25
25
  # Attribute type mapping.
26
26
  def self.types_mapping
27
27
  {
28
- :feeds => :"Hash<String, Injection>",
28
+ :feeds => :"Hash<String, FeedInjection>",
29
29
  :feeds_order => :"Array<String>"
30
30
  }
31
31
  end
@@ -104,6 +104,9 @@ module Algolia
104
104
  # The search query string.
105
105
  attr_accessor :query
106
106
 
107
+ # The ID of the feed.
108
+ attr_accessor :feed_id
109
+
107
110
  attr_accessor :compositions
108
111
 
109
112
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -142,6 +145,7 @@ module Algolia
142
145
  :page => :page,
143
146
  :params => :params,
144
147
  :query => :query,
148
+ :feed_id => :feedID,
145
149
  :compositions => :compositions
146
150
  }
147
151
  end
@@ -182,6 +186,7 @@ module Algolia
182
186
  :page => :"Integer",
183
187
  :params => :"String",
184
188
  :query => :"String",
189
+ :feed_id => :"String",
185
190
  :compositions => :"Hash<String, ResultsCompositionInfoResponse>"
186
191
  }
187
192
  end
@@ -367,6 +372,10 @@ module Algolia
367
372
  self.query = attributes[:query]
368
373
  end
369
374
 
375
+ if attributes.key?(:feed_id)
376
+ self.feed_id = attributes[:feed_id]
377
+ end
378
+
370
379
  if attributes.key?(:compositions)
371
380
  if (value = attributes[:compositions]).is_a?(Hash)
372
381
  self.compositions = value
@@ -414,6 +423,7 @@ module Algolia
414
423
  page == other.page &&
415
424
  params == other.params &&
416
425
  query == other.query &&
426
+ feed_id == other.feed_id &&
417
427
  compositions == other.compositions
418
428
  end
419
429
 
@@ -460,6 +470,7 @@ module Algolia
460
470
  page,
461
471
  params,
462
472
  query,
473
+ feed_id,
463
474
  compositions
464
475
  ].hash
465
476
  end
@@ -3,5 +3,5 @@
3
3
  # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
4
 
5
5
  module Algolia
6
- VERSION = "3.35.1"
6
+ VERSION = "3.36.0"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.35.1
4
+ version: 3.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://alg.li/support
@@ -301,6 +301,7 @@ files:
301
301
  - lib/algolia/models/composition/facet_hits.rb
302
302
  - lib/algolia/models/composition/facet_ordering.rb
303
303
  - lib/algolia/models/composition/facet_stats.rb
304
+ - lib/algolia/models/composition/feed_injection.rb
304
305
  - lib/algolia/models/composition/get_task_response.rb
305
306
  - lib/algolia/models/composition/highlight_result.rb
306
307
  - lib/algolia/models/composition/highlight_result_option.rb