algolia 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,212 @@
1
+ # 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.
2
+
3
+ require "date"
4
+ require "time"
5
+
6
+ module Algolia
7
+ module Search
8
+ # Error.
9
+ class ErrorBase
10
+ attr_accessor :message
11
+
12
+ attr_accessor :additional_properties
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :message => :message
18
+ }
19
+ end
20
+
21
+ # Returns all the JSON keys this model knows about
22
+ def self.acceptable_attributes
23
+ attribute_map.values
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.types_mapping
28
+ {
29
+ :message => :"String"
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new(
36
+ []
37
+ )
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ raise(
45
+ ArgumentError,
46
+ "The input argument (attributes) must be a hash in `Algolia::ErrorBase` initialize method"
47
+ )
48
+ end
49
+
50
+ if attributes.key?(:message)
51
+ self.message = attributes[:message]
52
+ end
53
+
54
+ # add extra attribute to additional_properties
55
+ self.additional_properties ||= {}
56
+ self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
57
+ end
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] Object to be compared
61
+ def ==(other)
62
+ return true if self.equal?(other)
63
+ self.class == other.class &&
64
+ message == other.message
65
+ end
66
+
67
+ # @see the `==` method
68
+ # @param [Object] Object to be compared
69
+ def eql?(other)
70
+ self == other
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Integer] Hash code
75
+ def hash
76
+ [message].hash
77
+ end
78
+
79
+ # Builds the object from hash
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @return [Object] Returns the model itself
82
+ def self.build_from_hash(attributes)
83
+ return nil unless attributes.is_a?(Hash)
84
+ attributes = attributes.transform_keys(&:to_sym)
85
+ transformed_hash = {}
86
+ types_mapping.each_pair do |key, type|
87
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
88
+ transformed_hash[key.to_sym] = nil
89
+ elsif type =~ /\AArray<(.*)>/i
90
+ # check to ensure the input is an array given that the attribute
91
+ # is documented as an array but the input is not
92
+ if attributes[attribute_map[key]].is_a?(Array)
93
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
94
+ _deserialize(::Regexp.last_match(1), v)
95
+ }
96
+ end
97
+ elsif !attributes[attribute_map[key]].nil?
98
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
99
+ end
100
+ end
101
+
102
+ # add extra attribute to transformed_hash
103
+ transformed_hash.merge!(attributes.reject { |k, _| attribute_map.key?(k.to_sym) })
104
+ new(transformed_hash)
105
+ end
106
+
107
+ # Deserializes the data based on type
108
+ # @param string type Data type
109
+ # @param string value Value to be deserialized
110
+ # @return [Object] Deserialized data
111
+ def self._deserialize(type, value)
112
+ case type.to_sym
113
+ when :Time
114
+ Time.parse(value)
115
+ when :Date
116
+ Date.parse(value)
117
+ when :String
118
+ value.to_s
119
+ when :Integer
120
+ value.to_i
121
+ when :Float
122
+ value.to_f
123
+ when :Boolean
124
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
125
+ true
126
+ else
127
+ false
128
+ end
129
+
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ # model
145
+ else
146
+ # models (e.g. Pet) or oneOf
147
+ klass = Algolia::Search.const_get(type)
148
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
149
+ .build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ def to_json(*_args)
166
+ to_hash.to_json
167
+ end
168
+
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = send(attr)
175
+ if value.nil?
176
+ is_nullable = self.class.openapi_nullable.include?(attr)
177
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
178
+ end
179
+
180
+ hash[param] = _to_hash(value)
181
+ end
182
+
183
+ # also add attributes from additional_properties to hash
184
+ self.additional_properties&.each_pair do |k, v|
185
+ hash[k.to_sym] = _to_hash(v)
186
+ end
187
+
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map { |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to?(:to_hash)
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+
211
+ end
212
+ end
@@ -0,0 +1,212 @@
1
+ # 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.
2
+
3
+ require "date"
4
+ require "time"
5
+
6
+ module Algolia
7
+ module Usage
8
+ # Error.
9
+ class ErrorBase
10
+ attr_accessor :message
11
+
12
+ attr_accessor :additional_properties
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :message => :message
18
+ }
19
+ end
20
+
21
+ # Returns all the JSON keys this model knows about
22
+ def self.acceptable_attributes
23
+ attribute_map.values
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.types_mapping
28
+ {
29
+ :message => :"String"
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new(
36
+ []
37
+ )
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ raise(
45
+ ArgumentError,
46
+ "The input argument (attributes) must be a hash in `Algolia::ErrorBase` initialize method"
47
+ )
48
+ end
49
+
50
+ if attributes.key?(:message)
51
+ self.message = attributes[:message]
52
+ end
53
+
54
+ # add extra attribute to additional_properties
55
+ self.additional_properties ||= {}
56
+ self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
57
+ end
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] Object to be compared
61
+ def ==(other)
62
+ return true if self.equal?(other)
63
+ self.class == other.class &&
64
+ message == other.message
65
+ end
66
+
67
+ # @see the `==` method
68
+ # @param [Object] Object to be compared
69
+ def eql?(other)
70
+ self == other
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Integer] Hash code
75
+ def hash
76
+ [message].hash
77
+ end
78
+
79
+ # Builds the object from hash
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @return [Object] Returns the model itself
82
+ def self.build_from_hash(attributes)
83
+ return nil unless attributes.is_a?(Hash)
84
+ attributes = attributes.transform_keys(&:to_sym)
85
+ transformed_hash = {}
86
+ types_mapping.each_pair do |key, type|
87
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
88
+ transformed_hash[key.to_sym] = nil
89
+ elsif type =~ /\AArray<(.*)>/i
90
+ # check to ensure the input is an array given that the attribute
91
+ # is documented as an array but the input is not
92
+ if attributes[attribute_map[key]].is_a?(Array)
93
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
94
+ _deserialize(::Regexp.last_match(1), v)
95
+ }
96
+ end
97
+ elsif !attributes[attribute_map[key]].nil?
98
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
99
+ end
100
+ end
101
+
102
+ # add extra attribute to transformed_hash
103
+ transformed_hash.merge!(attributes.reject { |k, _| attribute_map.key?(k.to_sym) })
104
+ new(transformed_hash)
105
+ end
106
+
107
+ # Deserializes the data based on type
108
+ # @param string type Data type
109
+ # @param string value Value to be deserialized
110
+ # @return [Object] Deserialized data
111
+ def self._deserialize(type, value)
112
+ case type.to_sym
113
+ when :Time
114
+ Time.parse(value)
115
+ when :Date
116
+ Date.parse(value)
117
+ when :String
118
+ value.to_s
119
+ when :Integer
120
+ value.to_i
121
+ when :Float
122
+ value.to_f
123
+ when :Boolean
124
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
125
+ true
126
+ else
127
+ false
128
+ end
129
+
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ # model
145
+ else
146
+ # models (e.g. Pet) or oneOf
147
+ klass = Algolia::Usage.const_get(type)
148
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
149
+ .build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ def to_json(*_args)
166
+ to_hash.to_json
167
+ end
168
+
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = send(attr)
175
+ if value.nil?
176
+ is_nullable = self.class.openapi_nullable.include?(attr)
177
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
178
+ end
179
+
180
+ hash[param] = _to_hash(value)
181
+ end
182
+
183
+ # also add attributes from additional_properties to hash
184
+ self.additional_properties&.each_pair do |k, v|
185
+ hash[k.to_sym] = _to_hash(v)
186
+ end
187
+
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map { |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to?(:to_hash)
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+
211
+ end
212
+ end
@@ -1,5 +1,5 @@
1
1
  # 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.
2
2
 
3
3
  module Algolia
4
- VERSION = "3.2.0".freeze
4
+ VERSION = "3.2.1".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://alg.li/support
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-27 00:00:00.000000000 Z
11
+ date: 2024-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -155,6 +155,7 @@ files:
155
155
  - lib/algolia/models/abtesting/effect.rb
156
156
  - lib/algolia/models/abtesting/empty_search.rb
157
157
  - lib/algolia/models/abtesting/empty_search_filter.rb
158
+ - lib/algolia/models/abtesting/error_base.rb
158
159
  - lib/algolia/models/abtesting/filter_effects.rb
159
160
  - lib/algolia/models/abtesting/list_ab_tests_response.rb
160
161
  - lib/algolia/models/abtesting/minimum_detectable_effect.rb
@@ -179,6 +180,7 @@ files:
179
180
  - lib/algolia/models/analytics/daily_searches_no_results.rb
180
181
  - lib/algolia/models/analytics/daily_users.rb
181
182
  - lib/algolia/models/analytics/direction.rb
183
+ - lib/algolia/models/analytics/error_base.rb
182
184
  - lib/algolia/models/analytics/get_add_to_cart_rate_response.rb
183
185
  - lib/algolia/models/analytics/get_average_click_position_response.rb
184
186
  - lib/algolia/models/analytics/get_click_positions_response.rb
@@ -265,6 +267,7 @@ files:
265
267
  - lib/algolia/models/ingestion/docker_streams_input.rb
266
268
  - lib/algolia/models/ingestion/docker_streams_sync_mode.rb
267
269
  - lib/algolia/models/ingestion/entity_type.rb
270
+ - lib/algolia/models/ingestion/error_base.rb
268
271
  - lib/algolia/models/ingestion/event.rb
269
272
  - lib/algolia/models/ingestion/event_sort_keys.rb
270
273
  - lib/algolia/models/ingestion/event_status.rb
@@ -376,6 +379,7 @@ files:
376
379
  - lib/algolia/models/insights/converted_object_ids.rb
377
380
  - lib/algolia/models/insights/converted_object_ids_after_search.rb
378
381
  - lib/algolia/models/insights/discount.rb
382
+ - lib/algolia/models/insights/error_base.rb
379
383
  - lib/algolia/models/insights/events_items.rb
380
384
  - lib/algolia/models/insights/events_response.rb
381
385
  - lib/algolia/models/insights/insights_events.rb
@@ -389,6 +393,7 @@ files:
389
393
  - lib/algolia/models/insights/view_event.rb
390
394
  - lib/algolia/models/insights/viewed_filters.rb
391
395
  - lib/algolia/models/insights/viewed_object_ids.rb
396
+ - lib/algolia/models/monitoring/error_base.rb
392
397
  - lib/algolia/models/monitoring/incident.rb
393
398
  - lib/algolia/models/monitoring/incident_entry.rb
394
399
  - lib/algolia/models/monitoring/incidents_response.rb
@@ -410,6 +415,7 @@ files:
410
415
  - lib/algolia/models/monitoring/time_entry.rb
411
416
  - lib/algolia/models/monitoring/type.rb
412
417
  - lib/algolia/models/personalization/delete_user_profile_response.rb
418
+ - lib/algolia/models/personalization/error_base.rb
413
419
  - lib/algolia/models/personalization/event_scoring.rb
414
420
  - lib/algolia/models/personalization/event_type.rb
415
421
  - lib/algolia/models/personalization/facet_scoring.rb
@@ -423,6 +429,7 @@ files:
423
429
  - lib/algolia/models/query-suggestions/configuration.rb
424
430
  - lib/algolia/models/query-suggestions/configuration_response.rb
425
431
  - lib/algolia/models/query-suggestions/configuration_with_index.rb
432
+ - lib/algolia/models/query-suggestions/error_base.rb
426
433
  - lib/algolia/models/query-suggestions/facet.rb
427
434
  - lib/algolia/models/query-suggestions/get_config_status200_response.rb
428
435
  - lib/algolia/models/query-suggestions/get_log_file200_response.rb
@@ -444,6 +451,7 @@ files:
444
451
  - lib/algolia/models/recommend/consequence.rb
445
452
  - lib/algolia/models/recommend/deleted_at_response.rb
446
453
  - lib/algolia/models/recommend/distinct.rb
454
+ - lib/algolia/models/recommend/error_base.rb
447
455
  - lib/algolia/models/recommend/exact_on_single_word_query.rb
448
456
  - lib/algolia/models/recommend/exhaustive.rb
449
457
  - lib/algolia/models/recommend/facet_filters.rb
@@ -559,6 +567,7 @@ files:
559
567
  - lib/algolia/models/search/distinct.rb
560
568
  - lib/algolia/models/search/edit.rb
561
569
  - lib/algolia/models/search/edit_type.rb
570
+ - lib/algolia/models/search/error_base.rb
562
571
  - lib/algolia/models/search/exact_on_single_word_query.rb
563
572
  - lib/algolia/models/search/exhaustive.rb
564
573
  - lib/algolia/models/search/facet_filters.rb
@@ -667,6 +676,7 @@ files:
667
676
  - lib/algolia/models/search/user_hit.rb
668
677
  - lib/algolia/models/search/user_id.rb
669
678
  - lib/algolia/models/search/value.rb
679
+ - lib/algolia/models/usage/error_base.rb
670
680
  - lib/algolia/models/usage/error_item.rb
671
681
  - lib/algolia/models/usage/forbidden_error.rb
672
682
  - lib/algolia/models/usage/granularity.rb