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,234 @@
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 WhiteLabelingResponse
14
+ attr_accessor :remove_branding
15
+
16
+ attr_accessor :integrations
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'remove_branding' => :'remove_branding',
22
+ :'integrations' => :'integrations'
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
+ :'remove_branding' => :'Boolean',
35
+ :'integrations' => :'Object'
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::WhiteLabelingResponse` 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::WhiteLabelingResponse`. 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?(:'remove_branding')
61
+ self.remove_branding = attributes[:'remove_branding']
62
+ end
63
+
64
+ if attributes.key?(:'integrations')
65
+ self.integrations = attributes[:'integrations']
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
+ invalid_properties = Array.new
73
+ if @remove_branding.nil?
74
+ invalid_properties.push('invalid value for "remove_branding", remove_branding cannot be nil.')
75
+ end
76
+
77
+ if @integrations.nil?
78
+ invalid_properties.push('invalid value for "integrations", integrations cannot be nil.')
79
+ end
80
+
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @remove_branding.nil?
88
+ return false if @integrations.nil?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ remove_branding == o.remove_branding &&
98
+ integrations == o.integrations
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [remove_branding, integrations].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
128
+ self.send("#{key}=", nil)
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = Carbon.const_get(type)
182
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -0,0 +1,252 @@
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 YoutubeTranscriptResponse
14
+ attr_accessor :status
15
+
16
+ attr_accessor :error
17
+
18
+ attr_accessor :data
19
+
20
+ attr_accessor :raw_transcript
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'status' => :'status',
26
+ :'error' => :'error',
27
+ :'data' => :'data',
28
+ :'raw_transcript' => :'raw_transcript'
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
+ :'status' => :'String',
41
+ :'error' => :'String',
42
+ :'data' => :'String',
43
+ :'raw_transcript' => :'Array<Hash<String, RawTranscriptPropertyInnerValue>>'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'error',
51
+ :'data',
52
+ :'raw_transcript'
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::YoutubeTranscriptResponse` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::YoutubeTranscriptResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'status')
72
+ self.status = attributes[:'status']
73
+ end
74
+
75
+ if attributes.key?(:'error')
76
+ self.error = attributes[:'error']
77
+ end
78
+
79
+ if attributes.key?(:'data')
80
+ self.data = attributes[:'data']
81
+ end
82
+
83
+ if attributes.key?(:'raw_transcript')
84
+ if (value = attributes[:'raw_transcript']).is_a?(Array)
85
+ self.raw_transcript = value
86
+ end
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ if @status.nil?
95
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ return false if @status.nil?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ status == o.status &&
114
+ error == o.error &&
115
+ data == o.data &&
116
+ raw_transcript == o.raw_transcript
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [status, error, data, raw_transcript].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ new.build_from_hash(attributes)
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ attributes = attributes.transform_keys(&:to_sym)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
146
+ self.send("#{key}=", nil)
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :Time
168
+ Time.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ # models (e.g. Pet) or oneOf
199
+ klass = Carbon.const_get(type)
200
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+
250
+ end
251
+
252
+ end
@@ -0,0 +1,11 @@
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
+ module Carbon
10
+ VERSION = '0.1.0'
11
+ end
@@ -0,0 +1,207 @@
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 'forwardable'
10
+
11
+ # Common files
12
+ require 'carbon_ruby_sdk/api_client'
13
+ require 'carbon_ruby_sdk/api_error'
14
+ require 'carbon_ruby_sdk/version'
15
+ require 'carbon_ruby_sdk/configuration'
16
+
17
+ # Models
18
+ require 'carbon_ruby_sdk/models/add_webhook_props'
19
+ require 'carbon_ruby_sdk/models/body_create_upload_file_uploadfile_post'
20
+ require 'carbon_ruby_sdk/models/chunk_properties'
21
+ require 'carbon_ruby_sdk/models/chunk_properties_nullable'
22
+ require 'carbon_ruby_sdk/models/chunks_and_embeddings'
23
+ require 'carbon_ruby_sdk/models/chunks_and_embeddings_upload_input'
24
+ require 'carbon_ruby_sdk/models/data_source_last_sync_actions'
25
+ require 'carbon_ruby_sdk/models/data_source_sync_statuses'
26
+ require 'carbon_ruby_sdk/models/data_source_type'
27
+ require 'carbon_ruby_sdk/models/data_source_type_nullable'
28
+ require 'carbon_ruby_sdk/models/delete_files_query_input'
29
+ require 'carbon_ruby_sdk/models/directory_item'
30
+ require 'carbon_ruby_sdk/models/document_response'
31
+ require 'carbon_ruby_sdk/models/document_response_list'
32
+ require 'carbon_ruby_sdk/models/embedding_and_chunk'
33
+ require 'carbon_ruby_sdk/models/embedding_generators'
34
+ require 'carbon_ruby_sdk/models/embedding_generators_nullable'
35
+ require 'carbon_ruby_sdk/models/embedding_properties'
36
+ require 'carbon_ruby_sdk/models/embeddings_and_chunks_filters'
37
+ require 'carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns'
38
+ require 'carbon_ruby_sdk/models/embeddings_and_chunks_query_input'
39
+ require 'carbon_ruby_sdk/models/embeddings_and_chunks_response'
40
+ require 'carbon_ruby_sdk/models/external_file_sync_statuses'
41
+ require 'carbon_ruby_sdk/models/external_source_item'
42
+ require 'carbon_ruby_sdk/models/fetch_urls_response'
43
+ require 'carbon_ruby_sdk/models/file_content_types'
44
+ require 'carbon_ruby_sdk/models/file_content_types_nullable'
45
+ require 'carbon_ruby_sdk/models/file_formats'
46
+ require 'carbon_ruby_sdk/models/file_formats_nullable'
47
+ require 'carbon_ruby_sdk/models/file_statistics'
48
+ require 'carbon_ruby_sdk/models/file_statistics_nullable'
49
+ require 'carbon_ruby_sdk/models/fresh_desk_connect_request'
50
+ require 'carbon_ruby_sdk/models/generic_success_response'
51
+ require 'carbon_ruby_sdk/models/get_embedding_documents_body'
52
+ require 'carbon_ruby_sdk/models/gitbook_connect_request'
53
+ require 'carbon_ruby_sdk/models/gitbook_sync_request'
54
+ require 'carbon_ruby_sdk/models/gmail_sync_input'
55
+ require 'carbon_ruby_sdk/models/http_validation_error'
56
+ require 'carbon_ruby_sdk/models/hybrid_search_tuning_params'
57
+ require 'carbon_ruby_sdk/models/hybrid_search_tuning_params_nullable'
58
+ require 'carbon_ruby_sdk/models/list_data_source_items_request'
59
+ require 'carbon_ruby_sdk/models/list_data_source_items_response'
60
+ require 'carbon_ruby_sdk/models/list_request'
61
+ require 'carbon_ruby_sdk/models/list_response'
62
+ require 'carbon_ruby_sdk/models/location_property_inner'
63
+ require 'carbon_ruby_sdk/models/modify_user_configuration_input'
64
+ require 'carbon_ruby_sdk/models/o_auth_url_request'
65
+ require 'carbon_ruby_sdk/models/order_dir'
66
+ require 'carbon_ruby_sdk/models/organization_response'
67
+ require 'carbon_ruby_sdk/models/organization_user_data_source_api'
68
+ require 'carbon_ruby_sdk/models/organization_user_data_source_filters'
69
+ require 'carbon_ruby_sdk/models/organization_user_data_source_order_by_columns'
70
+ require 'carbon_ruby_sdk/models/organization_user_data_source_query_input'
71
+ require 'carbon_ruby_sdk/models/organization_user_data_source_response'
72
+ require 'carbon_ruby_sdk/models/organization_user_file_tag_create'
73
+ require 'carbon_ruby_sdk/models/organization_user_file_tags_remove'
74
+ require 'carbon_ruby_sdk/models/organization_user_files_to_sync_filters'
75
+ require 'carbon_ruby_sdk/models/organization_user_files_to_sync_order_by_types'
76
+ require 'carbon_ruby_sdk/models/organization_user_files_to_sync_query_input'
77
+ require 'carbon_ruby_sdk/models/outlook_sync_input'
78
+ require 'carbon_ruby_sdk/models/pagination'
79
+ require 'carbon_ruby_sdk/models/presigned_url_response'
80
+ require 'carbon_ruby_sdk/models/rss_feed_input'
81
+ require 'carbon_ruby_sdk/models/rank_property'
82
+ require 'carbon_ruby_sdk/models/raw_text_input'
83
+ require 'carbon_ruby_sdk/models/raw_transcript_property_inner_value'
84
+ require 'carbon_ruby_sdk/models/resync_file_query_input'
85
+ require 'carbon_ruby_sdk/models/revoke_access_token_input'
86
+ require 'carbon_ruby_sdk/models/s3_auth_request'
87
+ require 'carbon_ruby_sdk/models/s3_file_sync_input'
88
+ require 'carbon_ruby_sdk/models/s3_get_file_input'
89
+ require 'carbon_ruby_sdk/models/single_chunks_and_embeddings_upload_input'
90
+ require 'carbon_ruby_sdk/models/sitemap_scrape_request'
91
+ require 'carbon_ruby_sdk/models/source_property'
92
+ require 'carbon_ruby_sdk/models/sync_directory_request'
93
+ require 'carbon_ruby_sdk/models/sync_files_request'
94
+ require 'carbon_ruby_sdk/models/tags'
95
+ require 'carbon_ruby_sdk/models/tags1'
96
+ require 'carbon_ruby_sdk/models/text_embedding_generators'
97
+ require 'carbon_ruby_sdk/models/token_response'
98
+ require 'carbon_ruby_sdk/models/upload_file_from_url_input'
99
+ require 'carbon_ruby_sdk/models/user_file'
100
+ require 'carbon_ruby_sdk/models/user_files_v2'
101
+ require 'carbon_ruby_sdk/models/user_request_content'
102
+ require 'carbon_ruby_sdk/models/user_response'
103
+ require 'carbon_ruby_sdk/models/validation_error'
104
+ require 'carbon_ruby_sdk/models/webhook'
105
+ require 'carbon_ruby_sdk/models/webhook_filters'
106
+ require 'carbon_ruby_sdk/models/webhook_no_key'
107
+ require 'carbon_ruby_sdk/models/webhook_order_by_columns'
108
+ require 'carbon_ruby_sdk/models/webhook_query_input'
109
+ require 'carbon_ruby_sdk/models/webhook_query_response'
110
+ require 'carbon_ruby_sdk/models/webscrape_request'
111
+ require 'carbon_ruby_sdk/models/white_labeling_response'
112
+ require 'carbon_ruby_sdk/models/youtube_transcript_response'
113
+
114
+ # APIs
115
+ require 'carbon_ruby_sdk/api/auth_api'
116
+ require 'carbon_ruby_sdk/api/data_sources_api'
117
+ require 'carbon_ruby_sdk/api/embeddings_api'
118
+ require 'carbon_ruby_sdk/api/files_api'
119
+ require 'carbon_ruby_sdk/api/health_api'
120
+ require 'carbon_ruby_sdk/api/integrations_api'
121
+ require 'carbon_ruby_sdk/api/organizations_api'
122
+ require 'carbon_ruby_sdk/api/users_api'
123
+ require 'carbon_ruby_sdk/api/utilities_api'
124
+ require 'carbon_ruby_sdk/api/webhooks_api'
125
+
126
+ module Carbon
127
+ @config = Configuration.default
128
+ SENTINEL = Object.new
129
+ class << self
130
+
131
+ private def is_sentinel(value)
132
+ value == SENTINEL
133
+ end
134
+
135
+ def host
136
+ @config.host
137
+ end
138
+
139
+ def host=(value)
140
+ @config.host = value
141
+ end
142
+ # api key from OpenAPI spec
143
+ def access_token
144
+ @config.access_token
145
+ end
146
+
147
+ def access_token=(value)
148
+ @config.access_token = value
149
+ end
150
+ # api key from OpenAPI spec
151
+ def api_key
152
+ @config.api_key
153
+ end
154
+
155
+ def api_key=(value)
156
+ @config.api_key = value
157
+ end
158
+ # api key from OpenAPI spec
159
+ def customer_id
160
+ @config.customer_id
161
+ end
162
+
163
+ def customer_id=(value)
164
+ @config.customer_id = value
165
+ end
166
+
167
+ # Customize default settings for the SDK using block.
168
+ # Carbon.configure do |config|
169
+ # config.host = "http://example.com"
170
+ # end
171
+ # If no block given, return the default Configuration object.
172
+ def configure
173
+ if block_given?
174
+ yield(Configuration.default)
175
+ else
176
+ Configuration.default
177
+ end
178
+ end
179
+ end
180
+
181
+ class Client
182
+ attr_reader :auth
183
+ attr_reader :data_sources
184
+ attr_reader :embeddings
185
+ attr_reader :files
186
+ attr_reader :health
187
+ attr_reader :integrations
188
+ attr_reader :organizations
189
+ attr_reader :users
190
+ attr_reader :utilities
191
+ attr_reader :webhooks
192
+
193
+ def initialize(config = Configuration.default)
194
+ @api_client = ApiClient::new(config)
195
+ @auth = Carbon::AuthApi.new(@api_client)
196
+ @data_sources = Carbon::DataSourcesApi.new(@api_client)
197
+ @embeddings = Carbon::EmbeddingsApi.new(@api_client)
198
+ @files = Carbon::FilesApi.new(@api_client)
199
+ @health = Carbon::HealthApi.new(@api_client)
200
+ @integrations = Carbon::IntegrationsApi.new(@api_client)
201
+ @organizations = Carbon::OrganizationsApi.new(@api_client)
202
+ @users = Carbon::UsersApi.new(@api_client)
203
+ @utilities = Carbon::UtilitiesApi.new(@api_client)
204
+ @webhooks = Carbon::WebhooksApi.new(@api_client)
205
+ end
206
+ end
207
+ end