algolia 3.0.0.beta.10 → 3.0.0.beta.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +2 -2
- data/lib/algolia/api/ingestion_client.rb +912 -359
- data/lib/algolia/api/query_suggestions_client.rb +4 -10
- data/lib/algolia/api/search_client.rb +4 -4
- data/lib/algolia/api/usage_client.rb +4 -4
- data/lib/algolia/error.rb +10 -0
- data/lib/algolia/logger_helper.rb +11 -2
- data/lib/algolia/models/abtesting/{filter_effects_empty_search.rb → empty_search_filter.rb} +3 -3
- data/lib/algolia/models/abtesting/filter_effects.rb +2 -2
- data/lib/algolia/models/abtesting/{filter_effects_outliers.rb → outliers_filter.rb} +3 -3
- data/lib/algolia/models/analytics/{click_positions_inner.rb → click_position.rb} +3 -3
- data/lib/algolia/models/analytics/get_click_positions_response.rb +1 -1
- data/lib/algolia/models/analytics/top_search_with_analytics.rb +1 -1
- data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +1 -1
- data/lib/algolia/models/ingestion/action.rb +45 -0
- data/lib/algolia/models/{search/search_for_hits_options.rb → ingestion/batch_request.rb} +22 -20
- data/lib/algolia/models/ingestion/{source_shopify_base.rb → batch_write_params.rb} +14 -12
- data/lib/algolia/models/ingestion/docker_streams_input.rb +1 -0
- data/lib/algolia/models/{recommend/recommendations_hits.rb → ingestion/list_tasks_response_v1.rb} +26 -14
- data/lib/algolia/models/ingestion/task.rb +30 -9
- data/lib/algolia/models/ingestion/task_create.rb +11 -12
- data/lib/algolia/models/{search/search_for_facets_options.rb → ingestion/task_create_v1.rb} +86 -51
- data/lib/algolia/models/ingestion/task_update.rb +8 -7
- data/lib/algolia/models/{search/browse_pagination.rb → ingestion/task_update_v1.rb} +50 -55
- data/lib/algolia/models/{recommend/looking_similar.rb → ingestion/task_v1.rb} +147 -30
- data/lib/algolia/models/ingestion/{transformation_try_response_error.rb → transformation_error.rb} +3 -3
- data/lib/algolia/models/ingestion/transformation_try_response.rb +1 -1
- data/lib/algolia/models/monitoring/{incidents_inner.rb → incident_entry.rb} +3 -3
- data/lib/algolia/models/monitoring/{indexing_time_response_metrics.rb → indexing_metric.rb} +3 -3
- data/lib/algolia/models/monitoring/indexing_time_response.rb +1 -1
- data/lib/algolia/models/monitoring/infrastructure_response.rb +1 -1
- data/lib/algolia/models/monitoring/{latency_response_metrics.rb → latency_metric.rb} +3 -3
- data/lib/algolia/models/monitoring/latency_response.rb +1 -1
- data/lib/algolia/models/monitoring/{infrastructure_response_metrics.rb → metrics.rb} +3 -6
- data/lib/algolia/models/monitoring/{time_inner.rb → time_entry.rb} +3 -3
- data/lib/algolia/models/{recommend/trending_items.rb → query-suggestions/config_status.rb} +46 -58
- data/lib/algolia/models/{recommend/related_products.rb → query-suggestions/log_file.rb} +36 -32
- data/lib/algolia/models/recommend/around_precision.rb +1 -1
- data/lib/algolia/models/recommend/fallback_params.rb +1 -1
- data/lib/algolia/models/recommend/{around_precision_from_value_inner.rb → range.rb} +3 -6
- data/lib/algolia/models/recommend/recommend_rule.rb +1 -1
- data/lib/algolia/models/recommend/{redirect_rule_index_metadata_data.rb → redirect_rule_index_data.rb} +3 -3
- data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +1 -1
- data/lib/algolia/models/recommend/{recommend_rule_metadata.rb → rule_metadata.rb} +3 -3
- data/lib/algolia/models/recommend/search_params.rb +1 -1
- data/lib/algolia/models/recommend/search_params_object.rb +1 -1
- data/lib/algolia/models/search/around_precision.rb +1 -1
- data/lib/algolia/models/search/browse_params_object.rb +1 -1
- data/lib/algolia/models/search/built_in_operation.rb +1 -2
- data/lib/algolia/models/search/built_in_operation_value.rb +105 -0
- data/lib/algolia/models/search/consequence_params.rb +1 -1
- data/lib/algolia/models/search/dictionary_entry.rb +0 -2
- data/lib/algolia/models/search/index_settings.rb +2 -2
- data/lib/algolia/models/search/{around_precision_from_value_inner.rb → range.rb} +3 -6
- data/lib/algolia/models/search/{redirect_rule_index_metadata_data.rb → redirect_rule_index_data.rb} +3 -3
- data/lib/algolia/models/search/redirect_rule_index_metadata.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +1 -1
- data/lib/algolia/models/search/search_for_hits.rb +1 -1
- data/lib/algolia/models/search/search_params_object.rb +1 -1
- data/lib/algolia/models/search/search_params_string.rb +1 -0
- data/lib/algolia/models/search/{index_settings_as_search_params.rb → settings_response.rb} +251 -11
- data/lib/algolia/models/usage/{get_usage400_response_error_errors_inner.rb → error_item.rb} +3 -3
- data/lib/algolia/models/usage/{get_usage400_response_error.rb → forbidden_error.rb} +4 -4
- data/lib/algolia/models/usage/{get_usage200_response.rb → index_usage.rb} +4 -4
- data/lib/algolia/models/usage/invalid_request_error.rb +231 -0
- data/lib/algolia/models/usage/{get_usage200_response_statistics_inner.rb → statistic_entry.rb} +3 -3
- data/lib/algolia/transport/transport.rb +8 -2
- data/lib/algolia/version.rb +1 -1
- metadata +32 -63
- data/lib/algolia/models/abtesting/custom_search_params.rb +0 -214
- data/lib/algolia/models/abtesting/error_base.rb +0 -212
- data/lib/algolia/models/analytics/error_base.rb +0 -212
- data/lib/algolia/models/ingestion/error_base.rb +0 -212
- data/lib/algolia/models/insights/error_base.rb +0 -212
- data/lib/algolia/models/monitoring/error_base.rb +0 -212
- data/lib/algolia/models/monitoring/get_servers403_response.rb +0 -211
- data/lib/algolia/models/personalization/error_base.rb +0 -212
- data/lib/algolia/models/query-suggestions/app_id.rb +0 -209
- data/lib/algolia/models/query-suggestions/error_base.rb +0 -212
- data/lib/algolia/models/recommend/base_recommend_request.rb +0 -281
- data/lib/algolia/models/recommend/base_search_params.rb +0 -635
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +0 -616
- data/lib/algolia/models/recommend/base_search_response.rb +0 -499
- data/lib/algolia/models/recommend/error_base.rb +0 -212
- data/lib/algolia/models/recommend/frequently_bought_together.rb +0 -247
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +0 -788
- data/lib/algolia/models/recommend/recommended_for_you.rb +0 -244
- data/lib/algolia/models/recommend/search_pagination.rb +0 -282
- data/lib/algolia/models/recommend/search_params_query.rb +0 -212
- data/lib/algolia/models/recommend/trending_facets.rb +0 -258
- data/lib/algolia/models/search/base_get_api_key_response.rb +0 -224
- data/lib/algolia/models/search/base_index_settings.rb +0 -426
- data/lib/algolia/models/search/base_search_params.rb +0 -635
- data/lib/algolia/models/search/base_search_params_without_query.rb +0 -616
- data/lib/algolia/models/search/base_search_response.rb +0 -499
- data/lib/algolia/models/search/cursor.rb +0 -209
- data/lib/algolia/models/search/error_base.rb +0 -212
- data/lib/algolia/models/search/params.rb +0 -236
- data/lib/algolia/models/search/search_hits.rb +0 -240
- data/lib/algolia/models/search/search_pagination.rb +0 -282
- data/lib/algolia/models/search/search_params_query.rb +0 -212
- data/lib/algolia/models/usage/error_base.rb +0 -212
- data/lib/algolia/models/usage/get_usage400_response.rb +0 -213
@@ -4,14 +4,38 @@ require "date"
|
|
4
4
|
require "time"
|
5
5
|
|
6
6
|
module Algolia
|
7
|
-
module
|
8
|
-
|
9
|
-
|
7
|
+
module Ingestion
|
8
|
+
# The V1 task object, please use methods and types that don't contain the V1 suffix.
|
9
|
+
class TaskV1
|
10
|
+
# Universally unique identifier (UUID) of a task.
|
11
|
+
attr_accessor :task_id
|
10
12
|
|
11
|
-
#
|
12
|
-
attr_accessor :
|
13
|
+
# Universally uniqud identifier (UUID) of a source.
|
14
|
+
attr_accessor :source_id
|
13
15
|
|
14
|
-
|
16
|
+
# Universally unique identifier (UUID) of a destination resource.
|
17
|
+
attr_accessor :destination_id
|
18
|
+
|
19
|
+
attr_accessor :trigger
|
20
|
+
|
21
|
+
attr_accessor :input
|
22
|
+
|
23
|
+
# Whether the task is enabled.
|
24
|
+
attr_accessor :enabled
|
25
|
+
|
26
|
+
# Maximum accepted percentage of failures for a task run to finish successfully.
|
27
|
+
attr_accessor :failure_threshold
|
28
|
+
|
29
|
+
attr_accessor :action
|
30
|
+
|
31
|
+
# Date of the last cursor in RFC 3339 format.
|
32
|
+
attr_accessor :cursor
|
33
|
+
|
34
|
+
# Date of creation in RFC 3339 format.
|
35
|
+
attr_accessor :created_at
|
36
|
+
|
37
|
+
# Date of last update in RFC 3339 format.
|
38
|
+
attr_accessor :updated_at
|
15
39
|
|
16
40
|
class EnumAttributeValidator
|
17
41
|
attr_reader :datatype
|
@@ -38,9 +62,17 @@ module Algolia
|
|
38
62
|
# Attribute mapping from ruby-style variable name to JSON key.
|
39
63
|
def self.attribute_map
|
40
64
|
{
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
65
|
+
:task_id => :taskID,
|
66
|
+
:source_id => :sourceID,
|
67
|
+
:destination_id => :destinationID,
|
68
|
+
:trigger => :trigger,
|
69
|
+
:input => :input,
|
70
|
+
:enabled => :enabled,
|
71
|
+
:failure_threshold => :failureThreshold,
|
72
|
+
:action => :action,
|
73
|
+
:cursor => :cursor,
|
74
|
+
:created_at => :createdAt,
|
75
|
+
:updated_at => :updatedAt
|
44
76
|
}
|
45
77
|
end
|
46
78
|
|
@@ -52,9 +84,17 @@ module Algolia
|
|
52
84
|
# Attribute type mapping.
|
53
85
|
def self.types_mapping
|
54
86
|
{
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
87
|
+
:task_id => :"String",
|
88
|
+
:source_id => :"String",
|
89
|
+
:destination_id => :"String",
|
90
|
+
:trigger => :"Trigger",
|
91
|
+
:input => :"TaskInput",
|
92
|
+
:enabled => :"Boolean",
|
93
|
+
:failure_threshold => :"Integer",
|
94
|
+
:action => :"ActionType",
|
95
|
+
:cursor => :"String",
|
96
|
+
:created_at => :"String",
|
97
|
+
:updated_at => :"String"
|
58
98
|
}
|
59
99
|
end
|
60
100
|
|
@@ -69,10 +109,7 @@ module Algolia
|
|
69
109
|
# @param [Hash] attributes Model attributes in the form of hash
|
70
110
|
def initialize(attributes = {})
|
71
111
|
if (!attributes.is_a?(Hash))
|
72
|
-
raise(
|
73
|
-
ArgumentError,
|
74
|
-
"The input argument (attributes) must be a hash in `Algolia::LookingSimilar` initialize method"
|
75
|
-
)
|
112
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::TaskV1` initialize method"
|
76
113
|
end
|
77
114
|
|
78
115
|
# check to see if the attribute exists and convert string to symbol for hash key
|
@@ -80,7 +117,7 @@ module Algolia
|
|
80
117
|
if (!self.class.attribute_map.key?(k.to_sym))
|
81
118
|
raise(
|
82
119
|
ArgumentError,
|
83
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
120
|
+
"`#{k}` is not a valid attribute in `Algolia::TaskV1`. Please check the name to make sure it's valid. List of attributes: " +
|
84
121
|
self.class.attribute_map.keys.inspect
|
85
122
|
)
|
86
123
|
end
|
@@ -88,21 +125,81 @@ module Algolia
|
|
88
125
|
h[k.to_sym] = v
|
89
126
|
}
|
90
127
|
|
91
|
-
if attributes.key?(:
|
92
|
-
self.
|
128
|
+
if attributes.key?(:task_id)
|
129
|
+
self.task_id = attributes[:task_id]
|
93
130
|
else
|
94
|
-
self.
|
131
|
+
self.task_id = nil
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:source_id)
|
135
|
+
self.source_id = attributes[:source_id]
|
136
|
+
else
|
137
|
+
self.source_id = nil
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:destination_id)
|
141
|
+
self.destination_id = attributes[:destination_id]
|
142
|
+
else
|
143
|
+
self.destination_id = nil
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.key?(:trigger)
|
147
|
+
self.trigger = attributes[:trigger]
|
148
|
+
else
|
149
|
+
self.trigger = nil
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:input)
|
153
|
+
self.input = attributes[:input]
|
95
154
|
end
|
96
155
|
|
97
|
-
if attributes.key?(:
|
98
|
-
self.
|
156
|
+
if attributes.key?(:enabled)
|
157
|
+
self.enabled = attributes[:enabled]
|
99
158
|
else
|
100
|
-
self.
|
159
|
+
self.enabled = nil
|
101
160
|
end
|
102
161
|
|
103
|
-
if attributes.key?(:
|
104
|
-
self.
|
162
|
+
if attributes.key?(:failure_threshold)
|
163
|
+
self.failure_threshold = attributes[:failure_threshold]
|
105
164
|
end
|
165
|
+
|
166
|
+
if attributes.key?(:action)
|
167
|
+
self.action = attributes[:action]
|
168
|
+
else
|
169
|
+
self.action = nil
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:cursor)
|
173
|
+
self.cursor = attributes[:cursor]
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:created_at)
|
177
|
+
self.created_at = attributes[:created_at]
|
178
|
+
else
|
179
|
+
self.created_at = nil
|
180
|
+
end
|
181
|
+
|
182
|
+
if attributes.key?(:updated_at)
|
183
|
+
self.updated_at = attributes[:updated_at]
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# Custom attribute writer method with validation
|
188
|
+
# @param [Object] failure_threshold Value to be assigned
|
189
|
+
def failure_threshold=(failure_threshold)
|
190
|
+
if failure_threshold.nil?
|
191
|
+
raise ArgumentError, "failure_threshold cannot be nil"
|
192
|
+
end
|
193
|
+
|
194
|
+
if failure_threshold > 100
|
195
|
+
raise ArgumentError, "invalid value for \"failure_threshold\", must be smaller than or equal to 100."
|
196
|
+
end
|
197
|
+
|
198
|
+
if failure_threshold < 0
|
199
|
+
raise ArgumentError, "invalid value for \"failure_threshold\", must be greater than or equal to 0."
|
200
|
+
end
|
201
|
+
|
202
|
+
@failure_threshold = failure_threshold
|
106
203
|
end
|
107
204
|
|
108
205
|
# Checks equality by comparing each attribute.
|
@@ -110,9 +207,17 @@ module Algolia
|
|
110
207
|
def ==(other)
|
111
208
|
return true if self.equal?(other)
|
112
209
|
self.class == other.class &&
|
113
|
-
|
114
|
-
|
115
|
-
|
210
|
+
task_id == other.task_id &&
|
211
|
+
source_id == other.source_id &&
|
212
|
+
destination_id == other.destination_id &&
|
213
|
+
trigger == other.trigger &&
|
214
|
+
input == other.input &&
|
215
|
+
enabled == other.enabled &&
|
216
|
+
failure_threshold == other.failure_threshold &&
|
217
|
+
action == other.action &&
|
218
|
+
cursor == other.cursor &&
|
219
|
+
created_at == other.created_at &&
|
220
|
+
updated_at == other.updated_at
|
116
221
|
end
|
117
222
|
|
118
223
|
# @see the `==` method
|
@@ -124,7 +229,19 @@ module Algolia
|
|
124
229
|
# Calculates hash code according to all attributes.
|
125
230
|
# @return [Integer] Hash code
|
126
231
|
def hash
|
127
|
-
[
|
232
|
+
[
|
233
|
+
task_id,
|
234
|
+
source_id,
|
235
|
+
destination_id,
|
236
|
+
trigger,
|
237
|
+
input,
|
238
|
+
enabled,
|
239
|
+
failure_threshold,
|
240
|
+
action,
|
241
|
+
cursor,
|
242
|
+
created_at,
|
243
|
+
updated_at
|
244
|
+
].hash
|
128
245
|
end
|
129
246
|
|
130
247
|
# Builds the object from hash
|
@@ -193,7 +310,7 @@ module Algolia
|
|
193
310
|
# model
|
194
311
|
else
|
195
312
|
# models (e.g. Pet) or oneOf
|
196
|
-
klass = Algolia::
|
313
|
+
klass = Algolia::Ingestion.const_get(type)
|
197
314
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
198
315
|
.build_from_hash(value)
|
199
316
|
end
|
data/lib/algolia/models/ingestion/{transformation_try_response_error.rb → transformation_error.rb}
RENAMED
@@ -6,7 +6,7 @@ require "time"
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
8
|
# The error if the transformation failed.
|
9
|
-
class
|
9
|
+
class TransformationError
|
10
10
|
# The error status code.
|
11
11
|
attr_accessor :code
|
12
12
|
|
@@ -47,7 +47,7 @@ module Algolia
|
|
47
47
|
if (!attributes.is_a?(Hash))
|
48
48
|
raise(
|
49
49
|
ArgumentError,
|
50
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
50
|
+
"The input argument (attributes) must be a hash in `Algolia::TransformationError` initialize method"
|
51
51
|
)
|
52
52
|
end
|
53
53
|
|
@@ -56,7 +56,7 @@ module Algolia
|
|
56
56
|
if (!self.class.attribute_map.key?(k.to_sym))
|
57
57
|
raise(
|
58
58
|
ArgumentError,
|
59
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
59
|
+
"`#{k}` is not a valid attribute in `Algolia::TransformationError`. Please check the name to make sure it's valid. List of attributes: " +
|
60
60
|
self.class.attribute_map.keys.inspect
|
61
61
|
)
|
62
62
|
end
|
@@ -5,7 +5,7 @@ require "time"
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Monitoring
|
8
|
-
class
|
8
|
+
class IncidentEntry
|
9
9
|
# Timestamp, measured in milliseconds since the Unix epoch.
|
10
10
|
attr_accessor :t
|
11
11
|
|
@@ -45,7 +45,7 @@ module Algolia
|
|
45
45
|
if (!attributes.is_a?(Hash))
|
46
46
|
raise(
|
47
47
|
ArgumentError,
|
48
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
48
|
+
"The input argument (attributes) must be a hash in `Algolia::IncidentEntry` initialize method"
|
49
49
|
)
|
50
50
|
end
|
51
51
|
|
@@ -54,7 +54,7 @@ module Algolia
|
|
54
54
|
if (!self.class.attribute_map.key?(k.to_sym))
|
55
55
|
raise(
|
56
56
|
ArgumentError,
|
57
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
57
|
+
"`#{k}` is not a valid attribute in `Algolia::IncidentEntry`. Please check the name to make sure it's valid. List of attributes: " +
|
58
58
|
self.class.attribute_map.keys.inspect
|
59
59
|
)
|
60
60
|
end
|
@@ -5,7 +5,7 @@ require "time"
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Monitoring
|
8
|
-
class
|
8
|
+
class IndexingMetric
|
9
9
|
attr_accessor :indexing
|
10
10
|
|
11
11
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -40,7 +40,7 @@ module Algolia
|
|
40
40
|
if (!attributes.is_a?(Hash))
|
41
41
|
raise(
|
42
42
|
ArgumentError,
|
43
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
43
|
+
"The input argument (attributes) must be a hash in `Algolia::IndexingMetric` initialize method"
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
@@ -49,7 +49,7 @@ module Algolia
|
|
49
49
|
if (!self.class.attribute_map.key?(k.to_sym))
|
50
50
|
raise(
|
51
51
|
ArgumentError,
|
52
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
52
|
+
"`#{k}` is not a valid attribute in `Algolia::IndexingMetric`. Please check the name to make sure it's valid. List of attributes: " +
|
53
53
|
self.class.attribute_map.keys.inspect
|
54
54
|
)
|
55
55
|
end
|
@@ -5,7 +5,7 @@ require "time"
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Monitoring
|
8
|
-
class
|
8
|
+
class LatencyMetric
|
9
9
|
attr_accessor :latency
|
10
10
|
|
11
11
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -40,7 +40,7 @@ module Algolia
|
|
40
40
|
if (!attributes.is_a?(Hash))
|
41
41
|
raise(
|
42
42
|
ArgumentError,
|
43
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
43
|
+
"The input argument (attributes) must be a hash in `Algolia::LatencyMetric` initialize method"
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
@@ -49,7 +49,7 @@ module Algolia
|
|
49
49
|
if (!self.class.attribute_map.key?(k.to_sym))
|
50
50
|
raise(
|
51
51
|
ArgumentError,
|
52
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
52
|
+
"`#{k}` is not a valid attribute in `Algolia::LatencyMetric`. Please check the name to make sure it's valid. List of attributes: " +
|
53
53
|
self.class.attribute_map.keys.inspect
|
54
54
|
)
|
55
55
|
end
|
@@ -5,7 +5,7 @@ require "time"
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Monitoring
|
8
|
-
class
|
8
|
+
class Metrics
|
9
9
|
# CPU idleness in %.
|
10
10
|
attr_accessor :cpu_usage
|
11
11
|
|
@@ -59,10 +59,7 @@ module Algolia
|
|
59
59
|
# @param [Hash] attributes Model attributes in the form of hash
|
60
60
|
def initialize(attributes = {})
|
61
61
|
if (!attributes.is_a?(Hash))
|
62
|
-
raise(
|
63
|
-
ArgumentError,
|
64
|
-
"The input argument (attributes) must be a hash in `Algolia::InfrastructureResponseMetrics` initialize method"
|
65
|
-
)
|
62
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::Metrics` initialize method"
|
66
63
|
end
|
67
64
|
|
68
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
@@ -70,7 +67,7 @@ module Algolia
|
|
70
67
|
if (!self.class.attribute_map.key?(k.to_sym))
|
71
68
|
raise(
|
72
69
|
ArgumentError,
|
73
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
70
|
+
"`#{k}` is not a valid attribute in `Algolia::Metrics`. Please check the name to make sure it's valid. List of attributes: " +
|
74
71
|
self.class.attribute_map.keys.inspect
|
75
72
|
)
|
76
73
|
end
|
@@ -5,7 +5,7 @@ require "time"
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Monitoring
|
8
|
-
class
|
8
|
+
class TimeEntry
|
9
9
|
# Timestamp, measured in milliseconds since the Unix epoch.
|
10
10
|
attr_accessor :t
|
11
11
|
|
@@ -46,7 +46,7 @@ module Algolia
|
|
46
46
|
if (!attributes.is_a?(Hash))
|
47
47
|
raise(
|
48
48
|
ArgumentError,
|
49
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
49
|
+
"The input argument (attributes) must be a hash in `Algolia::TimeEntry` initialize method"
|
50
50
|
)
|
51
51
|
end
|
52
52
|
|
@@ -55,7 +55,7 @@ module Algolia
|
|
55
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
56
56
|
raise(
|
57
57
|
ArgumentError,
|
58
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
58
|
+
"`#{k}` is not a valid attribute in `Algolia::TimeEntry`. Please check the name to make sure it's valid. List of attributes: " +
|
59
59
|
self.class.attribute_map.keys.inspect
|
60
60
|
)
|
61
61
|
end
|
@@ -4,47 +4,31 @@ require "date"
|
|
4
4
|
require "time"
|
5
5
|
|
6
6
|
module Algolia
|
7
|
-
module
|
8
|
-
class
|
9
|
-
#
|
10
|
-
attr_accessor :
|
11
|
-
|
12
|
-
# Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet filter will be returned.
|
13
|
-
attr_accessor :facet_value
|
14
|
-
|
15
|
-
attr_accessor :model
|
16
|
-
|
17
|
-
attr_accessor :fallback_parameters
|
18
|
-
|
19
|
-
class EnumAttributeValidator
|
20
|
-
attr_reader :datatype
|
21
|
-
attr_reader :allowable_values
|
22
|
-
|
23
|
-
def initialize(datatype, allowable_values)
|
24
|
-
@allowable_values = allowable_values.map do |value|
|
25
|
-
case datatype.to_s
|
26
|
-
when /Integer/i
|
27
|
-
value.to_i
|
28
|
-
when /Float/i
|
29
|
-
value.to_f
|
30
|
-
else
|
31
|
-
value
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
7
|
+
module QuerySuggestions
|
8
|
+
class ConfigStatus
|
9
|
+
# Name of the Query Suggestions index (case-sensitive).
|
10
|
+
attr_accessor :index_name
|
35
11
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
12
|
+
# Whether the creation or update of the Query Suggestions index is in progress.
|
13
|
+
attr_accessor :is_running
|
14
|
+
|
15
|
+
# Date and time when the Query Suggestions index was last built, in RFC 3339 format.
|
16
|
+
attr_accessor :last_built_at
|
17
|
+
|
18
|
+
# Date and time when the Query Suggestions index was last updated successfully.
|
19
|
+
attr_accessor :last_successful_built_at
|
20
|
+
|
21
|
+
# Duration of the last successful build in seconds.
|
22
|
+
attr_accessor :last_successful_build_duration
|
40
23
|
|
41
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
25
|
def self.attribute_map
|
43
26
|
{
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
27
|
+
:index_name => :indexName,
|
28
|
+
:is_running => :isRunning,
|
29
|
+
:last_built_at => :lastBuiltAt,
|
30
|
+
:last_successful_built_at => :lastSuccessfulBuiltAt,
|
31
|
+
:last_successful_build_duration => :lastSuccessfulBuildDuration
|
48
32
|
}
|
49
33
|
end
|
50
34
|
|
@@ -56,10 +40,11 @@ module Algolia
|
|
56
40
|
# Attribute type mapping.
|
57
41
|
def self.types_mapping
|
58
42
|
{
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
43
|
+
:index_name => :"String",
|
44
|
+
:is_running => :"Boolean",
|
45
|
+
:last_built_at => :"String",
|
46
|
+
:last_successful_built_at => :"String",
|
47
|
+
:last_successful_build_duration => :"String"
|
63
48
|
}
|
64
49
|
end
|
65
50
|
|
@@ -76,7 +61,7 @@ module Algolia
|
|
76
61
|
if (!attributes.is_a?(Hash))
|
77
62
|
raise(
|
78
63
|
ArgumentError,
|
79
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
64
|
+
"The input argument (attributes) must be a hash in `Algolia::ConfigStatus` initialize method"
|
80
65
|
)
|
81
66
|
end
|
82
67
|
|
@@ -85,7 +70,7 @@ module Algolia
|
|
85
70
|
if (!self.class.attribute_map.key?(k.to_sym))
|
86
71
|
raise(
|
87
72
|
ArgumentError,
|
88
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
73
|
+
"`#{k}` is not a valid attribute in `Algolia::ConfigStatus`. Please check the name to make sure it's valid. List of attributes: " +
|
89
74
|
self.class.attribute_map.keys.inspect
|
90
75
|
)
|
91
76
|
end
|
@@ -93,22 +78,24 @@ module Algolia
|
|
93
78
|
h[k.to_sym] = v
|
94
79
|
}
|
95
80
|
|
96
|
-
if attributes.key?(:
|
97
|
-
self.
|
81
|
+
if attributes.key?(:index_name)
|
82
|
+
self.index_name = attributes[:index_name]
|
98
83
|
end
|
99
84
|
|
100
|
-
if attributes.key?(:
|
101
|
-
self.
|
85
|
+
if attributes.key?(:is_running)
|
86
|
+
self.is_running = attributes[:is_running]
|
102
87
|
end
|
103
88
|
|
104
|
-
if attributes.key?(:
|
105
|
-
self.
|
106
|
-
|
107
|
-
|
89
|
+
if attributes.key?(:last_built_at)
|
90
|
+
self.last_built_at = attributes[:last_built_at]
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:last_successful_built_at)
|
94
|
+
self.last_successful_built_at = attributes[:last_successful_built_at]
|
108
95
|
end
|
109
96
|
|
110
|
-
if attributes.key?(:
|
111
|
-
self.
|
97
|
+
if attributes.key?(:last_successful_build_duration)
|
98
|
+
self.last_successful_build_duration = attributes[:last_successful_build_duration]
|
112
99
|
end
|
113
100
|
end
|
114
101
|
|
@@ -117,10 +104,11 @@ module Algolia
|
|
117
104
|
def ==(other)
|
118
105
|
return true if self.equal?(other)
|
119
106
|
self.class == other.class &&
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
107
|
+
index_name == other.index_name &&
|
108
|
+
is_running == other.is_running &&
|
109
|
+
last_built_at == other.last_built_at &&
|
110
|
+
last_successful_built_at == other.last_successful_built_at &&
|
111
|
+
last_successful_build_duration == other.last_successful_build_duration
|
124
112
|
end
|
125
113
|
|
126
114
|
# @see the `==` method
|
@@ -132,7 +120,7 @@ module Algolia
|
|
132
120
|
# Calculates hash code according to all attributes.
|
133
121
|
# @return [Integer] Hash code
|
134
122
|
def hash
|
135
|
-
[
|
123
|
+
[index_name, is_running, last_built_at, last_successful_built_at, last_successful_build_duration].hash
|
136
124
|
end
|
137
125
|
|
138
126
|
# Builds the object from hash
|
@@ -201,7 +189,7 @@ module Algolia
|
|
201
189
|
# model
|
202
190
|
else
|
203
191
|
# models (e.g. Pet) or oneOf
|
204
|
-
klass = Algolia::
|
192
|
+
klass = Algolia::QuerySuggestions.const_get(type)
|
205
193
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
206
194
|
.build_from_hash(value)
|
207
195
|
end
|