algolia 3.0.0.beta.13 → 3.0.0.beta.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/ingestion_client.rb +60 -6
- data/lib/algolia/models/ingestion/docker_streams.rb +259 -0
- data/lib/algolia/models/ingestion/docker_streams_input.rb +4 -2
- data/lib/algolia/models/ingestion/docker_streams_sync_mode.rb +32 -0
- data/lib/algolia/models/ingestion/generate_transformation_code_payload.rb +233 -0
- data/lib/algolia/models/ingestion/generate_transformation_code_response.rb +211 -0
- data/lib/algolia/models/ingestion/transformation_search.rb +8 -10
- data/lib/algolia/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77b4c1bf1ec0ae78a66401213ff5ad43cbe5af1eb876e3f869954e7970f9e2d7
|
4
|
+
data.tar.gz: 30161fea26f09f5a8651297ad0d785231ca8477c09cb6bd948ff4c66fa9f72eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e61a29d8f4887039452dac0d97c7e1c307665f1162d6065e3ba15617130ddee08af68a0d7bc8cc87c726aaa42cddaebcb117c1e8e4e52c4272cfa190e73235a3
|
7
|
+
data.tar.gz: fab57401cf66f5871fd0298cea6248880097e9b85c7d4aa8fb7ddbfa733fb206547ffe27f2eb7c1d37382ee4f748295a0d2fda5e5a5510f08d85409065e6fddb
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## [3.0.0.beta.14](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.beta.13...3.0.0.beta.14)
|
2
|
+
|
3
|
+
- [2c6147ee7](https://github.com/algolia/api-clients-automation/commit/2c6147ee7) feat(specs): add generate code endpoint to ingestion specs ([#3489](https://github.com/algolia/api-clients-automation/pull/3489)) by [@shortcuts](https://github.com/shortcuts/)
|
4
|
+
- [6c62a81a7](https://github.com/algolia/api-clients-automation/commit/6c62a81a7) fix(specs): ingestion docker task input ([#3488](https://github.com/algolia/api-clients-automation/pull/3488)) by [@shortcuts](https://github.com/shortcuts/)
|
5
|
+
- [eab2887f8](https://github.com/algolia/api-clients-automation/commit/eab2887f8) fix(specs): ingestion search endpoint ([#3487](https://github.com/algolia/api-clients-automation/pull/3487)) by [@shortcuts](https://github.com/shortcuts/)
|
6
|
+
|
1
7
|
## [3.0.0.beta.13](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.beta.12...3.0.0.beta.13)
|
2
8
|
|
3
9
|
- [ac0cadb8a](https://github.com/algolia/api-clients-automation/commit/ac0cadb8a) feat(specs): add transformation copilot to ingestion ([#3479](https://github.com/algolia/api-clients-automation/pull/3479)) by [@Fluf22](https://github.com/Fluf22/)
|
data/Gemfile.lock
CHANGED
@@ -953,6 +953,60 @@ module Algolia
|
|
953
953
|
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::TaskUpdateResponse")
|
954
954
|
end
|
955
955
|
|
956
|
+
# Generates code for the selected model based on the given prompt.
|
957
|
+
#
|
958
|
+
# Required API Key ACLs:
|
959
|
+
# - addObject
|
960
|
+
# - deleteIndex
|
961
|
+
# - editSettings
|
962
|
+
# @param generate_transformation_code_payload [GenerateTransformationCodePayload] (required)
|
963
|
+
# @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)
|
964
|
+
# @return [Http::Response] the response
|
965
|
+
def generate_transformation_code_with_http_info(generate_transformation_code_payload, request_options = {})
|
966
|
+
# verify the required parameter 'generate_transformation_code_payload' is set
|
967
|
+
if @api_client.config.client_side_validation && generate_transformation_code_payload.nil?
|
968
|
+
raise(
|
969
|
+
ArgumentError,
|
970
|
+
"Parameter `generate_transformation_code_payload` is required when calling `generate_transformation_code`."
|
971
|
+
)
|
972
|
+
end
|
973
|
+
|
974
|
+
path = "/1/transformations/models"
|
975
|
+
query_params = {}
|
976
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
977
|
+
header_params = {}
|
978
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
979
|
+
|
980
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(generate_transformation_code_payload)
|
981
|
+
|
982
|
+
new_options = request_options.merge(
|
983
|
+
:operation => :"IngestionClient.generate_transformation_code",
|
984
|
+
:header_params => header_params,
|
985
|
+
:query_params => query_params,
|
986
|
+
:body => post_body,
|
987
|
+
:use_read_transporter => false
|
988
|
+
)
|
989
|
+
|
990
|
+
@api_client.call_api(:POST, path, new_options)
|
991
|
+
end
|
992
|
+
|
993
|
+
# Generates code for the selected model based on the given prompt.
|
994
|
+
#
|
995
|
+
# Required API Key ACLs:
|
996
|
+
# - addObject
|
997
|
+
# - deleteIndex
|
998
|
+
# - editSettings
|
999
|
+
# @param generate_transformation_code_payload [GenerateTransformationCodePayload] (required)
|
1000
|
+
# @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)
|
1001
|
+
# @return [GenerateTransformationCodeResponse]
|
1002
|
+
def generate_transformation_code(generate_transformation_code_payload, request_options = {})
|
1003
|
+
response = generate_transformation_code_with_http_info(generate_transformation_code_payload, request_options)
|
1004
|
+
@api_client.deserialize(
|
1005
|
+
response.body,
|
1006
|
+
request_options[:debug_return_type] || "Ingestion::GenerateTransformationCodeResponse"
|
1007
|
+
)
|
1008
|
+
end
|
1009
|
+
|
956
1010
|
# Retrieves an authentication resource by its ID.
|
957
1011
|
#
|
958
1012
|
# Required API Key ACLs:
|
@@ -2172,7 +2226,7 @@ module Algolia
|
|
2172
2226
|
# @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)
|
2173
2227
|
# @return [Http::Response] the response
|
2174
2228
|
def list_transformation_models_with_http_info(request_options = {})
|
2175
|
-
path = "/1/transformations/
|
2229
|
+
path = "/1/transformations/models"
|
2176
2230
|
query_params = {}
|
2177
2231
|
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
2178
2232
|
header_params = {}
|
@@ -2832,10 +2886,10 @@ module Algolia
|
|
2832
2886
|
# @param transformation_try [TransformationTry] (required)
|
2833
2887
|
# @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)
|
2834
2888
|
# @return [Http::Response] the response
|
2835
|
-
def
|
2889
|
+
def try_transformation_with_http_info(transformation_try, request_options = {})
|
2836
2890
|
# verify the required parameter 'transformation_try' is set
|
2837
2891
|
if @api_client.config.client_side_validation && transformation_try.nil?
|
2838
|
-
raise ArgumentError, "Parameter `transformation_try` is required when calling `
|
2892
|
+
raise ArgumentError, "Parameter `transformation_try` is required when calling `try_transformation`."
|
2839
2893
|
end
|
2840
2894
|
|
2841
2895
|
path = "/1/transformations/try"
|
@@ -2847,7 +2901,7 @@ module Algolia
|
|
2847
2901
|
post_body = request_options[:debug_body] || @api_client.object_to_http_body(transformation_try)
|
2848
2902
|
|
2849
2903
|
new_options = request_options.merge(
|
2850
|
-
:operation => :"IngestionClient.
|
2904
|
+
:operation => :"IngestionClient.try_transformation",
|
2851
2905
|
:header_params => header_params,
|
2852
2906
|
:query_params => query_params,
|
2853
2907
|
:body => post_body,
|
@@ -2866,8 +2920,8 @@ module Algolia
|
|
2866
2920
|
# @param transformation_try [TransformationTry] (required)
|
2867
2921
|
# @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)
|
2868
2922
|
# @return [TransformationTryResponse]
|
2869
|
-
def
|
2870
|
-
response =
|
2923
|
+
def try_transformation(transformation_try, request_options = {})
|
2924
|
+
response = try_transformation_with_http_info(transformation_try, request_options)
|
2871
2925
|
@api_client.deserialize(
|
2872
2926
|
response.body,
|
2873
2927
|
request_options[:debug_return_type] || "Ingestion::TransformationTryResponse"
|
@@ -0,0 +1,259 @@
|
|
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 DockerStreams
|
9
|
+
# The name of the stream to fetch the data from (e.g. table name).
|
10
|
+
attr_accessor :name
|
11
|
+
|
12
|
+
# The properties of the stream to select (e.g. column).
|
13
|
+
attr_accessor :properties
|
14
|
+
|
15
|
+
attr_accessor :sync_mode
|
16
|
+
|
17
|
+
class EnumAttributeValidator
|
18
|
+
attr_reader :datatype
|
19
|
+
attr_reader :allowable_values
|
20
|
+
|
21
|
+
def initialize(datatype, allowable_values)
|
22
|
+
@allowable_values = allowable_values.map do |value|
|
23
|
+
case datatype.to_s
|
24
|
+
when /Integer/i
|
25
|
+
value.to_i
|
26
|
+
when /Float/i
|
27
|
+
value.to_f
|
28
|
+
else
|
29
|
+
value
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def valid?(value)
|
35
|
+
!value || allowable_values.include?(value)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:name => :name,
|
43
|
+
:properties => :properties,
|
44
|
+
:sync_mode => :syncMode
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns all the JSON keys this model knows about
|
49
|
+
def self.acceptable_attributes
|
50
|
+
attribute_map.values
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.types_mapping
|
55
|
+
{
|
56
|
+
:name => :"String",
|
57
|
+
:properties => :"Array<String>",
|
58
|
+
:sync_mode => :"DockerStreamsSyncMode"
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# List of attributes with nullable: true
|
63
|
+
def self.openapi_nullable
|
64
|
+
Set.new(
|
65
|
+
[]
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Initializes the object
|
70
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
71
|
+
def initialize(attributes = {})
|
72
|
+
if (!attributes.is_a?(Hash))
|
73
|
+
raise(
|
74
|
+
ArgumentError,
|
75
|
+
"The input argument (attributes) must be a hash in `Algolia::DockerStreams` initialize method"
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
81
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
82
|
+
raise(
|
83
|
+
ArgumentError,
|
84
|
+
"`#{k}` is not a valid attribute in `Algolia::DockerStreams`. Please check the name to make sure it's valid. List of attributes: " +
|
85
|
+
self.class.attribute_map.keys.inspect
|
86
|
+
)
|
87
|
+
end
|
88
|
+
|
89
|
+
h[k.to_sym] = v
|
90
|
+
}
|
91
|
+
|
92
|
+
if attributes.key?(:name)
|
93
|
+
self.name = attributes[:name]
|
94
|
+
else
|
95
|
+
self.name = nil
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:properties)
|
99
|
+
if (value = attributes[:properties]).is_a?(Array)
|
100
|
+
self.properties = value
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:sync_mode)
|
105
|
+
self.sync_mode = attributes[:sync_mode]
|
106
|
+
else
|
107
|
+
self.sync_mode = nil
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# Checks equality by comparing each attribute.
|
112
|
+
# @param [Object] Object to be compared
|
113
|
+
def ==(other)
|
114
|
+
return true if self.equal?(other)
|
115
|
+
self.class == other.class &&
|
116
|
+
name == other.name &&
|
117
|
+
properties == other.properties &&
|
118
|
+
sync_mode == other.sync_mode
|
119
|
+
end
|
120
|
+
|
121
|
+
# @see the `==` method
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def eql?(other)
|
124
|
+
self == other
|
125
|
+
end
|
126
|
+
|
127
|
+
# Calculates hash code according to all attributes.
|
128
|
+
# @return [Integer] Hash code
|
129
|
+
def hash
|
130
|
+
[name, properties, sync_mode].hash
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def self.build_from_hash(attributes)
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
138
|
+
attributes = attributes.transform_keys(&:to_sym)
|
139
|
+
transformed_hash = {}
|
140
|
+
types_mapping.each_pair do |key, type|
|
141
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
142
|
+
transformed_hash[key.to_sym] = nil
|
143
|
+
elsif type =~ /\AArray<(.*)>/i
|
144
|
+
# check to ensure the input is an array given that the attribute
|
145
|
+
# is documented as an array but the input is not
|
146
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
147
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
148
|
+
_deserialize(::Regexp.last_match(1), v)
|
149
|
+
}
|
150
|
+
end
|
151
|
+
elsif !attributes[attribute_map[key]].nil?
|
152
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
new(transformed_hash)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Deserializes the data based on type
|
160
|
+
# @param string type Data type
|
161
|
+
# @param string value Value to be deserialized
|
162
|
+
# @return [Object] Deserialized data
|
163
|
+
def self._deserialize(type, value)
|
164
|
+
case type.to_sym
|
165
|
+
when :Time
|
166
|
+
Time.parse(value)
|
167
|
+
when :Date
|
168
|
+
Date.parse(value)
|
169
|
+
when :String
|
170
|
+
value.to_s
|
171
|
+
when :Integer
|
172
|
+
value.to_i
|
173
|
+
when :Float
|
174
|
+
value.to_f
|
175
|
+
when :Boolean
|
176
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
177
|
+
true
|
178
|
+
else
|
179
|
+
false
|
180
|
+
end
|
181
|
+
|
182
|
+
when :Object
|
183
|
+
# generic object (usually a Hash), return directly
|
184
|
+
value
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each do |k, v|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
# model
|
197
|
+
else
|
198
|
+
# models (e.g. Pet) or oneOf
|
199
|
+
klass = Algolia::Ingestion.const_get(type)
|
200
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
201
|
+
.build_from_hash(value)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
# Returns the string representation of the object
|
206
|
+
# @return [String] String presentation of the object
|
207
|
+
def to_s
|
208
|
+
to_hash.to_s
|
209
|
+
end
|
210
|
+
|
211
|
+
# to_body is an alias to to_hash (backward compatibility)
|
212
|
+
# @return [Hash] Returns the object in the form of hash
|
213
|
+
def to_body
|
214
|
+
to_hash
|
215
|
+
end
|
216
|
+
|
217
|
+
def to_json(*_args)
|
218
|
+
to_hash.to_json
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the object in the form of hash
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_hash
|
224
|
+
hash = {}
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
226
|
+
value = send(attr)
|
227
|
+
if value.nil?
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
230
|
+
end
|
231
|
+
|
232
|
+
hash[param] = _to_hash(value)
|
233
|
+
end
|
234
|
+
|
235
|
+
hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Outputs non-array value in the form of hash
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
240
|
+
# @param [Object] value Any valid value
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
242
|
+
def _to_hash(value)
|
243
|
+
if value.is_a?(Array)
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
245
|
+
elsif value.is_a?(Hash)
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
248
|
+
end
|
249
|
+
elsif value.respond_to?(:to_hash)
|
250
|
+
value.to_hash
|
251
|
+
else
|
252
|
+
value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
259
|
+
end
|
@@ -24,7 +24,7 @@ module Algolia
|
|
24
24
|
# Attribute type mapping.
|
25
25
|
def self.types_mapping
|
26
26
|
{
|
27
|
-
:streams => :"
|
27
|
+
:streams => :"Array<DockerStreams>"
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
@@ -59,7 +59,9 @@ module Algolia
|
|
59
59
|
}
|
60
60
|
|
61
61
|
if attributes.key?(:streams)
|
62
|
-
|
62
|
+
if (value = attributes[:streams]).is_a?(Array)
|
63
|
+
self.streams = value
|
64
|
+
end
|
63
65
|
else
|
64
66
|
self.streams = nil
|
65
67
|
end
|
@@ -0,0 +1,32 @@
|
|
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 DockerStreamsSyncMode
|
9
|
+
INCREMENTAL = "incremental".freeze
|
10
|
+
FULL_TABLE = "fullTable".freeze
|
11
|
+
|
12
|
+
def self.all_vars
|
13
|
+
@all_vars ||= [INCREMENTAL, FULL_TABLE].freeze
|
14
|
+
end
|
15
|
+
|
16
|
+
# Builds the enum from string
|
17
|
+
# @param [String] The enum value in the form of the string
|
18
|
+
# @return [String] The enum value
|
19
|
+
def self.build_from_hash(value)
|
20
|
+
new.build_from_hash(value)
|
21
|
+
end
|
22
|
+
|
23
|
+
# Builds the enum from string
|
24
|
+
# @param [String] The enum value in the form of the string
|
25
|
+
# @return [String] The enum value
|
26
|
+
def build_from_hash(value)
|
27
|
+
return value if DockerStreamsSyncMode.all_vars.include?(value)
|
28
|
+
raise "Invalid ENUM value #{value} for class #DockerStreamsSyncMode"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,233 @@
|
|
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 GenerateTransformationCodePayload
|
9
|
+
attr_accessor :id
|
10
|
+
|
11
|
+
attr_accessor :system_prompt
|
12
|
+
|
13
|
+
attr_accessor :user_prompt
|
14
|
+
|
15
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
16
|
+
def self.attribute_map
|
17
|
+
{
|
18
|
+
:id => :id,
|
19
|
+
:system_prompt => :systemPrompt,
|
20
|
+
:user_prompt => :userPrompt
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Returns all the JSON keys this model knows about
|
25
|
+
def self.acceptable_attributes
|
26
|
+
attribute_map.values
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.types_mapping
|
31
|
+
{
|
32
|
+
:id => :"String",
|
33
|
+
:system_prompt => :"String",
|
34
|
+
:user_prompt => :"String"
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of attributes with nullable: true
|
39
|
+
def self.openapi_nullable
|
40
|
+
Set.new(
|
41
|
+
[]
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
raise(
|
50
|
+
ArgumentError,
|
51
|
+
"The input argument (attributes) must be a hash in `Algolia::GenerateTransformationCodePayload` initialize method"
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
57
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
58
|
+
raise(
|
59
|
+
ArgumentError,
|
60
|
+
"`#{k}` is not a valid attribute in `Algolia::GenerateTransformationCodePayload`. Please check the name to make sure it's valid. List of attributes: " +
|
61
|
+
self.class.attribute_map.keys.inspect
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:id)
|
69
|
+
self.id = attributes[:id]
|
70
|
+
else
|
71
|
+
self.id = nil
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:system_prompt)
|
75
|
+
self.system_prompt = attributes[:system_prompt]
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:user_prompt)
|
79
|
+
self.user_prompt = attributes[:user_prompt]
|
80
|
+
else
|
81
|
+
self.user_prompt = nil
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Checks equality by comparing each attribute.
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def ==(other)
|
88
|
+
return true if self.equal?(other)
|
89
|
+
self.class == other.class &&
|
90
|
+
id == other.id &&
|
91
|
+
system_prompt == other.system_prompt &&
|
92
|
+
user_prompt == other.user_prompt
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(other)
|
98
|
+
self == other
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[id, system_prompt, user_prompt].hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def self.build_from_hash(attributes)
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
112
|
+
attributes = attributes.transform_keys(&:to_sym)
|
113
|
+
transformed_hash = {}
|
114
|
+
types_mapping.each_pair do |key, type|
|
115
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash[key.to_sym] = nil
|
117
|
+
elsif type =~ /\AArray<(.*)>/i
|
118
|
+
# check to ensure the input is an array given that the attribute
|
119
|
+
# is documented as an array but the input is not
|
120
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
121
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
122
|
+
_deserialize(::Regexp.last_match(1), v)
|
123
|
+
}
|
124
|
+
end
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
new(transformed_hash)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Deserializes the data based on type
|
134
|
+
# @param string type Data type
|
135
|
+
# @param string value Value to be deserialized
|
136
|
+
# @return [Object] Deserialized data
|
137
|
+
def self._deserialize(type, value)
|
138
|
+
case type.to_sym
|
139
|
+
when :Time
|
140
|
+
Time.parse(value)
|
141
|
+
when :Date
|
142
|
+
Date.parse(value)
|
143
|
+
when :String
|
144
|
+
value.to_s
|
145
|
+
when :Integer
|
146
|
+
value.to_i
|
147
|
+
when :Float
|
148
|
+
value.to_f
|
149
|
+
when :Boolean
|
150
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
151
|
+
true
|
152
|
+
else
|
153
|
+
false
|
154
|
+
end
|
155
|
+
|
156
|
+
when :Object
|
157
|
+
# generic object (usually a Hash), return directly
|
158
|
+
value
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
165
|
+
{}.tap do |hash|
|
166
|
+
value.each do |k, v|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
# model
|
171
|
+
else
|
172
|
+
# models (e.g. Pet) or oneOf
|
173
|
+
klass = Algolia::Ingestion.const_get(type)
|
174
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
175
|
+
.build_from_hash(value)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the string representation of the object
|
180
|
+
# @return [String] String presentation of the object
|
181
|
+
def to_s
|
182
|
+
to_hash.to_s
|
183
|
+
end
|
184
|
+
|
185
|
+
# to_body is an alias to to_hash (backward compatibility)
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_body
|
188
|
+
to_hash
|
189
|
+
end
|
190
|
+
|
191
|
+
def to_json(*_args)
|
192
|
+
to_hash.to_json
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = send(attr)
|
201
|
+
if value.nil?
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
+
end
|
205
|
+
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
|
209
|
+
hash
|
210
|
+
end
|
211
|
+
|
212
|
+
# Outputs non-array value in the form of hash
|
213
|
+
# For object, use to_hash. Otherwise, just return the value
|
214
|
+
# @param [Object] value Any valid value
|
215
|
+
# @return [Hash] Returns the value in the form of hash
|
216
|
+
def _to_hash(value)
|
217
|
+
if value.is_a?(Array)
|
218
|
+
value.compact.map { |v| _to_hash(v) }
|
219
|
+
elsif value.is_a?(Hash)
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
222
|
+
end
|
223
|
+
elsif value.respond_to?(:to_hash)
|
224
|
+
value.to_hash
|
225
|
+
else
|
226
|
+
value
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
end
|
@@ -0,0 +1,211 @@
|
|
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 GenerateTransformationCodeResponse
|
9
|
+
attr_accessor :generated_code
|
10
|
+
|
11
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
12
|
+
def self.attribute_map
|
13
|
+
{
|
14
|
+
:generated_code => :generatedCode
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
# Returns all the JSON keys this model knows about
|
19
|
+
def self.acceptable_attributes
|
20
|
+
attribute_map.values
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.types_mapping
|
25
|
+
{
|
26
|
+
:generated_code => :"String"
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# List of attributes with nullable: true
|
31
|
+
def self.openapi_nullable
|
32
|
+
Set.new(
|
33
|
+
[]
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
if (!attributes.is_a?(Hash))
|
41
|
+
raise(
|
42
|
+
ArgumentError,
|
43
|
+
"The input argument (attributes) must be a hash in `Algolia::GenerateTransformationCodeResponse` initialize method"
|
44
|
+
)
|
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({}) { |(k, v), h|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
+
raise(
|
51
|
+
ArgumentError,
|
52
|
+
"`#{k}` is not a valid attribute in `Algolia::GenerateTransformationCodeResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
53
|
+
self.class.attribute_map.keys.inspect
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:generated_code)
|
61
|
+
self.generated_code = attributes[:generated_code]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Checks equality by comparing each attribute.
|
66
|
+
# @param [Object] Object to be compared
|
67
|
+
def ==(other)
|
68
|
+
return true if self.equal?(other)
|
69
|
+
self.class == other.class &&
|
70
|
+
generated_code == other.generated_code
|
71
|
+
end
|
72
|
+
|
73
|
+
# @see the `==` method
|
74
|
+
# @param [Object] Object to be compared
|
75
|
+
def eql?(other)
|
76
|
+
self == other
|
77
|
+
end
|
78
|
+
|
79
|
+
# Calculates hash code according to all attributes.
|
80
|
+
# @return [Integer] Hash code
|
81
|
+
def hash
|
82
|
+
[generated_code].hash
|
83
|
+
end
|
84
|
+
|
85
|
+
# Builds the object from hash
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
87
|
+
# @return [Object] Returns the model itself
|
88
|
+
def self.build_from_hash(attributes)
|
89
|
+
return nil unless attributes.is_a?(Hash)
|
90
|
+
attributes = attributes.transform_keys(&:to_sym)
|
91
|
+
transformed_hash = {}
|
92
|
+
types_mapping.each_pair do |key, type|
|
93
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
94
|
+
transformed_hash[key.to_sym] = nil
|
95
|
+
elsif type =~ /\AArray<(.*)>/i
|
96
|
+
# check to ensure the input is an array given that the attribute
|
97
|
+
# is documented as an array but the input is not
|
98
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
99
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
100
|
+
_deserialize(::Regexp.last_match(1), v)
|
101
|
+
}
|
102
|
+
end
|
103
|
+
elsif !attributes[attribute_map[key]].nil?
|
104
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
new(transformed_hash)
|
109
|
+
end
|
110
|
+
|
111
|
+
# Deserializes the data based on type
|
112
|
+
# @param string type Data type
|
113
|
+
# @param string value Value to be deserialized
|
114
|
+
# @return [Object] Deserialized data
|
115
|
+
def self._deserialize(type, value)
|
116
|
+
case type.to_sym
|
117
|
+
when :Time
|
118
|
+
Time.parse(value)
|
119
|
+
when :Date
|
120
|
+
Date.parse(value)
|
121
|
+
when :String
|
122
|
+
value.to_s
|
123
|
+
when :Integer
|
124
|
+
value.to_i
|
125
|
+
when :Float
|
126
|
+
value.to_f
|
127
|
+
when :Boolean
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
129
|
+
true
|
130
|
+
else
|
131
|
+
false
|
132
|
+
end
|
133
|
+
|
134
|
+
when :Object
|
135
|
+
# generic object (usually a Hash), return directly
|
136
|
+
value
|
137
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
138
|
+
inner_type = Regexp.last_match[:inner_type]
|
139
|
+
value.map { |v| _deserialize(inner_type, v) }
|
140
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
141
|
+
k_type = Regexp.last_match[:k_type]
|
142
|
+
v_type = Regexp.last_match[:v_type]
|
143
|
+
{}.tap do |hash|
|
144
|
+
value.each do |k, v|
|
145
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
# model
|
149
|
+
else
|
150
|
+
# models (e.g. Pet) or oneOf
|
151
|
+
klass = Algolia::Ingestion.const_get(type)
|
152
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
153
|
+
.build_from_hash(value)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
159
|
+
def to_s
|
160
|
+
to_hash.to_s
|
161
|
+
end
|
162
|
+
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
165
|
+
def to_body
|
166
|
+
to_hash
|
167
|
+
end
|
168
|
+
|
169
|
+
def to_json(*_args)
|
170
|
+
to_hash.to_json
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the object in the form of hash
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_hash
|
176
|
+
hash = {}
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
178
|
+
value = send(attr)
|
179
|
+
if value.nil?
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
182
|
+
end
|
183
|
+
|
184
|
+
hash[param] = _to_hash(value)
|
185
|
+
end
|
186
|
+
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map { |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to?(:to_hash)
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
end
|
211
|
+
end
|
@@ -6,12 +6,12 @@ require "time"
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
8
|
class TransformationSearch
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :transformation_ids
|
10
10
|
|
11
11
|
# Attribute mapping from ruby-style variable name to JSON key.
|
12
12
|
def self.attribute_map
|
13
13
|
{
|
14
|
-
:
|
14
|
+
:transformation_ids => :transformationIDs
|
15
15
|
}
|
16
16
|
end
|
17
17
|
|
@@ -23,7 +23,7 @@ module Algolia
|
|
23
23
|
# Attribute type mapping.
|
24
24
|
def self.types_mapping
|
25
25
|
{
|
26
|
-
:
|
26
|
+
:transformation_ids => :"Array<String>"
|
27
27
|
}
|
28
28
|
end
|
29
29
|
|
@@ -57,12 +57,10 @@ module Algolia
|
|
57
57
|
h[k.to_sym] = v
|
58
58
|
}
|
59
59
|
|
60
|
-
if attributes.key?(:
|
61
|
-
if (value = attributes[:
|
62
|
-
self.
|
60
|
+
if attributes.key?(:transformation_ids)
|
61
|
+
if (value = attributes[:transformation_ids]).is_a?(Array)
|
62
|
+
self.transformation_ids = value
|
63
63
|
end
|
64
|
-
else
|
65
|
-
self.transformations_ids = nil
|
66
64
|
end
|
67
65
|
end
|
68
66
|
|
@@ -71,7 +69,7 @@ module Algolia
|
|
71
69
|
def ==(other)
|
72
70
|
return true if self.equal?(other)
|
73
71
|
self.class == other.class &&
|
74
|
-
|
72
|
+
transformation_ids == other.transformation_ids
|
75
73
|
end
|
76
74
|
|
77
75
|
# @see the `==` method
|
@@ -83,7 +81,7 @@ module Algolia
|
|
83
81
|
# Calculates hash code according to all attributes.
|
84
82
|
# @return [Integer] Hash code
|
85
83
|
def hash
|
86
|
-
[
|
84
|
+
[transformation_ids].hash
|
87
85
|
end
|
88
86
|
|
89
87
|
# Builds the object from hash
|
data/lib/algolia/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
2
|
|
3
3
|
module Algolia
|
4
|
-
VERSION = "3.0.0.beta.
|
4
|
+
VERSION = "3.0.0.beta.14".freeze
|
5
5
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: algolia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.beta.
|
4
|
+
version: 3.0.0.beta.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://alg.li/support
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -258,12 +258,16 @@ files:
|
|
258
258
|
- lib/algolia/models/ingestion/destination_update_response.rb
|
259
259
|
- lib/algolia/models/ingestion/docker_image_type.rb
|
260
260
|
- lib/algolia/models/ingestion/docker_registry.rb
|
261
|
+
- lib/algolia/models/ingestion/docker_streams.rb
|
261
262
|
- lib/algolia/models/ingestion/docker_streams_input.rb
|
263
|
+
- lib/algolia/models/ingestion/docker_streams_sync_mode.rb
|
262
264
|
- lib/algolia/models/ingestion/entity_type.rb
|
263
265
|
- lib/algolia/models/ingestion/event.rb
|
264
266
|
- lib/algolia/models/ingestion/event_sort_keys.rb
|
265
267
|
- lib/algolia/models/ingestion/event_status.rb
|
266
268
|
- lib/algolia/models/ingestion/event_type.rb
|
269
|
+
- lib/algolia/models/ingestion/generate_transformation_code_payload.rb
|
270
|
+
- lib/algolia/models/ingestion/generate_transformation_code_response.rb
|
267
271
|
- lib/algolia/models/ingestion/list_authentications_response.rb
|
268
272
|
- lib/algolia/models/ingestion/list_destinations_response.rb
|
269
273
|
- lib/algolia/models/ingestion/list_events_response.rb
|