trieve_ruby_client 0.7.2 → 0.7.6

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 (142) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -6
  3. data/docs/ChunkApi.md +158 -10
  4. data/docs/ChunkData.md +2 -0
  5. data/docs/ChunkMetadata.md +2 -0
  6. data/docs/CreateMessageData.md +0 -2
  7. data/docs/CreateTopicData.md +0 -2
  8. data/docs/EditMessageData.md +0 -2
  9. data/docs/FieldCondition.md +6 -0
  10. data/docs/GenerateChunksRequest.md +0 -2
  11. data/docs/GeoInfo.md +20 -0
  12. data/docs/GeoTypes.md +49 -0
  13. data/docs/GetChunksData.md +18 -0
  14. data/docs/GetTrackingChunksData.md +18 -0
  15. data/docs/LocationBoundingBox.md +20 -0
  16. data/docs/LocationPolygon.md +20 -0
  17. data/docs/LocationRadius.md +20 -0
  18. data/docs/RangeCondition.md +2 -0
  19. data/docs/RegenerateMessageData.md +0 -2
  20. data/docs/SlimChunkMetadata.md +4 -0
  21. data/docs/UpdateChunkData.md +2 -0
  22. data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
  23. data/lib/trieve_ruby_client/api/chunk_api.rb +161 -11
  24. data/lib/trieve_ruby_client/api/chunk_group_api.rb +1 -1
  25. data/lib/trieve_ruby_client/api/dataset_api.rb +1 -1
  26. data/lib/trieve_ruby_client/api/events_api.rb +1 -1
  27. data/lib/trieve_ruby_client/api/file_api.rb +1 -1
  28. data/lib/trieve_ruby_client/api/health_api.rb +1 -1
  29. data/lib/trieve_ruby_client/api/invitation_api.rb +1 -1
  30. data/lib/trieve_ruby_client/api/message_api.rb +1 -1
  31. data/lib/trieve_ruby_client/api/organization_api.rb +1 -1
  32. data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
  33. data/lib/trieve_ruby_client/api/topic_api.rb +1 -1
  34. data/lib/trieve_ruby_client/api/user_api.rb +1 -1
  35. data/lib/trieve_ruby_client/api_client.rb +1 -1
  36. data/lib/trieve_ruby_client/api_error.rb +1 -1
  37. data/lib/trieve_ruby_client/configuration.rb +1 -1
  38. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +1 -1
  39. data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
  40. data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
  41. data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
  42. data/lib/trieve_ruby_client/models/bookmark_data.rb +1 -1
  43. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
  44. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
  45. data/lib/trieve_ruby_client/models/chunk_data.rb +12 -2
  46. data/lib/trieve_ruby_client/models/chunk_filter.rb +1 -1
  47. data/lib/trieve_ruby_client/models/chunk_group.rb +1 -1
  48. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
  49. data/lib/trieve_ruby_client/models/chunk_metadata.rb +12 -2
  50. data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +1 -1
  51. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +1 -1
  52. data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
  53. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
  54. data/lib/trieve_ruby_client/models/create_dataset_request.rb +1 -1
  55. data/lib/trieve_ruby_client/models/create_message_data.rb +2 -13
  56. data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
  57. data/lib/trieve_ruby_client/models/create_topic_data.rb +2 -13
  58. data/lib/trieve_ruby_client/models/dataset.rb +1 -1
  59. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
  60. data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
  61. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
  62. data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
  63. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
  64. data/lib/trieve_ruby_client/models/edit_message_data.rb +2 -13
  65. data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
  66. data/lib/trieve_ruby_client/models/event.rb +1 -1
  67. data/lib/trieve_ruby_client/models/event_return.rb +1 -1
  68. data/lib/trieve_ruby_client/models/field_condition.rb +32 -2
  69. data/lib/trieve_ruby_client/models/file.rb +1 -1
  70. data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
  71. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +2 -13
  72. data/lib/trieve_ruby_client/models/geo_info.rb +237 -0
  73. data/lib/trieve_ruby_client/models/geo_types.rb +105 -0
  74. data/lib/trieve_ruby_client/models/get_chunks_data.rb +223 -0
  75. data/lib/trieve_ruby_client/models/get_events_data.rb +1 -1
  76. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
  77. data/lib/trieve_ruby_client/models/get_tracking_chunks_data.rb +223 -0
  78. data/lib/trieve_ruby_client/models/group_data.rb +1 -1
  79. data/lib/trieve_ruby_client/models/group_score_chunk.rb +1 -1
  80. data/lib/trieve_ruby_client/models/group_score_slim_chunks.rb +1 -1
  81. data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
  82. data/lib/trieve_ruby_client/models/location_bounding_box.rb +237 -0
  83. data/lib/trieve_ruby_client/models/location_polygon.rb +235 -0
  84. data/lib/trieve_ruby_client/models/location_radius.rb +237 -0
  85. data/lib/trieve_ruby_client/models/match_condition.rb +1 -1
  86. data/lib/trieve_ruby_client/models/message.rb +1 -1
  87. data/lib/trieve_ruby_client/models/organization.rb +1 -1
  88. data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
  89. data/lib/trieve_ruby_client/models/range.rb +1 -1
  90. data/lib/trieve_ruby_client/models/range_condition.rb +2 -1
  91. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +1 -1
  92. data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +1 -1
  93. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +2 -13
  94. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
  95. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +1 -1
  96. data/lib/trieve_ruby_client/models/score_slim_chunks.rb +1 -1
  97. data/lib/trieve_ruby_client/models/search_chunk_data.rb +1 -1
  98. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
  99. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +1 -1
  100. data/lib/trieve_ruby_client/models/search_over_groups_results.rb +1 -1
  101. data/lib/trieve_ruby_client/models/search_over_groups_slim_results.rb +1 -1
  102. data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +1 -1
  103. data/lib/trieve_ruby_client/models/search_within_group_data.rb +1 -1
  104. data/lib/trieve_ruby_client/models/search_within_group_results.rb +1 -1
  105. data/lib/trieve_ruby_client/models/search_within_group_slim_results.rb +1 -1
  106. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +1 -1
  107. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
  108. data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
  109. data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +28 -2
  110. data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.rb +1 -1
  111. data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
  112. data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
  113. data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
  114. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
  115. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
  116. data/lib/trieve_ruby_client/models/topic.rb +1 -1
  117. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
  118. data/lib/trieve_ruby_client/models/update_chunk_data.rb +12 -2
  119. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
  120. data/lib/trieve_ruby_client/models/update_dataset_request.rb +1 -1
  121. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
  122. data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
  123. data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
  124. data/lib/trieve_ruby_client/models/update_user_org_role_data.rb +1 -1
  125. data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
  126. data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
  127. data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
  128. data/lib/trieve_ruby_client/version.rb +2 -2
  129. data/lib/trieve_ruby_client.rb +8 -1
  130. data/openapi-generator.yaml +1 -1
  131. data/openapi.json +322 -28
  132. data/spec/models/geo_info_spec.rb +42 -0
  133. data/spec/models/geo_types_spec.rb +32 -0
  134. data/spec/models/get_chunks_data_spec.rb +36 -0
  135. data/spec/models/get_tracking_chunks_data_spec.rb +36 -0
  136. data/spec/models/location_bounding_box_spec.rb +42 -0
  137. data/spec/models/location_polygon_spec.rb +42 -0
  138. data/spec/models/location_radius_spec.rb +42 -0
  139. data/spec/spec_helper.rb +1 -1
  140. data/trieve_ruby_client-0.7.2.gem +0 -0
  141. data/trieve_ruby_client.gemspec +1 -1
  142. metadata +31 -2
@@ -0,0 +1,237 @@
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.7.6
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 GeoInfo
18
+ attr_accessor :lat
19
+
20
+ attr_accessor :lon
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'lat' => :'lat',
26
+ :'lon' => :'lon'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'lat' => :'GeoTypes',
39
+ :'lon' => :'GeoTypes'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::GeoInfo` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::GeoInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'lat')
65
+ self.lat = attributes[:'lat']
66
+ else
67
+ self.lat = nil
68
+ end
69
+
70
+ if attributes.key?(:'lon')
71
+ self.lon = attributes[:'lon']
72
+ else
73
+ self.lon = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @lat.nil?
83
+ invalid_properties.push('invalid value for "lat", lat cannot be nil.')
84
+ end
85
+
86
+ if @lon.nil?
87
+ invalid_properties.push('invalid value for "lon", lon cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @lat.nil?
98
+ return false if @lon.nil?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ lat == o.lat &&
108
+ lon == o.lon
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [lat, lon].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def self._deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = TrieveRubyClient.const_get(type)
185
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -0,0 +1,105 @@
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.7.6
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
+ module GeoTypes
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'Float',
23
+ :'Integer'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - We do not attempt to check whether exactly one item matches.
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_one_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ typed_data = find_and_cast_into_type(klass, data)
42
+ return typed_data if typed_data
43
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
+ end
45
+ end
46
+
47
+ openapi_one_of.include?(:AnyType) ? data : nil
48
+ end
49
+
50
+ private
51
+
52
+ SchemaMismatchError = Class.new(StandardError)
53
+
54
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
+ def find_and_cast_into_type(klass, data)
56
+ return if data.nil?
57
+
58
+ case klass.to_s
59
+ when 'Boolean'
60
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
+ when 'Float'
62
+ return data if data.instance_of?(Float)
63
+ when 'Integer'
64
+ return data if data.instance_of?(Integer)
65
+ when 'Time'
66
+ return Time.parse(data)
67
+ when 'Date'
68
+ return Date.parse(data)
69
+ when 'String'
70
+ return data if data.instance_of?(String)
71
+ when 'Object' # "type: object"
72
+ return data if data.instance_of?(Hash)
73
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
+ if data.instance_of?(Array)
75
+ sub_type = Regexp.last_match[:sub_type]
76
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
+ end
78
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
+ sub_type = Regexp.last_match[:sub_type]
81
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
+ end
83
+ else # model
84
+ const = TrieveRubyClient.const_get(klass)
85
+ if const
86
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
87
+ model = const.build(data)
88
+ return model if model
89
+ else
90
+ # raise if data contains keys that are not known to the model
91
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
92
+ model = const.build_from_hash(data)
93
+ return model if model
94
+ end
95
+ end
96
+ end
97
+
98
+ raise # if no match by now, raise
99
+ rescue
100
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
+ end
102
+ end
103
+ end
104
+
105
+ end
@@ -0,0 +1,223 @@
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.7.6
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 GetChunksData
18
+ attr_accessor :ids
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'ids' => :'ids'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'ids' => :'Array<String>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::GetChunksData` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::GetChunksData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'ids')
61
+ if (value = attributes[:'ids']).is_a?(Array)
62
+ self.ids = value
63
+ end
64
+ else
65
+ self.ids = nil
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
+ invalid_properties = Array.new
74
+ if @ids.nil?
75
+ invalid_properties.push('invalid value for "ids", ids cannot be nil.')
76
+ end
77
+
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ return false if @ids.nil?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ ids == o.ids
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [ids].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
128
+ end
129
+ new(transformed_hash)
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def self._deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = TrieveRubyClient.const_get(type)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ 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.7.2
6
+ The version of the OpenAPI document: 0.7.6
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.7.2
6
+ The version of the OpenAPI document: 0.7.6
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0