algolia 3.0.0.alpha.11 → 3.0.0.alpha.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c6f55c1f03d70cd3cf974e56e8e38935071b6c897e3e4087dec61daa8e963d7
4
- data.tar.gz: ecb224772c31f319bc0327616cfce7a62eef98a6032923bf3e18d85ea8c5c1ff
3
+ metadata.gz: 83955f794742e28331a6a92d11dd5c3a614bc7f4fbaaa0ddeb15917108b02008
4
+ data.tar.gz: 3396251b1cf2d5a38401845323c8850c81a002698cba78609161b4a2460fa819
5
5
  SHA512:
6
- metadata.gz: 75b06bd1c0690db66603da2fb80d7aef9ef5b194dbcb598210277c26e1dd55688c16c5644a297b9ab22baffd49c040ae548d9ccec9f91c0ec2542b5497f66a0e
7
- data.tar.gz: ae90b0e9e4eda6d4b15f2ffa23084af86cf22fd29a7a55066aed0e66d352bfef3546521e8163c6ac1833a47f6aec573f3e94b4458c02f703202c0406d56ea9b2
6
+ metadata.gz: f1e35e74fcec5a35a02ab0400214a8a9919a65513c5fb7348edaf9bf9e5da339faa96691e573e8508675380f354c94e9b43b05bedc3065061556d7a54388566d
7
+ data.tar.gz: 4e22b6da6f089c8141846fa05aff5d0f9d61ecb36c76c39613e9e3a791348673f5cb84974c81bff97cffcbd714ba7e09e38f24a1a8325d2d2eee618565bf1f33
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [3.0.0.alpha.12](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.alpha.11...3.0.0.alpha.12)
2
+
3
+ - [234427491](https://github.com/algolia/api-clients-automation/commit/234427491) feat(specs): Add MappingInput to Task Inputs ([#2787](https://github.com/algolia/api-clients-automation/pull/2787)) by [@jsok](https://github.com/jsok/)
4
+
1
5
  ## [3.0.0.alpha.11](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.alpha.10...3.0.0.alpha.11)
2
6
 
3
7
  - [a138c2fef](https://github.com/algolia/api-clients-automation/commit/a138c2fef) fix(specs): add `queryID` to search response ([#2801](https://github.com/algolia/api-clients-automation/pull/2801)) by [@aallam](https://github.com/aallam/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.0.0.alpha.11)
4
+ algolia (3.0.0.alpha.12)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-net_http_persistent (>= 0.15, < 3)
7
7
  net-http-persistent
@@ -33,7 +33,7 @@ GEM
33
33
  rake (13.1.0)
34
34
  regexp_parser (2.9.0)
35
35
  rexml (3.2.6)
36
- rubocop (1.60.2)
36
+ rubocop (1.61.0)
37
37
  json (~> 2.3)
38
38
  language_server-protocol (>= 3.17.0)
39
39
  parallel (~> 1.10)
@@ -44,8 +44,8 @@ GEM
44
44
  rubocop-ast (>= 1.30.0, < 2.0)
45
45
  ruby-progressbar (~> 1.7)
46
46
  unicode-display_width (>= 2.4.0, < 3.0)
47
- rubocop-ast (1.30.0)
48
- parser (>= 3.2.1.0)
47
+ rubocop-ast (1.31.1)
48
+ parser (>= 3.3.0.4)
49
49
  ruby-progressbar (1.13.0)
50
50
  unicode-display_width (2.5.0)
51
51
  uri (0.13.0)
@@ -0,0 +1,214 @@
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
+ # Describes how a field should be resolved by applying a set of directives.
9
+ class MappingFieldDirective
10
+ # Destination field key.
11
+ attr_accessor :field_key
12
+
13
+ # How the destination field should be resolved from the source.
14
+ attr_accessor :value
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ :field_key => :fieldKey,
20
+ :value => :value
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
+ :field_key => :String,
33
+ :value => :'Hash<String, Object>'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([])
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ unless attributes.is_a?(Hash)
46
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::MappingFieldDirective` initialize method"
47
+ end
48
+
49
+ # check to see if the attribute exists and convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) do |(k, v), h|
51
+ unless self.class.attribute_map.key?(k.to_sym)
52
+ raise ArgumentError,
53
+ "`#{k}` is not a valid attribute in `Algolia::MappingFieldDirective`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+
56
+ h[k.to_sym] = v
57
+ end
58
+
59
+ if attributes.key?(:field_key)
60
+ self.field_key = attributes[:field_key]
61
+ else
62
+ self.field_key = nil
63
+ end
64
+
65
+ if attributes.key?(:value)
66
+ if (value = attributes[:value]).is_a?(Hash)
67
+ self.value = value
68
+ end
69
+ else
70
+ self.value = nil
71
+ end
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(other)
77
+ return true if equal?(other)
78
+
79
+ self.class == other.class &&
80
+ field_key == other.field_key &&
81
+ value == other.value
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(other)
87
+ self == other
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [field_key, value].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ return nil unless attributes.is_a?(Hash)
101
+
102
+ attributes = attributes.transform_keys(&:to_sym)
103
+ transformed_hash = {}
104
+ types_mapping.each_pair do |key, type|
105
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
106
+ transformed_hash[key.to_sym] = nil
107
+ elsif type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[attribute_map[key]].is_a?(Array)
111
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
112
+ end
113
+ elsif !attributes[attribute_map[key]].nil?
114
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
115
+ end
116
+ end
117
+ new(transformed_hash)
118
+ end
119
+
120
+ # Deserializes the data based on type
121
+ # @param string type Data type
122
+ # @param string value Value to be deserialized
123
+ # @return [Object] Deserialized data
124
+ def self._deserialize(type, value)
125
+ case type.to_sym
126
+ when :Time
127
+ Time.parse(value)
128
+ when :Date
129
+ Date.parse(value)
130
+ when :String
131
+ value.to_s
132
+ when :Integer
133
+ value.to_i
134
+ when :Float
135
+ value.to_f
136
+ when :Boolean
137
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
138
+ true
139
+ else
140
+ false
141
+ end
142
+ when :Object
143
+ # generic object (usually a Hash), return directly
144
+ value
145
+ when /\AArray<(?<inner_type>.+)>\z/
146
+ inner_type = Regexp.last_match[:inner_type]
147
+ value.map { |v| _deserialize(inner_type, v) }
148
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
149
+ k_type = Regexp.last_match[:k_type]
150
+ v_type = Regexp.last_match[:v_type]
151
+ {}.tap do |hash|
152
+ value.each do |k, v|
153
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
154
+ end
155
+ end
156
+ else # model
157
+ # models (e.g. Pet) or oneOf
158
+ klass = Algolia::Ingestion.const_get(type)
159
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ def to_json(*_args)
176
+ to_hash.to_json
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = send(attr)
185
+ if value.nil?
186
+ is_nullable = self.class.openapi_nullable.include?(attr)
187
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
+ end
189
+
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
@@ -0,0 +1,213 @@
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
+ # Transformations to apply to source, serialized as a JSON string.
9
+ class MappingInput
10
+ # Name of the mapping format schema, `mappingkit/v1` is currently the only supported format.
11
+ attr_accessor :format
12
+
13
+ attr_accessor :actions
14
+
15
+ # Attribute mapping from ruby-style variable name to JSON key.
16
+ def self.attribute_map
17
+ {
18
+ :format => :format,
19
+ :actions => :actions
20
+ }
21
+ end
22
+
23
+ # Returns all the JSON keys this model knows about
24
+ def self.acceptable_attributes
25
+ attribute_map.values
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.types_mapping
30
+ {
31
+ :format => :String,
32
+ :actions => :'Array<MappingKitAction>'
33
+ }
34
+ end
35
+
36
+ # List of attributes with nullable: true
37
+ def self.openapi_nullable
38
+ Set.new([])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ unless attributes.is_a?(Hash)
45
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::MappingInput` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) do |(k, v), h|
50
+ unless self.class.attribute_map.key?(k.to_sym)
51
+ raise ArgumentError,
52
+ "`#{k}` is not a valid attribute in `Algolia::MappingInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ end
54
+
55
+ h[k.to_sym] = v
56
+ end
57
+
58
+ if attributes.key?(:format)
59
+ self.format = attributes[:format]
60
+ else
61
+ self.format = nil
62
+ end
63
+
64
+ if attributes.key?(:actions)
65
+ if (value = attributes[:actions]).is_a?(Array)
66
+ self.actions = value
67
+ end
68
+ else
69
+ self.actions = nil
70
+ end
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param [Object] Object to be compared
75
+ def ==(other)
76
+ return true if equal?(other)
77
+
78
+ self.class == other.class &&
79
+ format == other.format &&
80
+ actions == other.actions
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(other)
86
+ self == other
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Integer] Hash code
91
+ def hash
92
+ [format, actions].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def self.build_from_hash(attributes)
99
+ return nil unless attributes.is_a?(Hash)
100
+
101
+ attributes = attributes.transform_keys(&:to_sym)
102
+ transformed_hash = {}
103
+ types_mapping.each_pair do |key, type|
104
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
105
+ transformed_hash[key.to_sym] = nil
106
+ elsif type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[attribute_map[key]].is_a?(Array)
110
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
111
+ end
112
+ elsif !attributes[attribute_map[key]].nil?
113
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
114
+ end
115
+ end
116
+ new(transformed_hash)
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def self._deserialize(type, value)
124
+ case type.to_sym
125
+ when :Time
126
+ Time.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :Boolean
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ # models (e.g. Pet) or oneOf
157
+ klass = Algolia::Ingestion.const_get(type)
158
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ def to_json(*_args)
175
+ to_hash.to_json
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = send(attr)
184
+ if value.nil?
185
+ is_nullable = self.class.openapi_nullable.include?(attr)
186
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
187
+ end
188
+
189
+ hash[param] = _to_hash(value)
190
+ end
191
+ hash
192
+ end
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.compact.map { |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to? :to_hash
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end
211
+ end
212
+ end
213
+ end
@@ -0,0 +1,235 @@
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
+ # Describes how a destination object should be resolved by means of applying a set of directives.
9
+ class MappingKitAction
10
+ # ID to uniquely identify this action.
11
+ attr_accessor :id
12
+
13
+ # Whether this action has any effect.
14
+ attr_accessor :enabled
15
+
16
+ # Condition which must be satisfied to apply the action. If this evaluates to false, the action is not applied, and the process attempts to apply the next action, if any.
17
+ attr_accessor :trigger
18
+
19
+ attr_accessor :field_directives
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :id => :id,
25
+ :enabled => :enabled,
26
+ :trigger => :trigger,
27
+ :field_directives => :fieldDirectives
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.types_mapping
38
+ {
39
+ :id => :String,
40
+ :enabled => :Boolean,
41
+ :trigger => :String,
42
+ :field_directives => :'Array<MappingFieldDirective>'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ unless attributes.is_a?(Hash)
55
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::MappingKitAction` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) do |(k, v), h|
60
+ unless self.class.attribute_map.key?(k.to_sym)
61
+ raise ArgumentError,
62
+ "`#{k}` is not a valid attribute in `Algolia::MappingKitAction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+
65
+ h[k.to_sym] = v
66
+ end
67
+
68
+ if attributes.key?(:id)
69
+ self.id = attributes[:id]
70
+ end
71
+
72
+ if attributes.key?(:enabled)
73
+ self.enabled = attributes[:enabled]
74
+ else
75
+ self.enabled = nil
76
+ end
77
+
78
+ if attributes.key?(:trigger)
79
+ self.trigger = attributes[:trigger]
80
+ else
81
+ self.trigger = nil
82
+ end
83
+
84
+ if attributes.key?(:field_directives)
85
+ if (value = attributes[:field_directives]).is_a?(Array)
86
+ self.field_directives = value
87
+ end
88
+ else
89
+ self.field_directives = nil
90
+ end
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(other)
96
+ return true if equal?(other)
97
+
98
+ self.class == other.class &&
99
+ id == other.id &&
100
+ enabled == other.enabled &&
101
+ trigger == other.trigger &&
102
+ field_directives == other.field_directives
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(other)
108
+ self == other
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [id, enabled, trigger, field_directives].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ types_mapping.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash[key.to_sym] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def self._deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = Algolia::Ingestion.const_get(type)
180
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ def to_json(*_args)
197
+ to_hash.to_json
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+ end
234
+ end
235
+ end
@@ -13,11 +13,14 @@ module Algolia
13
13
  # The end date of the extraction (RFC3339 format).
14
14
  attr_accessor :end_date
15
15
 
16
+ attr_accessor :mapping
17
+
16
18
  # Attribute mapping from ruby-style variable name to JSON key.
17
19
  def self.attribute_map
18
20
  {
19
21
  :start_date => :startDate,
20
- :end_date => :endDate
22
+ :end_date => :endDate,
23
+ :mapping => :mapping
21
24
  }
22
25
  end
23
26
 
@@ -30,7 +33,8 @@ module Algolia
30
33
  def self.types_mapping
31
34
  {
32
35
  :start_date => :String,
33
- :end_date => :String
36
+ :end_date => :String,
37
+ :mapping => :MappingInput
34
38
  }
35
39
  end
36
40
 
@@ -67,6 +71,10 @@ module Algolia
67
71
  else
68
72
  self.end_date = nil
69
73
  end
74
+
75
+ if attributes.key?(:mapping)
76
+ self.mapping = attributes[:mapping]
77
+ end
70
78
  end
71
79
 
72
80
  # Checks equality by comparing each attribute.
@@ -76,7 +84,8 @@ module Algolia
76
84
 
77
85
  self.class == other.class &&
78
86
  start_date == other.start_date &&
79
- end_date == other.end_date
87
+ end_date == other.end_date &&
88
+ mapping == other.mapping
80
89
  end
81
90
 
82
91
  # @see the `==` method
@@ -88,7 +97,7 @@ module Algolia
88
97
  # Calculates hash code according to all attributes.
89
98
  # @return [Integer] Hash code
90
99
  def hash
91
- [start_date, end_date].hash
100
+ [start_date, end_date, mapping].hash
92
101
  end
93
102
 
94
103
  # Builds the object from hash
@@ -10,10 +10,13 @@ module Algolia
10
10
  # The timeframe of the extraction, in number of days from today.
11
11
  attr_accessor :timeframe
12
12
 
13
+ attr_accessor :mapping
14
+
13
15
  # Attribute mapping from ruby-style variable name to JSON key.
14
16
  def self.attribute_map
15
17
  {
16
- :timeframe => :timeframe
18
+ :timeframe => :timeframe,
19
+ :mapping => :mapping
17
20
  }
18
21
  end
19
22
 
@@ -25,7 +28,8 @@ module Algolia
25
28
  # Attribute type mapping.
26
29
  def self.types_mapping
27
30
  {
28
- :timeframe => :Integer
31
+ :timeframe => :Integer,
32
+ :mapping => :MappingInput
29
33
  }
30
34
  end
31
35
 
@@ -56,6 +60,10 @@ module Algolia
56
60
  else
57
61
  self.timeframe = nil
58
62
  end
63
+
64
+ if attributes.key?(:mapping)
65
+ self.mapping = attributes[:mapping]
66
+ end
59
67
  end
60
68
 
61
69
  # Custom attribute writer method with validation
@@ -82,7 +90,8 @@ module Algolia
82
90
  return true if equal?(other)
83
91
 
84
92
  self.class == other.class &&
85
- timeframe == other.timeframe
93
+ timeframe == other.timeframe &&
94
+ mapping == other.mapping
86
95
  end
87
96
 
88
97
  # @see the `==` method
@@ -94,7 +103,7 @@ module Algolia
94
103
  # Calculates hash code according to all attributes.
95
104
  # @return [Integer] Hash code
96
105
  def hash
97
- [timeframe].hash
106
+ [timeframe, mapping].hash
98
107
  end
99
108
 
100
109
  # Builds the object from hash
@@ -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.alpha.11'.freeze
4
+ VERSION = '3.0.0.alpha.12'.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.alpha.11
4
+ version: 3.0.0.alpha.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-29 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -248,6 +248,9 @@ files:
248
248
  - lib/algolia/models/ingestion/list_events_response.rb
249
249
  - lib/algolia/models/ingestion/list_sources_response.rb
250
250
  - lib/algolia/models/ingestion/list_tasks_response.rb
251
+ - lib/algolia/models/ingestion/mapping_field_directive.rb
252
+ - lib/algolia/models/ingestion/mapping_input.rb
253
+ - lib/algolia/models/ingestion/mapping_kit_action.rb
251
254
  - lib/algolia/models/ingestion/mapping_type_csv.rb
252
255
  - lib/algolia/models/ingestion/method_type.rb
253
256
  - lib/algolia/models/ingestion/on_demand_date_utils_input.rb