algolia 3.17.0 → 3.19.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 +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/ingestion_client.rb +12 -3
- data/lib/algolia/models/composition/search_results_item.rb +0 -2
- data/lib/algolia/models/ingestion/transformation_create.rb +0 -4
- data/lib/algolia/models/ingestion/transformation_try.rb +19 -3
- data/lib/algolia/models/ingestion/watch_response.rb +3 -3
- data/lib/algolia/models/recommend/recommendations_results.rb +0 -2
- data/lib/algolia/models/search/browse_response.rb +0 -2
- data/lib/algolia/models/search/event.rb +281 -0
- data/lib/algolia/models/search/event_status.rb +38 -0
- data/lib/algolia/models/search/event_type.rb +36 -0
- data/lib/algolia/models/search/search_response.rb +0 -2
- data/lib/algolia/models/search/watch_response.rb +265 -0
- data/lib/algolia/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dc1d4b4b89f71b73d4977ac3fe520bb3685edf11ffe1ee95bca8374e2e1134a
|
4
|
+
data.tar.gz: 5b4208660bc7c81beea899cb8cee45e789d8b17053e66e53e620e5d2a24e67d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a92986647516aaa6d955704ef912d411e23b37976a988cf8cf672d1f72052e63e5ff6df870e655bff789f1d48fe8a673192468b277c65c1f8e526ba8ecf1aa6d
|
7
|
+
data.tar.gz: 967804977eba434d02da15689376bb88883728fbe835d0824eec79843c9cb4cf2aad8d8c250964d2fd7878a95f804cbe86c08edc943d1444076712ada010a4fa
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## [3.19.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.18.0...3.19.0)
|
2
|
+
|
3
|
+
- [6031284e24](https://github.com/algolia/api-clients-automation/commit/6031284e24) feat(specs): update try transformation specs for no-code ([#4974](https://github.com/algolia/api-clients-automation/pull/4974)) by [@mehmetaligok](https://github.com/mehmetaligok/)
|
4
|
+
- [2561c945f7](https://github.com/algolia/api-clients-automation/commit/2561c945f7) fix(clients): processingTimeMS should be optional ([#5004](https://github.com/algolia/api-clients-automation/pull/5004)) by [@Fluf22](https://github.com/Fluf22/)
|
5
|
+
- [973cc0c07e](https://github.com/algolia/api-clients-automation/commit/973cc0c07e) feat(specs): add new ingestion property for push ([#5007](https://github.com/algolia/api-clients-automation/pull/5007)) by [@shortcuts](https://github.com/shortcuts/)
|
6
|
+
|
7
|
+
## [3.18.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.17.0...3.18.0)
|
8
|
+
|
9
|
+
- [835daccb48](https://github.com/algolia/api-clients-automation/commit/835daccb48) feat(specs): add with transformation helpers ([#4931](https://github.com/algolia/api-clients-automation/pull/4931)) by [@shortcuts](https://github.com/shortcuts/)
|
10
|
+
|
1
11
|
## [3.17.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.16.0...3.17.0)
|
2
12
|
|
3
13
|
- [9db03b532b](https://github.com/algolia/api-clients-automation/commit/9db03b532b) fix(specs): typo ([#4854](https://github.com/algolia/api-clients-automation/pull/4854)) by [@kai687](https://github.com/kai687/)
|
data/Gemfile.lock
CHANGED
@@ -2147,9 +2147,16 @@ module Algolia
|
|
2147
2147
|
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
2148
2148
|
# @param push_task_payload [PushTaskPayload] (required)
|
2149
2149
|
# @param watch [Boolean] When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
|
2150
|
+
# @param reference_index_name [String] This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name).
|
2150
2151
|
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
2151
2152
|
# @return [Http::Response] the response
|
2152
|
-
def push_with_http_info(
|
2153
|
+
def push_with_http_info(
|
2154
|
+
index_name,
|
2155
|
+
push_task_payload,
|
2156
|
+
watch = nil,
|
2157
|
+
reference_index_name = nil,
|
2158
|
+
request_options = {}
|
2159
|
+
)
|
2153
2160
|
# verify the required parameter 'index_name' is set
|
2154
2161
|
if @api_client.config.client_side_validation && index_name.nil?
|
2155
2162
|
raise ArgumentError, "Parameter `index_name` is required when calling `push`."
|
@@ -2162,6 +2169,7 @@ module Algolia
|
|
2162
2169
|
path = "/1/push/{indexName}".sub("{" + "indexName" + "}", Transport.encode_uri(index_name.to_s))
|
2163
2170
|
query_params = {}
|
2164
2171
|
query_params[:watch] = watch unless watch.nil?
|
2172
|
+
query_params[:referenceIndexName] = reference_index_name unless reference_index_name.nil?
|
2165
2173
|
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
2166
2174
|
header_params = {}
|
2167
2175
|
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
@@ -2190,10 +2198,11 @@ module Algolia
|
|
2190
2198
|
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
2191
2199
|
# @param push_task_payload [PushTaskPayload] (required)
|
2192
2200
|
# @param watch [Boolean] When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
|
2201
|
+
# @param reference_index_name [String] This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name).
|
2193
2202
|
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
2194
2203
|
# @return [WatchResponse]
|
2195
|
-
def push(index_name, push_task_payload, watch = nil, request_options = {})
|
2196
|
-
response = push_with_http_info(index_name, push_task_payload, watch, request_options)
|
2204
|
+
def push(index_name, push_task_payload, watch = nil, reference_index_name = nil, request_options = {})
|
2205
|
+
response = push_with_http_info(index_name, push_task_payload, watch, reference_index_name, request_options)
|
2197
2206
|
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::WatchResponse")
|
2198
2207
|
end
|
2199
2208
|
|
@@ -91,14 +91,10 @@ module Algolia
|
|
91
91
|
|
92
92
|
if attributes.key?(:type)
|
93
93
|
self.type = attributes[:type]
|
94
|
-
else
|
95
|
-
self.type = nil
|
96
94
|
end
|
97
95
|
|
98
96
|
if attributes.key?(:input)
|
99
97
|
self.input = attributes[:input]
|
100
|
-
else
|
101
|
-
self.input = nil
|
102
98
|
end
|
103
99
|
|
104
100
|
if attributes.key?(:description)
|
@@ -11,6 +11,10 @@ module Algolia
|
|
11
11
|
# It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
|
12
12
|
attr_accessor :code
|
13
13
|
|
14
|
+
attr_accessor :type
|
15
|
+
|
16
|
+
attr_accessor :input
|
17
|
+
|
14
18
|
# The record to apply the given code to.
|
15
19
|
attr_accessor :sample_record
|
16
20
|
|
@@ -20,6 +24,8 @@ module Algolia
|
|
20
24
|
def self.attribute_map
|
21
25
|
{
|
22
26
|
:code => :code,
|
27
|
+
:type => :type,
|
28
|
+
:input => :input,
|
23
29
|
:sample_record => :sampleRecord,
|
24
30
|
:authentications => :authentications
|
25
31
|
}
|
@@ -29,6 +35,8 @@ module Algolia
|
|
29
35
|
def self.types_mapping
|
30
36
|
{
|
31
37
|
:code => :"String",
|
38
|
+
:type => :"TransformationType",
|
39
|
+
:input => :"TransformationInput",
|
32
40
|
:sample_record => :"Object",
|
33
41
|
:authentications => :"Array<AuthenticationCreate>"
|
34
42
|
}
|
@@ -66,8 +74,14 @@ module Algolia
|
|
66
74
|
|
67
75
|
if attributes.key?(:code)
|
68
76
|
self.code = attributes[:code]
|
69
|
-
|
70
|
-
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:type)
|
80
|
+
self.type = attributes[:type]
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:input)
|
84
|
+
self.input = attributes[:input]
|
71
85
|
end
|
72
86
|
|
73
87
|
if attributes.key?(:sample_record)
|
@@ -89,6 +103,8 @@ module Algolia
|
|
89
103
|
return true if self.equal?(other)
|
90
104
|
self.class == other.class &&
|
91
105
|
code == other.code &&
|
106
|
+
type == other.type &&
|
107
|
+
input == other.input &&
|
92
108
|
sample_record == other.sample_record &&
|
93
109
|
authentications == other.authentications
|
94
110
|
end
|
@@ -102,7 +118,7 @@ module Algolia
|
|
102
118
|
# Calculates hash code according to all attributes.
|
103
119
|
# @return [Integer] Hash code
|
104
120
|
def hash
|
105
|
-
[code, sample_record, authentications].hash
|
121
|
+
[code, type, input, sample_record, authentications].hash
|
106
122
|
end
|
107
123
|
|
108
124
|
# Builds the object from hash
|
@@ -14,13 +14,13 @@ module Algolia
|
|
14
14
|
# Universally unique identifier (UUID) of an event.
|
15
15
|
attr_accessor :event_id
|
16
16
|
|
17
|
-
# when used with
|
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
18
|
attr_accessor :data
|
19
19
|
|
20
|
-
# in case of error, observability events will be added to the response
|
20
|
+
# in case of error, observability events will be added to the response.
|
21
21
|
attr_accessor :events
|
22
22
|
|
23
|
-
# a message describing the outcome of
|
23
|
+
# a message describing the outcome of the operation that has been ran (push, discover or validate) run.
|
24
24
|
attr_accessor :message
|
25
25
|
|
26
26
|
# Date of creation in RFC 3339 format.
|
@@ -0,0 +1,281 @@
|
|
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
|
+
# An event describe a step of the task execution flow..
|
11
|
+
class Event
|
12
|
+
# Universally unique identifier (UUID) of an event.
|
13
|
+
attr_accessor :event_id
|
14
|
+
|
15
|
+
# Universally unique identifier (UUID) of a task run.
|
16
|
+
attr_accessor :run_id
|
17
|
+
|
18
|
+
attr_accessor :status
|
19
|
+
|
20
|
+
attr_accessor :type
|
21
|
+
|
22
|
+
# The extracted record batch size.
|
23
|
+
attr_accessor :batch_size
|
24
|
+
|
25
|
+
attr_accessor :data
|
26
|
+
|
27
|
+
# Date of publish RFC 3339 format.
|
28
|
+
attr_accessor :published_at
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:event_id => :eventID,
|
34
|
+
:run_id => :runID,
|
35
|
+
:status => :status,
|
36
|
+
:type => :type,
|
37
|
+
:batch_size => :batchSize,
|
38
|
+
:data => :data,
|
39
|
+
:published_at => :publishedAt
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.types_mapping
|
45
|
+
{
|
46
|
+
:event_id => :"String",
|
47
|
+
:run_id => :"String",
|
48
|
+
:status => :"EventStatus",
|
49
|
+
:type => :"EventType",
|
50
|
+
:batch_size => :"Integer",
|
51
|
+
:data => :"Hash<String, Object>",
|
52
|
+
:published_at => :"String"
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# List of attributes with nullable: true
|
57
|
+
def self.openapi_nullable
|
58
|
+
Set.new(
|
59
|
+
[
|
60
|
+
:status,
|
61
|
+
:data
|
62
|
+
]
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Initializes the object
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
68
|
+
def initialize(attributes = {})
|
69
|
+
if (!attributes.is_a?(Hash))
|
70
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::Event` initialize method"
|
71
|
+
end
|
72
|
+
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
75
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
76
|
+
raise(
|
77
|
+
ArgumentError,
|
78
|
+
"`#{k}` is not a valid attribute in `Algolia::Event`. Please check the name to make sure it's valid. List of attributes: " +
|
79
|
+
self.class.attribute_map.keys.inspect
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
h[k.to_sym] = v
|
84
|
+
}
|
85
|
+
|
86
|
+
if attributes.key?(:event_id)
|
87
|
+
self.event_id = attributes[:event_id]
|
88
|
+
else
|
89
|
+
self.event_id = nil
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:run_id)
|
93
|
+
self.run_id = attributes[:run_id]
|
94
|
+
else
|
95
|
+
self.run_id = nil
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:status)
|
99
|
+
self.status = attributes[:status]
|
100
|
+
else
|
101
|
+
self.status = nil
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:type)
|
105
|
+
self.type = attributes[:type]
|
106
|
+
else
|
107
|
+
self.type = nil
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:batch_size)
|
111
|
+
self.batch_size = attributes[:batch_size]
|
112
|
+
else
|
113
|
+
self.batch_size = nil
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:data)
|
117
|
+
if (value = attributes[:data]).is_a?(Hash)
|
118
|
+
self.data = value
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:published_at)
|
123
|
+
self.published_at = attributes[:published_at]
|
124
|
+
else
|
125
|
+
self.published_at = nil
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# Checks equality by comparing each attribute.
|
130
|
+
# @param [Object] Object to be compared
|
131
|
+
def ==(other)
|
132
|
+
return true if self.equal?(other)
|
133
|
+
self.class == other.class &&
|
134
|
+
event_id == other.event_id &&
|
135
|
+
run_id == other.run_id &&
|
136
|
+
status == other.status &&
|
137
|
+
type == other.type &&
|
138
|
+
batch_size == other.batch_size &&
|
139
|
+
data == other.data &&
|
140
|
+
published_at == other.published_at
|
141
|
+
end
|
142
|
+
|
143
|
+
# @see the `==` method
|
144
|
+
# @param [Object] Object to be compared
|
145
|
+
def eql?(other)
|
146
|
+
self == other
|
147
|
+
end
|
148
|
+
|
149
|
+
# Calculates hash code according to all attributes.
|
150
|
+
# @return [Integer] Hash code
|
151
|
+
def hash
|
152
|
+
[event_id, run_id, status, type, batch_size, data, published_at].hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Builds the object from hash
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
+
# @return [Object] Returns the model itself
|
158
|
+
def self.build_from_hash(attributes)
|
159
|
+
return nil unless attributes.is_a?(Hash)
|
160
|
+
attributes = attributes.transform_keys(&:to_sym)
|
161
|
+
transformed_hash = {}
|
162
|
+
types_mapping.each_pair do |key, type|
|
163
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
164
|
+
transformed_hash[key.to_sym] = nil
|
165
|
+
elsif type =~ /\AArray<(.*)>/i
|
166
|
+
# check to ensure the input is an array given that the attribute
|
167
|
+
# is documented as an array but the input is not
|
168
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
169
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
170
|
+
_deserialize(::Regexp.last_match(1), v)
|
171
|
+
}
|
172
|
+
end
|
173
|
+
elsif !attributes[attribute_map[key]].nil?
|
174
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
new(transformed_hash)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Deserializes the data based on type
|
182
|
+
# @param string type Data type
|
183
|
+
# @param string value Value to be deserialized
|
184
|
+
# @return [Object] Deserialized data
|
185
|
+
def self._deserialize(type, value)
|
186
|
+
case type.to_sym
|
187
|
+
when :Time
|
188
|
+
Time.parse(value)
|
189
|
+
when :Date
|
190
|
+
Date.parse(value)
|
191
|
+
when :String
|
192
|
+
value.to_s
|
193
|
+
when :Integer
|
194
|
+
value.to_i
|
195
|
+
when :Float
|
196
|
+
value.to_f
|
197
|
+
when :Boolean
|
198
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
199
|
+
true
|
200
|
+
else
|
201
|
+
false
|
202
|
+
end
|
203
|
+
|
204
|
+
when :Object
|
205
|
+
# generic object (usually a Hash), return directly
|
206
|
+
value
|
207
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
208
|
+
inner_type = Regexp.last_match[:inner_type]
|
209
|
+
value.map { |v| _deserialize(inner_type, v) }
|
210
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
211
|
+
k_type = Regexp.last_match[:k_type]
|
212
|
+
v_type = Regexp.last_match[:v_type]
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each do |k, v|
|
215
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
# model
|
219
|
+
else
|
220
|
+
# models (e.g. Pet) or oneOf
|
221
|
+
klass = Algolia::Search.const_get(type)
|
222
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
223
|
+
.build_from_hash(value)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
# Returns the string representation of the object
|
228
|
+
# @return [String] String presentation of the object
|
229
|
+
def to_s
|
230
|
+
to_hash.to_s
|
231
|
+
end
|
232
|
+
|
233
|
+
# to_body is an alias to to_hash (backward compatibility)
|
234
|
+
# @return [Hash] Returns the object in the form of hash
|
235
|
+
def to_body
|
236
|
+
to_hash
|
237
|
+
end
|
238
|
+
|
239
|
+
def to_json(*_args)
|
240
|
+
to_hash.to_json
|
241
|
+
end
|
242
|
+
|
243
|
+
# Returns the object in the form of hash
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_hash
|
246
|
+
hash = {}
|
247
|
+
self.class.attribute_map.each_pair do |attr, param|
|
248
|
+
value = send(attr)
|
249
|
+
if value.nil?
|
250
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
251
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
252
|
+
end
|
253
|
+
|
254
|
+
hash[param] = _to_hash(value)
|
255
|
+
end
|
256
|
+
|
257
|
+
hash
|
258
|
+
end
|
259
|
+
|
260
|
+
# Outputs non-array value in the form of hash
|
261
|
+
# For object, use to_hash. Otherwise, just return the value
|
262
|
+
# @param [Object] value Any valid value
|
263
|
+
# @return [Hash] Returns the value in the form of hash
|
264
|
+
def _to_hash(value)
|
265
|
+
if value.is_a?(Array)
|
266
|
+
value.compact.map { |v| _to_hash(v) }
|
267
|
+
elsif value.is_a?(Hash)
|
268
|
+
{}.tap do |hash|
|
269
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
270
|
+
end
|
271
|
+
elsif value.respond_to?(:to_hash)
|
272
|
+
value.to_hash
|
273
|
+
else
|
274
|
+
value
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
end
|
279
|
+
|
280
|
+
end
|
281
|
+
end
|
@@ -0,0 +1,38 @@
|
|
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 EventStatus
|
11
|
+
CREATED = "created".freeze
|
12
|
+
STARTED = "started".freeze
|
13
|
+
RETRIED = "retried".freeze
|
14
|
+
FAILED = "failed".freeze
|
15
|
+
SUCCEEDED = "succeeded".freeze
|
16
|
+
CRITICAL = "critical".freeze
|
17
|
+
|
18
|
+
def self.all_vars
|
19
|
+
@all_vars ||= [CREATED, STARTED, RETRIED, FAILED, SUCCEEDED, CRITICAL].freeze
|
20
|
+
end
|
21
|
+
|
22
|
+
# Builds the enum from string
|
23
|
+
# @param [String] The enum value in the form of the string
|
24
|
+
# @return [String] The enum value
|
25
|
+
def self.build_from_hash(value)
|
26
|
+
new.build_from_hash(value)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Builds the enum from string
|
30
|
+
# @param [String] The enum value in the form of the string
|
31
|
+
# @return [String] The enum value
|
32
|
+
def build_from_hash(value)
|
33
|
+
return value if EventStatus.all_vars.include?(value)
|
34
|
+
raise "Invalid ENUM value #{value} for class #EventStatus"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -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
|
@@ -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
|
data/lib/algolia/version.rb
CHANGED
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.
|
4
|
+
version: 3.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://alg.li/support
|
@@ -626,6 +626,9 @@ files:
|
|
626
626
|
- lib/algolia/models/search/edit.rb
|
627
627
|
- lib/algolia/models/search/edit_type.rb
|
628
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
|
629
632
|
- lib/algolia/models/search/exact_on_single_word_query.rb
|
630
633
|
- lib/algolia/models/search/exhaustive.rb
|
631
634
|
- lib/algolia/models/search/facet_filters.rb
|
@@ -735,6 +738,7 @@ files:
|
|
735
738
|
- lib/algolia/models/search/user_hit.rb
|
736
739
|
- lib/algolia/models/search/user_id.rb
|
737
740
|
- lib/algolia/models/search/value.rb
|
741
|
+
- lib/algolia/models/search/watch_response.rb
|
738
742
|
- lib/algolia/models/search/widgets.rb
|
739
743
|
- lib/algolia/transport/call_type.rb
|
740
744
|
- lib/algolia/transport/echo_requester.rb
|