trieve_ruby_client 0.8.2 → 0.10.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 (219) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -30
  3. data/docs/ApiKeyRespBody.md +32 -0
  4. data/docs/AutocompleteData.md +42 -0
  5. data/docs/AutocompleteReqPayload.md +50 -0
  6. data/docs/BoostPhrase.md +20 -0
  7. data/docs/ChunkApi.md +140 -66
  8. data/docs/ChunkData.md +3 -1
  9. data/docs/ChunkFilter.md +3 -3
  10. data/docs/ChunkGroup.md +1 -1
  11. data/docs/ChunkGroupApi.md +35 -33
  12. data/docs/ChunkMetadata.md +5 -1
  13. data/docs/ChunkMetadataStringTagSet.md +46 -0
  14. data/docs/ChunkMetadataTypes.md +51 -0
  15. data/docs/ChunkReqPayload.md +50 -0
  16. data/docs/ClientDatasetConfiguration.md +0 -2
  17. data/docs/ConditionType.md +49 -0
  18. data/docs/ContentChunkMetadata.md +32 -0
  19. data/docs/CreateChunkGroupReqPayload.md +28 -0
  20. data/docs/CreateChunkReqPayloadEnum.md +49 -0
  21. data/docs/CreateDatasetRequest.md +2 -2
  22. data/docs/CreateMessageData.md +2 -2
  23. data/docs/CreateMessageReqPayload.md +42 -0
  24. data/docs/CreateTopicReqPayload.md +22 -0
  25. data/docs/Dataset.md +2 -0
  26. data/docs/DatasetApi.md +236 -12
  27. data/docs/DateRange.md +24 -0
  28. data/docs/EditMessageReqPayload.md +44 -0
  29. data/docs/FieldCondition.md +2 -0
  30. data/docs/File.md +1 -1
  31. data/docs/FileApi.md +7 -7
  32. data/docs/GenerateChunksRequest.md +2 -0
  33. data/docs/GetDatasetsPagination.md +20 -0
  34. data/docs/HasIDCondition.md +20 -0
  35. data/docs/InvitationApi.md +1 -1
  36. data/docs/MatchCondition.md +3 -1
  37. data/docs/MessageApi.md +42 -42
  38. data/docs/Organization.md +2 -0
  39. data/docs/OrganizationApi.md +24 -25
  40. data/docs/RangeCondition.md +1 -3
  41. data/docs/RegenerateMessageReqPayload.md +40 -0
  42. data/docs/RemoveChunkFromGroupReqPayload.md +18 -0
  43. data/docs/ScoreChunkDTO.md +3 -1
  44. data/docs/SearchChunkData.md +9 -3
  45. data/docs/SearchChunksReqPayload.md +54 -0
  46. data/docs/SearchOverGroupsData.md +10 -2
  47. data/docs/SearchWithinGroupData.md +12 -2
  48. data/docs/SetUserApiKeyRequest.md +4 -0
  49. data/docs/SlimChunkMetadata.md +4 -0
  50. data/docs/SuggestedQueriesReqPayload.md +18 -0
  51. data/docs/TopicApi.md +16 -16
  52. data/docs/UpdateChunkData.md +2 -0
  53. data/docs/UpdateChunkReqPayload.md +46 -0
  54. data/docs/UpdateDatasetRequest.md +2 -0
  55. data/docs/UpdateGroupByTrackingIDReqPayload.md +26 -0
  56. data/docs/UpdateTopicReqPayload.md +20 -0
  57. data/docs/UpdateUserOrgRoleData.md +1 -1
  58. data/docs/UploadFileReqPayload.md +40 -0
  59. data/docs/UserApi.md +7 -8
  60. data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
  61. data/lib/trieve_ruby_client/api/chunk_api.rb +158 -83
  62. data/lib/trieve_ruby_client/api/chunk_group_api.rb +58 -51
  63. data/lib/trieve_ruby_client/api/dataset_api.rb +224 -15
  64. data/lib/trieve_ruby_client/api/events_api.rb +1 -1
  65. data/lib/trieve_ruby_client/api/file_api.rb +12 -12
  66. data/lib/trieve_ruby_client/api/health_api.rb +1 -1
  67. data/lib/trieve_ruby_client/api/invitation_api.rb +3 -3
  68. data/lib/trieve_ruby_client/api/message_api.rb +50 -50
  69. data/lib/trieve_ruby_client/api/organization_api.rb +27 -27
  70. data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
  71. data/lib/trieve_ruby_client/api/topic_api.rb +27 -27
  72. data/lib/trieve_ruby_client/api/user_api.rb +8 -8
  73. data/lib/trieve_ruby_client/api_client.rb +1 -1
  74. data/lib/trieve_ruby_client/api_error.rb +1 -1
  75. data/lib/trieve_ruby_client/configuration.rb +1 -1
  76. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +1 -1
  77. data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
  78. data/lib/trieve_ruby_client/models/api_key_resp_body.rb +325 -0
  79. data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
  80. data/lib/trieve_ruby_client/models/autocomplete_data.rb +378 -0
  81. data/lib/trieve_ruby_client/models/autocomplete_req_payload.rb +467 -0
  82. data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
  83. data/lib/trieve_ruby_client/models/bookmark_data.rb +1 -1
  84. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
  85. data/lib/trieve_ruby_client/models/boost_phrase.rb +240 -0
  86. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
  87. data/lib/trieve_ruby_client/models/chunk_data.rb +16 -9
  88. data/lib/trieve_ruby_client/models/chunk_filter.rb +4 -4
  89. data/lib/trieve_ruby_client/models/chunk_group.rb +5 -3
  90. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
  91. data/lib/trieve_ruby_client/models/chunk_metadata.rb +28 -4
  92. data/lib/trieve_ruby_client/models/chunk_metadata_string_tag_set.rb +387 -0
  93. data/lib/trieve_ruby_client/models/chunk_metadata_types.rb +106 -0
  94. data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +1 -1
  95. data/lib/trieve_ruby_client/models/chunk_req_payload.rb +400 -0
  96. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +2 -18
  97. data/lib/trieve_ruby_client/models/condition_type.rb +105 -0
  98. data/lib/trieve_ruby_client/models/content_chunk_metadata.rb +299 -0
  99. data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
  100. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
  101. data/lib/trieve_ruby_client/models/create_chunk_group_req_payload.rb +273 -0
  102. data/lib/trieve_ruby_client/models/create_chunk_req_payload_enum.rb +105 -0
  103. data/lib/trieve_ruby_client/models/create_dataset_request.rb +3 -3
  104. data/lib/trieve_ruby_client/models/create_message_data.rb +13 -13
  105. data/lib/trieve_ruby_client/models/create_message_req_payload.rb +378 -0
  106. data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
  107. data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
  108. data/lib/trieve_ruby_client/models/create_topic_req_payload.rb +244 -0
  109. data/lib/trieve_ruby_client/models/dataset.rb +18 -2
  110. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
  111. data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
  112. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
  113. data/lib/trieve_ruby_client/models/date_range.rb +245 -0
  114. data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
  115. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
  116. data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
  117. data/lib/trieve_ruby_client/models/edit_message_req_payload.rb +395 -0
  118. data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
  119. data/lib/trieve_ruby_client/models/event.rb +1 -1
  120. data/lib/trieve_ruby_client/models/event_return.rb +1 -1
  121. data/lib/trieve_ruby_client/models/field_condition.rb +12 -2
  122. data/lib/trieve_ruby_client/models/file.rb +5 -3
  123. data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
  124. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +13 -2
  125. data/lib/trieve_ruby_client/models/geo_info.rb +1 -1
  126. data/lib/trieve_ruby_client/models/geo_types.rb +1 -1
  127. data/lib/trieve_ruby_client/models/get_chunks_data.rb +1 -1
  128. data/lib/trieve_ruby_client/models/get_datasets_pagination.rb +225 -0
  129. data/lib/trieve_ruby_client/models/get_events_data.rb +1 -1
  130. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
  131. data/lib/trieve_ruby_client/models/get_tracking_chunks_data.rb +1 -1
  132. data/lib/trieve_ruby_client/models/group_data.rb +1 -1
  133. data/lib/trieve_ruby_client/models/group_score_chunk.rb +1 -1
  134. data/lib/trieve_ruby_client/models/has_id_condition.rb +229 -0
  135. data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
  136. data/lib/trieve_ruby_client/models/location_bounding_box.rb +1 -1
  137. data/lib/trieve_ruby_client/models/location_polygon.rb +1 -1
  138. data/lib/trieve_ruby_client/models/location_radius.rb +1 -1
  139. data/lib/trieve_ruby_client/models/match_condition.rb +2 -1
  140. data/lib/trieve_ruby_client/models/message.rb +1 -1
  141. data/lib/trieve_ruby_client/models/organization.rb +18 -2
  142. data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
  143. data/lib/trieve_ruby_client/models/range.rb +1 -1
  144. data/lib/trieve_ruby_client/models/range_condition.rb +2 -3
  145. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +1 -1
  146. data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +1 -1
  147. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
  148. data/lib/trieve_ruby_client/models/regenerate_message_req_payload.rb +361 -0
  149. data/lib/trieve_ruby_client/models/remove_chunk_from_group_req_payload.rb +222 -0
  150. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
  151. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +15 -3
  152. data/lib/trieve_ruby_client/models/search_chunk_data.rb +40 -5
  153. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
  154. data/lib/trieve_ruby_client/models/search_chunks_req_payload.rb +504 -0
  155. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +93 -4
  156. data/lib/trieve_ruby_client/models/search_over_groups_results.rb +1 -1
  157. data/lib/trieve_ruby_client/models/search_within_group_data.rb +106 -4
  158. data/lib/trieve_ruby_client/models/search_within_group_results.rb +1 -1
  159. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +28 -2
  160. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
  161. data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
  162. data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +24 -2
  163. data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.rb +1 -1
  164. data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
  165. data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
  166. data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
  167. data/lib/trieve_ruby_client/models/suggested_queries_req_payload.rb +222 -0
  168. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
  169. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
  170. data/lib/trieve_ruby_client/models/topic.rb +1 -1
  171. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
  172. data/lib/trieve_ruby_client/models/update_chunk_data.rb +15 -2
  173. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
  174. data/lib/trieve_ruby_client/models/update_chunk_req_payload.rb +376 -0
  175. data/lib/trieve_ruby_client/models/update_dataset_request.rb +13 -2
  176. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
  177. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_req_payload.rb +268 -0
  178. data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
  179. data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
  180. data/lib/trieve_ruby_client/models/update_topic_req_payload.rb +239 -0
  181. data/lib/trieve_ruby_client/models/update_user_org_role_data.rb +2 -2
  182. data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
  183. data/lib/trieve_ruby_client/models/upload_file_req_payload.rb +368 -0
  184. data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
  185. data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
  186. data/lib/trieve_ruby_client/version.rb +2 -2
  187. data/lib/trieve_ruby_client.rb +25 -20
  188. data/openapi-generator.yaml +1 -1
  189. data/openapi.json +1 -7789
  190. data/spec/models/api_key_resp_body_spec.rb +78 -0
  191. data/spec/models/autocomplete_data_spec.rb +108 -0
  192. data/spec/models/autocomplete_req_payload_spec.rb +132 -0
  193. data/spec/models/boost_phrase_spec.rb +42 -0
  194. data/spec/models/chunk_metadata_string_tag_set_spec.rb +120 -0
  195. data/spec/models/chunk_metadata_types_spec.rb +32 -0
  196. data/spec/models/chunk_req_payload_spec.rb +132 -0
  197. data/spec/models/condition_type_spec.rb +32 -0
  198. data/spec/models/content_chunk_metadata_spec.rb +72 -0
  199. data/spec/models/create_chunk_group_req_payload_spec.rb +66 -0
  200. data/spec/models/create_chunk_req_payload_enum_spec.rb +32 -0
  201. data/spec/models/create_message_req_payload_spec.rb +108 -0
  202. data/spec/models/create_topic_req_payload_spec.rb +48 -0
  203. data/spec/models/date_range_spec.rb +54 -0
  204. data/spec/models/edit_message_req_payload_spec.rb +114 -0
  205. data/spec/models/get_datasets_pagination_spec.rb +42 -0
  206. data/spec/models/has_id_condition_spec.rb +42 -0
  207. data/spec/models/regenerate_message_req_payload_spec.rb +102 -0
  208. data/spec/models/remove_chunk_from_group_req_payload_spec.rb +36 -0
  209. data/spec/models/search_chunks_req_payload_spec.rb +144 -0
  210. data/spec/models/suggested_queries_req_payload_spec.rb +36 -0
  211. data/spec/models/update_chunk_req_payload_spec.rb +120 -0
  212. data/spec/models/update_group_by_tracking_id_req_payload_spec.rb +60 -0
  213. data/spec/models/update_topic_req_payload_spec.rb +42 -0
  214. data/spec/models/upload_file_req_payload_spec.rb +102 -0
  215. data/spec/spec_helper.rb +1 -1
  216. data/trieve_ruby_client-0.8.2.gem +0 -0
  217. data/trieve_ruby_client-0.8.5.gem +0 -0
  218. data/trieve_ruby_client.gemspec +1 -1
  219. metadata +104 -2
@@ -0,0 +1,268 @@
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.10.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 UpdateGroupByTrackingIDReqPayload
18
+ # Description to assign to the chunk_group. Convenience field for you to avoid having to remember what the group is for. If not provided, the description will not be updated.
19
+ attr_accessor :description
20
+
21
+ # Optional metadata to assign to the chunk_group. This is a JSON object that can store any additional information you want to associate with the chunks inside of the chunk_group.
22
+ attr_accessor :metadata
23
+
24
+ # Name to assign to the chunk_group. Does not need to be unique. If not provided, the name will not be updated.
25
+ attr_accessor :name
26
+
27
+ # Optional tags to assign to the chunk_group. This is a list of strings that can be used to categorize the chunks inside the chunk_group.
28
+ attr_accessor :tag_set
29
+
30
+ # Tracking Id of the chunk_group to update.
31
+ attr_accessor :tracking_id
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'description' => :'description',
37
+ :'metadata' => :'metadata',
38
+ :'name' => :'name',
39
+ :'tag_set' => :'tag_set',
40
+ :'tracking_id' => :'tracking_id'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'description' => :'String',
53
+ :'metadata' => :'Object',
54
+ :'name' => :'String',
55
+ :'tag_set' => :'Array<String>',
56
+ :'tracking_id' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'description',
64
+ :'metadata',
65
+ :'name',
66
+ :'tag_set',
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::UpdateGroupByTrackingIDReqPayload` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::UpdateGroupByTrackingIDReqPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'description')
86
+ self.description = attributes[:'description']
87
+ end
88
+
89
+ if attributes.key?(:'metadata')
90
+ self.metadata = attributes[:'metadata']
91
+ end
92
+
93
+ if attributes.key?(:'name')
94
+ self.name = attributes[:'name']
95
+ end
96
+
97
+ if attributes.key?(:'tag_set')
98
+ if (value = attributes[:'tag_set']).is_a?(Array)
99
+ self.tag_set = value
100
+ end
101
+ end
102
+
103
+ if attributes.key?(:'tracking_id')
104
+ self.tracking_id = attributes[:'tracking_id']
105
+ else
106
+ self.tracking_id = nil
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
+ invalid_properties = Array.new
115
+ if @tracking_id.nil?
116
+ invalid_properties.push('invalid value for "tracking_id", tracking_id cannot be nil.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ return false if @tracking_id.nil?
127
+ true
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ description == o.description &&
136
+ metadata == o.metadata &&
137
+ name == o.name &&
138
+ tag_set == o.tag_set &&
139
+ tracking_id == o.tracking_id
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ def hash
151
+ [description, metadata, name, tag_set, tracking_id].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def self.build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ attributes = attributes.transform_keys(&:to_sym)
160
+ transformed_hash = {}
161
+ openapi_types.each_pair do |key, type|
162
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = nil
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[attribute_map[key]].is_a?(Array)
168
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
169
+ end
170
+ elsif !attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
172
+ end
173
+ end
174
+ new(transformed_hash)
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def self._deserialize(type, value)
182
+ case type.to_sym
183
+ when :Time
184
+ Time.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :Boolean
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ # models (e.g. Pet) or oneOf
215
+ klass = TrieveRubyClient.const_get(type)
216
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ is_nullable = self.class.openapi_nullable.include?(attr)
240
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
+ end
242
+
243
+ hash[param] = _to_hash(value)
244
+ end
245
+ hash
246
+ end
247
+
248
+ # Outputs non-array value in the form of hash
249
+ # For object, use to_hash. Otherwise, just return the value
250
+ # @param [Object] value Any valid value
251
+ # @return [Hash] Returns the value in the form of hash
252
+ def _to_hash(value)
253
+ if value.is_a?(Array)
254
+ value.compact.map { |v| _to_hash(v) }
255
+ elsif value.is_a?(Hash)
256
+ {}.tap do |hash|
257
+ value.each { |k, v| hash[k] = _to_hash(v) }
258
+ end
259
+ elsif value.respond_to? :to_hash
260
+ value.to_hash
261
+ else
262
+ value
263
+ end
264
+ end
265
+
266
+ end
267
+
268
+ 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.8.2
6
+ The version of the OpenAPI document: 0.10.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.8.2
6
+ The version of the OpenAPI document: 0.8.5
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -0,0 +1,239 @@
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.10.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 UpdateTopicReqPayload
18
+ # The new name of the topic. A name is not generated from this field, it is used as-is.
19
+ attr_accessor :name
20
+
21
+ # The id of the topic to target.
22
+ attr_accessor :topic_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'name' => :'name',
28
+ :'topic_id' => :'topic_id'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'name' => :'String',
41
+ :'topic_id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::UpdateTopicReqPayload` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::UpdateTopicReqPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'name')
67
+ self.name = attributes[:'name']
68
+ else
69
+ self.name = nil
70
+ end
71
+
72
+ if attributes.key?(:'topic_id')
73
+ self.topic_id = attributes[:'topic_id']
74
+ else
75
+ self.topic_id = nil
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ if @name.nil?
85
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
86
+ end
87
+
88
+ if @topic_id.nil?
89
+ invalid_properties.push('invalid value for "topic_id", topic_id cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @name.nil?
100
+ return false if @topic_id.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ name == o.name &&
110
+ topic_id == o.topic_id
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [name, topic_id].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def self._deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = TrieveRubyClient.const_get(type)
187
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ 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.8.2
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -21,7 +21,7 @@ module TrieveRubyClient
21
21
  # Either 0 (user), 1 (admin), or 2 (owner). If not provided, the current role will be used. The auth'ed user must have a role greater than or equal to the role being assigned.
22
22
  attr_accessor :role
23
23
 
24
- # The id of the user to update, if not provided, the auth'ed user will be updated. If provided, the auth'ed user must be an admin (1) or owner (2) of the organization.
24
+ # The id of the user to update, if not provided, the auth'ed user will be updated. If provided, the role of the auth'ed user or api key must be an admin (1) or owner (2) of the organization.
25
25
  attr_accessor :user_id
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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.8.2
6
+ The version of the OpenAPI document: 0.8.5
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0