algolia 3.0.0.beta.10 → 3.0.0.beta.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/Gemfile.lock +2 -2
  4. data/lib/algolia/api/ingestion_client.rb +912 -359
  5. data/lib/algolia/api/query_suggestions_client.rb +4 -10
  6. data/lib/algolia/api/search_client.rb +4 -4
  7. data/lib/algolia/api/usage_client.rb +4 -4
  8. data/lib/algolia/error.rb +10 -0
  9. data/lib/algolia/logger_helper.rb +11 -2
  10. data/lib/algolia/models/abtesting/{filter_effects_empty_search.rb → empty_search_filter.rb} +3 -3
  11. data/lib/algolia/models/abtesting/filter_effects.rb +2 -2
  12. data/lib/algolia/models/abtesting/{filter_effects_outliers.rb → outliers_filter.rb} +3 -3
  13. data/lib/algolia/models/analytics/{click_positions_inner.rb → click_position.rb} +3 -3
  14. data/lib/algolia/models/analytics/get_click_positions_response.rb +1 -1
  15. data/lib/algolia/models/analytics/top_search_with_analytics.rb +1 -1
  16. data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +1 -1
  17. data/lib/algolia/models/ingestion/action.rb +45 -0
  18. data/lib/algolia/models/{search/search_for_hits_options.rb → ingestion/batch_request.rb} +22 -20
  19. data/lib/algolia/models/ingestion/{source_shopify_base.rb → batch_write_params.rb} +14 -12
  20. data/lib/algolia/models/ingestion/docker_streams_input.rb +1 -0
  21. data/lib/algolia/models/{recommend/recommendations_hits.rb → ingestion/list_tasks_response_v1.rb} +26 -14
  22. data/lib/algolia/models/ingestion/task.rb +30 -9
  23. data/lib/algolia/models/ingestion/task_create.rb +11 -12
  24. data/lib/algolia/models/{search/search_for_facets_options.rb → ingestion/task_create_v1.rb} +86 -51
  25. data/lib/algolia/models/ingestion/task_update.rb +8 -7
  26. data/lib/algolia/models/{search/browse_pagination.rb → ingestion/task_update_v1.rb} +50 -55
  27. data/lib/algolia/models/{recommend/looking_similar.rb → ingestion/task_v1.rb} +147 -30
  28. data/lib/algolia/models/ingestion/{transformation_try_response_error.rb → transformation_error.rb} +3 -3
  29. data/lib/algolia/models/ingestion/transformation_try_response.rb +1 -1
  30. data/lib/algolia/models/monitoring/{incidents_inner.rb → incident_entry.rb} +3 -3
  31. data/lib/algolia/models/monitoring/{indexing_time_response_metrics.rb → indexing_metric.rb} +3 -3
  32. data/lib/algolia/models/monitoring/indexing_time_response.rb +1 -1
  33. data/lib/algolia/models/monitoring/infrastructure_response.rb +1 -1
  34. data/lib/algolia/models/monitoring/{latency_response_metrics.rb → latency_metric.rb} +3 -3
  35. data/lib/algolia/models/monitoring/latency_response.rb +1 -1
  36. data/lib/algolia/models/monitoring/{infrastructure_response_metrics.rb → metrics.rb} +3 -6
  37. data/lib/algolia/models/monitoring/{time_inner.rb → time_entry.rb} +3 -3
  38. data/lib/algolia/models/{recommend/trending_items.rb → query-suggestions/config_status.rb} +46 -58
  39. data/lib/algolia/models/{recommend/related_products.rb → query-suggestions/log_file.rb} +36 -32
  40. data/lib/algolia/models/recommend/around_precision.rb +1 -1
  41. data/lib/algolia/models/recommend/fallback_params.rb +1 -1
  42. data/lib/algolia/models/recommend/{around_precision_from_value_inner.rb → range.rb} +3 -6
  43. data/lib/algolia/models/recommend/recommend_rule.rb +1 -1
  44. data/lib/algolia/models/recommend/{redirect_rule_index_metadata_data.rb → redirect_rule_index_data.rb} +3 -3
  45. data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +1 -1
  46. data/lib/algolia/models/recommend/{recommend_rule_metadata.rb → rule_metadata.rb} +3 -3
  47. data/lib/algolia/models/recommend/search_params.rb +1 -1
  48. data/lib/algolia/models/recommend/search_params_object.rb +1 -1
  49. data/lib/algolia/models/search/around_precision.rb +1 -1
  50. data/lib/algolia/models/search/browse_params_object.rb +1 -1
  51. data/lib/algolia/models/search/built_in_operation.rb +1 -2
  52. data/lib/algolia/models/search/built_in_operation_value.rb +105 -0
  53. data/lib/algolia/models/search/consequence_params.rb +1 -1
  54. data/lib/algolia/models/search/dictionary_entry.rb +0 -2
  55. data/lib/algolia/models/search/index_settings.rb +2 -2
  56. data/lib/algolia/models/search/{around_precision_from_value_inner.rb → range.rb} +3 -6
  57. data/lib/algolia/models/search/{redirect_rule_index_metadata_data.rb → redirect_rule_index_data.rb} +3 -3
  58. data/lib/algolia/models/search/redirect_rule_index_metadata.rb +1 -1
  59. data/lib/algolia/models/search/search_for_facets.rb +1 -1
  60. data/lib/algolia/models/search/search_for_hits.rb +1 -1
  61. data/lib/algolia/models/search/search_params_object.rb +1 -1
  62. data/lib/algolia/models/search/search_params_string.rb +1 -0
  63. data/lib/algolia/models/search/{index_settings_as_search_params.rb → settings_response.rb} +251 -11
  64. data/lib/algolia/models/usage/{get_usage400_response_error_errors_inner.rb → error_item.rb} +3 -3
  65. data/lib/algolia/models/usage/{get_usage400_response_error.rb → forbidden_error.rb} +4 -4
  66. data/lib/algolia/models/usage/{get_usage200_response.rb → index_usage.rb} +4 -4
  67. data/lib/algolia/models/usage/invalid_request_error.rb +231 -0
  68. data/lib/algolia/models/usage/{get_usage200_response_statistics_inner.rb → statistic_entry.rb} +3 -3
  69. data/lib/algolia/transport/transport.rb +8 -2
  70. data/lib/algolia/version.rb +1 -1
  71. metadata +32 -63
  72. data/lib/algolia/models/abtesting/custom_search_params.rb +0 -214
  73. data/lib/algolia/models/abtesting/error_base.rb +0 -212
  74. data/lib/algolia/models/analytics/error_base.rb +0 -212
  75. data/lib/algolia/models/ingestion/error_base.rb +0 -212
  76. data/lib/algolia/models/insights/error_base.rb +0 -212
  77. data/lib/algolia/models/monitoring/error_base.rb +0 -212
  78. data/lib/algolia/models/monitoring/get_servers403_response.rb +0 -211
  79. data/lib/algolia/models/personalization/error_base.rb +0 -212
  80. data/lib/algolia/models/query-suggestions/app_id.rb +0 -209
  81. data/lib/algolia/models/query-suggestions/error_base.rb +0 -212
  82. data/lib/algolia/models/recommend/base_recommend_request.rb +0 -281
  83. data/lib/algolia/models/recommend/base_search_params.rb +0 -635
  84. data/lib/algolia/models/recommend/base_search_params_without_query.rb +0 -616
  85. data/lib/algolia/models/recommend/base_search_response.rb +0 -499
  86. data/lib/algolia/models/recommend/error_base.rb +0 -212
  87. data/lib/algolia/models/recommend/frequently_bought_together.rb +0 -247
  88. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +0 -788
  89. data/lib/algolia/models/recommend/recommended_for_you.rb +0 -244
  90. data/lib/algolia/models/recommend/search_pagination.rb +0 -282
  91. data/lib/algolia/models/recommend/search_params_query.rb +0 -212
  92. data/lib/algolia/models/recommend/trending_facets.rb +0 -258
  93. data/lib/algolia/models/search/base_get_api_key_response.rb +0 -224
  94. data/lib/algolia/models/search/base_index_settings.rb +0 -426
  95. data/lib/algolia/models/search/base_search_params.rb +0 -635
  96. data/lib/algolia/models/search/base_search_params_without_query.rb +0 -616
  97. data/lib/algolia/models/search/base_search_response.rb +0 -499
  98. data/lib/algolia/models/search/cursor.rb +0 -209
  99. data/lib/algolia/models/search/error_base.rb +0 -212
  100. data/lib/algolia/models/search/params.rb +0 -236
  101. data/lib/algolia/models/search/search_hits.rb +0 -240
  102. data/lib/algolia/models/search/search_pagination.rb +0 -282
  103. data/lib/algolia/models/search/search_params_query.rb +0 -212
  104. data/lib/algolia/models/usage/error_base.rb +0 -212
  105. data/lib/algolia/models/usage/get_usage400_response.rb +0 -213
@@ -428,13 +428,10 @@ module Algolia
428
428
  # - settings
429
429
  # @param index_name [String] Query Suggestions index name. (required)
430
430
  # @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)
431
- # @return [GetConfigStatus200Response]
431
+ # @return [ConfigStatus]
432
432
  def get_config_status(index_name, request_options = {})
433
433
  response = get_config_status_with_http_info(index_name, request_options)
434
- @api_client.deserialize(
435
- response.body,
436
- request_options[:debug_return_type] || "QuerySuggestions::GetConfigStatus200Response"
437
- )
434
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "QuerySuggestions::ConfigStatus")
438
435
  end
439
436
 
440
437
  # Retrieves the logs for a single Query Suggestions index.
@@ -475,13 +472,10 @@ module Algolia
475
472
  # - settings
476
473
  # @param index_name [String] Query Suggestions index name. (required)
477
474
  # @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)
478
- # @return [GetLogFile200Response]
475
+ # @return [LogFile]
479
476
  def get_log_file(index_name, request_options = {})
480
477
  response = get_log_file_with_http_info(index_name, request_options)
481
- @api_client.deserialize(
482
- response.body,
483
- request_options[:debug_return_type] || "QuerySuggestions::GetLogFile200Response"
484
- )
478
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "QuerySuggestions::LogFile")
485
479
  end
486
480
 
487
481
  # Updates a QuerySuggestions configuration.
@@ -1389,10 +1389,10 @@ module Algolia
1389
1389
  # @param object_id [String] Unique record identifier. (required)
1390
1390
  # @param attributes_to_retrieve [Array<String>] Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. &#x60;objectID&#x60; is always retrieved. Attributes included in &#x60;unretrievableAttributes&#x60; won&#39;t be retrieved unless the request is authenticated with the admin API key.
1391
1391
  # @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)
1392
- # @return [Hash<String, String>]
1392
+ # @return [Object]
1393
1393
  def get_object(index_name, object_id, attributes_to_retrieve = nil, request_options = {})
1394
1394
  response = get_object_with_http_info(index_name, object_id, attributes_to_retrieve, request_options)
1395
- @api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::Hash<String, String>")
1395
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::Object")
1396
1396
  end
1397
1397
 
1398
1398
  # Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
@@ -1529,10 +1529,10 @@ module Algolia
1529
1529
  # - search
1530
1530
  # @param index_name [String] Name of the index on which to perform the operation. (required)
1531
1531
  # @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)
1532
- # @return [IndexSettings]
1532
+ # @return [SettingsResponse]
1533
1533
  def get_settings(index_name, request_options = {})
1534
1534
  response = get_settings_with_http_info(index_name, request_options)
1535
- @api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::IndexSettings")
1535
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::SettingsResponse")
1536
1536
  end
1537
1537
 
1538
1538
  # Retrieves all allowed IP addresses with access to your application.
@@ -275,7 +275,7 @@ module Algolia
275
275
  # @param end_date [String] End date of the period to analyze, in &#x60;YYYY-MM-DD&#x60; format. (required)
276
276
  # @param granularity [Granularity] Granularity of the aggregated metrics. - &#x60;hourly&#x60;: the maximum time range for hourly metrics is 7 days. - &#x60;daily&#x60;: the maximum time range for daily metrics is 365 days. (default to 'daily')
277
277
  # @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)
278
- # @return [GetUsage200Response]
278
+ # @return [IndexUsage]
279
279
  def get_index_usage(statistic, index_name, start_date, end_date, granularity = nil, request_options = {})
280
280
  response = get_index_usage_with_http_info(
281
281
  statistic,
@@ -285,7 +285,7 @@ module Algolia
285
285
  granularity,
286
286
  request_options
287
287
  )
288
- @api_client.deserialize(response.body, request_options[:debug_return_type] || "Usage::GetUsage200Response")
288
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Usage::IndexUsage")
289
289
  end
290
290
 
291
291
  # Retrieves usage statistics evaluated over a specified period.
@@ -339,10 +339,10 @@ module Algolia
339
339
  # @param end_date [String] End date of the period to analyze, in &#x60;YYYY-MM-DD&#x60; format. (required)
340
340
  # @param granularity [Granularity] Granularity of the aggregated metrics. - &#x60;hourly&#x60;: the maximum time range for hourly metrics is 7 days. - &#x60;daily&#x60;: the maximum time range for daily metrics is 365 days. (default to 'daily')
341
341
  # @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)
342
- # @return [GetUsage200Response]
342
+ # @return [IndexUsage]
343
343
  def get_usage(statistic, start_date, end_date, granularity = nil, request_options = {})
344
344
  response = get_usage_with_http_info(statistic, start_date, end_date, granularity, request_options)
345
- @api_client.deserialize(response.body, request_options[:debug_return_type] || "Usage::GetUsage200Response")
345
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || "Usage::IndexUsage")
346
346
  end
347
347
 
348
348
  end
data/lib/algolia/error.rb CHANGED
@@ -10,6 +10,16 @@ module Algolia
10
10
  # Used when hosts are unreachable
11
11
  #
12
12
  class AlgoliaUnreachableHostError < AlgoliaError
13
+ attr_reader :errors
14
+
15
+ def initialize(message, errors = [])
16
+ errors.last&.tap do |last_error|
17
+ message += " Last error for #{last_error[:host]}: #{last_error[:error]}"
18
+ end
19
+
20
+ super(message)
21
+ @errors = errors
22
+ end
13
23
  end
14
24
 
15
25
  # An exception class raised when the REST API returns an error.
@@ -5,8 +5,17 @@ module Algolia
5
5
  # @param debug_file [nil|String] file used to output the logs
6
6
  #
7
7
  def self.create(debug_file = nil)
8
- file = debug_file || (ENV["ALGOLIA_DEBUG"] ? File.new("debug.log", "a+") : $stderr)
9
- instance = ::Logger.new(file)
8
+ file = debug_file
9
+
10
+ if file.nil? && ENV["ALGOLIA_DEBUG"]
11
+ begin
12
+ file = File.new("debug.log", "a+")
13
+ rescue Errno::EACCES, Errno::ENOENT => e
14
+ puts("Failed to open debug.log: #{e.message}. Falling back to $stderr.")
15
+ end
16
+ end
17
+
18
+ instance = ::Logger.new(file || $stderr)
10
19
  instance.progname = "algolia"
11
20
  instance
12
21
  end
@@ -6,7 +6,7 @@ require "time"
6
6
  module Algolia
7
7
  module Abtesting
8
8
  # Empty searches removed from the A/B test as a result of configuration settings.
9
- class FilterEffectsEmptySearch
9
+ class EmptySearchFilter
10
10
  # Number of users removed from the A/B test.
11
11
  attr_accessor :users_count
12
12
 
@@ -47,7 +47,7 @@ module Algolia
47
47
  if (!attributes.is_a?(Hash))
48
48
  raise(
49
49
  ArgumentError,
50
- "The input argument (attributes) must be a hash in `Algolia::FilterEffectsEmptySearch` initialize method"
50
+ "The input argument (attributes) must be a hash in `Algolia::EmptySearchFilter` initialize method"
51
51
  )
52
52
  end
53
53
 
@@ -56,7 +56,7 @@ module Algolia
56
56
  if (!self.class.attribute_map.key?(k.to_sym))
57
57
  raise(
58
58
  ArgumentError,
59
- "`#{k}` is not a valid attribute in `Algolia::FilterEffectsEmptySearch`. Please check the name to make sure it's valid. List of attributes: " +
59
+ "`#{k}` is not a valid attribute in `Algolia::EmptySearchFilter`. Please check the name to make sure it's valid. List of attributes: " +
60
60
  self.class.attribute_map.keys.inspect
61
61
  )
62
62
  end
@@ -27,8 +27,8 @@ module Algolia
27
27
  # Attribute type mapping.
28
28
  def self.types_mapping
29
29
  {
30
- :outliers => :"FilterEffectsOutliers",
31
- :empty_search => :"FilterEffectsEmptySearch"
30
+ :outliers => :"OutliersFilter",
31
+ :empty_search => :"EmptySearchFilter"
32
32
  }
33
33
  end
34
34
 
@@ -6,7 +6,7 @@ require "time"
6
6
  module Algolia
7
7
  module Abtesting
8
8
  # Outliers removed from the A/B test as a result of configuration settings.
9
- class FilterEffectsOutliers
9
+ class OutliersFilter
10
10
  # Number of users removed from the A/B test.
11
11
  attr_accessor :users_count
12
12
 
@@ -47,7 +47,7 @@ module Algolia
47
47
  if (!attributes.is_a?(Hash))
48
48
  raise(
49
49
  ArgumentError,
50
- "The input argument (attributes) must be a hash in `Algolia::FilterEffectsOutliers` initialize method"
50
+ "The input argument (attributes) must be a hash in `Algolia::OutliersFilter` initialize method"
51
51
  )
52
52
  end
53
53
 
@@ -56,7 +56,7 @@ module Algolia
56
56
  if (!self.class.attribute_map.key?(k.to_sym))
57
57
  raise(
58
58
  ArgumentError,
59
- "`#{k}` is not a valid attribute in `Algolia::FilterEffectsOutliers`. Please check the name to make sure it's valid. List of attributes: " +
59
+ "`#{k}` is not a valid attribute in `Algolia::OutliersFilter`. Please check the name to make sure it's valid. List of attributes: " +
60
60
  self.class.attribute_map.keys.inspect
61
61
  )
62
62
  end
@@ -6,7 +6,7 @@ require "time"
6
6
  module Algolia
7
7
  module Analytics
8
8
  # Click position.
9
- class ClickPositionsInner
9
+ class ClickPosition
10
10
  # Range of positions in the search results, using the pattern `[start,end]`. For positions 11 and up, click events are summed over the specified range. `-1` indicates the end of the list of search results.
11
11
  attr_accessor :position
12
12
 
@@ -47,7 +47,7 @@ module Algolia
47
47
  if (!attributes.is_a?(Hash))
48
48
  raise(
49
49
  ArgumentError,
50
- "The input argument (attributes) must be a hash in `Algolia::ClickPositionsInner` initialize method"
50
+ "The input argument (attributes) must be a hash in `Algolia::ClickPosition` initialize method"
51
51
  )
52
52
  end
53
53
 
@@ -56,7 +56,7 @@ module Algolia
56
56
  if (!self.class.attribute_map.key?(k.to_sym))
57
57
  raise(
58
58
  ArgumentError,
59
- "`#{k}` is not a valid attribute in `Algolia::ClickPositionsInner`. Please check the name to make sure it's valid. List of attributes: " +
59
+ "`#{k}` is not a valid attribute in `Algolia::ClickPosition`. Please check the name to make sure it's valid. List of attributes: " +
60
60
  self.class.attribute_map.keys.inspect
61
61
  )
62
62
  end
@@ -24,7 +24,7 @@ module Algolia
24
24
  # Attribute type mapping.
25
25
  def self.types_mapping
26
26
  {
27
- :positions => :"Array<ClickPositionsInner>"
27
+ :positions => :"Array<ClickPosition>"
28
28
  }
29
29
  end
30
30
 
@@ -64,7 +64,7 @@ module Algolia
64
64
  :count => :"Integer",
65
65
  :click_through_rate => :"Float",
66
66
  :average_click_position => :"Float",
67
- :click_positions => :"Array<ClickPositionsInner>",
67
+ :click_positions => :"Array<ClickPosition>",
68
68
  :conversion_rate => :"Float",
69
69
  :tracked_search_count => :"Integer",
70
70
  :click_count => :"Integer",
@@ -84,7 +84,7 @@ module Algolia
84
84
  :count => :"Integer",
85
85
  :click_through_rate => :"Float",
86
86
  :average_click_position => :"Float",
87
- :click_positions => :"Array<ClickPositionsInner>",
87
+ :click_positions => :"Array<ClickPosition>",
88
88
  :conversion_rate => :"Float",
89
89
  :tracked_search_count => :"Integer",
90
90
  :click_count => :"Integer",
@@ -0,0 +1,45 @@
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 Action
9
+ ADD_OBJECT = "addObject".freeze
10
+ UPDATE_OBJECT = "updateObject".freeze
11
+ PARTIAL_UPDATE_OBJECT = "partialUpdateObject".freeze
12
+ PARTIAL_UPDATE_OBJECT_NO_CREATE = "partialUpdateObjectNoCreate".freeze
13
+ DELETE_OBJECT = "deleteObject".freeze
14
+ DELETE = "delete".freeze
15
+ CLEAR = "clear".freeze
16
+
17
+ def self.all_vars
18
+ @all_vars ||= [
19
+ ADD_OBJECT,
20
+ UPDATE_OBJECT,
21
+ PARTIAL_UPDATE_OBJECT,
22
+ PARTIAL_UPDATE_OBJECT_NO_CREATE,
23
+ DELETE_OBJECT,
24
+ DELETE,
25
+ CLEAR
26
+ ].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ new.build_from_hash(value)
34
+ end
35
+
36
+ # Builds the enum from string
37
+ # @param [String] The enum value in the form of the string
38
+ # @return [String] The enum value
39
+ def build_from_hash(value)
40
+ return value if Action.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #Action"
42
+ end
43
+ end
44
+ end
45
+ end
@@ -4,12 +4,12 @@ require "date"
4
4
  require "time"
5
5
 
6
6
  module Algolia
7
- module Search
8
- class SearchForHitsOptions
9
- # Index name (case-sensitive).
10
- attr_accessor :index_name
7
+ module Ingestion
8
+ class BatchRequest
9
+ attr_accessor :action
11
10
 
12
- attr_accessor :type
11
+ # Operation arguments (varies with specified `action`).
12
+ attr_accessor :body
13
13
 
14
14
  class EnumAttributeValidator
15
15
  attr_reader :datatype
@@ -36,8 +36,8 @@ module Algolia
36
36
  # Attribute mapping from ruby-style variable name to JSON key.
37
37
  def self.attribute_map
38
38
  {
39
- :index_name => :indexName,
40
- :type => :type
39
+ :action => :action,
40
+ :body => :body
41
41
  }
42
42
  end
43
43
 
@@ -49,8 +49,8 @@ module Algolia
49
49
  # Attribute type mapping.
50
50
  def self.types_mapping
51
51
  {
52
- :index_name => :"String",
53
- :type => :"SearchTypeDefault"
52
+ :action => :"Action",
53
+ :body => :"Object"
54
54
  }
55
55
  end
56
56
 
@@ -67,7 +67,7 @@ module Algolia
67
67
  if (!attributes.is_a?(Hash))
68
68
  raise(
69
69
  ArgumentError,
70
- "The input argument (attributes) must be a hash in `Algolia::SearchForHitsOptions` initialize method"
70
+ "The input argument (attributes) must be a hash in `Algolia::BatchRequest` initialize method"
71
71
  )
72
72
  end
73
73
 
@@ -76,7 +76,7 @@ module Algolia
76
76
  if (!self.class.attribute_map.key?(k.to_sym))
77
77
  raise(
78
78
  ArgumentError,
79
- "`#{k}` is not a valid attribute in `Algolia::SearchForHitsOptions`. Please check the name to make sure it's valid. List of attributes: " +
79
+ "`#{k}` is not a valid attribute in `Algolia::BatchRequest`. Please check the name to make sure it's valid. List of attributes: " +
80
80
  self.class.attribute_map.keys.inspect
81
81
  )
82
82
  end
@@ -84,14 +84,16 @@ module Algolia
84
84
  h[k.to_sym] = v
85
85
  }
86
86
 
87
- if attributes.key?(:index_name)
88
- self.index_name = attributes[:index_name]
87
+ if attributes.key?(:action)
88
+ self.action = attributes[:action]
89
89
  else
90
- self.index_name = nil
90
+ self.action = nil
91
91
  end
92
92
 
93
- if attributes.key?(:type)
94
- self.type = attributes[:type]
93
+ if attributes.key?(:body)
94
+ self.body = attributes[:body]
95
+ else
96
+ self.body = nil
95
97
  end
96
98
  end
97
99
 
@@ -100,8 +102,8 @@ module Algolia
100
102
  def ==(other)
101
103
  return true if self.equal?(other)
102
104
  self.class == other.class &&
103
- index_name == other.index_name &&
104
- type == other.type
105
+ action == other.action &&
106
+ body == other.body
105
107
  end
106
108
 
107
109
  # @see the `==` method
@@ -113,7 +115,7 @@ module Algolia
113
115
  # Calculates hash code according to all attributes.
114
116
  # @return [Integer] Hash code
115
117
  def hash
116
- [index_name, type].hash
118
+ [action, body].hash
117
119
  end
118
120
 
119
121
  # Builds the object from hash
@@ -182,7 +184,7 @@ module Algolia
182
184
  # model
183
185
  else
184
186
  # models (e.g. Pet) or oneOf
185
- klass = Algolia::Search.const_get(type)
187
+ klass = Algolia::Ingestion.const_get(type)
186
188
  klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
187
189
  .build_from_hash(value)
188
190
  end
@@ -5,14 +5,14 @@ require "time"
5
5
 
6
6
  module Algolia
7
7
  module Ingestion
8
- class SourceShopifyBase
9
- # URL of the Shopify store.
10
- attr_accessor :shop_url
8
+ # Batch parameters.
9
+ class BatchWriteParams
10
+ attr_accessor :requests
11
11
 
12
12
  # Attribute mapping from ruby-style variable name to JSON key.
13
13
  def self.attribute_map
14
14
  {
15
- :shop_url => :shopURL
15
+ :requests => :requests
16
16
  }
17
17
  end
18
18
 
@@ -24,7 +24,7 @@ module Algolia
24
24
  # Attribute type mapping.
25
25
  def self.types_mapping
26
26
  {
27
- :shop_url => :"String"
27
+ :requests => :"Array<BatchRequest>"
28
28
  }
29
29
  end
30
30
 
@@ -41,7 +41,7 @@ module Algolia
41
41
  if (!attributes.is_a?(Hash))
42
42
  raise(
43
43
  ArgumentError,
44
- "The input argument (attributes) must be a hash in `Algolia::SourceShopifyBase` initialize method"
44
+ "The input argument (attributes) must be a hash in `Algolia::BatchWriteParams` initialize method"
45
45
  )
46
46
  end
47
47
 
@@ -50,7 +50,7 @@ module Algolia
50
50
  if (!self.class.attribute_map.key?(k.to_sym))
51
51
  raise(
52
52
  ArgumentError,
53
- "`#{k}` is not a valid attribute in `Algolia::SourceShopifyBase`. Please check the name to make sure it's valid. List of attributes: " +
53
+ "`#{k}` is not a valid attribute in `Algolia::BatchWriteParams`. Please check the name to make sure it's valid. List of attributes: " +
54
54
  self.class.attribute_map.keys.inspect
55
55
  )
56
56
  end
@@ -58,10 +58,12 @@ module Algolia
58
58
  h[k.to_sym] = v
59
59
  }
60
60
 
61
- if attributes.key?(:shop_url)
62
- self.shop_url = attributes[:shop_url]
61
+ if attributes.key?(:requests)
62
+ if (value = attributes[:requests]).is_a?(Array)
63
+ self.requests = value
64
+ end
63
65
  else
64
- self.shop_url = nil
66
+ self.requests = nil
65
67
  end
66
68
  end
67
69
 
@@ -70,7 +72,7 @@ module Algolia
70
72
  def ==(other)
71
73
  return true if self.equal?(other)
72
74
  self.class == other.class &&
73
- shop_url == other.shop_url
75
+ requests == other.requests
74
76
  end
75
77
 
76
78
  # @see the `==` method
@@ -82,7 +84,7 @@ module Algolia
82
84
  # Calculates hash code according to all attributes.
83
85
  # @return [Integer] Hash code
84
86
  def hash
85
- [shop_url].hash
87
+ [requests].hash
86
88
  end
87
89
 
88
90
  # Builds the object from hash
@@ -5,6 +5,7 @@ require "time"
5
5
 
6
6
  module Algolia
7
7
  module Ingestion
8
+ # The selected streams of a singer or airbyte connector.
8
9
  class DockerStreamsInput
9
10
  attr_accessor :streams
10
11
 
@@ -4,14 +4,18 @@ require "date"
4
4
  require "time"
5
5
 
6
6
  module Algolia
7
- module Recommend
8
- class RecommendationsHits
9
- attr_accessor :hits
7
+ module Ingestion
8
+ # Configured tasks and pagination information.
9
+ class ListTasksResponseV1
10
+ attr_accessor :tasks
11
+
12
+ attr_accessor :pagination
10
13
 
11
14
  # Attribute mapping from ruby-style variable name to JSON key.
12
15
  def self.attribute_map
13
16
  {
14
- :hits => :hits
17
+ :tasks => :tasks,
18
+ :pagination => :pagination
15
19
  }
16
20
  end
17
21
 
@@ -23,7 +27,8 @@ module Algolia
23
27
  # Attribute type mapping.
24
28
  def self.types_mapping
25
29
  {
26
- :hits => :"Array<RecommendationsHit>"
30
+ :tasks => :"Array<TaskV1>",
31
+ :pagination => :"Pagination"
27
32
  }
28
33
  end
29
34
 
@@ -40,7 +45,7 @@ module Algolia
40
45
  if (!attributes.is_a?(Hash))
41
46
  raise(
42
47
  ArgumentError,
43
- "The input argument (attributes) must be a hash in `Algolia::RecommendationsHits` initialize method"
48
+ "The input argument (attributes) must be a hash in `Algolia::ListTasksResponseV1` initialize method"
44
49
  )
45
50
  end
46
51
 
@@ -49,7 +54,7 @@ module Algolia
49
54
  if (!self.class.attribute_map.key?(k.to_sym))
50
55
  raise(
51
56
  ArgumentError,
52
- "`#{k}` is not a valid attribute in `Algolia::RecommendationsHits`. Please check the name to make sure it's valid. List of attributes: " +
57
+ "`#{k}` is not a valid attribute in `Algolia::ListTasksResponseV1`. Please check the name to make sure it's valid. List of attributes: " +
53
58
  self.class.attribute_map.keys.inspect
54
59
  )
55
60
  end
@@ -57,12 +62,18 @@ module Algolia
57
62
  h[k.to_sym] = v
58
63
  }
59
64
 
60
- if attributes.key?(:hits)
61
- if (value = attributes[:hits]).is_a?(Array)
62
- self.hits = value
65
+ if attributes.key?(:tasks)
66
+ if (value = attributes[:tasks]).is_a?(Array)
67
+ self.tasks = value
63
68
  end
64
69
  else
65
- self.hits = nil
70
+ self.tasks = nil
71
+ end
72
+
73
+ if attributes.key?(:pagination)
74
+ self.pagination = attributes[:pagination]
75
+ else
76
+ self.pagination = nil
66
77
  end
67
78
  end
68
79
 
@@ -71,7 +82,8 @@ module Algolia
71
82
  def ==(other)
72
83
  return true if self.equal?(other)
73
84
  self.class == other.class &&
74
- hits == other.hits
85
+ tasks == other.tasks &&
86
+ pagination == other.pagination
75
87
  end
76
88
 
77
89
  # @see the `==` method
@@ -83,7 +95,7 @@ module Algolia
83
95
  # Calculates hash code according to all attributes.
84
96
  # @return [Integer] Hash code
85
97
  def hash
86
- [hits].hash
98
+ [tasks, pagination].hash
87
99
  end
88
100
 
89
101
  # Builds the object from hash
@@ -152,7 +164,7 @@ module Algolia
152
164
  # model
153
165
  else
154
166
  # models (e.g. Pet) or oneOf
155
- klass = Algolia::Recommend.const_get(type)
167
+ klass = Algolia::Ingestion.const_get(type)
156
168
  klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
157
169
  .build_from_hash(value)
158
170
  end