algolia 3.40.0 → 3.41.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.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/Bug_report.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +4 -4
- data/lib/algolia/api/agent_studio_client.rb +2364 -0
- data/lib/algolia/models/agent-studio/advanced_syntax_features.rb +34 -0
- data/lib/algolia/models/agent-studio/agent_completion_algolia_params.rb +221 -0
- data/lib/algolia/models/agent-studio/agent_completion_request.rb +247 -0
- data/lib/algolia/models/agent-studio/agent_config_create.rb +288 -0
- data/lib/algolia/models/agent-studio/agent_config_update.rb +294 -0
- data/lib/algolia/models/agent-studio/agent_status.rb +34 -0
- data/lib/algolia/models/agent-studio/agent_test_configuration.rb +271 -0
- data/lib/algolia/models/agent-studio/agent_with_version_response.rb +370 -0
- data/lib/algolia/models/agent-studio/algolia_display_results_tool_config.rb +254 -0
- data/lib/algolia/models/agent-studio/algolia_recommend_tool_config_input.rb +242 -0
- data/lib/algolia/models/agent-studio/algolia_recommend_tool_index_config.rb +228 -0
- data/lib/algolia/models/agent-studio/algolia_search_tool_config.rb +232 -0
- data/lib/algolia/models/agent-studio/algolia_search_tool_index_config.rb +249 -0
- data/lib/algolia/models/agent-studio/allowed_domain_bulk_delete.rb +212 -0
- data/lib/algolia/models/agent-studio/allowed_domain_bulk_insert.rb +212 -0
- data/lib/algolia/models/agent-studio/allowed_domain_create.rb +210 -0
- data/lib/algolia/models/agent-studio/allowed_domain_list_response.rb +211 -0
- data/lib/algolia/models/agent-studio/allowed_domain_response.rb +264 -0
- data/lib/algolia/models/agent-studio/alternatives_as_exact.rb +36 -0
- data/lib/algolia/models/agent-studio/anthropic_provider_input.rb +220 -0
- data/lib/algolia/models/agent-studio/application_config_patch.rb +209 -0
- data/lib/algolia/models/agent-studio/application_config_response.rb +208 -0
- data/lib/algolia/models/agent-studio/around_precision_union.rb +108 -0
- data/lib/algolia/models/agent-studio/around_radius_union.rb +108 -0
- data/lib/algolia/models/agent-studio/assistant_message_v4.rb +252 -0
- data/lib/algolia/models/agent-studio/assistant_message_v5.rb +228 -0
- data/lib/algolia/models/agent-studio/assistant_part_v4.rb +110 -0
- data/lib/algolia/models/agent-studio/assistant_part_v5.rb +110 -0
- data/lib/algolia/models/agent-studio/azure_open_ai_provider_input.rb +243 -0
- data/lib/algolia/models/agent-studio/base_provider_input.rb +209 -0
- data/lib/algolia/models/agent-studio/client_side_tool_config.rb +241 -0
- data/lib/algolia/models/agent-studio/client_tools_args_schema.rb +228 -0
- data/lib/algolia/models/agent-studio/compatibility_mode.rb +34 -0
- data/lib/algolia/models/agent-studio/conversation_base_response.rb +355 -0
- data/lib/algolia/models/agent-studio/conversation_full_response.rb +369 -0
- data/lib/algolia/models/agent-studio/conversation_metadata.rb +209 -0
- data/lib/algolia/models/agent-studio/distinct_union.rb +108 -0
- data/lib/algolia/models/agent-studio/episode.rb +243 -0
- data/lib/algolia/models/agent-studio/error_base.rb +207 -0
- data/lib/algolia/models/agent-studio/exact_on_single_word_query.rb +35 -0
- data/lib/algolia/models/agent-studio/facet_filters_union.rb +108 -0
- data/lib/algolia/models/agent-studio/facets.rb +208 -0
- data/lib/algolia/models/agent-studio/facets_param.rb +220 -0
- data/lib/algolia/models/agent-studio/facets_union.rb +108 -0
- data/lib/algolia/models/agent-studio/feedback_creation_request.rb +251 -0
- data/lib/algolia/models/agent-studio/feedback_response.rb +297 -0
- data/lib/algolia/models/agent-studio/ignore_plurals_union.rb +108 -0
- data/lib/algolia/models/agent-studio/index_search_parameters.rb +267 -0
- data/lib/algolia/models/agent-studio/inside_bounding_box_union.rb +108 -0
- data/lib/algolia/models/agent-studio/inside_polygon_union.rb +108 -0
- data/lib/algolia/models/agent-studio/location_item_union.rb +108 -0
- data/lib/algolia/models/agent-studio/mcp_server_tool_config.rb +276 -0
- data/lib/algolia/models/agent-studio/mcp_tool_config.rb +218 -0
- data/lib/algolia/models/agent-studio/memory_record.rb +368 -0
- data/lib/algolia/models/agent-studio/memory_type.rb +34 -0
- data/lib/algolia/models/agent-studio/message_part.rb +132 -0
- data/lib/algolia/models/agent-studio/message_response.rb +309 -0
- data/lib/algolia/models/agent-studio/message_role.rb +34 -0
- data/lib/algolia/models/agent-studio/message_v4.rb +117 -0
- data/lib/algolia/models/agent-studio/message_v5.rb +117 -0
- data/lib/algolia/models/agent-studio/messages_union.rb +108 -0
- data/lib/algolia/models/agent-studio/number_param.rb +230 -0
- data/lib/algolia/models/agent-studio/number_param_constraint.rb +219 -0
- data/lib/algolia/models/agent-studio/numeric_filters_union.rb +108 -0
- data/lib/algolia/models/agent-studio/open_ai_compatible_provider_input.rb +232 -0
- data/lib/algolia/models/agent-studio/open_ai_provider_input.rb +220 -0
- data/lib/algolia/models/agent-studio/optional_filters_union.rb +108 -0
- data/lib/algolia/models/agent-studio/optional_words_union.rb +108 -0
- data/lib/algolia/models/agent-studio/paginated_agents_response.rb +221 -0
- data/lib/algolia/models/agent-studio/paginated_conversations_response.rb +221 -0
- data/lib/algolia/models/agent-studio/paginated_provider_authentications_response.rb +221 -0
- data/lib/algolia/models/agent-studio/paginated_secret_keys_response.rb +221 -0
- data/lib/algolia/models/agent-studio/pagination_metadata.rb +241 -0
- data/lib/algolia/models/agent-studio/provider_authentication_create.rb +230 -0
- data/lib/algolia/models/agent-studio/provider_authentication_patch.rb +218 -0
- data/lib/algolia/models/agent-studio/provider_authentication_response.rb +274 -0
- data/lib/algolia/models/agent-studio/provider_input.rb +111 -0
- data/lib/algolia/models/agent-studio/provider_input_nullable.rb +111 -0
- data/lib/algolia/models/agent-studio/provider_name.rb +38 -0
- data/lib/algolia/models/agent-studio/query_type.rb +35 -0
- data/lib/algolia/models/agent-studio/re_ranking_apply_filter_union.rb +108 -0
- data/lib/algolia/models/agent-studio/reasoning_part.rb +219 -0
- data/lib/algolia/models/agent-studio/reasoning_part_v4.rb +217 -0
- data/lib/algolia/models/agent-studio/reasoning_part_v5.rb +217 -0
- data/lib/algolia/models/agent-studio/remove_stop_words_union.rb +108 -0
- data/lib/algolia/models/agent-studio/remove_words_if_no_results.rb +36 -0
- data/lib/algolia/models/agent-studio/search_parameters.rb +950 -0
- data/lib/algolia/models/agent-studio/search_parameters_overrides.rb +286 -0
- data/lib/algolia/models/agent-studio/secret_key_create.rb +222 -0
- data/lib/algolia/models/agent-studio/secret_key_patch.rb +223 -0
- data/lib/algolia/models/agent-studio/secret_key_response.rb +287 -0
- data/lib/algolia/models/agent-studio/start_part.rb +208 -0
- data/lib/algolia/models/agent-studio/start_step_part.rb +208 -0
- data/lib/algolia/models/agent-studio/step_start_part_v4.rb +206 -0
- data/lib/algolia/models/agent-studio/step_start_part_v5.rb +206 -0
- data/lib/algolia/models/agent-studio/string_array_param.rb +242 -0
- data/lib/algolia/models/agent-studio/string_array_param_constraint.rb +211 -0
- data/lib/algolia/models/agent-studio/supported_language.rb +169 -0
- data/lib/algolia/models/agent-studio/tag_filters_union.rb +108 -0
- data/lib/algolia/models/agent-studio/text_param.rb +220 -0
- data/lib/algolia/models/agent-studio/text_part.rb +216 -0
- data/lib/algolia/models/agent-studio/text_part_v4.rb +217 -0
- data/lib/algolia/models/agent-studio/text_part_v5.rb +217 -0
- data/lib/algolia/models/agent-studio/tool_approval_request_part.rb +285 -0
- data/lib/algolia/models/agent-studio/tool_call_part.rb +265 -0
- data/lib/algolia/models/agent-studio/tool_config.rb +108 -0
- data/lib/algolia/models/agent-studio/tool_config_input.rb +129 -0
- data/lib/algolia/models/agent-studio/tool_invocation_part_v4.rb +217 -0
- data/lib/algolia/models/agent-studio/tool_invocation_v4.rb +309 -0
- data/lib/algolia/models/agent-studio/tool_part_v5.rb +309 -0
- data/lib/algolia/models/agent-studio/tool_result_output.rb +221 -0
- data/lib/algolia/models/agent-studio/tool_result_output_type.rb +37 -0
- data/lib/algolia/models/agent-studio/tool_result_part.rb +254 -0
- data/lib/algolia/models/agent-studio/tool_state.rb +36 -0
- data/lib/algolia/models/agent-studio/typo_tolerance_enum.rb +36 -0
- data/lib/algolia/models/agent-studio/typo_tolerance_union.rb +108 -0
- data/lib/algolia/models/agent-studio/unknown_tool_config.rb +220 -0
- data/lib/algolia/models/agent-studio/user_data_response.rb +223 -0
- data/lib/algolia/models/agent-studio/user_message_metadata_v5.rb +209 -0
- data/lib/algolia/models/agent-studio/user_message_v4.rb +250 -0
- data/lib/algolia/models/agent-studio/user_message_v5.rb +237 -0
- data/lib/algolia/models/agent-studio/validation_error.rb +252 -0
- data/lib/algolia/models/agent-studio/vote_enum.rb +34 -0
- data/lib/algolia/version.rb +1 -1
- metadata +125 -1
|
@@ -0,0 +1,355 @@
|
|
|
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 AgentStudio
|
|
10
|
+
# Lightweight response model without its messages.
|
|
11
|
+
class ConversationBaseResponse
|
|
12
|
+
attr_accessor :id
|
|
13
|
+
|
|
14
|
+
attr_accessor :agent_id
|
|
15
|
+
|
|
16
|
+
attr_accessor :title
|
|
17
|
+
|
|
18
|
+
attr_accessor :created_at
|
|
19
|
+
|
|
20
|
+
attr_accessor :updated_at
|
|
21
|
+
|
|
22
|
+
attr_accessor :last_activity_at
|
|
23
|
+
|
|
24
|
+
attr_accessor :user_token
|
|
25
|
+
|
|
26
|
+
attr_accessor :is_from_dashboard
|
|
27
|
+
|
|
28
|
+
attr_accessor :message_count
|
|
29
|
+
|
|
30
|
+
attr_accessor :total_input_tokens
|
|
31
|
+
|
|
32
|
+
attr_accessor :total_output_tokens
|
|
33
|
+
|
|
34
|
+
attr_accessor :total_tokens
|
|
35
|
+
|
|
36
|
+
attr_accessor :conversation_metadata
|
|
37
|
+
|
|
38
|
+
attr_accessor :feedback
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:id => :id,
|
|
44
|
+
:agent_id => :agentId,
|
|
45
|
+
:title => :title,
|
|
46
|
+
:created_at => :createdAt,
|
|
47
|
+
:updated_at => :updatedAt,
|
|
48
|
+
:last_activity_at => :lastActivityAt,
|
|
49
|
+
:user_token => :userToken,
|
|
50
|
+
:is_from_dashboard => :isFromDashboard,
|
|
51
|
+
:message_count => :messageCount,
|
|
52
|
+
:total_input_tokens => :totalInputTokens,
|
|
53
|
+
:total_output_tokens => :totalOutputTokens,
|
|
54
|
+
:total_tokens => :totalTokens,
|
|
55
|
+
:conversation_metadata => :conversationMetadata,
|
|
56
|
+
:feedback => :feedback
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute type mapping.
|
|
61
|
+
def self.types_mapping
|
|
62
|
+
{
|
|
63
|
+
:id => :"String",
|
|
64
|
+
:agent_id => :"String",
|
|
65
|
+
:title => :"String",
|
|
66
|
+
:created_at => :"String",
|
|
67
|
+
:updated_at => :"String",
|
|
68
|
+
:last_activity_at => :"String",
|
|
69
|
+
:user_token => :"String",
|
|
70
|
+
:is_from_dashboard => :"Boolean",
|
|
71
|
+
:message_count => :"Integer",
|
|
72
|
+
:total_input_tokens => :"Integer",
|
|
73
|
+
:total_output_tokens => :"Integer",
|
|
74
|
+
:total_tokens => :"Integer",
|
|
75
|
+
:conversation_metadata => :"ConversationMetadata",
|
|
76
|
+
:feedback => :"Array<FeedbackResponse>"
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List of attributes with nullable: true
|
|
81
|
+
def self.openapi_nullable
|
|
82
|
+
Set.new(
|
|
83
|
+
[
|
|
84
|
+
:title,
|
|
85
|
+
:last_activity_at,
|
|
86
|
+
:user_token,
|
|
87
|
+
:conversation_metadata,
|
|
88
|
+
:feedback
|
|
89
|
+
]
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Initializes the object
|
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
|
+
def initialize(attributes = {})
|
|
96
|
+
if (!attributes.is_a?(Hash))
|
|
97
|
+
raise(
|
|
98
|
+
ArgumentError,
|
|
99
|
+
"The input argument (attributes) must be a hash in `Algolia::ConversationBaseResponse` initialize method"
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
105
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
106
|
+
raise(
|
|
107
|
+
ArgumentError,
|
|
108
|
+
"`#{k}` is not a valid attribute in `Algolia::ConversationBaseResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
|
109
|
+
self.class.attribute_map.keys.inspect
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
h[k.to_sym] = v
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:id)
|
|
117
|
+
self.id = attributes[:id]
|
|
118
|
+
else
|
|
119
|
+
self.id = nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:agent_id)
|
|
123
|
+
self.agent_id = attributes[:agent_id]
|
|
124
|
+
else
|
|
125
|
+
self.agent_id = nil
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:title)
|
|
129
|
+
self.title = attributes[:title]
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:created_at)
|
|
133
|
+
self.created_at = attributes[:created_at]
|
|
134
|
+
else
|
|
135
|
+
self.created_at = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:updated_at)
|
|
139
|
+
self.updated_at = attributes[:updated_at]
|
|
140
|
+
else
|
|
141
|
+
self.updated_at = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:last_activity_at)
|
|
145
|
+
self.last_activity_at = attributes[:last_activity_at]
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:user_token)
|
|
149
|
+
self.user_token = attributes[:user_token]
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:is_from_dashboard)
|
|
153
|
+
self.is_from_dashboard = attributes[:is_from_dashboard]
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:message_count)
|
|
157
|
+
self.message_count = attributes[:message_count]
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:total_input_tokens)
|
|
161
|
+
self.total_input_tokens = attributes[:total_input_tokens]
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:total_output_tokens)
|
|
165
|
+
self.total_output_tokens = attributes[:total_output_tokens]
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:total_tokens)
|
|
169
|
+
self.total_tokens = attributes[:total_tokens]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:conversation_metadata)
|
|
173
|
+
self.conversation_metadata = attributes[:conversation_metadata]
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.key?(:feedback)
|
|
177
|
+
if (value = attributes[:feedback]).is_a?(Array)
|
|
178
|
+
self.feedback = value
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Checks equality by comparing each attribute.
|
|
184
|
+
# @param [Object] Object to be compared
|
|
185
|
+
def ==(other)
|
|
186
|
+
return true if self.equal?(other)
|
|
187
|
+
self.class == other.class &&
|
|
188
|
+
id == other.id &&
|
|
189
|
+
agent_id == other.agent_id &&
|
|
190
|
+
title == other.title &&
|
|
191
|
+
created_at == other.created_at &&
|
|
192
|
+
updated_at == other.updated_at &&
|
|
193
|
+
last_activity_at == other.last_activity_at &&
|
|
194
|
+
user_token == other.user_token &&
|
|
195
|
+
is_from_dashboard == other.is_from_dashboard &&
|
|
196
|
+
message_count == other.message_count &&
|
|
197
|
+
total_input_tokens == other.total_input_tokens &&
|
|
198
|
+
total_output_tokens == other.total_output_tokens &&
|
|
199
|
+
total_tokens == other.total_tokens &&
|
|
200
|
+
conversation_metadata == other.conversation_metadata &&
|
|
201
|
+
feedback == other.feedback
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# @see the `==` method
|
|
205
|
+
# @param [Object] Object to be compared
|
|
206
|
+
def eql?(other)
|
|
207
|
+
self == other
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Calculates hash code according to all attributes.
|
|
211
|
+
# @return [Integer] Hash code
|
|
212
|
+
def hash
|
|
213
|
+
[
|
|
214
|
+
id,
|
|
215
|
+
agent_id,
|
|
216
|
+
title,
|
|
217
|
+
created_at,
|
|
218
|
+
updated_at,
|
|
219
|
+
last_activity_at,
|
|
220
|
+
user_token,
|
|
221
|
+
is_from_dashboard,
|
|
222
|
+
message_count,
|
|
223
|
+
total_input_tokens,
|
|
224
|
+
total_output_tokens,
|
|
225
|
+
total_tokens,
|
|
226
|
+
conversation_metadata,
|
|
227
|
+
feedback
|
|
228
|
+
].hash
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Builds the object from hash
|
|
232
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
233
|
+
# @return [Object] Returns the model itself
|
|
234
|
+
def self.build_from_hash(attributes)
|
|
235
|
+
return nil unless attributes.is_a?(Hash)
|
|
236
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
237
|
+
transformed_hash = {}
|
|
238
|
+
types_mapping.each_pair do |key, type|
|
|
239
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
240
|
+
transformed_hash[key.to_sym] = nil
|
|
241
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
242
|
+
# check to ensure the input is an array given that the attribute
|
|
243
|
+
# is documented as an array but the input is not
|
|
244
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
245
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
|
246
|
+
_deserialize(::Regexp.last_match(1), v)
|
|
247
|
+
}
|
|
248
|
+
end
|
|
249
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
250
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
new(transformed_hash)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Deserializes the data based on type
|
|
258
|
+
# @param string type Data type
|
|
259
|
+
# @param string value Value to be deserialized
|
|
260
|
+
# @return [Object] Deserialized data
|
|
261
|
+
def self._deserialize(type, value)
|
|
262
|
+
case type.to_sym
|
|
263
|
+
when :Time
|
|
264
|
+
Time.parse(value)
|
|
265
|
+
when :Date
|
|
266
|
+
Date.parse(value)
|
|
267
|
+
when :String
|
|
268
|
+
value.to_s
|
|
269
|
+
when :Integer
|
|
270
|
+
value.to_i
|
|
271
|
+
when :Float
|
|
272
|
+
value.to_f
|
|
273
|
+
when :Boolean
|
|
274
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
275
|
+
true
|
|
276
|
+
else
|
|
277
|
+
false
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
when :Object
|
|
281
|
+
# generic object (usually a Hash), return directly
|
|
282
|
+
value
|
|
283
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
284
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
285
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
286
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
287
|
+
k_type = Regexp.last_match[:k_type]
|
|
288
|
+
v_type = Regexp.last_match[:v_type]
|
|
289
|
+
{}.tap do |hash|
|
|
290
|
+
value.each do |k, v|
|
|
291
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
# model
|
|
295
|
+
else
|
|
296
|
+
# models (e.g. Pet) or oneOf
|
|
297
|
+
klass = Algolia::AgentStudio.const_get(type)
|
|
298
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
|
299
|
+
.build_from_hash(value)
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Returns the string representation of the object
|
|
304
|
+
# @return [String] String presentation of the object
|
|
305
|
+
def to_s
|
|
306
|
+
to_hash.to_s
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
310
|
+
# @return [Hash] Returns the object in the form of hash
|
|
311
|
+
def to_body
|
|
312
|
+
to_hash
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
def to_json(*_args)
|
|
316
|
+
to_hash.to_json
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# Returns the object in the form of hash
|
|
320
|
+
# @return [Hash] Returns the object in the form of hash
|
|
321
|
+
def to_hash
|
|
322
|
+
hash = {}
|
|
323
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
324
|
+
value = send(attr)
|
|
325
|
+
if value.nil?
|
|
326
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
327
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
hash[param] = _to_hash(value)
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
hash
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# Outputs non-array value in the form of hash
|
|
337
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
338
|
+
# @param [Object] value Any valid value
|
|
339
|
+
# @return [Hash] Returns the value in the form of hash
|
|
340
|
+
def _to_hash(value)
|
|
341
|
+
if value.is_a?(Array)
|
|
342
|
+
value.compact.map { |v| _to_hash(v) }
|
|
343
|
+
elsif value.is_a?(Hash)
|
|
344
|
+
{}.tap do |hash|
|
|
345
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
346
|
+
end
|
|
347
|
+
elsif value.respond_to?(:to_hash)
|
|
348
|
+
value.to_hash
|
|
349
|
+
else
|
|
350
|
+
value
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
end
|
|
354
|
+
end
|
|
355
|
+
end
|