algolia 3.0.0.alpha.15 → 3.0.0.alpha.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +10 -167
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/analytics_client.rb +76 -76
- data/lib/algolia/api/ingestion_client.rb +267 -196
- data/lib/algolia/api/monitoring_client.rb +49 -49
- data/lib/algolia/api/query_suggestions_client.rb +14 -14
- data/lib/algolia/api/recommend_client.rb +22 -22
- data/lib/algolia/api/search_client.rb +8 -8
- data/lib/algolia/api/usage_client.rb +329 -0
- data/lib/algolia/models/analytics/get_status_response.rb +1 -1
- data/lib/algolia/models/ingestion/auth_algolia.rb +3 -2
- data/lib/algolia/models/ingestion/auth_algolia_insights.rb +212 -0
- data/lib/algolia/models/{recommend/consequence_query_object.rb → ingestion/auth_algolia_insights_partial.rb} +21 -24
- data/lib/algolia/models/ingestion/auth_algolia_partial.rb +3 -2
- data/lib/algolia/models/ingestion/auth_api_key.rb +2 -1
- data/lib/algolia/models/ingestion/auth_api_key_partial.rb +2 -1
- data/lib/algolia/models/ingestion/auth_basic.rb +3 -1
- data/lib/algolia/models/ingestion/auth_basic_partial.rb +3 -1
- data/lib/algolia/models/ingestion/auth_google_service_account.rb +3 -3
- data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +3 -3
- data/lib/algolia/models/ingestion/auth_input.rb +1 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
- data/lib/algolia/models/ingestion/auth_o_auth.rb +18 -8
- data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +18 -8
- data/lib/algolia/models/ingestion/authentication.rb +5 -5
- data/lib/algolia/models/ingestion/authentication_create.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_create_response.rb +4 -4
- data/lib/algolia/models/ingestion/authentication_search.rb +1 -1
- data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
- data/lib/algolia/models/ingestion/authentication_update.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_update_response.rb +4 -4
- data/lib/algolia/models/ingestion/big_commerce_channel.rb +2 -2
- data/lib/algolia/models/ingestion/big_commerce_metafield.rb +2 -2
- data/lib/algolia/models/ingestion/commercetools_custom_fields.rb +1 -1
- data/lib/algolia/models/ingestion/delete_response.rb +1 -1
- data/lib/algolia/models/ingestion/destination.rb +6 -6
- data/lib/algolia/models/ingestion/destination_create.rb +3 -3
- data/lib/algolia/models/ingestion/destination_create_response.rb +4 -4
- data/lib/algolia/models/ingestion/destination_index_name.rb +2 -2
- data/lib/algolia/models/ingestion/destination_index_prefix.rb +1 -1
- data/lib/algolia/models/ingestion/destination_search.rb +1 -1
- data/lib/algolia/models/ingestion/destination_type.rb +1 -2
- data/lib/algolia/models/ingestion/destination_update.rb +3 -3
- data/lib/algolia/models/ingestion/destination_update_response.rb +4 -4
- data/lib/algolia/models/ingestion/docker_source_discover.rb +2 -2
- data/lib/algolia/models/ingestion/event.rb +3 -3
- data/lib/algolia/models/ingestion/list_tasks_response.rb +1 -1
- data/lib/algolia/models/ingestion/mapping_format_schema.rb +32 -0
- data/lib/algolia/models/ingestion/mapping_input.rb +24 -3
- data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +3 -3
- data/lib/algolia/models/ingestion/on_demand_trigger.rb +2 -2
- data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +1 -1
- data/lib/algolia/models/ingestion/pagination.rb +65 -0
- data/lib/algolia/models/ingestion/platform.rb +2 -1
- data/lib/algolia/models/ingestion/run.rb +7 -7
- data/lib/algolia/models/ingestion/run_response.rb +3 -3
- data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +2 -2
- data/lib/algolia/models/ingestion/schedule_trigger.rb +4 -4
- data/lib/algolia/models/ingestion/schedule_trigger_input.rb +2 -2
- data/lib/algolia/models/ingestion/source.rb +4 -4
- data/lib/algolia/models/ingestion/source_big_commerce.rb +1 -1
- data/lib/algolia/models/ingestion/source_big_query.rb +5 -5
- data/lib/algolia/models/ingestion/source_commercetools.rb +2 -2
- data/lib/algolia/models/ingestion/source_create.rb +2 -1
- data/lib/algolia/models/ingestion/source_create_response.rb +3 -2
- data/lib/algolia/models/ingestion/source_csv.rb +3 -3
- data/lib/algolia/models/ingestion/source_docker.rb +3 -3
- data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +3 -3
- data/lib/algolia/models/ingestion/source_json.rb +2 -2
- data/lib/algolia/models/ingestion/source_type.rb +5 -3
- data/lib/algolia/models/ingestion/source_update.rb +2 -1
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +2 -3
- data/lib/algolia/models/ingestion/source_update_docker.rb +3 -3
- data/lib/algolia/models/ingestion/source_update_response.rb +3 -2
- data/lib/algolia/models/ingestion/streaming_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/streaming_utils_input.rb +1 -1
- data/lib/algolia/models/ingestion/subscription_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/task.rb +7 -7
- data/lib/algolia/models/ingestion/task_create.rb +5 -5
- data/lib/algolia/models/ingestion/task_create_response.rb +3 -3
- data/lib/algolia/models/ingestion/task_input.rb +1 -0
- data/lib/algolia/models/ingestion/task_update.rb +4 -4
- data/lib/algolia/models/ingestion/task_update_response.rb +3 -3
- data/lib/algolia/models/ingestion/trigger.rb +1 -0
- data/lib/algolia/models/ingestion/trigger_update_input.rb +2 -2
- data/lib/algolia/models/ingestion/window.rb +3 -3
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +1 -1
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/clicked_filters.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/converted_filters.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +3 -1
- data/lib/algolia/models/insights/viewed_filters.rb +1 -1
- data/lib/algolia/models/insights/viewed_object_ids.rb +1 -1
- data/lib/algolia/models/monitoring/{get_inventory403_response.rb → get_servers403_response.rb} +3 -3
- data/lib/algolia/models/monitoring/incidents_inner.rb +1 -1
- data/lib/algolia/models/monitoring/probes_metric.rb +1 -1
- data/lib/algolia/models/monitoring/server.rb +2 -2
- data/lib/algolia/models/monitoring/time_inner.rb +1 -1
- data/lib/algolia/models/query-suggestions/app_id.rb +197 -0
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +4 -4
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +2 -2
- data/lib/algolia/models/query-suggestions/languages.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +2 -3
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +23 -34
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +18 -20
- data/lib/algolia/models/query-suggestions/source_index.rb +3 -5
- data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +36 -7
- data/lib/algolia/models/recommend/base_search_params.rb +1 -1
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +1 -1
- data/lib/algolia/models/recommend/bought_together_query.rb +319 -0
- data/lib/algolia/models/recommend/condition.rb +12 -62
- data/lib/algolia/models/recommend/consequence.rb +32 -54
- data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
- data/lib/algolia/models/recommend/{recommended_for_you_query_parameters.rb → fallback_params.rb} +9 -12
- data/lib/algolia/models/recommend/{edit_type.rb → fbt_model.rb} +5 -6
- data/lib/algolia/models/recommend/{base_trending_facets_query.rb → frequently_bought_together.rb} +20 -18
- data/lib/algolia/models/recommend/get_recommendations_params.rb +2 -2
- data/lib/algolia/models/recommend/{consequence_hide.rb → hide_consequence_object.rb} +4 -6
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +5 -5
- data/lib/algolia/models/recommend/{base_recommendations_query.rb → looking_similar.rb} +6 -15
- data/lib/algolia/models/recommend/{anchoring.rb → looking_similar_model.rb} +5 -8
- data/lib/algolia/models/recommend/looking_similar_query.rb +328 -0
- data/lib/algolia/models/recommend/{params.rb → params_consequence.rb} +26 -28
- data/lib/algolia/models/recommend/{promote_object_id.rb → promote_consequence_object.rb} +19 -9
- data/lib/algolia/models/recommend/{rule_response.rb → recommend_rule.rb} +13 -18
- data/lib/algolia/models/recommend/{rule_response_metadata.rb → recommend_rule_metadata.rb} +5 -4
- data/lib/algolia/models/recommend/recommendations_hits.rb +4 -24
- data/lib/algolia/models/recommend/recommendations_request.rb +3 -1
- data/lib/algolia/models/recommend/recommendations_results.rb +4 -24
- data/lib/algolia/models/recommend/{base_recommended_for_you_query.rb → recommended_for_you.rb} +5 -14
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +35 -15
- data/lib/algolia/models/recommend/{recommendation_models.rb → related_model.rb} +4 -5
- data/lib/algolia/models/recommend/{edit.rb → related_products.rb} +27 -24
- data/lib/algolia/models/recommend/{recommendations_query.rb → related_query.rb} +39 -19
- data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +25 -44
- data/lib/algolia/models/recommend/search_params_object.rb +6 -6
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +58 -10
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +2 -2
- data/lib/algolia/models/recommend/trending_facet_hit.rb +2 -2
- data/lib/algolia/models/recommend/trending_facets.rb +243 -0
- data/lib/algolia/models/recommend/trending_facets_query.rb +50 -10
- data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
- data/lib/algolia/models/recommend/trending_items_query.rb +42 -16
- data/lib/algolia/models/search/add_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_index_settings.rb +4 -4
- data/lib/algolia/models/search/base_search_params.rb +1 -1
- data/lib/algolia/models/search/base_search_params_without_query.rb +1 -1
- data/lib/algolia/models/search/browse_params_object.rb +6 -6
- data/lib/algolia/models/search/consequence_params.rb +6 -6
- data/lib/algolia/models/search/created_at_response.rb +1 -1
- data/lib/algolia/models/search/delete_api_key_response.rb +1 -1
- data/lib/algolia/models/search/delete_by_params.rb +1 -1
- data/lib/algolia/models/search/delete_source_response.rb +1 -1
- data/lib/algolia/models/search/deleted_at_response.rb +1 -1
- data/lib/algolia/models/search/fetched_index.rb +1 -1
- data/lib/algolia/models/search/get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/index_settings.rb +9 -9
- data/lib/algolia/models/search/index_settings_as_search_params.rb +5 -5
- data/lib/algolia/models/search/log.rb +1 -1
- data/lib/algolia/models/search/remove_user_id_response.rb +1 -1
- data/lib/algolia/models/search/replace_source_response.rb +1 -1
- data/lib/algolia/models/search/save_object_response.rb +1 -1
- data/lib/algolia/models/search/save_synonym_response.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +6 -6
- data/lib/algolia/models/search/search_for_hits.rb +6 -6
- data/lib/algolia/models/search/search_params_object.rb +6 -6
- data/lib/algolia/models/search/search_user_ids_response.rb +1 -1
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
- data/lib/algolia/models/search/update_api_key_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +1 -1
- data/lib/algolia/models/search/updated_rule_response.rb +1 -1
- data/lib/algolia/models/search/user_hit.rb +1 -1
- data/lib/algolia/models/search/user_id.rb +1 -1
- data/lib/algolia/models/usage/error_base.rb +205 -0
- data/lib/algolia/models/usage/get_usage200_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage200_response_statistics_inner.rb +206 -0
- data/lib/algolia/models/{recommend/base_recommended_for_you_query_parameters.rb → usage/get_usage400_response.rb} +13 -14
- data/lib/algolia/models/usage/get_usage400_response_error.rb +216 -0
- data/lib/algolia/models/usage/get_usage400_response_error_errors_inner.rb +225 -0
- data/lib/algolia/models/usage/granularity.rb +33 -0
- data/lib/algolia/models/usage/statistic.rb +116 -0
- data/lib/algolia/models/{recommend/promote.rb → usage/statistic_value.rb} +5 -5
- data/lib/algolia/version.rb +1 -1
- metadata +37 -26
- data/lib/algolia/models/recommend/automatic_facet_filter.rb +0 -220
- data/lib/algolia/models/recommend/automatic_facet_filters.rb +0 -97
- data/lib/algolia/models/recommend/consequence_query.rb +0 -97
- data/lib/algolia/models/recommend/promote_object_ids.rb +0 -228
@@ -0,0 +1,212 @@
|
|
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
|
+
# Credentials for authenticating with the Algolia Insights API.
|
9
|
+
class AuthAlgoliaInsights
|
10
|
+
# Algolia application ID.
|
11
|
+
attr_accessor :app_id
|
12
|
+
|
13
|
+
# Algolia API key with the ACL: `search`. This field is `null` in the API response.
|
14
|
+
attr_accessor :api_key
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:app_id => :appID,
|
20
|
+
:api_key => :apiKey
|
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
|
+
:app_id => :String,
|
33
|
+
:api_key => :String
|
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::AuthAlgoliaInsights` 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::AuthAlgoliaInsights`. 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?(:app_id)
|
60
|
+
self.app_id = attributes[:app_id]
|
61
|
+
else
|
62
|
+
self.app_id = nil
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.key?(:api_key)
|
66
|
+
self.api_key = attributes[:api_key]
|
67
|
+
else
|
68
|
+
self.api_key = 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 equal?(other)
|
76
|
+
|
77
|
+
self.class == other.class &&
|
78
|
+
app_id == other.app_id &&
|
79
|
+
api_key == other.api_key
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(other)
|
85
|
+
self == other
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Integer] Hash code
|
90
|
+
def hash
|
91
|
+
[app_id, api_key].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def self.build_from_hash(attributes)
|
98
|
+
return nil unless attributes.is_a?(Hash)
|
99
|
+
|
100
|
+
attributes = attributes.transform_keys(&:to_sym)
|
101
|
+
transformed_hash = {}
|
102
|
+
types_mapping.each_pair do |key, type|
|
103
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
104
|
+
transformed_hash[key.to_sym] = nil
|
105
|
+
elsif type =~ /\AArray<(.*)>/i
|
106
|
+
# check to ensure the input is an array given that the attribute
|
107
|
+
# is documented as an array but the input is not
|
108
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
109
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
110
|
+
end
|
111
|
+
elsif !attributes[attribute_map[key]].nil?
|
112
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
113
|
+
end
|
114
|
+
end
|
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
|
+
when :Object
|
141
|
+
# generic object (usually a Hash), return directly
|
142
|
+
value
|
143
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
144
|
+
inner_type = Regexp.last_match[:inner_type]
|
145
|
+
value.map { |v| _deserialize(inner_type, v) }
|
146
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
147
|
+
k_type = Regexp.last_match[:k_type]
|
148
|
+
v_type = Regexp.last_match[:v_type]
|
149
|
+
{}.tap do |hash|
|
150
|
+
value.each do |k, v|
|
151
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
else # model
|
155
|
+
# models (e.g. Pet) or oneOf
|
156
|
+
klass = Algolia::Ingestion.const_get(type)
|
157
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Returns the string representation of the object
|
162
|
+
# @return [String] String presentation of the object
|
163
|
+
def to_s
|
164
|
+
to_hash.to_s
|
165
|
+
end
|
166
|
+
|
167
|
+
# to_body is an alias to to_hash (backward compatibility)
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_body
|
170
|
+
to_hash
|
171
|
+
end
|
172
|
+
|
173
|
+
def to_json(*_args)
|
174
|
+
to_hash.to_json
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the object in the form of hash
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_hash
|
180
|
+
hash = {}
|
181
|
+
self.class.attribute_map.each_pair do |attr, param|
|
182
|
+
value = send(attr)
|
183
|
+
if value.nil?
|
184
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
185
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
186
|
+
end
|
187
|
+
|
188
|
+
hash[param] = _to_hash(value)
|
189
|
+
end
|
190
|
+
hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Outputs non-array value in the form of hash
|
194
|
+
# For object, use to_hash. Otherwise, just return the value
|
195
|
+
# @param [Object] value Any valid value
|
196
|
+
# @return [Hash] Returns the value in the form of hash
|
197
|
+
def _to_hash(value)
|
198
|
+
if value.is_a?(Array)
|
199
|
+
value.compact.map { |v| _to_hash(v) }
|
200
|
+
elsif value.is_a?(Hash)
|
201
|
+
{}.tap do |hash|
|
202
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
203
|
+
end
|
204
|
+
elsif value.respond_to? :to_hash
|
205
|
+
value.to_hash
|
206
|
+
else
|
207
|
+
value
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
@@ -4,19 +4,20 @@ require 'date'
|
|
4
4
|
require 'time'
|
5
5
|
|
6
6
|
module Algolia
|
7
|
-
module
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
module Ingestion
|
8
|
+
# Credentials for authenticating with the Algolia Insights API.
|
9
|
+
class AuthAlgoliaInsightsPartial
|
10
|
+
# Algolia application ID.
|
11
|
+
attr_accessor :app_id
|
11
12
|
|
12
|
-
#
|
13
|
-
attr_accessor :
|
13
|
+
# Algolia API key with the ACL: `search`. This field is `null` in the API response.
|
14
|
+
attr_accessor :api_key
|
14
15
|
|
15
16
|
# Attribute mapping from ruby-style variable name to JSON key.
|
16
17
|
def self.attribute_map
|
17
18
|
{
|
18
|
-
:
|
19
|
-
:
|
19
|
+
:app_id => :appID,
|
20
|
+
:api_key => :apiKey
|
20
21
|
}
|
21
22
|
end
|
22
23
|
|
@@ -28,8 +29,8 @@ module Algolia
|
|
28
29
|
# Attribute type mapping.
|
29
30
|
def self.types_mapping
|
30
31
|
{
|
31
|
-
:
|
32
|
-
:
|
32
|
+
:app_id => :String,
|
33
|
+
:api_key => :String
|
33
34
|
}
|
34
35
|
end
|
35
36
|
|
@@ -42,29 +43,25 @@ module Algolia
|
|
42
43
|
# @param [Hash] attributes Model attributes in the form of hash
|
43
44
|
def initialize(attributes = {})
|
44
45
|
unless attributes.is_a?(Hash)
|
45
|
-
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::
|
46
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::AuthAlgoliaInsightsPartial` initialize method"
|
46
47
|
end
|
47
48
|
|
48
49
|
# check to see if the attribute exists and convert string to symbol for hash key
|
49
50
|
attributes = attributes.each_with_object({}) do |(k, v), h|
|
50
51
|
unless self.class.attribute_map.key?(k.to_sym)
|
51
52
|
raise ArgumentError,
|
52
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
53
|
+
"`#{k}` is not a valid attribute in `Algolia::AuthAlgoliaInsightsPartial`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
53
54
|
end
|
54
55
|
|
55
56
|
h[k.to_sym] = v
|
56
57
|
end
|
57
58
|
|
58
|
-
if attributes.key?(:
|
59
|
-
|
60
|
-
self.remove = value
|
61
|
-
end
|
59
|
+
if attributes.key?(:app_id)
|
60
|
+
self.app_id = attributes[:app_id]
|
62
61
|
end
|
63
62
|
|
64
|
-
if attributes.key?(:
|
65
|
-
|
66
|
-
self.edits = value
|
67
|
-
end
|
63
|
+
if attributes.key?(:api_key)
|
64
|
+
self.api_key = attributes[:api_key]
|
68
65
|
end
|
69
66
|
end
|
70
67
|
|
@@ -74,8 +71,8 @@ module Algolia
|
|
74
71
|
return true if equal?(other)
|
75
72
|
|
76
73
|
self.class == other.class &&
|
77
|
-
|
78
|
-
|
74
|
+
app_id == other.app_id &&
|
75
|
+
api_key == other.api_key
|
79
76
|
end
|
80
77
|
|
81
78
|
# @see the `==` method
|
@@ -87,7 +84,7 @@ module Algolia
|
|
87
84
|
# Calculates hash code according to all attributes.
|
88
85
|
# @return [Integer] Hash code
|
89
86
|
def hash
|
90
|
-
[
|
87
|
+
[app_id, api_key].hash
|
91
88
|
end
|
92
89
|
|
93
90
|
# Builds the object from hash
|
@@ -152,7 +149,7 @@ module Algolia
|
|
152
149
|
end
|
153
150
|
else # model
|
154
151
|
# models (e.g. Pet) or oneOf
|
155
|
-
klass = Algolia::
|
152
|
+
klass = Algolia::Ingestion.const_get(type)
|
156
153
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
157
154
|
end
|
158
155
|
end
|
@@ -5,11 +5,12 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
+
# Credentials for authenticating with Algolia.
|
8
9
|
class AuthAlgoliaPartial
|
9
|
-
# Algolia
|
10
|
+
# Algolia application ID.
|
10
11
|
attr_accessor :app_id
|
11
12
|
|
12
|
-
# Algolia API
|
13
|
+
# Algolia API key with the ACL: `addObject`, `deleteObject`, `settings`, `editSettings`, `listIndexes`, `deleteIndex`. This field is `null` in the API response.
|
13
14
|
attr_accessor :api_key
|
14
15
|
|
15
16
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,8 +5,9 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Credentials for authenticating with an API key.
|
9
9
|
class AuthAPIKey
|
10
|
+
# API key. This field is `null` in the API response.
|
10
11
|
attr_accessor :key
|
11
12
|
|
12
13
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,8 +5,9 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Credentials for authenticating with an API key.
|
9
9
|
class AuthAPIKeyPartial
|
10
|
+
# API key. This field is `null` in the API response.
|
10
11
|
attr_accessor :key
|
11
12
|
|
12
13
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,10 +5,12 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Credentials for authenticating with user name and password.
|
9
9
|
class AuthBasic
|
10
|
+
# Username.
|
10
11
|
attr_accessor :username
|
11
12
|
|
13
|
+
# Password. This field is `null` in the API response.
|
12
14
|
attr_accessor :password
|
13
15
|
|
14
16
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,10 +5,12 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Credentials for authenticating with user name and password.
|
9
9
|
class AuthBasicPartial
|
10
|
+
# Username.
|
10
11
|
attr_accessor :username
|
11
12
|
|
13
|
+
# Password. This field is `null` in the API response.
|
12
14
|
attr_accessor :password
|
13
15
|
|
14
16
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,12 +5,12 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Credentials for authenticating with a Google service account, such as BigQuery.
|
9
9
|
class AuthGoogleServiceAccount
|
10
|
-
# Email address of the
|
10
|
+
# Email address of the Google service account.
|
11
11
|
attr_accessor :client_email
|
12
12
|
|
13
|
-
# Private key of the
|
13
|
+
# Private key of the Google service account. This field is `null` in the API response.
|
14
14
|
attr_accessor :private_key
|
15
15
|
|
16
16
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,12 +5,12 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Credentials for authenticating with a Google service account, such as BigQuery.
|
9
9
|
class AuthGoogleServiceAccountPartial
|
10
|
-
# Email address of the
|
10
|
+
# Email address of the Google service account.
|
11
11
|
attr_accessor :client_email
|
12
12
|
|
13
|
-
# Private key of the
|
13
|
+
# Private key of the Google service account. This field is `null` in the API response.
|
14
14
|
attr_accessor :private_key
|
15
15
|
|
16
16
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,23 +5,27 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Credentials for authenticating with OAuth 2.0.
|
9
9
|
class AuthOAuth
|
10
|
-
#
|
10
|
+
# URL for the OAuth endpoint.
|
11
11
|
attr_accessor :url
|
12
12
|
|
13
|
-
#
|
13
|
+
# Client ID.
|
14
14
|
attr_accessor :client_id
|
15
15
|
|
16
|
-
#
|
16
|
+
# Client secret. This field is `null` in the API response.
|
17
17
|
attr_accessor :client_secret
|
18
18
|
|
19
|
+
# OAuth scope.
|
20
|
+
attr_accessor :scope
|
21
|
+
|
19
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
23
|
def self.attribute_map
|
21
24
|
{
|
22
25
|
:url => :url,
|
23
26
|
:client_id => :client_id,
|
24
|
-
:client_secret => :client_secret
|
27
|
+
:client_secret => :client_secret,
|
28
|
+
:scope => :scope
|
25
29
|
}
|
26
30
|
end
|
27
31
|
|
@@ -35,7 +39,8 @@ module Algolia
|
|
35
39
|
{
|
36
40
|
:url => :String,
|
37
41
|
:client_id => :String,
|
38
|
-
:client_secret => :String
|
42
|
+
:client_secret => :String,
|
43
|
+
:scope => :String
|
39
44
|
}
|
40
45
|
end
|
41
46
|
|
@@ -78,6 +83,10 @@ module Algolia
|
|
78
83
|
else
|
79
84
|
self.client_secret = nil
|
80
85
|
end
|
86
|
+
|
87
|
+
if attributes.key?(:scope)
|
88
|
+
self.scope = attributes[:scope]
|
89
|
+
end
|
81
90
|
end
|
82
91
|
|
83
92
|
# Checks equality by comparing each attribute.
|
@@ -88,7 +97,8 @@ module Algolia
|
|
88
97
|
self.class == other.class &&
|
89
98
|
url == other.url &&
|
90
99
|
client_id == other.client_id &&
|
91
|
-
client_secret == other.client_secret
|
100
|
+
client_secret == other.client_secret &&
|
101
|
+
scope == other.scope
|
92
102
|
end
|
93
103
|
|
94
104
|
# @see the `==` method
|
@@ -100,7 +110,7 @@ module Algolia
|
|
100
110
|
# Calculates hash code according to all attributes.
|
101
111
|
# @return [Integer] Hash code
|
102
112
|
def hash
|
103
|
-
[url, client_id, client_secret].hash
|
113
|
+
[url, client_id, client_secret, scope].hash
|
104
114
|
end
|
105
115
|
|
106
116
|
# Builds the object from hash
|
@@ -5,23 +5,27 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Credentials for authenticating with OAuth 2.0.
|
9
9
|
class AuthOAuthPartial
|
10
|
-
#
|
10
|
+
# URL for the OAuth endpoint.
|
11
11
|
attr_accessor :url
|
12
12
|
|
13
|
-
#
|
13
|
+
# Client ID.
|
14
14
|
attr_accessor :client_id
|
15
15
|
|
16
|
-
#
|
16
|
+
# Client secret. This field is `null` in the API response.
|
17
17
|
attr_accessor :client_secret
|
18
18
|
|
19
|
+
# OAuth scope.
|
20
|
+
attr_accessor :scope
|
21
|
+
|
19
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
23
|
def self.attribute_map
|
21
24
|
{
|
22
25
|
:url => :url,
|
23
26
|
:client_id => :client_id,
|
24
|
-
:client_secret => :client_secret
|
27
|
+
:client_secret => :client_secret,
|
28
|
+
:scope => :scope
|
25
29
|
}
|
26
30
|
end
|
27
31
|
|
@@ -35,7 +39,8 @@ module Algolia
|
|
35
39
|
{
|
36
40
|
:url => :String,
|
37
41
|
:client_id => :String,
|
38
|
-
:client_secret => :String
|
42
|
+
:client_secret => :String,
|
43
|
+
:scope => :String
|
39
44
|
}
|
40
45
|
end
|
41
46
|
|
@@ -72,6 +77,10 @@ module Algolia
|
|
72
77
|
if attributes.key?(:client_secret)
|
73
78
|
self.client_secret = attributes[:client_secret]
|
74
79
|
end
|
80
|
+
|
81
|
+
if attributes.key?(:scope)
|
82
|
+
self.scope = attributes[:scope]
|
83
|
+
end
|
75
84
|
end
|
76
85
|
|
77
86
|
# Checks equality by comparing each attribute.
|
@@ -82,7 +91,8 @@ module Algolia
|
|
82
91
|
self.class == other.class &&
|
83
92
|
url == other.url &&
|
84
93
|
client_id == other.client_id &&
|
85
|
-
client_secret == other.client_secret
|
94
|
+
client_secret == other.client_secret &&
|
95
|
+
scope == other.scope
|
86
96
|
end
|
87
97
|
|
88
98
|
# @see the `==` method
|
@@ -94,7 +104,7 @@ module Algolia
|
|
94
104
|
# Calculates hash code according to all attributes.
|
95
105
|
# @return [Integer] Hash code
|
96
106
|
def hash
|
97
|
-
[url, client_id, client_secret].hash
|
107
|
+
[url, client_id, client_secret, scope].hash
|
98
108
|
end
|
99
109
|
|
100
110
|
# Builds the object from hash
|
@@ -5,24 +5,24 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Resource representing the information required to authenticate with a source or a destination.
|
9
9
|
class Authentication
|
10
|
-
#
|
10
|
+
# Universally unique identifier (UUID) of an authentication resource.
|
11
11
|
attr_accessor :authentication_id
|
12
12
|
|
13
13
|
attr_accessor :type
|
14
14
|
|
15
|
-
#
|
15
|
+
# Descriptive name for the resource.
|
16
16
|
attr_accessor :name
|
17
17
|
|
18
18
|
attr_accessor :platform
|
19
19
|
|
20
20
|
attr_accessor :input
|
21
21
|
|
22
|
-
# Date of creation
|
22
|
+
# Date of creation in RFC3339 format.
|
23
23
|
attr_accessor :created_at
|
24
24
|
|
25
|
-
# Date of last update
|
25
|
+
# Date of last update in RFC3339 format.
|
26
26
|
attr_accessor :updated_at
|
27
27
|
|
28
28
|
class EnumAttributeValidator
|
@@ -5,11 +5,11 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Request body for creating a new authentication resource.
|
9
9
|
class AuthenticationCreate
|
10
10
|
attr_accessor :type
|
11
11
|
|
12
|
-
#
|
12
|
+
# Descriptive name for the resource.
|
13
13
|
attr_accessor :name
|
14
14
|
|
15
15
|
attr_accessor :platform
|
@@ -5,15 +5,15 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# API response for the successful creation of an authentication resource.
|
9
9
|
class AuthenticationCreateResponse
|
10
|
-
#
|
10
|
+
# Universally unique identifier (UUID) of an authentication resource.
|
11
11
|
attr_accessor :authentication_id
|
12
12
|
|
13
|
-
#
|
13
|
+
# Descriptive name for the resource.
|
14
14
|
attr_accessor :name
|
15
15
|
|
16
|
-
# Date of creation
|
16
|
+
# Date of creation in RFC3339 format.
|
17
17
|
attr_accessor :created_at
|
18
18
|
|
19
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -5,7 +5,7 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Ingestion
|
8
|
-
#
|
8
|
+
# Request body for searching for authentication resources.
|
9
9
|
class AuthenticationSearch
|
10
10
|
attr_accessor :authentication_ids
|
11
11
|
|
@@ -11,9 +11,10 @@ module Algolia
|
|
11
11
|
API_KEY = "apiKey".freeze
|
12
12
|
OAUTH = "oauth".freeze
|
13
13
|
ALGOLIA = "algolia".freeze
|
14
|
+
ALGOLIA_INSIGHTS = "algoliaInsights".freeze
|
14
15
|
|
15
16
|
def self.all_vars
|
16
|
-
@all_vars ||= [GOOGLE_SERVICE_ACCOUNT, BASIC, API_KEY, OAUTH, ALGOLIA].freeze
|
17
|
+
@all_vars ||= [GOOGLE_SERVICE_ACCOUNT, BASIC, API_KEY, OAUTH, ALGOLIA, ALGOLIA_INSIGHTS].freeze
|
17
18
|
end
|
18
19
|
|
19
20
|
# Builds the enum from string
|