algolia 3.0.0.beta.9 → 3.0.0.beta.10

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fcea9c4cdc2e5fe4b4bbefdd10a24ef88aac0da2032a4637e2d8c7b26637ac5
4
- data.tar.gz: 178c675d48ffb5ed60b6432af57d75e033612b4b1f10af4d7b478dd3e30b3886
3
+ metadata.gz: d7cbf50c75d055b57b0fa11bce17057254adef6028335af00245734751edc19a
4
+ data.tar.gz: 369df07cdd8f04bb2343803c7623a58daa861f769fe506058259aaddf1aa8694
5
5
  SHA512:
6
- metadata.gz: 4a2a2f15b69fff7582e8de983d6525403daa1179693b2f0362d576dbc8c34ce75ca13c742874def1ea9788d38feaad376d8c8cd00e8a80671dac157eb430ebd4
7
- data.tar.gz: 71e9d8baf51f1a2b67eb684897e289b581259ee5ea28f9bebb6374f7f253af3e8b61d55c2d9ad411fc891be8d8c7e9425659e38b8d65b47f5fc41a9f4315c7c2
6
+ metadata.gz: 0a4bdd4248cc355064dfa72e9220d8ebc097da6075383373ebad2269e7e320d982f0a2a430692ea35de6fa12e632e7fd404eeee307a00e66f012912918642510
7
+ data.tar.gz: 6d4cdfbcc8310402a0e26e4a17c45df391f7fa2b4227053853b6c910daa3a95951133c42140f74518358de1efbedcca47851beef796705750ec306b74cf11236
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.0.0.beta.10](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.beta.9...3.0.0.beta.10)
2
+
3
+ - [280037178](https://github.com/algolia/api-clients-automation/commit/280037178) fix(specs): update shopify feature flags ([#3380](https://github.com/algolia/api-clients-automation/pull/3380)) by [@millotp](https://github.com/millotp/)
4
+ - [a68907d1c](https://github.com/algolia/api-clients-automation/commit/a68907d1c) feat(clients): add api key helper test ([#3338](https://github.com/algolia/api-clients-automation/pull/3338)) by [@Fluf22](https://github.com/Fluf22/)
5
+ - [31ba7f6d0](https://github.com/algolia/api-clients-automation/commit/31ba7f6d0) fix(specs): recommend non required parameters ([#3355](https://github.com/algolia/api-clients-automation/pull/3355)) by [@shortcuts](https://github.com/shortcuts/)
6
+ - [337eea93e](https://github.com/algolia/api-clients-automation/commit/337eea93e) fix(specs): results is required in GetRecommendationsResponse ([#3357](https://github.com/algolia/api-clients-automation/pull/3357)) by [@millotp](https://github.com/millotp/)
7
+
1
8
  ## [3.0.0.beta.9](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.beta.8...3.0.0.beta.9)
2
9
 
3
10
  - [a009967f6](https://github.com/algolia/api-clients-automation/commit/a009967f6) fix(specs): browse response required properties ([#3348](https://github.com/algolia/api-clients-automation/pull/3348)) by [@millotp](https://github.com/millotp/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.0.0.beta.9)
4
+ algolia (3.0.0.beta.10)
5
5
  base64 (>= 0.2.0, < 1)
6
6
  faraday (>= 1.0.1, < 3.0)
7
7
  faraday-net_http_persistent (>= 0.15, < 3)
@@ -12,13 +12,15 @@ GEM
12
12
  specs:
13
13
  base64 (0.2.0)
14
14
  connection_pool (2.4.1)
15
- faraday (2.9.0)
15
+ faraday (2.10.0)
16
16
  faraday-net_http (>= 2.0, < 3.2)
17
+ logger
17
18
  faraday-net_http (3.1.0)
18
19
  net-http
19
20
  faraday-net_http_persistent (2.1.0)
20
21
  faraday (~> 2.5)
21
22
  net-http-persistent (~> 4.0)
23
+ logger (1.6.0)
22
24
  net-http (0.4.1)
23
25
  uri
24
26
  net-http-persistent (4.0.2)
@@ -3179,16 +3179,16 @@ module Algolia
3179
3179
 
3180
3180
  # Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
3181
3181
  #
3182
- # @param operation [String] the `operation` that was done on a `key`.
3183
3182
  # @param key [String] the `key` that has been added, deleted or updated.
3183
+ # @param operation [String] the `operation` that was done on a `key`.
3184
3184
  # @param api_key [Hash] necessary to know if an `update` operation has been processed, compare fields of the response with it.
3185
3185
  # @param max_retries [Integer] the maximum number of retries.
3186
3186
  # @param timeout [Proc] the function to decide how long to wait between retries.
3187
3187
  # @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
3188
3188
  # @return [Http::Response] the last get_api_key response
3189
3189
  def wait_for_api_key(
3190
- operation,
3191
3190
  key,
3191
+ operation,
3192
3192
  api_key = {},
3193
3193
  max_retries = 50,
3194
3194
  timeout = -> (retry_count) { [retry_count * 200, 5000].min },
@@ -3198,19 +3198,15 @@ module Algolia
3198
3198
  if operation == "update"
3199
3199
  raise ArgumentError, "`api_key` is required when waiting for an `update` operation." if api_key.nil?
3200
3200
  while retries < max_retries
3201
- begin
3202
- updatad_key = get_api_key(key, request_options)
3203
- updated_key_hash = updatad_key.to_hash
3204
- equals = true
3205
- api_key.to_hash.each do |k, v|
3206
- equals &&= updated_key_hash[k] == v
3207
- end
3208
-
3209
- return updatad_key if equals
3210
- rescue AlgoliaError => e
3211
- raise e unless e.code == 404
3201
+ updated_key = get_api_key(key, request_options)
3202
+ updated_key_hash = updated_key.to_hash
3203
+ equals = true
3204
+ api_key.to_hash.each do |k, v|
3205
+ equals &&= updated_key_hash[k] == v
3212
3206
  end
3213
3207
 
3208
+ return updated_key if equals
3209
+
3214
3210
  retries += 1
3215
3211
  sleep(timeout.call(retries) / 1000.0)
3216
3212
  end
@@ -3222,8 +3218,12 @@ module Algolia
3222
3218
  begin
3223
3219
  res = get_api_key(key, request_options)
3224
3220
  return res if operation == "add"
3225
- rescue AlgoliaError => e
3226
- return res if operation == "delete" && e.code == 404
3221
+ rescue AlgoliaHttpError => e
3222
+ if e.code == 404
3223
+ return nil if operation == "delete"
3224
+ else
3225
+ raise e
3226
+ end
3227
3227
  end
3228
3228
 
3229
3229
  retries += 1
@@ -6,26 +6,8 @@ require "time"
6
6
  module Algolia
7
7
  module Ingestion
8
8
  class SourceShopify
9
- # Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false.
10
- attr_accessor :collection_id_indexing
11
-
12
- # Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed.
13
- attr_accessor :increase_product_collection_limit
14
-
15
- # Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead.
16
- attr_accessor :default_price_ratio_as_one
17
-
18
- # Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes.
19
- attr_accessor :exclude_oos_variants_for_price_at_trs
20
-
21
- # Whether to include an inventory with every variant for every product record.
22
- attr_accessor :include_variants_inventory
23
-
24
- # Whether to include collection IDs and handles in the product records.
25
- attr_accessor :has_collection_search_page
26
-
27
- # Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags).
28
- attr_accessor :product_named_tags
9
+ # Feature flags for the Shopify source.
10
+ attr_accessor :feature_flags
29
11
 
30
12
  # URL of the Shopify store.
31
13
  attr_accessor :shop_url
@@ -33,13 +15,7 @@ module Algolia
33
15
  # Attribute mapping from ruby-style variable name to JSON key.
34
16
  def self.attribute_map
35
17
  {
36
- :collection_id_indexing => :collectionIDIndexing,
37
- :increase_product_collection_limit => :increaseProductCollectionLimit,
38
- :default_price_ratio_as_one => :defaultPriceRatioAsOne,
39
- :exclude_oos_variants_for_price_at_trs => :excludeOOSVariantsForPriceAtTRS,
40
- :include_variants_inventory => :includeVariantsInventory,
41
- :has_collection_search_page => :hasCollectionSearchPage,
42
- :product_named_tags => :productNamedTags,
18
+ :feature_flags => :featureFlags,
43
19
  :shop_url => :shopURL
44
20
  }
45
21
  end
@@ -52,13 +28,7 @@ module Algolia
52
28
  # Attribute type mapping.
53
29
  def self.types_mapping
54
30
  {
55
- :collection_id_indexing => :"Boolean",
56
- :increase_product_collection_limit => :"Boolean",
57
- :default_price_ratio_as_one => :"Boolean",
58
- :exclude_oos_variants_for_price_at_trs => :"Boolean",
59
- :include_variants_inventory => :"Boolean",
60
- :has_collection_search_page => :"Boolean",
61
- :product_named_tags => :"Boolean",
31
+ :feature_flags => :"Hash<String, Object>",
62
32
  :shop_url => :"String"
63
33
  }
64
34
  end
@@ -101,32 +71,10 @@ module Algolia
101
71
  h[k.to_sym] = v
102
72
  }
103
73
 
104
- if attributes.key?(:collection_id_indexing)
105
- self.collection_id_indexing = attributes[:collection_id_indexing]
106
- end
107
-
108
- if attributes.key?(:increase_product_collection_limit)
109
- self.increase_product_collection_limit = attributes[:increase_product_collection_limit]
110
- end
111
-
112
- if attributes.key?(:default_price_ratio_as_one)
113
- self.default_price_ratio_as_one = attributes[:default_price_ratio_as_one]
114
- end
115
-
116
- if attributes.key?(:exclude_oos_variants_for_price_at_trs)
117
- self.exclude_oos_variants_for_price_at_trs = attributes[:exclude_oos_variants_for_price_at_trs]
118
- end
119
-
120
- if attributes.key?(:include_variants_inventory)
121
- self.include_variants_inventory = attributes[:include_variants_inventory]
122
- end
123
-
124
- if attributes.key?(:has_collection_search_page)
125
- self.has_collection_search_page = attributes[:has_collection_search_page]
126
- end
127
-
128
- if attributes.key?(:product_named_tags)
129
- self.product_named_tags = attributes[:product_named_tags]
74
+ if attributes.key?(:feature_flags)
75
+ if (value = attributes[:feature_flags]).is_a?(Hash)
76
+ self.feature_flags = value
77
+ end
130
78
  end
131
79
 
132
80
  if attributes.key?(:shop_url)
@@ -141,13 +89,7 @@ module Algolia
141
89
  def ==(other)
142
90
  return true if self.equal?(other)
143
91
  self.class == other.class &&
144
- collection_id_indexing == other.collection_id_indexing &&
145
- increase_product_collection_limit == other.increase_product_collection_limit &&
146
- default_price_ratio_as_one == other.default_price_ratio_as_one &&
147
- exclude_oos_variants_for_price_at_trs == other.exclude_oos_variants_for_price_at_trs &&
148
- include_variants_inventory == other.include_variants_inventory &&
149
- has_collection_search_page == other.has_collection_search_page &&
150
- product_named_tags == other.product_named_tags &&
92
+ feature_flags == other.feature_flags &&
151
93
  shop_url == other.shop_url
152
94
  end
153
95
 
@@ -160,16 +102,7 @@ module Algolia
160
102
  # Calculates hash code according to all attributes.
161
103
  # @return [Integer] Hash code
162
104
  def hash
163
- [
164
- collection_id_indexing,
165
- increase_product_collection_limit,
166
- default_price_ratio_as_one,
167
- exclude_oos_variants_for_price_at_trs,
168
- include_variants_inventory,
169
- has_collection_search_page,
170
- product_named_tags,
171
- shop_url
172
- ].hash
105
+ [feature_flags, shop_url].hash
173
106
  end
174
107
 
175
108
  # Builds the object from hash
@@ -6,37 +6,13 @@ require "time"
6
6
  module Algolia
7
7
  module Ingestion
8
8
  class SourceUpdateShopify
9
- # Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false.
10
- attr_accessor :collection_id_indexing
11
-
12
- # Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed.
13
- attr_accessor :increase_product_collection_limit
14
-
15
- # Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead.
16
- attr_accessor :default_price_ratio_as_one
17
-
18
- # Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes.
19
- attr_accessor :exclude_oos_variants_for_price_at_trs
20
-
21
- # Whether to include an inventory with every variant for every product record.
22
- attr_accessor :include_variants_inventory
23
-
24
- # Whether to include collection IDs and handles in the product records.
25
- attr_accessor :has_collection_search_page
26
-
27
- # Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags).
28
- attr_accessor :product_named_tags
9
+ # Feature flags for the Shopify source.
10
+ attr_accessor :feature_flags
29
11
 
30
12
  # Attribute mapping from ruby-style variable name to JSON key.
31
13
  def self.attribute_map
32
14
  {
33
- :collection_id_indexing => :collectionIDIndexing,
34
- :increase_product_collection_limit => :increaseProductCollectionLimit,
35
- :default_price_ratio_as_one => :defaultPriceRatioAsOne,
36
- :exclude_oos_variants_for_price_at_trs => :excludeOOSVariantsForPriceAtTRS,
37
- :include_variants_inventory => :includeVariantsInventory,
38
- :has_collection_search_page => :hasCollectionSearchPage,
39
- :product_named_tags => :productNamedTags
15
+ :feature_flags => :featureFlags
40
16
  }
41
17
  end
42
18
 
@@ -48,13 +24,7 @@ module Algolia
48
24
  # Attribute type mapping.
49
25
  def self.types_mapping
50
26
  {
51
- :collection_id_indexing => :"Boolean",
52
- :increase_product_collection_limit => :"Boolean",
53
- :default_price_ratio_as_one => :"Boolean",
54
- :exclude_oos_variants_for_price_at_trs => :"Boolean",
55
- :include_variants_inventory => :"Boolean",
56
- :has_collection_search_page => :"Boolean",
57
- :product_named_tags => :"Boolean"
27
+ :feature_flags => :"Hash<String, Object>"
58
28
  }
59
29
  end
60
30
 
@@ -88,32 +58,10 @@ module Algolia
88
58
  h[k.to_sym] = v
89
59
  }
90
60
 
91
- if attributes.key?(:collection_id_indexing)
92
- self.collection_id_indexing = attributes[:collection_id_indexing]
93
- end
94
-
95
- if attributes.key?(:increase_product_collection_limit)
96
- self.increase_product_collection_limit = attributes[:increase_product_collection_limit]
97
- end
98
-
99
- if attributes.key?(:default_price_ratio_as_one)
100
- self.default_price_ratio_as_one = attributes[:default_price_ratio_as_one]
101
- end
102
-
103
- if attributes.key?(:exclude_oos_variants_for_price_at_trs)
104
- self.exclude_oos_variants_for_price_at_trs = attributes[:exclude_oos_variants_for_price_at_trs]
105
- end
106
-
107
- if attributes.key?(:include_variants_inventory)
108
- self.include_variants_inventory = attributes[:include_variants_inventory]
109
- end
110
-
111
- if attributes.key?(:has_collection_search_page)
112
- self.has_collection_search_page = attributes[:has_collection_search_page]
113
- end
114
-
115
- if attributes.key?(:product_named_tags)
116
- self.product_named_tags = attributes[:product_named_tags]
61
+ if attributes.key?(:feature_flags)
62
+ if (value = attributes[:feature_flags]).is_a?(Hash)
63
+ self.feature_flags = value
64
+ end
117
65
  end
118
66
  end
119
67
 
@@ -122,13 +70,7 @@ module Algolia
122
70
  def ==(other)
123
71
  return true if self.equal?(other)
124
72
  self.class == other.class &&
125
- collection_id_indexing == other.collection_id_indexing &&
126
- increase_product_collection_limit == other.increase_product_collection_limit &&
127
- default_price_ratio_as_one == other.default_price_ratio_as_one &&
128
- exclude_oos_variants_for_price_at_trs == other.exclude_oos_variants_for_price_at_trs &&
129
- include_variants_inventory == other.include_variants_inventory &&
130
- has_collection_search_page == other.has_collection_search_page &&
131
- product_named_tags == other.product_named_tags
73
+ feature_flags == other.feature_flags
132
74
  end
133
75
 
134
76
  # @see the `==` method
@@ -140,15 +82,7 @@ module Algolia
140
82
  # Calculates hash code according to all attributes.
141
83
  # @return [Integer] Hash code
142
84
  def hash
143
- [
144
- collection_id_indexing,
145
- increase_product_collection_limit,
146
- default_price_ratio_as_one,
147
- exclude_oos_variants_for_price_at_trs,
148
- include_variants_inventory,
149
- has_collection_search_page,
150
- product_named_tags
151
- ].hash
85
+ [feature_flags].hash
152
86
  end
153
87
 
154
88
  # Builds the object from hash
@@ -61,6 +61,8 @@ module Algolia
61
61
  if (value = attributes[:results]).is_a?(Array)
62
62
  self.results = value
63
63
  end
64
+ else
65
+ self.results = nil
64
66
  end
65
67
  end
66
68
 
@@ -95,14 +95,10 @@ module Algolia
95
95
 
96
96
  if attributes.key?(:facet_name)
97
97
  self.facet_name = attributes[:facet_name]
98
- else
99
- self.facet_name = nil
100
98
  end
101
99
 
102
100
  if attributes.key?(:facet_value)
103
101
  self.facet_value = attributes[:facet_value]
104
- else
105
- self.facet_value = nil
106
102
  end
107
103
 
108
104
  if attributes.key?(:model)
@@ -142,14 +142,10 @@ module Algolia
142
142
 
143
143
  if attributes.key?(:facet_name)
144
144
  self.facet_name = attributes[:facet_name]
145
- else
146
- self.facet_name = nil
147
145
  end
148
146
 
149
147
  if attributes.key?(:facet_value)
150
148
  self.facet_value = attributes[:facet_value]
151
- else
152
- self.facet_value = nil
153
149
  end
154
150
 
155
151
  if attributes.key?(:model)
@@ -68,7 +68,7 @@ module Algolia
68
68
  )
69
69
  if outcome == FAILURE
70
70
  decoded_error = JSON.parse(response.error, :symbolize_names => true)
71
- raise Algolia::AlgoliaHttpError.new(decoded_error[:status], decoded_error[:message])
71
+ raise Algolia::AlgoliaHttpError.new(response.status, decoded_error[:message])
72
72
  end
73
73
 
74
74
  return response unless outcome == RETRY
@@ -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.9".freeze
4
+ VERSION = "3.0.0.beta.10".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.9
4
+ version: 3.0.0.beta.10
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-07-12 00:00:00.000000000 Z
11
+ date: 2024-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday