trieve_ruby_client 0.6.0 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -19
  3. data/docs/BookmarkData.md +1 -1
  4. data/docs/ChunkApi.md +9 -9
  5. data/docs/ChunkData.md +2 -0
  6. data/docs/ChunkGroupApi.md +14 -14
  7. data/docs/ChunkMetadataWithScore.md +44 -0
  8. data/docs/CreateChunkGroupData.md +1 -1
  9. data/docs/FileApi.md +1 -1
  10. data/docs/GetEventsData.md +1 -1
  11. data/docs/GroupScoreChunk.md +24 -0
  12. data/docs/GroupScoreSlimChunks.md +20 -0
  13. data/docs/ScoreChunkDTO.md +1 -1
  14. data/docs/SearchOverGroupsResults.md +20 -0
  15. data/docs/SearchOverGroupsSlimResults.md +20 -0
  16. data/docs/SearchWithinGroupResults.md +22 -0
  17. data/docs/SearchWithinGroupSlimResults.md +22 -0
  18. data/docs/SlimChunkMetadataWithScore.md +38 -0
  19. data/docs/UpdateChunkByTrackingIdData.md +2 -0
  20. data/docs/UpdateChunkData.md +2 -0
  21. data/docs/UploadFileData.md +2 -2
  22. data/docs/UserApi.md +2 -2
  23. data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
  24. data/lib/trieve_ruby_client/api/chunk_api.rb +9 -9
  25. data/lib/trieve_ruby_client/api/chunk_group_api.rb +10 -10
  26. data/lib/trieve_ruby_client/api/dataset_api.rb +1 -1
  27. data/lib/trieve_ruby_client/api/events_api.rb +1 -1
  28. data/lib/trieve_ruby_client/api/file_api.rb +1 -1
  29. data/lib/trieve_ruby_client/api/health_api.rb +1 -1
  30. data/lib/trieve_ruby_client/api/invitation_api.rb +1 -1
  31. data/lib/trieve_ruby_client/api/message_api.rb +1 -1
  32. data/lib/trieve_ruby_client/api/organization_api.rb +1 -1
  33. data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
  34. data/lib/trieve_ruby_client/api/topic_api.rb +1 -1
  35. data/lib/trieve_ruby_client/api/user_api.rb +3 -3
  36. data/lib/trieve_ruby_client/api_client.rb +1 -1
  37. data/lib/trieve_ruby_client/api_error.rb +1 -1
  38. data/lib/trieve_ruby_client/configuration.rb +1 -1
  39. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +1 -1
  40. data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
  41. data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
  42. data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
  43. data/lib/trieve_ruby_client/models/bookmark_data.rb +2 -2
  44. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
  45. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
  46. data/lib/trieve_ruby_client/models/chunk_data.rb +13 -2
  47. data/lib/trieve_ruby_client/models/chunk_filter.rb +1 -1
  48. data/lib/trieve_ruby_client/models/chunk_group.rb +1 -1
  49. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
  50. data/lib/trieve_ruby_client/models/chunk_metadata.rb +1 -1
  51. data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +387 -0
  52. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +1 -1
  53. data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
  54. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +2 -8
  55. data/lib/trieve_ruby_client/models/create_dataset_request.rb +1 -1
  56. data/lib/trieve_ruby_client/models/create_message_data.rb +1 -1
  57. data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
  58. data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
  59. data/lib/trieve_ruby_client/models/dataset.rb +1 -1
  60. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
  61. data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
  62. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
  63. data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
  64. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
  65. data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
  66. data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
  67. data/lib/trieve_ruby_client/models/event.rb +1 -1
  68. data/lib/trieve_ruby_client/models/event_return.rb +1 -1
  69. data/lib/trieve_ruby_client/models/field_condition.rb +1 -1
  70. data/lib/trieve_ruby_client/models/file.rb +1 -1
  71. data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
  72. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +1 -1
  73. data/lib/trieve_ruby_client/models/get_events_data.rb +2 -2
  74. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
  75. data/lib/trieve_ruby_client/models/group_data.rb +1 -1
  76. data/lib/trieve_ruby_client/models/group_score_chunk.rb +259 -0
  77. data/lib/trieve_ruby_client/models/group_score_slim_chunks.rb +239 -0
  78. data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
  79. data/lib/trieve_ruby_client/models/match_condition.rb +1 -1
  80. data/lib/trieve_ruby_client/models/message.rb +1 -1
  81. data/lib/trieve_ruby_client/models/organization.rb +1 -1
  82. data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
  83. data/lib/trieve_ruby_client/models/range.rb +1 -1
  84. data/lib/trieve_ruby_client/models/range_condition.rb +1 -1
  85. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +1 -1
  86. data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +1 -1
  87. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
  88. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
  89. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +2 -2
  90. data/lib/trieve_ruby_client/models/score_slim_chunks.rb +1 -1
  91. data/lib/trieve_ruby_client/models/search_chunk_data.rb +1 -1
  92. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
  93. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +1 -1
  94. data/lib/trieve_ruby_client/models/search_over_groups_results.rb +239 -0
  95. data/lib/trieve_ruby_client/models/search_over_groups_slim_results.rb +239 -0
  96. data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +1 -1
  97. data/lib/trieve_ruby_client/models/search_within_group_data.rb +1 -1
  98. data/lib/trieve_ruby_client/models/search_within_group_results.rb +255 -0
  99. data/lib/trieve_ruby_client/models/search_within_group_slim_results.rb +255 -0
  100. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +1 -1
  101. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
  102. data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
  103. data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +1 -1
  104. data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.rb +345 -0
  105. data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
  106. data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
  107. data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
  108. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
  109. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
  110. data/lib/trieve_ruby_client/models/topic.rb +1 -1
  111. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +13 -2
  112. data/lib/trieve_ruby_client/models/update_chunk_data.rb +13 -2
  113. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
  114. data/lib/trieve_ruby_client/models/update_dataset_request.rb +1 -1
  115. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
  116. data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
  117. data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
  118. data/lib/trieve_ruby_client/models/update_user_data.rb +1 -1
  119. data/lib/trieve_ruby_client/models/upload_file_data.rb +13 -19
  120. data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
  121. data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
  122. data/lib/trieve_ruby_client/version.rb +2 -2
  123. data/lib/trieve_ruby_client.rb +9 -13
  124. data/openapi-generator.yaml +1 -1
  125. data/openapi.json +279 -198
  126. data/spec/models/chunk_metadata_with_score_spec.rb +114 -0
  127. data/spec/models/group_score_chunk_spec.rb +48 -0
  128. data/spec/models/group_score_slim_chunks_spec.rb +42 -0
  129. data/spec/models/search_over_groups_results_spec.rb +42 -0
  130. data/spec/models/search_over_groups_slim_results_spec.rb +42 -0
  131. data/spec/models/search_within_group_results_spec.rb +48 -0
  132. data/spec/models/search_within_group_slim_results_spec.rb +48 -0
  133. data/spec/models/slim_chunk_metadata_with_score_spec.rb +96 -0
  134. data/spec/spec_helper.rb +1 -1
  135. data/trieve_ruby_client-0.6.0.gem +0 -0
  136. data/trieve_ruby_client-0.6.2.gem +0 -0
  137. data/trieve_ruby_client.gemspec +1 -1
  138. metadata +36 -2
@@ -0,0 +1,255 @@
1
+ =begin
2
+ #Trieve API
3
+
4
+ #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
+
6
+ The version of the OpenAPI document: 0.6.7
7
+ Contact: developers@trieve.ai
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrieveRubyClient
17
+ class SearchWithinGroupResults
18
+ attr_accessor :bookmarks
19
+
20
+ attr_accessor :group
21
+
22
+ attr_accessor :total_pages
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'bookmarks' => :'bookmarks',
28
+ :'group' => :'group',
29
+ :'total_pages' => :'total_pages'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'bookmarks' => :'Array<ScoreChunkDTO>',
42
+ :'group' => :'ChunkGroup',
43
+ :'total_pages' => :'Integer'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::SearchWithinGroupResults` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::SearchWithinGroupResults`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'bookmarks')
69
+ if (value = attributes[:'bookmarks']).is_a?(Array)
70
+ self.bookmarks = value
71
+ end
72
+ else
73
+ self.bookmarks = nil
74
+ end
75
+
76
+ if attributes.key?(:'group')
77
+ self.group = attributes[:'group']
78
+ else
79
+ self.group = nil
80
+ end
81
+
82
+ if attributes.key?(:'total_pages')
83
+ self.total_pages = attributes[:'total_pages']
84
+ else
85
+ self.total_pages = nil
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ if @bookmarks.nil?
95
+ invalid_properties.push('invalid value for "bookmarks", bookmarks cannot be nil.')
96
+ end
97
+
98
+ if @group.nil?
99
+ invalid_properties.push('invalid value for "group", group cannot be nil.')
100
+ end
101
+
102
+ if @total_pages.nil?
103
+ invalid_properties.push('invalid value for "total_pages", total_pages cannot be nil.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ return false if @bookmarks.nil?
114
+ return false if @group.nil?
115
+ return false if @total_pages.nil?
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ bookmarks == o.bookmarks &&
125
+ group == o.group &&
126
+ total_pages == o.total_pages
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [bookmarks, group, total_pages].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ openapi_types.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def self._deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = TrieveRubyClient.const_get(type)
203
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end
@@ -0,0 +1,255 @@
1
+ =begin
2
+ #Trieve API
3
+
4
+ #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
+
6
+ The version of the OpenAPI document: 0.6.7
7
+ Contact: developers@trieve.ai
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrieveRubyClient
17
+ class SearchWithinGroupSlimResults
18
+ attr_accessor :bookmarks
19
+
20
+ attr_accessor :group
21
+
22
+ attr_accessor :total_pages
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'bookmarks' => :'bookmarks',
28
+ :'group' => :'group',
29
+ :'total_pages' => :'total_pages'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'bookmarks' => :'Array<ScoreSlimChunks>',
42
+ :'group' => :'ChunkGroup',
43
+ :'total_pages' => :'Integer'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::SearchWithinGroupSlimResults` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::SearchWithinGroupSlimResults`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'bookmarks')
69
+ if (value = attributes[:'bookmarks']).is_a?(Array)
70
+ self.bookmarks = value
71
+ end
72
+ else
73
+ self.bookmarks = nil
74
+ end
75
+
76
+ if attributes.key?(:'group')
77
+ self.group = attributes[:'group']
78
+ else
79
+ self.group = nil
80
+ end
81
+
82
+ if attributes.key?(:'total_pages')
83
+ self.total_pages = attributes[:'total_pages']
84
+ else
85
+ self.total_pages = nil
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ if @bookmarks.nil?
95
+ invalid_properties.push('invalid value for "bookmarks", bookmarks cannot be nil.')
96
+ end
97
+
98
+ if @group.nil?
99
+ invalid_properties.push('invalid value for "group", group cannot be nil.')
100
+ end
101
+
102
+ if @total_pages.nil?
103
+ invalid_properties.push('invalid value for "total_pages", total_pages cannot be nil.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ return false if @bookmarks.nil?
114
+ return false if @group.nil?
115
+ return false if @total_pages.nil?
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ bookmarks == o.bookmarks &&
125
+ group == o.group &&
126
+ total_pages == o.total_pages
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [bookmarks, group, total_pages].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ openapi_types.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def self._deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = TrieveRubyClient.const_get(type)
203
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0