algolia 3.37.1 → 3.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/Gemfile.lock +1 -1
  4. data/lib/algolia/api/monitoring_client.rb +2 -2
  5. data/lib/algolia/models/composition/{external.rb → injected_item_external.rb} +6 -3
  6. data/lib/algolia/models/composition/{external_source.rb → injected_item_external_source.rb} +4 -4
  7. data/lib/algolia/models/composition/injected_item_recommend_source.rb +216 -0
  8. data/lib/algolia/models/composition/{search.rb → injected_item_search.rb} +6 -3
  9. data/lib/algolia/models/composition/{search_source.rb → injected_item_search_source.rb} +4 -4
  10. data/lib/algolia/models/composition/injected_item_source.rb +3 -2
  11. data/lib/algolia/models/composition/injection.rb +2 -2
  12. data/lib/algolia/models/composition/{injected_item.rb → injection_injected_item.rb} +3 -3
  13. data/lib/algolia/models/composition/{main.rb → injection_main.rb} +8 -6
  14. data/lib/algolia/models/composition/injection_main_recommend_source.rb +216 -0
  15. data/lib/algolia/models/composition/{composition_source.rb → injection_main_search_source.rb} +12 -4
  16. data/lib/algolia/models/composition/injection_main_source.rb +109 -0
  17. data/lib/algolia/models/composition/main_recommend.rb +250 -0
  18. data/lib/algolia/models/composition/{composition_source_search.rb → main_search.rb} +4 -4
  19. data/lib/algolia/models/composition/model.rb +33 -0
  20. data/lib/algolia/models/composition/recommend.rb +250 -0
  21. data/lib/algolia/models/search/auto_filtering_filter_entry.rb +108 -0
  22. data/lib/algolia/models/search/auto_filtering_result.rb +242 -0
  23. data/lib/algolia/models/search/browse_response.rb +10 -0
  24. data/lib/algolia/models/search/category_prediction.rb +218 -0
  25. data/lib/algolia/models/search/category_prediction_bin.rb +37 -0
  26. data/lib/algolia/models/search/hierarchy_path_entry.rb +227 -0
  27. data/lib/algolia/models/search/query_categorization.rb +248 -0
  28. data/lib/algolia/models/search/query_categorization_type.rb +36 -0
  29. data/lib/algolia/models/search/response_extensions.rb +207 -0
  30. data/lib/algolia/models/search/search_extensions.rb +207 -0
  31. data/lib/algolia/models/search/search_extensions_query_categorization.rb +218 -0
  32. data/lib/algolia/models/search/search_for_hits.rb +14 -4
  33. data/lib/algolia/models/search/search_response.rb +14 -4
  34. data/lib/algolia/version.rb +1 -1
  35. metadata +25 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ba68c4db4558693366a3a03e5791f8a3319a65cd999eeb06384af77835908dd
4
- data.tar.gz: ee5f89ee90d38548f080073ee7b2317f8f122b46dc4e27b14881459c29c1fa1f
3
+ metadata.gz: 04aeeacff2c4802f3be4f34616b67c94dda8985d3c3d8826b5f14e3dfd2331dd
4
+ data.tar.gz: bc1e57a05b971a50815a216fc8766e7c5d8d2b7361991d0c0644375e1cb88814
5
5
  SHA512:
6
- metadata.gz: 06e52b23d46d08296c9f65bde34a4fce7e7f5f3eb9f06b841578371847d5d81d8f392c8f6ace00ebdfd98b5de987233d590b71af5ac43505e7869307c9ab5729
7
- data.tar.gz: 394e21acd70914592158b1e301201728e7429e9da0376689ddb6b94c2642811a4855824c0f1f3dfc215a7be3e89c4a7400de1aae0311c355b42b70d887f38d6c
6
+ metadata.gz: a87390e2e06bd7d0bf3fab4ba0d01d0c9192cd425b16f94fdcebca0af41022fcf85c16cc8a30a987065a262c5d52a2645ccaf943c973e39a1e77eb3612df5470
7
+ data.tar.gz: 510cb212c879552f742247000e36b9fe91e5ff069fb9d69858b92608152f2fd47700dab3e0fee2e8bdcde0cb1824f6b2858c110c6d6333ecb90bf6a157cbdc30
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [3.38.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.37.1...3.38.0)
2
+
3
+ BREAKING CHANGES: this minor version includes breaking changes in the Composition API. See below for more details.
4
+
5
+ - [39ea2c5cb3](https://github.com/algolia/api-clients-automation/commit/39ea2c5cb3) refactor(specs): split injection schema ([#6224](https://github.com/algolia/api-clients-automation/pull/6224)) by [@ClaraMuller](https://github.com/ClaraMuller/)
6
+ - [544091a5f2](https://github.com/algolia/api-clients-automation/commit/544091a5f2) feat(specs): introduce recommend source in Comp API client ([#6227](https://github.com/algolia/api-clients-automation/pull/6227)) by [@ClaraMuller](https://github.com/ClaraMuller/)
7
+ - [f73d69aae4](https://github.com/algolia/api-clients-automation/commit/f73d69aae4) fix(specs): clarify getIndexingTime ([#6276](https://github.com/algolia/api-clients-automation/pull/6276)) by [@kai687](https://github.com/kai687/)
8
+ - [e48d5c4bbf](https://github.com/algolia/api-clients-automation/commit/e48d5c4bbf) feat(specs): query categorization ([#6258](https://github.com/algolia/api-clients-automation/pull/6258)) by [@eric-zaharia](https://github.com/eric-zaharia/)
9
+
1
10
  ## [3.37.1](https://github.com/algolia/algoliasearch-client-ruby/compare/3.37.0...3.37.1)
2
11
 
3
12
  - [16b17eea7b](https://github.com/algolia/api-clients-automation/commit/16b17eea7b) fix(clients): add discriminator fields for InjectedItemSource oneOf ([#6170](https://github.com/algolia/api-clients-automation/pull/6170)) by [@eric-zaharia](https://github.com/eric-zaharia/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.37.1)
4
+ algolia (3.38.0)
5
5
  base64 (>= 0.2.0, < 1)
6
6
  faraday (>= 1.0.1, < 3.0)
7
7
  faraday-net_http_persistent (>= 0.15, < 3)
@@ -343,7 +343,7 @@ module Algolia
343
343
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Monitoring::IncidentsResponse")
344
344
  end
345
345
 
346
- # Retrieves average times for indexing operations for selected clusters.
346
+ # Retrieves indexing latency metrics for selected clusters. This endpoint is intended for infrastructure-level monitoring and availability checks. The returned value reflects latency measured on Algolia's internal monitoring index and is reported in milliseconds. This metric isn't intended to represent the indexing performance of an individual application or index. To measure when an indexing operation has completed for your application, use the `waitTask` method.
347
347
 
348
348
  # @param clusters [String] Subset of clusters, separated by commas. (required)
349
349
  # @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)
@@ -373,7 +373,7 @@ module Algolia
373
373
  @api_client.call_api(:GET, path, new_options)
374
374
  end
375
375
 
376
- # Retrieves average times for indexing operations for selected clusters.
376
+ # Retrieves indexing latency metrics for selected clusters. This endpoint is intended for infrastructure-level monitoring and availability checks. The returned value reflects latency measured on Algolia's internal monitoring index and is reported in milliseconds. This metric isn't intended to represent the indexing performance of an individual application or index. To measure when an indexing operation has completed for your application, use the `waitTask` method.
377
377
 
378
378
  # @param clusters [String] Subset of clusters, separated by commas. (required)
379
379
  # @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)
@@ -7,7 +7,7 @@ require "time"
7
7
 
8
8
  module Algolia
9
9
  module Composition
10
- class External
10
+ class InjectedItemExternal
11
11
  # Composition Index name.
12
12
  attr_accessor :index
13
13
 
@@ -44,7 +44,10 @@ module Algolia
44
44
  # @param [Hash] attributes Model attributes in the form of hash
45
45
  def initialize(attributes = {})
46
46
  if (!attributes.is_a?(Hash))
47
- raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::External` initialize method"
47
+ raise(
48
+ ArgumentError,
49
+ "The input argument (attributes) must be a hash in `Algolia::InjectedItemExternal` initialize method"
50
+ )
48
51
  end
49
52
 
50
53
  # check to see if the attribute exists and convert string to symbol for hash key
@@ -52,7 +55,7 @@ module Algolia
52
55
  if (!self.class.attribute_map.key?(k.to_sym))
53
56
  raise(
54
57
  ArgumentError,
55
- "`#{k}` is not a valid attribute in `Algolia::External`. Please check the name to make sure it's valid. List of attributes: " +
58
+ "`#{k}` is not a valid attribute in `Algolia::InjectedItemExternal`. Please check the name to make sure it's valid. List of attributes: " +
56
59
  self.class.attribute_map.keys.inspect
57
60
  )
58
61
  end
@@ -8,7 +8,7 @@ require "time"
8
8
  module Algolia
9
9
  module Composition
10
10
  # Injected items will originate from externally provided objectIDs (that must exist in the index) given at runtime in the run request payload.
11
- class ExternalSource
11
+ class InjectedItemExternalSource
12
12
  attr_accessor :external
13
13
 
14
14
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -28,7 +28,7 @@ module Algolia
28
28
  # Attribute type mapping.
29
29
  def self.types_mapping
30
30
  {
31
- :external => :"External"
31
+ :external => :"InjectedItemExternal"
32
32
  }
33
33
  end
34
34
 
@@ -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::ExternalSource` initialize method"
48
+ "The input argument (attributes) must be a hash in `Algolia::InjectedItemExternalSource` 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::ExternalSource`. Please check the name to make sure it's valid. List of attributes: " +
57
+ "`#{k}` is not a valid attribute in `Algolia::InjectedItemExternalSource`. 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
@@ -0,0 +1,216 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
+
5
+ require "date"
6
+ require "time"
7
+
8
+ module Algolia
9
+ module Composition
10
+ # Injected items will originate from a recommendation request performed on the specified index.
11
+ class InjectedItemRecommendSource
12
+ attr_accessor :recommend
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :recommend => :recommend
18
+ }
19
+ end
20
+
21
+ # Returns the keys that uniquely identify this oneOf variant when present
22
+ def self.discriminator_attributes
23
+ [
24
+ :recommend
25
+ ]
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.types_mapping
30
+ {
31
+ :recommend => :"Recommend"
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new(
38
+ []
39
+ )
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ if (!attributes.is_a?(Hash))
46
+ raise(
47
+ ArgumentError,
48
+ "The input argument (attributes) must be a hash in `Algolia::InjectedItemRecommendSource` initialize method"
49
+ )
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ raise(
56
+ ArgumentError,
57
+ "`#{k}` is not a valid attribute in `Algolia::InjectedItemRecommendSource`. Please check the name to make sure it's valid. List of attributes: " +
58
+ self.class.attribute_map.keys.inspect
59
+ )
60
+ end
61
+
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:recommend)
66
+ self.recommend = attributes[:recommend]
67
+ else
68
+ self.recommend = 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 self.equal?(other)
76
+ self.class == other.class &&
77
+ recommend == other.recommend
78
+ end
79
+
80
+ # @see the `==` method
81
+ # @param [Object] Object to be compared
82
+ def eql?(other)
83
+ self == other
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Integer] Hash code
88
+ def hash
89
+ [recommend].hash
90
+ end
91
+
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def self.build_from_hash(attributes)
96
+ return nil unless attributes.is_a?(Hash)
97
+ attributes = attributes.transform_keys(&:to_sym)
98
+ transformed_hash = {}
99
+ types_mapping.each_pair do |key, type|
100
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
101
+ transformed_hash[key.to_sym] = nil
102
+ elsif type =~ /\AArray<(.*)>/i
103
+ # check to ensure the input is an array given that the attribute
104
+ # is documented as an array but the input is not
105
+ if attributes[attribute_map[key]].is_a?(Array)
106
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
107
+ _deserialize(::Regexp.last_match(1), v)
108
+ }
109
+ end
110
+ elsif !attributes[attribute_map[key]].nil?
111
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
112
+ end
113
+ end
114
+
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
+
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
+ # model
156
+ else
157
+ # models (e.g. Pet) or oneOf
158
+ klass = Algolia::Composition.const_get(type)
159
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
160
+ .build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ def to_json(*_args)
177
+ to_hash.to_json
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to?(:to_hash)
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end
216
+ end
@@ -7,7 +7,7 @@ require "time"
7
7
 
8
8
  module Algolia
9
9
  module Composition
10
- class Search
10
+ class InjectedItemSearch
11
11
  # Composition Index name.
12
12
  attr_accessor :index
13
13
 
@@ -40,7 +40,10 @@ module Algolia
40
40
  # @param [Hash] attributes Model attributes in the form of hash
41
41
  def initialize(attributes = {})
42
42
  if (!attributes.is_a?(Hash))
43
- raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::Search` initialize method"
43
+ raise(
44
+ ArgumentError,
45
+ "The input argument (attributes) must be a hash in `Algolia::InjectedItemSearch` initialize method"
46
+ )
44
47
  end
45
48
 
46
49
  # check to see if the attribute exists and convert string to symbol for hash key
@@ -48,7 +51,7 @@ module Algolia
48
51
  if (!self.class.attribute_map.key?(k.to_sym))
49
52
  raise(
50
53
  ArgumentError,
51
- "`#{k}` is not a valid attribute in `Algolia::Search`. Please check the name to make sure it's valid. List of attributes: " +
54
+ "`#{k}` is not a valid attribute in `Algolia::InjectedItemSearch`. Please check the name to make sure it's valid. List of attributes: " +
52
55
  self.class.attribute_map.keys.inspect
53
56
  )
54
57
  end
@@ -8,7 +8,7 @@ require "time"
8
8
  module Algolia
9
9
  module Composition
10
10
  # Injected items will originate from a search request performed on the specified index.
11
- class SearchSource
11
+ class InjectedItemSearchSource
12
12
  attr_accessor :search
13
13
 
14
14
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -28,7 +28,7 @@ module Algolia
28
28
  # Attribute type mapping.
29
29
  def self.types_mapping
30
30
  {
31
- :search => :"Search"
31
+ :search => :"InjectedItemSearch"
32
32
  }
33
33
  end
34
34
 
@@ -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::SearchSource` initialize method"
48
+ "The input argument (attributes) must be a hash in `Algolia::InjectedItemSearchSource` 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::SearchSource`. Please check the name to make sure it's valid. List of attributes: " +
57
+ "`#{k}` is not a valid attribute in `Algolia::InjectedItemSearchSource`. 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
@@ -12,8 +12,9 @@ module Algolia
12
12
  # List of class defined in oneOf (OpenAPI v3)
13
13
  def openapi_one_of
14
14
  [
15
- :"ExternalSource",
16
- :"SearchSource"
15
+ :"InjectedItemExternalSource",
16
+ :"InjectedItemRecommendSource",
17
+ :"InjectedItemSearchSource"
17
18
  ]
18
19
  end
19
20
 
@@ -27,8 +27,8 @@ module Algolia
27
27
  # Attribute type mapping.
28
28
  def self.types_mapping
29
29
  {
30
- :main => :"Main",
31
- :injected_items => :"Array<InjectedItem>",
30
+ :main => :"InjectionMain",
31
+ :injected_items => :"Array<InjectionInjectedItem>",
32
32
  :deduplication => :"Deduplication"
33
33
  }
34
34
  end
@@ -7,7 +7,7 @@ require "time"
7
7
 
8
8
  module Algolia
9
9
  module Composition
10
- class InjectedItem
10
+ class InjectionInjectedItem
11
11
  # injected Item unique identifier.
12
12
  attr_accessor :key
13
13
 
@@ -54,7 +54,7 @@ module Algolia
54
54
  if (!attributes.is_a?(Hash))
55
55
  raise(
56
56
  ArgumentError,
57
- "The input argument (attributes) must be a hash in `Algolia::InjectedItem` initialize method"
57
+ "The input argument (attributes) must be a hash in `Algolia::InjectionInjectedItem` initialize method"
58
58
  )
59
59
  end
60
60
 
@@ -63,7 +63,7 @@ module Algolia
63
63
  if (!self.class.attribute_map.key?(k.to_sym))
64
64
  raise(
65
65
  ArgumentError,
66
- "`#{k}` is not a valid attribute in `Algolia::InjectedItem`. Please check the name to make sure it's valid. List of attributes: " +
66
+ "`#{k}` is not a valid attribute in `Algolia::InjectionInjectedItem`. Please check the name to make sure it's valid. List of attributes: " +
67
67
  self.class.attribute_map.keys.inspect
68
68
  )
69
69
  end
@@ -7,7 +7,8 @@ require "time"
7
7
 
8
8
  module Algolia
9
9
  module Composition
10
- class Main
10
+ # Main defines the organic result set of the injection.
11
+ class InjectionMain
11
12
  attr_accessor :source
12
13
 
13
14
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -20,7 +21,7 @@ module Algolia
20
21
  # Attribute type mapping.
21
22
  def self.types_mapping
22
23
  {
23
- :source => :"CompositionSource"
24
+ :source => :"InjectionMainSource"
24
25
  }
25
26
  end
26
27
 
@@ -35,7 +36,10 @@ module Algolia
35
36
  # @param [Hash] attributes Model attributes in the form of hash
36
37
  def initialize(attributes = {})
37
38
  if (!attributes.is_a?(Hash))
38
- raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::Main` initialize method"
39
+ raise(
40
+ ArgumentError,
41
+ "The input argument (attributes) must be a hash in `Algolia::InjectionMain` initialize method"
42
+ )
39
43
  end
40
44
 
41
45
  # check to see if the attribute exists and convert string to symbol for hash key
@@ -43,7 +47,7 @@ module Algolia
43
47
  if (!self.class.attribute_map.key?(k.to_sym))
44
48
  raise(
45
49
  ArgumentError,
46
- "`#{k}` is not a valid attribute in `Algolia::Main`. Please check the name to make sure it's valid. List of attributes: " +
50
+ "`#{k}` is not a valid attribute in `Algolia::InjectionMain`. Please check the name to make sure it's valid. List of attributes: " +
47
51
  self.class.attribute_map.keys.inspect
48
52
  )
49
53
  end
@@ -53,8 +57,6 @@ module Algolia
53
57
 
54
58
  if attributes.key?(:source)
55
59
  self.source = attributes[:source]
56
- else
57
- self.source = nil
58
60
  end
59
61
  end
60
62