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,76 @@
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 DataSourceTypeNullable
14
+ GOOGLE_DRIVE = "GOOGLE_DRIVE".freeze
15
+ NOTION = "NOTION".freeze
16
+ NOTION_DATABASE = "NOTION_DATABASE".freeze
17
+ INTERCOM = "INTERCOM".freeze
18
+ DROPBOX = "DROPBOX".freeze
19
+ ONEDRIVE = "ONEDRIVE".freeze
20
+ SHAREPOINT = "SHAREPOINT".freeze
21
+ CONFLUENCE = "CONFLUENCE".freeze
22
+ BOX = "BOX".freeze
23
+ ZENDESK = "ZENDESK".freeze
24
+ ZOTERO = "ZOTERO".freeze
25
+ S3 = "S3".freeze
26
+ GMAIL = "GMAIL".freeze
27
+ OUTLOOK = "OUTLOOK".freeze
28
+ TEXT = "TEXT".freeze
29
+ CSV = "CSV".freeze
30
+ TSV = "TSV".freeze
31
+ PDF = "PDF".freeze
32
+ DOCX = "DOCX".freeze
33
+ PPTX = "PPTX".freeze
34
+ XLSX = "XLSX".freeze
35
+ MD = "MD".freeze
36
+ RTF = "RTF".freeze
37
+ JSON = "JSON".freeze
38
+ RAW_TEXT = "RAW_TEXT".freeze
39
+ WEB_SCRAPE = "WEB_SCRAPE".freeze
40
+ RSS_FEED = "RSS_FEED".freeze
41
+ FRESHDESK = "FRESHDESK".freeze
42
+ GITBOOK = "GITBOOK".freeze
43
+ JPG = "JPG".freeze
44
+ PNG = "PNG".freeze
45
+ MP3 = "MP3".freeze
46
+ MP4 = "MP4".freeze
47
+ MP2 = "MP2".freeze
48
+ AAC = "AAC".freeze
49
+ WAV = "WAV".freeze
50
+ FLAC = "FLAC".freeze
51
+ PCM = "PCM".freeze
52
+ M4_A = "M4A".freeze
53
+ OGG = "OGG".freeze
54
+ OPUS = "OPUS".freeze
55
+ WEBM = "WEBM".freeze
56
+
57
+ def self.all_vars
58
+ @all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, JPG, PNG, MP3, MP4, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, WEBM].freeze
59
+ end
60
+
61
+ # Builds the enum from string
62
+ # @param [String] The enum value in the form of the string
63
+ # @return [String] The enum value
64
+ def self.build_from_hash(value)
65
+ new.build_from_hash(value)
66
+ end
67
+
68
+ # Builds the enum from string
69
+ # @param [String] The enum value in the form of the string
70
+ # @return [String] The enum value
71
+ def build_from_hash(value)
72
+ return value if DataSourceTypeNullable.all_vars.include?(value)
73
+ raise "Invalid ENUM value #{value} for class #DataSourceTypeNullable"
74
+ end
75
+ end
76
+ 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 DeleteFilesQueryInput
14
+ attr_accessor :file_ids
15
+
16
+ attr_accessor :sync_statuses
17
+
18
+ attr_accessor :delete_non_synced_only
19
+
20
+ attr_accessor :send_webhook
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'file_ids' => :'file_ids',
26
+ :'sync_statuses' => :'sync_statuses',
27
+ :'delete_non_synced_only' => :'delete_non_synced_only',
28
+ :'send_webhook' => :'send_webhook'
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
+ :'file_ids' => :'Array<Integer>',
41
+ :'sync_statuses' => :'Array<ExternalFileSyncStatuses>',
42
+ :'delete_non_synced_only' => :'Boolean',
43
+ :'send_webhook' => :'Boolean'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'file_ids',
51
+ :'sync_statuses',
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::DeleteFilesQueryInput` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::DeleteFilesQueryInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'file_ids')
71
+ if (value = attributes[:'file_ids']).is_a?(Array)
72
+ self.file_ids = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'sync_statuses')
77
+ if (value = attributes[:'sync_statuses']).is_a?(Array)
78
+ self.sync_statuses = value
79
+ end
80
+ end
81
+
82
+ if attributes.key?(:'delete_non_synced_only')
83
+ self.delete_non_synced_only = attributes[:'delete_non_synced_only']
84
+ else
85
+ self.delete_non_synced_only = false
86
+ end
87
+
88
+ if attributes.key?(:'send_webhook')
89
+ self.send_webhook = attributes[:'send_webhook']
90
+ else
91
+ self.send_webhook = false
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
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
+ file_ids == o.file_ids &&
114
+ sync_statuses == o.sync_statuses &&
115
+ delete_non_synced_only == o.delete_non_synced_only &&
116
+ send_webhook == o.send_webhook
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
+ [file_ids, sync_statuses, delete_non_synced_only, send_webhook].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,266 @@
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 DirectoryItem
14
+ attr_accessor :id
15
+
16
+ attr_accessor :name
17
+
18
+ attr_accessor :is_synced
19
+
20
+ attr_accessor :has_children
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id',
26
+ :'name' => :'name',
27
+ :'is_synced' => :'is_synced',
28
+ :'has_children' => :'has_children'
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
+ :'id' => :'String',
41
+ :'name' => :'String',
42
+ :'is_synced' => :'Boolean',
43
+ :'has_children' => :'Boolean'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::DirectoryItem` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::DirectoryItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'id')
69
+ self.id = attributes[:'id']
70
+ end
71
+
72
+ if attributes.key?(:'name')
73
+ self.name = attributes[:'name']
74
+ end
75
+
76
+ if attributes.key?(:'is_synced')
77
+ self.is_synced = attributes[:'is_synced']
78
+ else
79
+ self.is_synced = false
80
+ end
81
+
82
+ if attributes.key?(:'has_children')
83
+ self.has_children = attributes[:'has_children']
84
+ else
85
+ self.has_children = false
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ if @id.nil?
94
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
95
+ end
96
+
97
+ if @name.nil?
98
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
99
+ end
100
+
101
+ if @is_synced.nil?
102
+ invalid_properties.push('invalid value for "is_synced", is_synced cannot be nil.')
103
+ end
104
+
105
+ if @has_children.nil?
106
+ invalid_properties.push('invalid value for "has_children", has_children cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ return false if @id.nil?
116
+ return false if @name.nil?
117
+ return false if @is_synced.nil?
118
+ return false if @has_children.nil?
119
+ true
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ id == o.id &&
128
+ name == o.name &&
129
+ is_synced == o.is_synced &&
130
+ has_children == o.has_children
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [id, name, is_synced, has_children].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ self.class.openapi_types.each_pair do |key, type|
159
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
160
+ self.send("#{key}=", nil)
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
165
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
166
+ end
167
+ elsif !attributes[self.class.attribute_map[key]].nil?
168
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
169
+ end
170
+ end
171
+
172
+ self
173
+ end
174
+
175
+ # Deserializes the data based on type
176
+ # @param string type Data type
177
+ # @param string value Value to be deserialized
178
+ # @return [Object] Deserialized data
179
+ def _deserialize(type, value)
180
+ case type.to_sym
181
+ when :Time
182
+ Time.parse(value)
183
+ when :Date
184
+ Date.parse(value)
185
+ when :String
186
+ value.to_s
187
+ when :Integer
188
+ value.to_i
189
+ when :Float
190
+ value.to_f
191
+ when :Boolean
192
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
193
+ true
194
+ else
195
+ false
196
+ end
197
+ when :Object
198
+ # generic object (usually a Hash), return directly
199
+ value
200
+ when /\AArray<(?<inner_type>.+)>\z/
201
+ inner_type = Regexp.last_match[:inner_type]
202
+ value.map { |v| _deserialize(inner_type, v) }
203
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
204
+ k_type = Regexp.last_match[:k_type]
205
+ v_type = Regexp.last_match[:v_type]
206
+ {}.tap do |hash|
207
+ value.each do |k, v|
208
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
209
+ end
210
+ end
211
+ else # model
212
+ # models (e.g. Pet) or oneOf
213
+ klass = Carbon.const_get(type)
214
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ if value.nil?
237
+ is_nullable = self.class.openapi_nullable.include?(attr)
238
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
239
+ end
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ end
265
+
266
+ end