algolia 3.16.0 → 3.18.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.
@@ -0,0 +1,36 @@
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 Search
10
+ class EventType
11
+ FETCH = "fetch".freeze
12
+ RECORD = "record".freeze
13
+ LOG = "log".freeze
14
+ TRANSFORM = "transform".freeze
15
+
16
+ def self.all_vars
17
+ @all_vars ||= [FETCH, RECORD, LOG, TRANSFORM].freeze
18
+ end
19
+
20
+ # Builds the enum from string
21
+ # @param [String] The enum value in the form of the string
22
+ # @return [String] The enum value
23
+ def self.build_from_hash(value)
24
+ new.build_from_hash(value)
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def build_from_hash(value)
31
+ return value if EventType.all_vars.include?(value)
32
+ raise "Invalid ENUM value #{value} for class #EventType"
33
+ end
34
+ end
35
+ end
36
+ end
@@ -10,9 +10,11 @@ module Algolia
10
10
  class TypoToleranceEnum
11
11
  MIN = "min".freeze
12
12
  STRICT = "strict".freeze
13
+ TRUE = "true".freeze
14
+ FALSE = "false".freeze
13
15
 
14
16
  def self.all_vars
15
- @all_vars ||= [MIN, STRICT].freeze
17
+ @all_vars ||= [MIN, STRICT, TRUE, FALSE].freeze
16
18
  end
17
19
 
18
20
  # Builds the enum from string
@@ -0,0 +1,265 @@
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 Search
10
+ class WatchResponse
11
+ # Universally unique identifier (UUID) of a task run.
12
+ attr_accessor :run_id
13
+
14
+ # Universally unique identifier (UUID) of an event.
15
+ attr_accessor :event_id
16
+
17
+ # This field is always null when used with the Push endpoint. When used for a source discover or source validate run, it will include the sampled data of the source.
18
+ attr_accessor :data
19
+
20
+ # in case of error, observability events will be added to the response.
21
+ attr_accessor :events
22
+
23
+ # a message describing the outcome of the operation that has been ran (push, discover or validate) run.
24
+ attr_accessor :message
25
+
26
+ # Date of creation in RFC 3339 format.
27
+ attr_accessor :created_at
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :run_id => :runID,
33
+ :event_id => :eventID,
34
+ :data => :data,
35
+ :events => :events,
36
+ :message => :message,
37
+ :created_at => :createdAt
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.types_mapping
43
+ {
44
+ :run_id => :"String",
45
+ :event_id => :"String",
46
+ :data => :"Array<Object>",
47
+ :events => :"Array<Event>",
48
+ :message => :"String",
49
+ :created_at => :"String"
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new(
56
+ []
57
+ )
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ raise(
65
+ ArgumentError,
66
+ "The input argument (attributes) must be a hash in `Algolia::WatchResponse` initialize method"
67
+ )
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ raise(
74
+ ArgumentError,
75
+ "`#{k}` is not a valid attribute in `Algolia::WatchResponse`. Please check the name to make sure it's valid. List of attributes: " +
76
+ self.class.attribute_map.keys.inspect
77
+ )
78
+ end
79
+
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:run_id)
84
+ self.run_id = attributes[:run_id]
85
+ else
86
+ self.run_id = nil
87
+ end
88
+
89
+ if attributes.key?(:event_id)
90
+ self.event_id = attributes[:event_id]
91
+ end
92
+
93
+ if attributes.key?(:data)
94
+ if (value = attributes[:data]).is_a?(Array)
95
+ self.data = value
96
+ end
97
+ end
98
+
99
+ if attributes.key?(:events)
100
+ if (value = attributes[:events]).is_a?(Array)
101
+ self.events = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:message)
106
+ self.message = attributes[:message]
107
+ end
108
+
109
+ if attributes.key?(:created_at)
110
+ self.created_at = attributes[:created_at]
111
+ end
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(other)
117
+ return true if self.equal?(other)
118
+ self.class == other.class &&
119
+ run_id == other.run_id &&
120
+ event_id == other.event_id &&
121
+ data == other.data &&
122
+ events == other.events &&
123
+ message == other.message &&
124
+ created_at == other.created_at
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(other)
130
+ self == other
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [run_id, event_id, data, events, message, created_at].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ attributes = attributes.transform_keys(&:to_sym)
145
+ transformed_hash = {}
146
+ types_mapping.each_pair do |key, type|
147
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
148
+ transformed_hash[key.to_sym] = nil
149
+ elsif type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[attribute_map[key]].is_a?(Array)
153
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
154
+ _deserialize(::Regexp.last_match(1), v)
155
+ }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+
162
+ new(transformed_hash)
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def self._deserialize(type, value)
170
+ case type.to_sym
171
+ when :Time
172
+ Time.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ # model
203
+ else
204
+ # models (e.g. Pet) or oneOf
205
+ klass = Algolia::Search.const_get(type)
206
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
207
+ .build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ def to_json(*_args)
224
+ to_hash.to_json
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+
241
+ hash
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map { |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to?(:to_hash)
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+
262
+ end
263
+
264
+ end
265
+ 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.16.0"
6
+ VERSION = "3.18.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.16.0
4
+ version: 3.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://alg.li/support
@@ -405,13 +405,17 @@ files:
405
405
  - lib/algolia/models/ingestion/task_update_v1.rb
406
406
  - lib/algolia/models/ingestion/task_v1.rb
407
407
  - lib/algolia/models/ingestion/transformation.rb
408
+ - lib/algolia/models/ingestion/transformation_code.rb
408
409
  - lib/algolia/models/ingestion/transformation_create.rb
409
410
  - lib/algolia/models/ingestion/transformation_create_response.rb
410
411
  - lib/algolia/models/ingestion/transformation_error.rb
412
+ - lib/algolia/models/ingestion/transformation_input.rb
413
+ - lib/algolia/models/ingestion/transformation_no_code.rb
411
414
  - lib/algolia/models/ingestion/transformation_search.rb
412
415
  - lib/algolia/models/ingestion/transformation_sort_keys.rb
413
416
  - lib/algolia/models/ingestion/transformation_try.rb
414
417
  - lib/algolia/models/ingestion/transformation_try_response.rb
418
+ - lib/algolia/models/ingestion/transformation_type.rb
415
419
  - lib/algolia/models/ingestion/transformation_update_response.rb
416
420
  - lib/algolia/models/ingestion/trigger.rb
417
421
  - lib/algolia/models/ingestion/trigger_type.rb
@@ -622,6 +626,9 @@ files:
622
626
  - lib/algolia/models/search/edit.rb
623
627
  - lib/algolia/models/search/edit_type.rb
624
628
  - lib/algolia/models/search/error_base.rb
629
+ - lib/algolia/models/search/event.rb
630
+ - lib/algolia/models/search/event_status.rb
631
+ - lib/algolia/models/search/event_type.rb
625
632
  - lib/algolia/models/search/exact_on_single_word_query.rb
626
633
  - lib/algolia/models/search/exhaustive.rb
627
634
  - lib/algolia/models/search/facet_filters.rb
@@ -731,6 +738,7 @@ files:
731
738
  - lib/algolia/models/search/user_hit.rb
732
739
  - lib/algolia/models/search/user_id.rb
733
740
  - lib/algolia/models/search/value.rb
741
+ - lib/algolia/models/search/watch_response.rb
734
742
  - lib/algolia/models/search/widgets.rb
735
743
  - lib/algolia/transport/call_type.rb
736
744
  - lib/algolia/transport/echo_requester.rb