algolia 3.0.0.beta.4 → 3.0.0.beta.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/Gemfile.lock +1 -1
- data/LICENSE +21 -0
- data/README.md +4 -4
- data/lib/algolia/api/ingestion_client.rb +424 -58
- data/lib/algolia/api/search_client.rb +158 -3
- data/lib/algolia/models/ingestion/authentication.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_create_response.rb +1 -1
- data/lib/algolia/models/ingestion/authentication_update_response.rb +1 -1
- data/lib/algolia/models/ingestion/delete_response.rb +1 -1
- data/lib/algolia/models/ingestion/destination.rb +2 -2
- data/lib/algolia/models/ingestion/destination_create_response.rb +1 -1
- data/lib/algolia/models/ingestion/destination_update_response.rb +1 -1
- data/lib/algolia/models/ingestion/event.rb +1 -1
- data/lib/algolia/models/ingestion/list_transformations_response.rb +212 -0
- data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +2 -2
- data/lib/algolia/models/ingestion/on_demand_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/run.rb +3 -3
- data/lib/algolia/models/ingestion/run_response.rb +1 -1
- data/lib/algolia/models/ingestion/schedule_trigger.rb +2 -2
- data/lib/algolia/models/ingestion/sort_keys.rb +35 -0
- data/lib/algolia/models/ingestion/source.rb +2 -2
- data/lib/algolia/models/ingestion/source_create_response.rb +1 -1
- data/lib/algolia/models/ingestion/source_update_response.rb +1 -1
- data/lib/algolia/models/ingestion/source_watch_response.rb +233 -0
- data/lib/algolia/models/ingestion/task.rb +13 -3
- data/lib/algolia/models/ingestion/task_create.rb +14 -4
- data/lib/algolia/models/ingestion/task_create_response.rb +1 -1
- data/lib/algolia/models/ingestion/task_update_response.rb +1 -1
- data/lib/algolia/models/ingestion/transformation.rb +257 -0
- data/lib/algolia/models/ingestion/transformation_create.rb +224 -0
- data/lib/algolia/models/ingestion/{docker_source_discover.rb → transformation_create_response.rb} +14 -13
- data/lib/algolia/models/ingestion/{docker_source_streams.rb → transformation_search.rb} +12 -12
- data/lib/algolia/models/ingestion/transformation_try.rb +211 -0
- data/lib/algolia/models/ingestion/transformation_try_response.rb +210 -0
- data/lib/algolia/models/ingestion/transformation_try_response_error.rb +208 -0
- data/lib/algolia/models/ingestion/transformation_update_response.rb +212 -0
- data/lib/algolia/models/ingestion/window.rb +2 -2
- data/lib/algolia/models/recommend/base_search_response.rb +2 -4
- data/lib/algolia/models/recommend/fallback_params.rb +3 -1
- data/lib/algolia/models/recommend/recommendations_results.rb +1 -1
- data/lib/algolia/models/recommend/search_params.rb +3 -1
- data/lib/algolia/models/recommend/search_params_object.rb +3 -1
- data/lib/algolia/models/recommend/trending_facets_query.rb +3 -1
- data/lib/algolia/models/recommend/value.rb +16 -4
- data/lib/algolia/models/search/base_index_settings.rb +2 -4
- data/lib/algolia/models/search/base_search_response.rb +2 -4
- data/lib/algolia/models/search/browse_params_object.rb +3 -1
- data/lib/algolia/models/search/browse_response.rb +1 -1
- data/lib/algolia/models/search/consequence_params.rb +3 -1
- data/lib/algolia/models/search/fetched_index.rb +14 -4
- data/lib/algolia/models/search/index_settings.rb +4 -2
- data/lib/algolia/models/search/search_for_facets.rb +3 -1
- data/lib/algolia/models/search/search_for_hits.rb +3 -1
- data/lib/algolia/models/search/search_params_object.rb +3 -1
- data/lib/algolia/models/search/search_response.rb +1 -1
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +3 -3
- data/lib/algolia/models/search/value.rb +16 -4
- data/lib/algolia/version.rb +1 -1
- metadata +14 -7
- data/.openapi-generator/FILES +0 -11
- data/.openapi-generator/VERSION +0 -1
- data/.openapi-generator-ignore +0 -23
@@ -3154,9 +3154,6 @@ module Algolia
|
|
3154
3154
|
end.join('&')
|
3155
3155
|
|
3156
3156
|
hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), parent_api_key, url_encoded_restrictions)
|
3157
|
-
|
3158
|
-
puts "hmac: #{hmac}"
|
3159
|
-
puts "url_encoded_restrictions: #{url_encoded_restrictions}"
|
3160
3157
|
Base64.encode64("#{hmac}#{url_encoded_restrictions}").gsub("\n", '')
|
3161
3158
|
end
|
3162
3159
|
|
@@ -3180,5 +3177,163 @@ module Algolia
|
|
3180
3177
|
|
3181
3178
|
valid_until - now
|
3182
3179
|
end
|
3180
|
+
|
3181
|
+
# Helper: Saves the given array of objects in the given index. The `chunked_batch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
3182
|
+
#
|
3183
|
+
# @param index_name [String]: The `index_name` to save `objects` in.
|
3184
|
+
# @param objects [Array]: The array of `objects` to store in the given Algolia `indexName`.
|
3185
|
+
# @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)
|
3186
|
+
#
|
3187
|
+
# @return [BatchResponse]
|
3188
|
+
#
|
3189
|
+
def save_objects(index_name, objects, request_options = {})
|
3190
|
+
chunked_batch(
|
3191
|
+
index_name,
|
3192
|
+
objects,
|
3193
|
+
Search::Action::ADD_OBJECT,
|
3194
|
+
false,
|
3195
|
+
1000,
|
3196
|
+
request_options
|
3197
|
+
)
|
3198
|
+
end
|
3199
|
+
|
3200
|
+
# Helper: Deletes every records for the given objectIDs. The `chunked_batch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
|
3201
|
+
#
|
3202
|
+
# @param index_name [String]: The `index_name` to delete `object_ids` from.
|
3203
|
+
# @param object_ids [Array]: The object_ids to delete.
|
3204
|
+
# @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)
|
3205
|
+
#
|
3206
|
+
# @return [BatchResponse]
|
3207
|
+
#
|
3208
|
+
def delete_objects(index_name, object_ids, request_options = {})
|
3209
|
+
chunked_batch(
|
3210
|
+
index_name,
|
3211
|
+
object_ids.map { |id| { "objectID" => id } },
|
3212
|
+
Search::Action::DELETE_OBJECT,
|
3213
|
+
false,
|
3214
|
+
1000,
|
3215
|
+
request_options
|
3216
|
+
)
|
3217
|
+
end
|
3218
|
+
|
3219
|
+
# Helper: Replaces object content of all the given objects according to their respective `object_id` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
3220
|
+
#
|
3221
|
+
# @param index_name [String]: The `index_name` to delete `object_ids` from.
|
3222
|
+
# @param objects [Array]: The objects to partially update.
|
3223
|
+
# @param create_if_not_exists [Boolean]: To be provided if non-existing objects are passed, otherwise, the call will fail.
|
3224
|
+
# @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)
|
3225
|
+
#
|
3226
|
+
# @return [BatchResponse]
|
3227
|
+
#
|
3228
|
+
def partial_update_objects(index_name, objects, create_if_not_exists, request_options = {})
|
3229
|
+
chunked_batch(
|
3230
|
+
index_name,
|
3231
|
+
objects,
|
3232
|
+
create_if_not_exists ? Search::Action::PARTIAL_UPDATE_OBJECT : Search::Action::PARTIAL_UPDATE_OBJECT_NO_CREATE,
|
3233
|
+
false,
|
3234
|
+
1000,
|
3235
|
+
request_options
|
3236
|
+
)
|
3237
|
+
end
|
3238
|
+
|
3239
|
+
# Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
|
3240
|
+
#
|
3241
|
+
# @param index_name [String] the `index_name` where the operation will be performed.
|
3242
|
+
# @param objects [Array] The array of `objects` to store in the given Algolia `index_name`.
|
3243
|
+
# @param action [Action] The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
|
3244
|
+
# @param wait_for_tasks [Boolean] Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
|
3245
|
+
# @param batch_size [int] The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
3246
|
+
# @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)
|
3247
|
+
#
|
3248
|
+
# @return [Array<BatchResponse>]
|
3249
|
+
#
|
3250
|
+
def chunked_batch(index_name, objects, action = Action::ADD_OBJECT, wait_for_tasks = false, batch_size = 1000, request_options = {})
|
3251
|
+
responses = []
|
3252
|
+
objects.each_slice(batch_size) do |chunk|
|
3253
|
+
requests = chunk.map do |object|
|
3254
|
+
Search::BatchRequest.new(action: action, body: object)
|
3255
|
+
end
|
3256
|
+
|
3257
|
+
responses.append(batch(index_name, Search::BatchWriteParams.new(requests: requests), request_options))
|
3258
|
+
end
|
3259
|
+
|
3260
|
+
if wait_for_tasks
|
3261
|
+
responses.each do |response|
|
3262
|
+
wait_for_task(index_name, response.task_id)
|
3263
|
+
end
|
3264
|
+
end
|
3265
|
+
|
3266
|
+
responses
|
3267
|
+
end
|
3268
|
+
|
3269
|
+
# Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
|
3270
|
+
#
|
3271
|
+
# @param index_name [String] The `index_name` to replace `objects` in.
|
3272
|
+
# @param objects [Array] The array of `objects` to store in the given Algolia `index_name`.
|
3273
|
+
# @param batch_size [int] The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
3274
|
+
# @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)
|
3275
|
+
#
|
3276
|
+
# @return [Array<ReplaceAllObjectsResponse>]
|
3277
|
+
def replace_all_objects(index_name, objects, batch_size = 1000, request_options = {})
|
3278
|
+
tmp_index_name = index_name + '_tmp_' + rand(10_000_000).to_s
|
3279
|
+
|
3280
|
+
copy_operation_response = operation_index(
|
3281
|
+
index_name,
|
3282
|
+
Search::OperationIndexParams.new(
|
3283
|
+
operation: Search::OperationType::COPY,
|
3284
|
+
destination: tmp_index_name,
|
3285
|
+
scope: [
|
3286
|
+
Search::ScopeType::SETTINGS,
|
3287
|
+
Search::ScopeType::SYNONYMS,
|
3288
|
+
Search::ScopeType::RULES
|
3289
|
+
]
|
3290
|
+
),
|
3291
|
+
request_options
|
3292
|
+
)
|
3293
|
+
|
3294
|
+
batch_responses = chunked_batch(
|
3295
|
+
tmp_index_name,
|
3296
|
+
objects,
|
3297
|
+
Search::Action::ADD_OBJECT,
|
3298
|
+
true,
|
3299
|
+
batch_size,
|
3300
|
+
request_options
|
3301
|
+
)
|
3302
|
+
|
3303
|
+
wait_for_task(tmp_index_name, copy_operation_response.task_id)
|
3304
|
+
|
3305
|
+
copy_operation_response = operation_index(
|
3306
|
+
index_name,
|
3307
|
+
Search::OperationIndexParams.new(
|
3308
|
+
operation: Search::OperationType::COPY,
|
3309
|
+
destination: tmp_index_name,
|
3310
|
+
scope: [
|
3311
|
+
Search::ScopeType::SETTINGS,
|
3312
|
+
Search::ScopeType::SYNONYMS,
|
3313
|
+
Search::ScopeType::RULES
|
3314
|
+
]
|
3315
|
+
),
|
3316
|
+
request_options
|
3317
|
+
)
|
3318
|
+
|
3319
|
+
wait_for_task(tmp_index_name, copy_operation_response.task_id)
|
3320
|
+
|
3321
|
+
move_operation_response = operation_index(
|
3322
|
+
tmp_index_name,
|
3323
|
+
Search::OperationIndexParams.new(
|
3324
|
+
operation: Search::OperationType::MOVE,
|
3325
|
+
destination: index_name
|
3326
|
+
),
|
3327
|
+
request_options
|
3328
|
+
)
|
3329
|
+
|
3330
|
+
wait_for_task(tmp_index_name, move_operation_response.task_id)
|
3331
|
+
|
3332
|
+
Search::ReplaceAllObjectsResponse.new(
|
3333
|
+
copy_operation_response: copy_operation_response,
|
3334
|
+
batch_responses: batch_responses,
|
3335
|
+
move_operation_response: move_operation_response
|
3336
|
+
)
|
3337
|
+
end
|
3183
3338
|
end
|
3184
3339
|
end
|
@@ -19,10 +19,10 @@ module Algolia
|
|
19
19
|
|
20
20
|
attr_accessor :input
|
21
21
|
|
22
|
-
# Date of creation in
|
22
|
+
# Date of creation in RFC 3339 format.
|
23
23
|
attr_accessor :created_at
|
24
24
|
|
25
|
-
# Date of last update in
|
25
|
+
# Date of last update in RFC 3339 format.
|
26
26
|
attr_accessor :updated_at
|
27
27
|
|
28
28
|
class EnumAttributeValidator
|
@@ -13,7 +13,7 @@ module Algolia
|
|
13
13
|
# Descriptive name for the resource.
|
14
14
|
attr_accessor :name
|
15
15
|
|
16
|
-
# Date of creation in
|
16
|
+
# Date of creation in RFC 3339 format.
|
17
17
|
attr_accessor :created_at
|
18
18
|
|
19
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -13,7 +13,7 @@ module Algolia
|
|
13
13
|
# Descriptive name for the resource.
|
14
14
|
attr_accessor :name
|
15
15
|
|
16
|
-
# Date of last update in
|
16
|
+
# Date of last update in RFC 3339 format.
|
17
17
|
attr_accessor :updated_at
|
18
18
|
|
19
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -17,10 +17,10 @@ module Algolia
|
|
17
17
|
|
18
18
|
attr_accessor :input
|
19
19
|
|
20
|
-
# Date of creation in
|
20
|
+
# Date of creation in RFC 3339 format.
|
21
21
|
attr_accessor :created_at
|
22
22
|
|
23
|
-
# Date of last update in
|
23
|
+
# Date of last update in RFC 3339 format.
|
24
24
|
attr_accessor :updated_at
|
25
25
|
|
26
26
|
# Universally unique identifier (UUID) of an authentication resource.
|
@@ -13,7 +13,7 @@ module Algolia
|
|
13
13
|
# Descriptive name for the resource.
|
14
14
|
attr_accessor :name
|
15
15
|
|
16
|
-
# Date of creation in
|
16
|
+
# Date of creation in RFC 3339 format.
|
17
17
|
attr_accessor :created_at
|
18
18
|
|
19
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -13,7 +13,7 @@ module Algolia
|
|
13
13
|
# Descriptive name for the resource.
|
14
14
|
attr_accessor :name
|
15
15
|
|
16
|
-
# Date of last update in
|
16
|
+
# Date of last update in RFC 3339 format.
|
17
17
|
attr_accessor :updated_at
|
18
18
|
|
19
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -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 Ingestion
|
8
|
+
# Configured transformations and pagination information.
|
9
|
+
class ListTransformationsResponse
|
10
|
+
attr_accessor :transformations
|
11
|
+
|
12
|
+
attr_accessor :pagination
|
13
|
+
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
15
|
+
def self.attribute_map
|
16
|
+
{
|
17
|
+
:transformations => :transformations,
|
18
|
+
:pagination => :pagination
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns all the JSON keys this model knows about
|
23
|
+
def self.acceptable_attributes
|
24
|
+
attribute_map.values
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.types_mapping
|
29
|
+
{
|
30
|
+
:transformations => :'Array<Transformation>',
|
31
|
+
:pagination => :Pagination
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([])
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
unless attributes.is_a?(Hash)
|
44
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::ListTransformationsResponse` initialize method"
|
45
|
+
end
|
46
|
+
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
49
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
50
|
+
raise ArgumentError,
|
51
|
+
"`#{k}` is not a valid attribute in `Algolia::ListTransformationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
52
|
+
end
|
53
|
+
|
54
|
+
h[k.to_sym] = v
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.key?(:transformations)
|
58
|
+
if (value = attributes[:transformations]).is_a?(Array)
|
59
|
+
self.transformations = value
|
60
|
+
end
|
61
|
+
else
|
62
|
+
self.transformations = nil
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.key?(:pagination)
|
66
|
+
self.pagination = attributes[:pagination]
|
67
|
+
else
|
68
|
+
self.pagination = nil
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Checks equality by comparing each attribute.
|
73
|
+
# @param [Object] Object to be compared
|
74
|
+
def ==(other)
|
75
|
+
return true if equal?(other)
|
76
|
+
|
77
|
+
self.class == other.class &&
|
78
|
+
transformations == other.transformations &&
|
79
|
+
pagination == other.pagination
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(other)
|
85
|
+
self == other
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Integer] Hash code
|
90
|
+
def hash
|
91
|
+
[transformations, pagination].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def self.build_from_hash(attributes)
|
98
|
+
return nil unless attributes.is_a?(Hash)
|
99
|
+
|
100
|
+
attributes = attributes.transform_keys(&:to_sym)
|
101
|
+
transformed_hash = {}
|
102
|
+
types_mapping.each_pair do |key, type|
|
103
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
104
|
+
transformed_hash[key.to_sym] = nil
|
105
|
+
elsif type =~ /\AArray<(.*)>/i
|
106
|
+
# check to ensure the input is an array given that the attribute
|
107
|
+
# is documented as an array but the input is not
|
108
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
109
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
110
|
+
end
|
111
|
+
elsif !attributes[attribute_map[key]].nil?
|
112
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
113
|
+
end
|
114
|
+
end
|
115
|
+
new(transformed_hash)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Deserializes the data based on type
|
119
|
+
# @param string type Data type
|
120
|
+
# @param string value Value to be deserialized
|
121
|
+
# @return [Object] Deserialized data
|
122
|
+
def self._deserialize(type, value)
|
123
|
+
case type.to_sym
|
124
|
+
when :Time
|
125
|
+
Time.parse(value)
|
126
|
+
when :Date
|
127
|
+
Date.parse(value)
|
128
|
+
when :String
|
129
|
+
value.to_s
|
130
|
+
when :Integer
|
131
|
+
value.to_i
|
132
|
+
when :Float
|
133
|
+
value.to_f
|
134
|
+
when :Boolean
|
135
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
136
|
+
true
|
137
|
+
else
|
138
|
+
false
|
139
|
+
end
|
140
|
+
when :Object
|
141
|
+
# generic object (usually a Hash), return directly
|
142
|
+
value
|
143
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
144
|
+
inner_type = Regexp.last_match[:inner_type]
|
145
|
+
value.map { |v| _deserialize(inner_type, v) }
|
146
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
147
|
+
k_type = Regexp.last_match[:k_type]
|
148
|
+
v_type = Regexp.last_match[:v_type]
|
149
|
+
{}.tap do |hash|
|
150
|
+
value.each do |k, v|
|
151
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
else # model
|
155
|
+
# models (e.g. Pet) or oneOf
|
156
|
+
klass = Algolia::Ingestion.const_get(type)
|
157
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Returns the string representation of the object
|
162
|
+
# @return [String] String presentation of the object
|
163
|
+
def to_s
|
164
|
+
to_hash.to_s
|
165
|
+
end
|
166
|
+
|
167
|
+
# to_body is an alias to to_hash (backward compatibility)
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_body
|
170
|
+
to_hash
|
171
|
+
end
|
172
|
+
|
173
|
+
def to_json(*_args)
|
174
|
+
to_hash.to_json
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the object in the form of hash
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_hash
|
180
|
+
hash = {}
|
181
|
+
self.class.attribute_map.each_pair do |attr, param|
|
182
|
+
value = send(attr)
|
183
|
+
if value.nil?
|
184
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
185
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
186
|
+
end
|
187
|
+
|
188
|
+
hash[param] = _to_hash(value)
|
189
|
+
end
|
190
|
+
hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Outputs non-array value in the form of hash
|
194
|
+
# For object, use to_hash. Otherwise, just return the value
|
195
|
+
# @param [Object] value Any valid value
|
196
|
+
# @return [Hash] Returns the value in the form of hash
|
197
|
+
def _to_hash(value)
|
198
|
+
if value.is_a?(Array)
|
199
|
+
value.compact.map { |v| _to_hash(v) }
|
200
|
+
elsif value.is_a?(Hash)
|
201
|
+
{}.tap do |hash|
|
202
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
203
|
+
end
|
204
|
+
elsif value.respond_to? :to_hash
|
205
|
+
value.to_hash
|
206
|
+
else
|
207
|
+
value
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
@@ -7,10 +7,10 @@ module Algolia
|
|
7
7
|
module Ingestion
|
8
8
|
# Input for a manually-triggered task whose source is of type `bigquery` and for which extracted data spans a given time range.
|
9
9
|
class OnDemandDateUtilsInput
|
10
|
-
# Earliest date in
|
10
|
+
# Earliest date in RFC 3339 format of the extracted data from Big Query.
|
11
11
|
attr_accessor :start_date
|
12
12
|
|
13
|
-
# Latest date in
|
13
|
+
# Latest date in RFC 3339 format of the extracted data from Big Query.
|
14
14
|
attr_accessor :end_date
|
15
15
|
|
16
16
|
attr_accessor :mapping
|
@@ -30,13 +30,13 @@ module Algolia
|
|
30
30
|
|
31
31
|
attr_accessor :type
|
32
32
|
|
33
|
-
# Date of creation in
|
33
|
+
# Date of creation in RFC 3339 format.
|
34
34
|
attr_accessor :created_at
|
35
35
|
|
36
|
-
# Date of start in
|
36
|
+
# Date of start in RFC 3339 format.
|
37
37
|
attr_accessor :started_at
|
38
38
|
|
39
|
-
# Date of finish in
|
39
|
+
# Date of finish in RFC 3339 format.
|
40
40
|
attr_accessor :finished_at
|
41
41
|
|
42
42
|
class EnumAttributeValidator
|
@@ -10,7 +10,7 @@ module Algolia
|
|
10
10
|
# Universally unique identifier (UUID) of a task run.
|
11
11
|
attr_accessor :run_id
|
12
12
|
|
13
|
-
# Date of creation in
|
13
|
+
# Date of creation in RFC 3339 format.
|
14
14
|
attr_accessor :created_at
|
15
15
|
|
16
16
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -12,10 +12,10 @@ module Algolia
|
|
12
12
|
# Cron expression for the task's schedule.
|
13
13
|
attr_accessor :cron
|
14
14
|
|
15
|
-
# The last time the scheduled task ran in
|
15
|
+
# The last time the scheduled task ran in RFC 3339 format.
|
16
16
|
attr_accessor :last_run
|
17
17
|
|
18
|
-
# The next scheduled run of the task in
|
18
|
+
# The next scheduled run of the task in RFC 3339 format.
|
19
19
|
attr_accessor :next_run
|
20
20
|
|
21
21
|
class EnumAttributeValidator
|
@@ -0,0 +1,35 @@
|
|
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 Ingestion
|
8
|
+
class SortKeys
|
9
|
+
NAME = "name".freeze
|
10
|
+
TYPE = "type".freeze
|
11
|
+
UPDATED_AT = "updatedAt".freeze
|
12
|
+
CREATED_AT = "createdAt".freeze
|
13
|
+
|
14
|
+
def self.all_vars
|
15
|
+
@all_vars ||= [NAME, TYPE, UPDATED_AT, CREATED_AT].freeze
|
16
|
+
end
|
17
|
+
|
18
|
+
# Builds the enum from string
|
19
|
+
# @param [String] The enum value in the form of the string
|
20
|
+
# @return [String] The enum value
|
21
|
+
def self.build_from_hash(value)
|
22
|
+
new.build_from_hash(value)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Builds the enum from string
|
26
|
+
# @param [String] The enum value in the form of the string
|
27
|
+
# @return [String] The enum value
|
28
|
+
def build_from_hash(value)
|
29
|
+
return value if SortKeys.all_vars.include?(value)
|
30
|
+
|
31
|
+
raise "Invalid ENUM value #{value} for class #SortKeys"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -18,10 +18,10 @@ module Algolia
|
|
18
18
|
# Universally unique identifier (UUID) of an authentication resource.
|
19
19
|
attr_accessor :authentication_id
|
20
20
|
|
21
|
-
# Date of creation in
|
21
|
+
# Date of creation in RFC 3339 format.
|
22
22
|
attr_accessor :created_at
|
23
23
|
|
24
|
-
# Date of last update in
|
24
|
+
# Date of last update in RFC 3339 format.
|
25
25
|
attr_accessor :updated_at
|
26
26
|
|
27
27
|
class EnumAttributeValidator
|
@@ -12,7 +12,7 @@ module Algolia
|
|
12
12
|
# Descriptive name of the source.
|
13
13
|
attr_accessor :name
|
14
14
|
|
15
|
-
# Date of last update in
|
15
|
+
# Date of last update in RFC 3339 format.
|
16
16
|
attr_accessor :updated_at
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|