carbon_ruby_sdk 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +11 -0
  3. data/Gemfile.lock +89 -0
  4. data/README.md +2325 -0
  5. data/Rakefile +10 -0
  6. data/carbon_ruby_sdk.gemspec +39 -0
  7. data/header.png +0 -0
  8. data/lib/carbon_ruby_sdk/api/auth_api.rb +177 -0
  9. data/lib/carbon_ruby_sdk/api/data_sources_api.rb +217 -0
  10. data/lib/carbon_ruby_sdk/api/embeddings_api.rb +565 -0
  11. data/lib/carbon_ruby_sdk/api/files_api.rb +1526 -0
  12. data/lib/carbon_ruby_sdk/api/health_api.rb +92 -0
  13. data/lib/carbon_ruby_sdk/api/integrations_api.rb +2201 -0
  14. data/lib/carbon_ruby_sdk/api/organizations_api.rb +92 -0
  15. data/lib/carbon_ruby_sdk/api/users_api.rb +209 -0
  16. data/lib/carbon_ruby_sdk/api/utilities_api.rb +710 -0
  17. data/lib/carbon_ruby_sdk/api/webhooks_api.rb +296 -0
  18. data/lib/carbon_ruby_sdk/api_client.rb +436 -0
  19. data/lib/carbon_ruby_sdk/api_client_custom.rb +14 -0
  20. data/lib/carbon_ruby_sdk/api_error.rb +53 -0
  21. data/lib/carbon_ruby_sdk/configuration.rb +354 -0
  22. data/lib/carbon_ruby_sdk/models/add_webhook_props.rb +220 -0
  23. data/lib/carbon_ruby_sdk/models/body_create_upload_file_uploadfile_post.rb +220 -0
  24. data/lib/carbon_ruby_sdk/models/chunk_properties.rb +248 -0
  25. data/lib/carbon_ruby_sdk/models/chunk_properties_nullable.rb +248 -0
  26. data/lib/carbon_ruby_sdk/models/chunks_and_embeddings.rb +246 -0
  27. data/lib/carbon_ruby_sdk/models/chunks_and_embeddings_upload_input.rb +247 -0
  28. data/lib/carbon_ruby_sdk/models/data_source_last_sync_actions.rb +38 -0
  29. data/lib/carbon_ruby_sdk/models/data_source_sync_statuses.rb +38 -0
  30. data/lib/carbon_ruby_sdk/models/data_source_type.rb +76 -0
  31. data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +76 -0
  32. data/lib/carbon_ruby_sdk/models/delete_files_query_input.rb +252 -0
  33. data/lib/carbon_ruby_sdk/models/directory_item.rb +266 -0
  34. data/lib/carbon_ruby_sdk/models/document_response.rb +328 -0
  35. data/lib/carbon_ruby_sdk/models/document_response_list.rb +222 -0
  36. data/lib/carbon_ruby_sdk/models/embedding_and_chunk.rb +256 -0
  37. data/lib/carbon_ruby_sdk/models/embedding_generators.rb +43 -0
  38. data/lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb +43 -0
  39. data/lib/carbon_ruby_sdk/models/embedding_properties.rb +226 -0
  40. data/lib/carbon_ruby_sdk/models/embeddings_and_chunks_filters.rb +232 -0
  41. data/lib/carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns.rb +37 -0
  42. data/lib/carbon_ruby_sdk/models/embeddings_and_chunks_query_input.rb +262 -0
  43. data/lib/carbon_ruby_sdk/models/embeddings_and_chunks_response.rb +236 -0
  44. data/lib/carbon_ruby_sdk/models/external_file_sync_statuses.rb +43 -0
  45. data/lib/carbon_ruby_sdk/models/external_source_item.rb +420 -0
  46. data/lib/carbon_ruby_sdk/models/fetch_urls_response.rb +236 -0
  47. data/lib/carbon_ruby_sdk/models/file_content_types.rb +36 -0
  48. data/lib/carbon_ruby_sdk/models/file_content_types_nullable.rb +36 -0
  49. data/lib/carbon_ruby_sdk/models/file_formats.rb +76 -0
  50. data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +76 -0
  51. data/lib/carbon_ruby_sdk/models/file_statistics.rb +256 -0
  52. data/lib/carbon_ruby_sdk/models/file_statistics_nullable.rb +256 -0
  53. data/lib/carbon_ruby_sdk/models/fresh_desk_connect_request.rb +316 -0
  54. data/lib/carbon_ruby_sdk/models/generic_success_response.rb +220 -0
  55. data/lib/carbon_ruby_sdk/models/get_embedding_documents_body.rb +416 -0
  56. data/lib/carbon_ruby_sdk/models/gitbook_connect_request.rb +234 -0
  57. data/lib/carbon_ruby_sdk/models/gitbook_sync_request.rb +336 -0
  58. data/lib/carbon_ruby_sdk/models/gmail_sync_input.rb +301 -0
  59. data/lib/carbon_ruby_sdk/models/http_validation_error.rb +217 -0
  60. data/lib/carbon_ruby_sdk/models/hybrid_search_tuning_params.rb +234 -0
  61. data/lib/carbon_ruby_sdk/models/hybrid_search_tuning_params_nullable.rb +235 -0
  62. data/lib/carbon_ruby_sdk/models/list_data_source_items_request.rb +239 -0
  63. data/lib/carbon_ruby_sdk/models/list_data_source_items_response.rb +236 -0
  64. data/lib/carbon_ruby_sdk/models/list_request.rb +230 -0
  65. data/lib/carbon_ruby_sdk/models/list_response.rb +222 -0
  66. data/lib/carbon_ruby_sdk/models/location_property_inner.rb +226 -0
  67. data/lib/carbon_ruby_sdk/models/modify_user_configuration_input.rb +234 -0
  68. data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +362 -0
  69. data/lib/carbon_ruby_sdk/models/order_dir.rb +36 -0
  70. data/lib/carbon_ruby_sdk/models/organization_response.rb +362 -0
  71. data/lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb +380 -0
  72. data/lib/carbon_ruby_sdk/models/organization_user_data_source_filters.rb +238 -0
  73. data/lib/carbon_ruby_sdk/models/organization_user_data_source_order_by_columns.rb +36 -0
  74. data/lib/carbon_ruby_sdk/models/organization_user_data_source_query_input.rb +246 -0
  75. data/lib/carbon_ruby_sdk/models/organization_user_data_source_response.rb +236 -0
  76. data/lib/carbon_ruby_sdk/models/organization_user_file_tag_create.rb +236 -0
  77. data/lib/carbon_ruby_sdk/models/organization_user_file_tags_remove.rb +236 -0
  78. data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb +330 -0
  79. data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_order_by_types.rb +39 -0
  80. data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_query_input.rb +276 -0
  81. data/lib/carbon_ruby_sdk/models/outlook_sync_input.rb +313 -0
  82. data/lib/carbon_ruby_sdk/models/pagination.rb +228 -0
  83. data/lib/carbon_ruby_sdk/models/presigned_url_response.rb +220 -0
  84. data/lib/carbon_ruby_sdk/models/rank_property.rb +226 -0
  85. data/lib/carbon_ruby_sdk/models/raw_text_input.rb +295 -0
  86. data/lib/carbon_ruby_sdk/models/raw_transcript_property_inner_value.rb +226 -0
  87. data/lib/carbon_ruby_sdk/models/resync_file_query_input.rb +240 -0
  88. data/lib/carbon_ruby_sdk/models/revoke_access_token_input.rb +220 -0
  89. data/lib/carbon_ruby_sdk/models/rss_feed_input.rb +301 -0
  90. data/lib/carbon_ruby_sdk/models/s3_auth_request.rb +234 -0
  91. data/lib/carbon_ruby_sdk/models/s3_file_sync_input.rb +313 -0
  92. data/lib/carbon_ruby_sdk/models/s3_get_file_input.rb +226 -0
  93. data/lib/carbon_ruby_sdk/models/single_chunks_and_embeddings_upload_input.rb +256 -0
  94. data/lib/carbon_ruby_sdk/models/sitemap_scrape_request.rb +361 -0
  95. data/lib/carbon_ruby_sdk/models/source_property.rb +226 -0
  96. data/lib/carbon_ruby_sdk/models/sync_directory_request.rb +220 -0
  97. data/lib/carbon_ruby_sdk/models/sync_files_request.rb +328 -0
  98. data/lib/carbon_ruby_sdk/models/tags.rb +232 -0
  99. data/lib/carbon_ruby_sdk/models/tags1.rb +230 -0
  100. data/lib/carbon_ruby_sdk/models/text_embedding_generators.rb +42 -0
  101. data/lib/carbon_ruby_sdk/models/token_response.rb +234 -0
  102. data/lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb +326 -0
  103. data/lib/carbon_ruby_sdk/models/user_file.rb +524 -0
  104. data/lib/carbon_ruby_sdk/models/user_files_v2.rb +236 -0
  105. data/lib/carbon_ruby_sdk/models/user_request_content.rb +220 -0
  106. data/lib/carbon_ruby_sdk/models/user_response.rb +354 -0
  107. data/lib/carbon_ruby_sdk/models/validation_error.rb +250 -0
  108. data/lib/carbon_ruby_sdk/models/webhook.rb +290 -0
  109. data/lib/carbon_ruby_sdk/models/webhook_filters.rb +218 -0
  110. data/lib/carbon_ruby_sdk/models/webhook_no_key.rb +276 -0
  111. data/lib/carbon_ruby_sdk/models/webhook_order_by_columns.rb +36 -0
  112. data/lib/carbon_ruby_sdk/models/webhook_query_input.rb +246 -0
  113. data/lib/carbon_ruby_sdk/models/webhook_query_response.rb +236 -0
  114. data/lib/carbon_ruby_sdk/models/webscrape_request.rb +375 -0
  115. data/lib/carbon_ruby_sdk/models/white_labeling_response.rb +234 -0
  116. data/lib/carbon_ruby_sdk/models/youtube_transcript_response.rb +252 -0
  117. data/lib/carbon_ruby_sdk/version.rb +11 -0
  118. data/lib/carbon_ruby_sdk.rb +207 -0
  119. data/spec/api/auth_api_spec.rb +50 -0
  120. data/spec/api/data_sources_api_spec.rb +51 -0
  121. data/spec/api/embeddings_api_spec.rb +63 -0
  122. data/spec/api/files_api_spec.rb +178 -0
  123. data/spec/api/health_api_spec.rb +39 -0
  124. data/spec/api/integrations_api_spec.rb +226 -0
  125. data/spec/api/organizations_api_spec.rb +39 -0
  126. data/spec/api/users_api_spec.rb +51 -0
  127. data/spec/api/utilities_api_spec.rb +102 -0
  128. data/spec/api/webhooks_api_spec.rb +62 -0
  129. data/spec/api_client_spec.rb +191 -0
  130. data/spec/configuration_spec.rb +38 -0
  131. data/spec/getting_started_spec.rb +196 -0
  132. data/spec/models/add_webhook_props_spec.rb +28 -0
  133. data/spec/models/body_create_upload_file_uploadfile_post_spec.rb +28 -0
  134. data/spec/models/chunk_properties_nullable_spec.rb +40 -0
  135. data/spec/models/chunk_properties_spec.rb +40 -0
  136. data/spec/models/chunks_and_embeddings_spec.rb +40 -0
  137. data/spec/models/chunks_and_embeddings_upload_input_spec.rb +40 -0
  138. data/spec/models/data_source_last_sync_actions_spec.rb +22 -0
  139. data/spec/models/data_source_sync_statuses_spec.rb +22 -0
  140. data/spec/models/data_source_type_nullable_spec.rb +22 -0
  141. data/spec/models/data_source_type_spec.rb +22 -0
  142. data/spec/models/delete_files_query_input_spec.rb +46 -0
  143. data/spec/models/directory_item_spec.rb +46 -0
  144. data/spec/models/document_response_list_spec.rb +28 -0
  145. data/spec/models/document_response_spec.rb +88 -0
  146. data/spec/models/embedding_and_chunk_spec.rb +46 -0
  147. data/spec/models/embedding_generators_nullable_spec.rb +22 -0
  148. data/spec/models/embedding_generators_spec.rb +22 -0
  149. data/spec/models/embedding_properties_spec.rb +34 -0
  150. data/spec/models/embeddings_and_chunks_filters_spec.rb +34 -0
  151. data/spec/models/embeddings_and_chunks_order_by_columns_spec.rb +22 -0
  152. data/spec/models/embeddings_and_chunks_query_input_spec.rb +52 -0
  153. data/spec/models/embeddings_and_chunks_response_spec.rb +34 -0
  154. data/spec/models/external_file_sync_statuses_spec.rb +22 -0
  155. data/spec/models/external_source_item_spec.rb +124 -0
  156. data/spec/models/fetch_urls_response_spec.rb +34 -0
  157. data/spec/models/file_content_types_nullable_spec.rb +22 -0
  158. data/spec/models/file_content_types_spec.rb +22 -0
  159. data/spec/models/file_formats_nullable_spec.rb +22 -0
  160. data/spec/models/file_formats_spec.rb +22 -0
  161. data/spec/models/file_statistics_nullable_spec.rb +52 -0
  162. data/spec/models/file_statistics_spec.rb +52 -0
  163. data/spec/models/fresh_desk_connect_request_spec.rb +76 -0
  164. data/spec/models/generic_success_response_spec.rb +28 -0
  165. data/spec/models/get_embedding_documents_body_spec.rb +106 -0
  166. data/spec/models/gitbook_connect_request_spec.rb +34 -0
  167. data/spec/models/gitbook_sync_request_spec.rb +76 -0
  168. data/spec/models/gmail_sync_input_spec.rb +70 -0
  169. data/spec/models/http_validation_error_spec.rb +28 -0
  170. data/spec/models/hybrid_search_tuning_params_nullable_spec.rb +34 -0
  171. data/spec/models/hybrid_search_tuning_params_spec.rb +34 -0
  172. data/spec/models/list_data_source_items_request_spec.rb +40 -0
  173. data/spec/models/list_data_source_items_response_spec.rb +34 -0
  174. data/spec/models/list_request_spec.rb +34 -0
  175. data/spec/models/list_response_spec.rb +28 -0
  176. data/spec/models/location_property_inner_spec.rb +22 -0
  177. data/spec/models/modify_user_configuration_input_spec.rb +34 -0
  178. data/spec/models/o_auth_url_request_spec.rb +106 -0
  179. data/spec/models/order_dir_spec.rb +22 -0
  180. data/spec/models/organization_response_spec.rb +94 -0
  181. data/spec/models/organization_user_data_source_api_spec.rb +100 -0
  182. data/spec/models/organization_user_data_source_filters_spec.rb +40 -0
  183. data/spec/models/organization_user_data_source_order_by_columns_spec.rb +22 -0
  184. data/spec/models/organization_user_data_source_query_input_spec.rb +46 -0
  185. data/spec/models/organization_user_data_source_response_spec.rb +34 -0
  186. data/spec/models/organization_user_file_tag_create_spec.rb +34 -0
  187. data/spec/models/organization_user_file_tags_remove_spec.rb +34 -0
  188. data/spec/models/organization_user_files_to_sync_filters_spec.rb +88 -0
  189. data/spec/models/organization_user_files_to_sync_order_by_types_spec.rb +22 -0
  190. data/spec/models/organization_user_files_to_sync_query_input_spec.rb +64 -0
  191. data/spec/models/outlook_sync_input_spec.rb +76 -0
  192. data/spec/models/pagination_spec.rb +34 -0
  193. data/spec/models/presigned_url_response_spec.rb +28 -0
  194. data/spec/models/rank_property_spec.rb +22 -0
  195. data/spec/models/raw_text_input_spec.rb +70 -0
  196. data/spec/models/raw_transcript_property_inner_value_spec.rb +22 -0
  197. data/spec/models/resync_file_query_input_spec.rb +40 -0
  198. data/spec/models/revoke_access_token_input_spec.rb +28 -0
  199. data/spec/models/rss_feed_input_spec.rb +70 -0
  200. data/spec/models/s3_auth_request_spec.rb +34 -0
  201. data/spec/models/s3_file_sync_input_spec.rb +76 -0
  202. data/spec/models/s3_get_file_input_spec.rb +34 -0
  203. data/spec/models/single_chunks_and_embeddings_upload_input_spec.rb +46 -0
  204. data/spec/models/sitemap_scrape_request_spec.rb +100 -0
  205. data/spec/models/source_property_spec.rb +22 -0
  206. data/spec/models/sync_directory_request_spec.rb +28 -0
  207. data/spec/models/sync_files_request_spec.rb +82 -0
  208. data/spec/models/tags1_spec.rb +22 -0
  209. data/spec/models/tags_spec.rb +22 -0
  210. data/spec/models/text_embedding_generators_spec.rb +22 -0
  211. data/spec/models/token_response_spec.rb +34 -0
  212. data/spec/models/upload_file_from_url_input_spec.rb +88 -0
  213. data/spec/models/user_file_spec.rb +190 -0
  214. data/spec/models/user_files_v2_spec.rb +34 -0
  215. data/spec/models/user_request_content_spec.rb +28 -0
  216. data/spec/models/user_response_spec.rb +88 -0
  217. data/spec/models/validation_error_spec.rb +40 -0
  218. data/spec/models/webhook_filters_spec.rb +28 -0
  219. data/spec/models/webhook_no_key_spec.rb +52 -0
  220. data/spec/models/webhook_order_by_columns_spec.rb +22 -0
  221. data/spec/models/webhook_query_input_spec.rb +46 -0
  222. data/spec/models/webhook_query_response_spec.rb +34 -0
  223. data/spec/models/webhook_spec.rb +58 -0
  224. data/spec/models/webscrape_request_spec.rb +106 -0
  225. data/spec/models/white_labeling_response_spec.rb +34 -0
  226. data/spec/models/youtube_transcript_response_spec.rb +46 -0
  227. data/spec/spec_helper.rb +107 -0
  228. metadata +440 -0
@@ -0,0 +1,236 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Carbon
13
+ class OrganizationUserFileTagsRemove
14
+ attr_accessor :tags
15
+
16
+ attr_accessor :organization_user_file_id
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'tags' => :'tags',
22
+ :'organization_user_file_id' => :'organization_user_file_id'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'tags' => :'Array<String>',
35
+ :'organization_user_file_id' => :'Integer'
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 `Carbon::OrganizationUserFileTagsRemove` 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 `Carbon::OrganizationUserFileTagsRemove`. 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?(:'tags')
61
+ if (value = attributes[:'tags']).is_a?(Array)
62
+ self.tags = value
63
+ end
64
+ end
65
+
66
+ if attributes.key?(:'organization_user_file_id')
67
+ self.organization_user_file_id = attributes[:'organization_user_file_id']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ if @tags.nil?
76
+ invalid_properties.push('invalid value for "tags", tags cannot be nil.')
77
+ end
78
+
79
+ if @organization_user_file_id.nil?
80
+ invalid_properties.push('invalid value for "organization_user_file_id", organization_user_file_id cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if @tags.nil?
90
+ return false if @organization_user_file_id.nil?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ tags == o.tags &&
100
+ organization_user_file_id == o.organization_user_file_id
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [tags, organization_user_file_id].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ new.build_from_hash(attributes)
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ attributes = attributes.transform_keys(&:to_sym)
128
+ self.class.openapi_types.each_pair do |key, type|
129
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
130
+ self.send("#{key}=", nil)
131
+ elsif type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :Time
152
+ Time.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ # models (e.g. Pet) or oneOf
183
+ klass = Carbon.const_get(type)
184
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+
234
+ end
235
+
236
+ end
@@ -0,0 +1,330 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Carbon
13
+ class OrganizationUserFilesToSyncFilters
14
+ attr_accessor :tags
15
+
16
+ attr_accessor :source
17
+
18
+ attr_accessor :name
19
+
20
+ attr_accessor :tags_v2
21
+
22
+ attr_accessor :ids
23
+
24
+ attr_accessor :external_file_ids
25
+
26
+ attr_accessor :sync_statuses
27
+
28
+ attr_accessor :parent_file_ids
29
+
30
+ attr_accessor :organization_user_data_source_id
31
+
32
+ attr_accessor :embedding_generators
33
+
34
+ attr_accessor :root_files_only
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'tags' => :'tags',
40
+ :'source' => :'source',
41
+ :'name' => :'name',
42
+ :'tags_v2' => :'tags_v2',
43
+ :'ids' => :'ids',
44
+ :'external_file_ids' => :'external_file_ids',
45
+ :'sync_statuses' => :'sync_statuses',
46
+ :'parent_file_ids' => :'parent_file_ids',
47
+ :'organization_user_data_source_id' => :'organization_user_data_source_id',
48
+ :'embedding_generators' => :'embedding_generators',
49
+ :'root_files_only' => :'root_files_only'
50
+ }
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'tags' => :'Hash<String, Tags1>',
62
+ :'source' => :'SourceProperty',
63
+ :'name' => :'String',
64
+ :'tags_v2' => :'Object',
65
+ :'ids' => :'Array<Integer>',
66
+ :'external_file_ids' => :'Array<String>',
67
+ :'sync_statuses' => :'Array<ExternalFileSyncStatuses>',
68
+ :'parent_file_ids' => :'Array<Integer>',
69
+ :'organization_user_data_source_id' => :'Array<Integer>',
70
+ :'embedding_generators' => :'Array<EmbeddingGenerators>',
71
+ :'root_files_only' => :'Boolean'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ :'tags',
79
+ :'source',
80
+ :'name',
81
+ :'tags_v2',
82
+ :'ids',
83
+ :'external_file_ids',
84
+ :'sync_statuses',
85
+ :'parent_file_ids',
86
+ :'organization_user_data_source_id',
87
+ :'embedding_generators',
88
+ :'root_files_only'
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::OrganizationUserFilesToSyncFilters` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::OrganizationUserFilesToSyncFilters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'tags')
108
+ if (value = attributes[:'tags']).is_a?(Hash)
109
+ self.tags = value
110
+ end
111
+ end
112
+
113
+ if attributes.key?(:'source')
114
+ self.source = attributes[:'source']
115
+ end
116
+
117
+ if attributes.key?(:'name')
118
+ self.name = attributes[:'name']
119
+ end
120
+
121
+ if attributes.key?(:'tags_v2')
122
+ self.tags_v2 = attributes[:'tags_v2']
123
+ end
124
+
125
+ if attributes.key?(:'ids')
126
+ if (value = attributes[:'ids']).is_a?(Array)
127
+ self.ids = value
128
+ end
129
+ end
130
+
131
+ if attributes.key?(:'external_file_ids')
132
+ if (value = attributes[:'external_file_ids']).is_a?(Array)
133
+ self.external_file_ids = value
134
+ end
135
+ end
136
+
137
+ if attributes.key?(:'sync_statuses')
138
+ if (value = attributes[:'sync_statuses']).is_a?(Array)
139
+ self.sync_statuses = value
140
+ end
141
+ end
142
+
143
+ if attributes.key?(:'parent_file_ids')
144
+ if (value = attributes[:'parent_file_ids']).is_a?(Array)
145
+ self.parent_file_ids = value
146
+ end
147
+ end
148
+
149
+ if attributes.key?(:'organization_user_data_source_id')
150
+ if (value = attributes[:'organization_user_data_source_id']).is_a?(Array)
151
+ self.organization_user_data_source_id = value
152
+ end
153
+ end
154
+
155
+ if attributes.key?(:'embedding_generators')
156
+ if (value = attributes[:'embedding_generators']).is_a?(Array)
157
+ self.embedding_generators = value
158
+ end
159
+ end
160
+
161
+ if attributes.key?(:'root_files_only')
162
+ self.root_files_only = attributes[:'root_files_only']
163
+ end
164
+ end
165
+
166
+ # Show invalid properties with the reasons. Usually used together with valid?
167
+ # @return Array for valid properties with the reasons
168
+ def list_invalid_properties
169
+ invalid_properties = Array.new
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ true
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ tags == o.tags &&
185
+ source == o.source &&
186
+ name == o.name &&
187
+ tags_v2 == o.tags_v2 &&
188
+ ids == o.ids &&
189
+ external_file_ids == o.external_file_ids &&
190
+ sync_statuses == o.sync_statuses &&
191
+ parent_file_ids == o.parent_file_ids &&
192
+ organization_user_data_source_id == o.organization_user_data_source_id &&
193
+ embedding_generators == o.embedding_generators &&
194
+ root_files_only == o.root_files_only
195
+ end
196
+
197
+ # @see the `==` method
198
+ # @param [Object] Object to be compared
199
+ def eql?(o)
200
+ self == o
201
+ end
202
+
203
+ # Calculates hash code according to all attributes.
204
+ # @return [Integer] Hash code
205
+ def hash
206
+ [tags, source, name, tags_v2, ids, external_file_ids, sync_statuses, parent_file_ids, organization_user_data_source_id, embedding_generators, root_files_only].hash
207
+ end
208
+
209
+ # Builds the object from hash
210
+ # @param [Hash] attributes Model attributes in the form of hash
211
+ # @return [Object] Returns the model itself
212
+ def self.build_from_hash(attributes)
213
+ new.build_from_hash(attributes)
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def build_from_hash(attributes)
220
+ return nil unless attributes.is_a?(Hash)
221
+ attributes = attributes.transform_keys(&:to_sym)
222
+ self.class.openapi_types.each_pair do |key, type|
223
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
224
+ self.send("#{key}=", nil)
225
+ elsif type =~ /\AArray<(.*)>/i
226
+ # check to ensure the input is an array given that the attribute
227
+ # is documented as an array but the input is not
228
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
229
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
230
+ end
231
+ elsif !attributes[self.class.attribute_map[key]].nil?
232
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
233
+ end
234
+ end
235
+
236
+ self
237
+ end
238
+
239
+ # Deserializes the data based on type
240
+ # @param string type Data type
241
+ # @param string value Value to be deserialized
242
+ # @return [Object] Deserialized data
243
+ def _deserialize(type, value)
244
+ case type.to_sym
245
+ when :Time
246
+ Time.parse(value)
247
+ when :Date
248
+ Date.parse(value)
249
+ when :String
250
+ value.to_s
251
+ when :Integer
252
+ value.to_i
253
+ when :Float
254
+ value.to_f
255
+ when :Boolean
256
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
257
+ true
258
+ else
259
+ false
260
+ end
261
+ when :Object
262
+ # generic object (usually a Hash), return directly
263
+ value
264
+ when /\AArray<(?<inner_type>.+)>\z/
265
+ inner_type = Regexp.last_match[:inner_type]
266
+ value.map { |v| _deserialize(inner_type, v) }
267
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
268
+ k_type = Regexp.last_match[:k_type]
269
+ v_type = Regexp.last_match[:v_type]
270
+ {}.tap do |hash|
271
+ value.each do |k, v|
272
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
273
+ end
274
+ end
275
+ else # model
276
+ # models (e.g. Pet) or oneOf
277
+ klass = Carbon.const_get(type)
278
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
279
+ end
280
+ end
281
+
282
+ # Returns the string representation of the object
283
+ # @return [String] String presentation of the object
284
+ def to_s
285
+ to_hash.to_s
286
+ end
287
+
288
+ # to_body is an alias to to_hash (backward compatibility)
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_body
291
+ to_hash
292
+ end
293
+
294
+ # Returns the object in the form of hash
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_hash
297
+ hash = {}
298
+ self.class.attribute_map.each_pair do |attr, param|
299
+ value = self.send(attr)
300
+ if value.nil?
301
+ is_nullable = self.class.openapi_nullable.include?(attr)
302
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
303
+ end
304
+
305
+ hash[param] = _to_hash(value)
306
+ end
307
+ hash
308
+ end
309
+
310
+ # Outputs non-array value in the form of hash
311
+ # For object, use to_hash. Otherwise, just return the value
312
+ # @param [Object] value Any valid value
313
+ # @return [Hash] Returns the value in the form of hash
314
+ def _to_hash(value)
315
+ if value.is_a?(Array)
316
+ value.compact.map { |v| _to_hash(v) }
317
+ elsif value.is_a?(Hash)
318
+ {}.tap do |hash|
319
+ value.each { |k, v| hash[k] = _to_hash(v) }
320
+ end
321
+ elsif value.respond_to? :to_hash
322
+ value.to_hash
323
+ else
324
+ value
325
+ end
326
+ end
327
+
328
+ end
329
+
330
+ end
@@ -0,0 +1,39 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Carbon
13
+ class OrganizationUserFilesToSyncOrderByTypes
14
+ CREATED_AT = "created_at".freeze
15
+ UPDATED_AT = "updated_at".freeze
16
+ NAME = "name".freeze
17
+ LAST_SYNC = "last_sync".freeze
18
+ FILE_SIZE = "file_size".freeze
19
+
20
+ def self.all_vars
21
+ @all_vars ||= [CREATED_AT, UPDATED_AT, NAME, LAST_SYNC, FILE_SIZE].freeze
22
+ end
23
+
24
+ # Builds the enum from string
25
+ # @param [String] The enum value in the form of the string
26
+ # @return [String] The enum value
27
+ def self.build_from_hash(value)
28
+ new.build_from_hash(value)
29
+ end
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ return value if OrganizationUserFilesToSyncOrderByTypes.all_vars.include?(value)
36
+ raise "Invalid ENUM value #{value} for class #OrganizationUserFilesToSyncOrderByTypes"
37
+ end
38
+ end
39
+ end