ragie_ruby_sdk 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +291 -0
  4. data/Rakefile +10 -0
  5. data/docs/AccessTokenCredentials.md +18 -0
  6. data/docs/AsyncDocumentMetadataUpdate.md +18 -0
  7. data/docs/AudioModalityData.md +20 -0
  8. data/docs/AuthenticatorConfluenceConnection.md +22 -0
  9. data/docs/AuthenticatorDropboxConnection.md +24 -0
  10. data/docs/AuthenticatorGmailConnection.md +24 -0
  11. data/docs/AuthenticatorGoogleDriveConnection.md +24 -0
  12. data/docs/AuthenticatorHubspotConnection.md +26 -0
  13. data/docs/AuthenticatorJiraConnection.md +20 -0
  14. data/docs/AuthenticatorList.md +20 -0
  15. data/docs/AuthenticatorNotionConnection.md +26 -0
  16. data/docs/AuthenticatorOnedriveConnection.md +24 -0
  17. data/docs/AuthenticatorSalesforceConnection.md +24 -0
  18. data/docs/AuthenticatorSharepointConnection.md +24 -0
  19. data/docs/AuthenticatorSlackConnection.md +24 -0
  20. data/docs/AuthenticatorsApi.md +293 -0
  21. data/docs/BackblazeCredentials.md +24 -0
  22. data/docs/BaseGetAuthenticator.md +22 -0
  23. data/docs/BetaApi.md +363 -0
  24. data/docs/Body.md +22 -0
  25. data/docs/BodyCreateDocument.md +28 -0
  26. data/docs/BodyUpdateDocumentFile.md +20 -0
  27. data/docs/BucketData.md +22 -0
  28. data/docs/ConfluenceData.md +24 -0
  29. data/docs/Connection.md +44 -0
  30. data/docs/Connection1.md +106 -0
  31. data/docs/Connection2.md +91 -0
  32. data/docs/ConnectionBase.md +22 -0
  33. data/docs/ConnectionLimitExceededWebhook.md +22 -0
  34. data/docs/ConnectionLimitExceededWebhookPayload.md +24 -0
  35. data/docs/ConnectionLimitParams.md +18 -0
  36. data/docs/ConnectionList.md +20 -0
  37. data/docs/ConnectionStats.md +20 -0
  38. data/docs/ConnectionSyncFinishedWebhook.md +22 -0
  39. data/docs/ConnectionSyncFinishedWebhookPayload.md +24 -0
  40. data/docs/ConnectionSyncProgressWebhook.md +22 -0
  41. data/docs/ConnectionSyncProgressWebhookPayload.md +42 -0
  42. data/docs/ConnectionSyncStartedWebhook.md +22 -0
  43. data/docs/ConnectionSyncStartedWebhookPayload.md +32 -0
  44. data/docs/ConnectionsApi.md +790 -0
  45. data/docs/ConnectorSource.md +15 -0
  46. data/docs/ConnectorSourceTypeInfo.md +24 -0
  47. data/docs/CreateAuthenticatorConnection.md +28 -0
  48. data/docs/CreateDocumentFromUrlParams.md +28 -0
  49. data/docs/CreateDocumentRawParams.md +26 -0
  50. data/docs/CreateGoogleAuthenticator.md +28 -0
  51. data/docs/CreateInstructionParams.md +30 -0
  52. data/docs/CreatePartitionParams.md +42 -0
  53. data/docs/Data.md +15 -0
  54. data/docs/DefaultApi.md +77 -0
  55. data/docs/DeleteConnectionPayload.md +18 -0
  56. data/docs/Document.md +36 -0
  57. data/docs/DocumentChunk.md +26 -0
  58. data/docs/DocumentChunkDetail.md +28 -0
  59. data/docs/DocumentChunkDetailModalityData.md +79 -0
  60. data/docs/DocumentChunkList.md +20 -0
  61. data/docs/DocumentDelete.md +18 -0
  62. data/docs/DocumentDeleteWebhook.md +22 -0
  63. data/docs/DocumentDeleteWebhookPayload.md +30 -0
  64. data/docs/DocumentFileUpdate.md +18 -0
  65. data/docs/DocumentGet.md +38 -0
  66. data/docs/DocumentList.md +20 -0
  67. data/docs/DocumentMetadataUpdate.md +18 -0
  68. data/docs/DocumentRawUpdate.md +18 -0
  69. data/docs/DocumentSummary.md +20 -0
  70. data/docs/DocumentUpdateWebhook.md +22 -0
  71. data/docs/DocumentUpdateWebhookPayload.md +34 -0
  72. data/docs/DocumentUrlUpdate.md +18 -0
  73. data/docs/DocumentWithContent.md +38 -0
  74. data/docs/DocumentsApi.md +1221 -0
  75. data/docs/EnterpriseApi.md +363 -0
  76. data/docs/EntitiesApi.md +436 -0
  77. data/docs/Entity.md +30 -0
  78. data/docs/EntityExtractedWebhook.md +22 -0
  79. data/docs/EntityExtractedWebhookPayload.md +34 -0
  80. data/docs/EntityList.md +20 -0
  81. data/docs/ErrorMessage.md +18 -0
  82. data/docs/FolderData.md +20 -0
  83. data/docs/FreshdeskCredentials.md +20 -0
  84. data/docs/FreshdeskData.md +20 -0
  85. data/docs/GmailData.md +18 -0
  86. data/docs/GoogleFolderData.md +22 -0
  87. data/docs/HTTPValidationError.md +18 -0
  88. data/docs/HubspotData.md +30 -0
  89. data/docs/Instruction.md +36 -0
  90. data/docs/IntercomCredentials.md +22 -0
  91. data/docs/IntercomData.md +28 -0
  92. data/docs/Link.md +20 -0
  93. data/docs/ListConnectorSourceTypeInfo.md +18 -0
  94. data/docs/MediaModeParam.md +22 -0
  95. data/docs/MediaType.md +15 -0
  96. data/docs/MetadataValue.md +15 -0
  97. data/docs/MetadataValue1.md +53 -0
  98. data/docs/Mode.md +22 -0
  99. data/docs/Mode1.md +22 -0
  100. data/docs/Mode2.md +49 -0
  101. data/docs/Mode2OneOf.md +22 -0
  102. data/docs/OAuthCredentials.md +26 -0
  103. data/docs/OAuthRefreshTokenCredentials.md +18 -0
  104. data/docs/OAuthUrlCreate.md +34 -0
  105. data/docs/OAuthUrlResponse.md +18 -0
  106. data/docs/OnedriveData.md +22 -0
  107. data/docs/Pagination.md +20 -0
  108. data/docs/Partition.md +24 -0
  109. data/docs/PartitionDetail.md +26 -0
  110. data/docs/PartitionLimitExceededWebhook.md +22 -0
  111. data/docs/PartitionLimitExceededWebhookPayload.md +20 -0
  112. data/docs/PartitionLimitParams.md +40 -0
  113. data/docs/PartitionLimitResetWebhook.md +22 -0
  114. data/docs/PartitionLimitResetWebhookPayload.md +18 -0
  115. data/docs/PartitionLimits.md +40 -0
  116. data/docs/PartitionList.md +20 -0
  117. data/docs/PartitionStats.md +42 -0
  118. data/docs/PartitionStrategy.md +22 -0
  119. data/docs/PartitionsApi.md +363 -0
  120. data/docs/PatchDocumentMetadataParams.md +20 -0
  121. data/docs/Payload.md +84 -0
  122. data/docs/PublicBackblazeConnection.md +22 -0
  123. data/docs/PublicCreateConnection.md +28 -0
  124. data/docs/PublicFreshdeskConnection.md +24 -0
  125. data/docs/PublicGCSConnection.md +22 -0
  126. data/docs/PublicIntercomConnection.md +22 -0
  127. data/docs/PublicS3CompatibleConnection.md +22 -0
  128. data/docs/PublicZendeskConnection.md +22 -0
  129. data/docs/ResponseOK.md +18 -0
  130. data/docs/ResponsePatchdocumentmetadata.md +20 -0
  131. data/docs/Retrieval.md +18 -0
  132. data/docs/RetrievalsApi.md +75 -0
  133. data/docs/RetrieveParams.md +30 -0
  134. data/docs/S3CompatibleCredentials.md +24 -0
  135. data/docs/ScoredChunk.md +34 -0
  136. data/docs/SetConnectionEnabledPayload.md +20 -0
  137. data/docs/SharepointData.md +20 -0
  138. data/docs/SharepointFileData.md +22 -0
  139. data/docs/SharepointSiteData.md +20 -0
  140. data/docs/SlackData.md +20 -0
  141. data/docs/Source.md +15 -0
  142. data/docs/Status.md +15 -0
  143. data/docs/UpdateDocumentFromUrlParams.md +20 -0
  144. data/docs/UpdateDocumentRawParams.md +18 -0
  145. data/docs/UpdateInstructionParams.md +18 -0
  146. data/docs/ValidationError.md +22 -0
  147. data/docs/ValidationErrorLocInner.md +15 -0
  148. data/docs/VideoModalityData.md +20 -0
  149. data/docs/WordTimestamp.md +24 -0
  150. data/docs/ZendeskCredentials.md +22 -0
  151. data/docs/ZendeskData.md +18 -0
  152. data/git_push.sh +57 -0
  153. data/lib/ragie_ruby_sdk/api/authenticators_api.rb +298 -0
  154. data/lib/ragie_ruby_sdk/api/beta_api.rb +366 -0
  155. data/lib/ragie_ruby_sdk/api/connections_api.rb +777 -0
  156. data/lib/ragie_ruby_sdk/api/default_api.rb +90 -0
  157. data/lib/ragie_ruby_sdk/api/documents_api.rb +1206 -0
  158. data/lib/ragie_ruby_sdk/api/enterprise_api.rb +366 -0
  159. data/lib/ragie_ruby_sdk/api/entities_api.rb +438 -0
  160. data/lib/ragie_ruby_sdk/api/partitions_api.rb +361 -0
  161. data/lib/ragie_ruby_sdk/api/retrievals_api.rb +88 -0
  162. data/lib/ragie_ruby_sdk/api_client.rb +393 -0
  163. data/lib/ragie_ruby_sdk/api_error.rb +58 -0
  164. data/lib/ragie_ruby_sdk/configuration.rb +308 -0
  165. data/lib/ragie_ruby_sdk/models/access_token_credentials.rb +237 -0
  166. data/lib/ragie_ruby_sdk/models/async_document_metadata_update.rb +237 -0
  167. data/lib/ragie_ruby_sdk/models/audio_modality_data.rb +267 -0
  168. data/lib/ragie_ruby_sdk/models/authenticator_confluence_connection.rb +315 -0
  169. data/lib/ragie_ruby_sdk/models/authenticator_dropbox_connection.rb +340 -0
  170. data/lib/ragie_ruby_sdk/models/authenticator_gmail_connection.rb +340 -0
  171. data/lib/ragie_ruby_sdk/models/authenticator_google_drive_connection.rb +342 -0
  172. data/lib/ragie_ruby_sdk/models/authenticator_hubspot_connection.rb +365 -0
  173. data/lib/ragie_ruby_sdk/models/authenticator_jira_connection.rb +287 -0
  174. data/lib/ragie_ruby_sdk/models/authenticator_list.rb +265 -0
  175. data/lib/ragie_ruby_sdk/models/authenticator_notion_connection.rb +366 -0
  176. data/lib/ragie_ruby_sdk/models/authenticator_onedrive_connection.rb +340 -0
  177. data/lib/ragie_ruby_sdk/models/authenticator_salesforce_connection.rb +341 -0
  178. data/lib/ragie_ruby_sdk/models/authenticator_sharepoint_connection.rb +340 -0
  179. data/lib/ragie_ruby_sdk/models/authenticator_slack_connection.rb +340 -0
  180. data/lib/ragie_ruby_sdk/models/backblaze_credentials.rb +315 -0
  181. data/lib/ragie_ruby_sdk/models/base_get_authenticator.rb +290 -0
  182. data/lib/ragie_ruby_sdk/models/body.rb +111 -0
  183. data/lib/ragie_ruby_sdk/models/body_create_document.rb +292 -0
  184. data/lib/ragie_ruby_sdk/models/body_update_document_file.rb +250 -0
  185. data/lib/ragie_ruby_sdk/models/bucket_data.rb +258 -0
  186. data/lib/ragie_ruby_sdk/models/confluence_data.rb +315 -0
  187. data/lib/ragie_ruby_sdk/models/connection.rb +521 -0
  188. data/lib/ragie_ruby_sdk/models/connection1.rb +73 -0
  189. data/lib/ragie_ruby_sdk/models/connection2.rb +63 -0
  190. data/lib/ragie_ruby_sdk/models/connection_base.rb +274 -0
  191. data/lib/ragie_ruby_sdk/models/connection_limit_exceeded_webhook.rb +313 -0
  192. data/lib/ragie_ruby_sdk/models/connection_limit_exceeded_webhook_payload.rb +327 -0
  193. data/lib/ragie_ruby_sdk/models/connection_limit_params.rb +236 -0
  194. data/lib/ragie_ruby_sdk/models/connection_list.rb +265 -0
  195. data/lib/ragie_ruby_sdk/models/connection_stats.rb +263 -0
  196. data/lib/ragie_ruby_sdk/models/connection_sync_finished_webhook.rb +313 -0
  197. data/lib/ragie_ruby_sdk/models/connection_sync_finished_webhook_payload.rb +317 -0
  198. data/lib/ragie_ruby_sdk/models/connection_sync_progress_webhook.rb +313 -0
  199. data/lib/ragie_ruby_sdk/models/connection_sync_progress_webhook_payload.rb +551 -0
  200. data/lib/ragie_ruby_sdk/models/connection_sync_started_webhook.rb +313 -0
  201. data/lib/ragie_ruby_sdk/models/connection_sync_started_webhook_payload.rb +421 -0
  202. data/lib/ragie_ruby_sdk/models/connector_source.rb +55 -0
  203. data/lib/ragie_ruby_sdk/models/connector_source_type_info.rb +337 -0
  204. data/lib/ragie_ruby_sdk/models/create_authenticator_connection.rb +307 -0
  205. data/lib/ragie_ruby_sdk/models/create_document_from_url_params.rb +306 -0
  206. data/lib/ragie_ruby_sdk/models/create_document_raw_params.rb +279 -0
  207. data/lib/ragie_ruby_sdk/models/create_google_authenticator.rb +360 -0
  208. data/lib/ragie_ruby_sdk/models/create_instruction_params.rb +373 -0
  209. data/lib/ragie_ruby_sdk/models/create_partition_params.rb +537 -0
  210. data/lib/ragie_ruby_sdk/models/data.rb +105 -0
  211. data/lib/ragie_ruby_sdk/models/delete_connection_payload.rb +237 -0
  212. data/lib/ragie_ruby_sdk/models/document.rb +425 -0
  213. data/lib/ragie_ruby_sdk/models/document_chunk.rb +313 -0
  214. data/lib/ragie_ruby_sdk/models/document_chunk_detail.rb +323 -0
  215. data/lib/ragie_ruby_sdk/models/document_chunk_detail_modality_data.rb +55 -0
  216. data/lib/ragie_ruby_sdk/models/document_chunk_list.rb +265 -0
  217. data/lib/ragie_ruby_sdk/models/document_delete.rb +237 -0
  218. data/lib/ragie_ruby_sdk/models/document_delete_webhook.rb +313 -0
  219. data/lib/ragie_ruby_sdk/models/document_delete_webhook_payload.rb +353 -0
  220. data/lib/ragie_ruby_sdk/models/document_file_update.rb +237 -0
  221. data/lib/ragie_ruby_sdk/models/document_get.rb +453 -0
  222. data/lib/ragie_ruby_sdk/models/document_list.rb +265 -0
  223. data/lib/ragie_ruby_sdk/models/document_metadata_update.rb +240 -0
  224. data/lib/ragie_ruby_sdk/models/document_raw_update.rb +237 -0
  225. data/lib/ragie_ruby_sdk/models/document_summary.rb +263 -0
  226. data/lib/ragie_ruby_sdk/models/document_update_webhook.rb +313 -0
  227. data/lib/ragie_ruby_sdk/models/document_update_webhook_payload.rb +391 -0
  228. data/lib/ragie_ruby_sdk/models/document_url_update.rb +237 -0
  229. data/lib/ragie_ruby_sdk/models/document_with_content.rb +451 -0
  230. data/lib/ragie_ruby_sdk/models/entity.rb +381 -0
  231. data/lib/ragie_ruby_sdk/models/entity_extracted_webhook.rb +313 -0
  232. data/lib/ragie_ruby_sdk/models/entity_extracted_webhook_payload.rb +421 -0
  233. data/lib/ragie_ruby_sdk/models/entity_list.rb +265 -0
  234. data/lib/ragie_ruby_sdk/models/error_message.rb +237 -0
  235. data/lib/ragie_ruby_sdk/models/folder_data.rb +263 -0
  236. data/lib/ragie_ruby_sdk/models/freshdesk_credentials.rb +263 -0
  237. data/lib/ragie_ruby_sdk/models/freshdesk_data.rb +263 -0
  238. data/lib/ragie_ruby_sdk/models/gmail_data.rb +221 -0
  239. data/lib/ragie_ruby_sdk/models/google_folder_data.rb +289 -0
  240. data/lib/ragie_ruby_sdk/models/http_validation_error.rb +222 -0
  241. data/lib/ragie_ruby_sdk/models/hubspot_data.rb +393 -0
  242. data/lib/ragie_ruby_sdk/models/instruction.rb +451 -0
  243. data/lib/ragie_ruby_sdk/models/intercom_credentials.rb +290 -0
  244. data/lib/ragie_ruby_sdk/models/intercom_data.rb +367 -0
  245. data/lib/ragie_ruby_sdk/models/link.rb +263 -0
  246. data/lib/ragie_ruby_sdk/models/list_connector_source_type_info.rb +239 -0
  247. data/lib/ragie_ruby_sdk/models/media_mode_param.rb +287 -0
  248. data/lib/ragie_ruby_sdk/models/media_type.rb +104 -0
  249. data/lib/ragie_ruby_sdk/models/metadata_value.rb +106 -0
  250. data/lib/ragie_ruby_sdk/models/metadata_value1.rb +107 -0
  251. data/lib/ragie_ruby_sdk/models/mode.rb +105 -0
  252. data/lib/ragie_ruby_sdk/models/mode1.rb +104 -0
  253. data/lib/ragie_ruby_sdk/models/mode2.rb +106 -0
  254. data/lib/ragie_ruby_sdk/models/mode2_one_of.rb +287 -0
  255. data/lib/ragie_ruby_sdk/models/o_auth_credentials.rb +350 -0
  256. data/lib/ragie_ruby_sdk/models/o_auth_refresh_token_credentials.rb +237 -0
  257. data/lib/ragie_ruby_sdk/models/o_auth_url_create.rb +370 -0
  258. data/lib/ragie_ruby_sdk/models/o_auth_url_response.rb +237 -0
  259. data/lib/ragie_ruby_sdk/models/onedrive_data.rb +289 -0
  260. data/lib/ragie_ruby_sdk/models/pagination.rb +247 -0
  261. data/lib/ragie_ruby_sdk/models/partition.rb +299 -0
  262. data/lib/ragie_ruby_sdk/models/partition_detail.rb +325 -0
  263. data/lib/ragie_ruby_sdk/models/partition_limit_exceeded_webhook.rb +313 -0
  264. data/lib/ragie_ruby_sdk/models/partition_limit_exceeded_webhook_payload.rb +287 -0
  265. data/lib/ragie_ruby_sdk/models/partition_limit_params.rb +511 -0
  266. data/lib/ragie_ruby_sdk/models/partition_limit_reset_webhook.rb +313 -0
  267. data/lib/ragie_ruby_sdk/models/partition_limit_reset_webhook_payload.rb +237 -0
  268. data/lib/ragie_ruby_sdk/models/partition_limits.rb +511 -0
  269. data/lib/ragie_ruby_sdk/models/partition_list.rb +265 -0
  270. data/lib/ragie_ruby_sdk/models/partition_stats.rb +562 -0
  271. data/lib/ragie_ruby_sdk/models/partition_strategy.rb +104 -0
  272. data/lib/ragie_ruby_sdk/models/patch_document_metadata_params.rb +252 -0
  273. data/lib/ragie_ruby_sdk/models/payload.rb +60 -0
  274. data/lib/ragie_ruby_sdk/models/public_backblaze_connection.rb +313 -0
  275. data/lib/ragie_ruby_sdk/models/public_create_connection.rb +307 -0
  276. data/lib/ragie_ruby_sdk/models/public_freshdesk_connection.rb +340 -0
  277. data/lib/ragie_ruby_sdk/models/public_gcs_connection.rb +315 -0
  278. data/lib/ragie_ruby_sdk/models/public_intercom_connection.rb +313 -0
  279. data/lib/ragie_ruby_sdk/models/public_s3_compatible_connection.rb +313 -0
  280. data/lib/ragie_ruby_sdk/models/public_zendesk_connection.rb +313 -0
  281. data/lib/ragie_ruby_sdk/models/response_ok.rb +222 -0
  282. data/lib/ragie_ruby_sdk/models/response_patchdocumentmetadata.rb +104 -0
  283. data/lib/ragie_ruby_sdk/models/retrieval.rb +239 -0
  284. data/lib/ragie_ruby_sdk/models/retrieve_params.rb +305 -0
  285. data/lib/ragie_ruby_sdk/models/s3_compatible_credentials.rb +299 -0
  286. data/lib/ragie_ruby_sdk/models/scored_chunk.rb +434 -0
  287. data/lib/ragie_ruby_sdk/models/set_connection_enabled_payload.rb +281 -0
  288. data/lib/ragie_ruby_sdk/models/sharepoint_data.rb +265 -0
  289. data/lib/ragie_ruby_sdk/models/sharepoint_file_data.rb +313 -0
  290. data/lib/ragie_ruby_sdk/models/sharepoint_site_data.rb +263 -0
  291. data/lib/ragie_ruby_sdk/models/slack_data.rb +263 -0
  292. data/lib/ragie_ruby_sdk/models/source.rb +105 -0
  293. data/lib/ragie_ruby_sdk/models/status.rb +103 -0
  294. data/lib/ragie_ruby_sdk/models/update_document_from_url_params.rb +247 -0
  295. data/lib/ragie_ruby_sdk/models/update_document_raw_params.rb +237 -0
  296. data/lib/ragie_ruby_sdk/models/update_instruction_params.rb +238 -0
  297. data/lib/ragie_ruby_sdk/models/validation_error.rb +291 -0
  298. data/lib/ragie_ruby_sdk/models/validation_error_loc_inner.rb +104 -0
  299. data/lib/ragie_ruby_sdk/models/video_modality_data.rb +267 -0
  300. data/lib/ragie_ruby_sdk/models/word_timestamp.rb +315 -0
  301. data/lib/ragie_ruby_sdk/models/zendesk_credentials.rb +289 -0
  302. data/lib/ragie_ruby_sdk/models/zendesk_data.rb +237 -0
  303. data/lib/ragie_ruby_sdk/version.rb +15 -0
  304. data/lib/ragie_ruby_sdk.rb +185 -0
  305. data/ragie_ruby_sdk.gemspec +39 -0
  306. data/spec/api/authenticators_api_spec.rb +85 -0
  307. data/spec/api/beta_api_spec.rb +97 -0
  308. data/spec/api/connections_api_spec.rb +173 -0
  309. data/spec/api/default_api_spec.rb +47 -0
  310. data/spec/api/documents_api_spec.rb +260 -0
  311. data/spec/api/enterprise_api_spec.rb +97 -0
  312. data/spec/api/entities_api_spec.rb +110 -0
  313. data/spec/api/partitions_api_spec.rb +97 -0
  314. data/spec/api/retrievals_api_spec.rb +46 -0
  315. data/spec/models/access_token_credentials_spec.rb +36 -0
  316. data/spec/models/async_document_metadata_update_spec.rb +36 -0
  317. data/spec/models/audio_modality_data_spec.rb +46 -0
  318. data/spec/models/authenticator_confluence_connection_spec.rb +52 -0
  319. data/spec/models/authenticator_dropbox_connection_spec.rb +58 -0
  320. data/spec/models/authenticator_gmail_connection_spec.rb +58 -0
  321. data/spec/models/authenticator_google_drive_connection_spec.rb +58 -0
  322. data/spec/models/authenticator_hubspot_connection_spec.rb +64 -0
  323. data/spec/models/authenticator_jira_connection_spec.rb +46 -0
  324. data/spec/models/authenticator_list_spec.rb +42 -0
  325. data/spec/models/authenticator_notion_connection_spec.rb +64 -0
  326. data/spec/models/authenticator_onedrive_connection_spec.rb +58 -0
  327. data/spec/models/authenticator_salesforce_connection_spec.rb +58 -0
  328. data/spec/models/authenticator_sharepoint_connection_spec.rb +58 -0
  329. data/spec/models/authenticator_slack_connection_spec.rb +58 -0
  330. data/spec/models/backblaze_credentials_spec.rb +54 -0
  331. data/spec/models/base_get_authenticator_spec.rb +48 -0
  332. data/spec/models/body_create_document_spec.rb +66 -0
  333. data/spec/models/body_spec.rb +21 -0
  334. data/spec/models/body_update_document_file_spec.rb +42 -0
  335. data/spec/models/bucket_data_spec.rb +48 -0
  336. data/spec/models/confluence_data_spec.rb +54 -0
  337. data/spec/models/connection1_spec.rb +44 -0
  338. data/spec/models/connection2_spec.rb +44 -0
  339. data/spec/models/connection_base_spec.rb +48 -0
  340. data/spec/models/connection_limit_exceeded_webhook_payload_spec.rb +58 -0
  341. data/spec/models/connection_limit_exceeded_webhook_spec.rb +52 -0
  342. data/spec/models/connection_limit_params_spec.rb +36 -0
  343. data/spec/models/connection_list_spec.rb +42 -0
  344. data/spec/models/connection_spec.rb +118 -0
  345. data/spec/models/connection_stats_spec.rb +42 -0
  346. data/spec/models/connection_sync_finished_webhook_payload_spec.rb +54 -0
  347. data/spec/models/connection_sync_finished_webhook_spec.rb +52 -0
  348. data/spec/models/connection_sync_progress_webhook_payload_spec.rb +108 -0
  349. data/spec/models/connection_sync_progress_webhook_spec.rb +52 -0
  350. data/spec/models/connection_sync_started_webhook_payload_spec.rb +78 -0
  351. data/spec/models/connection_sync_started_webhook_spec.rb +52 -0
  352. data/spec/models/connector_source_spec.rb +30 -0
  353. data/spec/models/connector_source_type_info_spec.rb +54 -0
  354. data/spec/models/create_authenticator_connection_spec.rb +66 -0
  355. data/spec/models/create_document_from_url_params_spec.rb +66 -0
  356. data/spec/models/create_document_raw_params_spec.rb +60 -0
  357. data/spec/models/create_google_authenticator_spec.rb +70 -0
  358. data/spec/models/create_instruction_params_spec.rb +76 -0
  359. data/spec/models/create_partition_params_spec.rb +108 -0
  360. data/spec/models/data_spec.rb +21 -0
  361. data/spec/models/delete_connection_payload_spec.rb +36 -0
  362. data/spec/models/document_chunk_detail_modality_data_spec.rb +44 -0
  363. data/spec/models/document_chunk_detail_spec.rb +66 -0
  364. data/spec/models/document_chunk_list_spec.rb +42 -0
  365. data/spec/models/document_chunk_spec.rb +60 -0
  366. data/spec/models/document_delete_spec.rb +36 -0
  367. data/spec/models/document_delete_webhook_payload_spec.rb +72 -0
  368. data/spec/models/document_delete_webhook_spec.rb +52 -0
  369. data/spec/models/document_file_update_spec.rb +36 -0
  370. data/spec/models/document_get_spec.rb +96 -0
  371. data/spec/models/document_list_spec.rb +42 -0
  372. data/spec/models/document_metadata_update_spec.rb +36 -0
  373. data/spec/models/document_raw_update_spec.rb +36 -0
  374. data/spec/models/document_spec.rb +90 -0
  375. data/spec/models/document_summary_spec.rb +42 -0
  376. data/spec/models/document_update_webhook_payload_spec.rb +84 -0
  377. data/spec/models/document_update_webhook_spec.rb +52 -0
  378. data/spec/models/document_url_update_spec.rb +36 -0
  379. data/spec/models/document_with_content_spec.rb +96 -0
  380. data/spec/models/entity_extracted_webhook_payload_spec.rb +84 -0
  381. data/spec/models/entity_extracted_webhook_spec.rb +52 -0
  382. data/spec/models/entity_list_spec.rb +42 -0
  383. data/spec/models/entity_spec.rb +72 -0
  384. data/spec/models/error_message_spec.rb +36 -0
  385. data/spec/models/folder_data_spec.rb +42 -0
  386. data/spec/models/freshdesk_credentials_spec.rb +42 -0
  387. data/spec/models/freshdesk_data_spec.rb +42 -0
  388. data/spec/models/gmail_data_spec.rb +36 -0
  389. data/spec/models/google_folder_data_spec.rb +48 -0
  390. data/spec/models/http_validation_error_spec.rb +36 -0
  391. data/spec/models/hubspot_data_spec.rb +72 -0
  392. data/spec/models/instruction_spec.rb +94 -0
  393. data/spec/models/intercom_credentials_spec.rb +48 -0
  394. data/spec/models/intercom_data_spec.rb +66 -0
  395. data/spec/models/link_spec.rb +42 -0
  396. data/spec/models/list_connector_source_type_info_spec.rb +36 -0
  397. data/spec/models/media_mode_param_spec.rb +56 -0
  398. data/spec/models/media_type_spec.rb +21 -0
  399. data/spec/models/metadata_value1_spec.rb +32 -0
  400. data/spec/models/metadata_value_spec.rb +21 -0
  401. data/spec/models/mode1_spec.rb +21 -0
  402. data/spec/models/mode2_one_of_spec.rb +56 -0
  403. data/spec/models/mode2_spec.rb +32 -0
  404. data/spec/models/mode_spec.rb +21 -0
  405. data/spec/models/o_auth_credentials_spec.rb +64 -0
  406. data/spec/models/o_auth_refresh_token_credentials_spec.rb +36 -0
  407. data/spec/models/o_auth_url_create_spec.rb +88 -0
  408. data/spec/models/o_auth_url_response_spec.rb +36 -0
  409. data/spec/models/onedrive_data_spec.rb +48 -0
  410. data/spec/models/pagination_spec.rb +42 -0
  411. data/spec/models/partition_detail_spec.rb +60 -0
  412. data/spec/models/partition_limit_exceeded_webhook_payload_spec.rb +46 -0
  413. data/spec/models/partition_limit_exceeded_webhook_spec.rb +52 -0
  414. data/spec/models/partition_limit_params_spec.rb +102 -0
  415. data/spec/models/partition_limit_reset_webhook_payload_spec.rb +36 -0
  416. data/spec/models/partition_limit_reset_webhook_spec.rb +52 -0
  417. data/spec/models/partition_limits_spec.rb +102 -0
  418. data/spec/models/partition_list_spec.rb +42 -0
  419. data/spec/models/partition_spec.rb +54 -0
  420. data/spec/models/partition_stats_spec.rb +108 -0
  421. data/spec/models/partition_strategy_spec.rb +21 -0
  422. data/spec/models/patch_document_metadata_params_spec.rb +42 -0
  423. data/spec/models/payload_spec.rb +44 -0
  424. data/spec/models/public_backblaze_connection_spec.rb +52 -0
  425. data/spec/models/public_create_connection_spec.rb +66 -0
  426. data/spec/models/public_freshdesk_connection_spec.rb +58 -0
  427. data/spec/models/public_gcs_connection_spec.rb +52 -0
  428. data/spec/models/public_intercom_connection_spec.rb +52 -0
  429. data/spec/models/public_s3_compatible_connection_spec.rb +52 -0
  430. data/spec/models/public_zendesk_connection_spec.rb +52 -0
  431. data/spec/models/response_ok_spec.rb +36 -0
  432. data/spec/models/response_patchdocumentmetadata_spec.rb +21 -0
  433. data/spec/models/retrieval_spec.rb +36 -0
  434. data/spec/models/retrieve_params_spec.rb +72 -0
  435. data/spec/models/s3_compatible_credentials_spec.rb +54 -0
  436. data/spec/models/scored_chunk_spec.rb +84 -0
  437. data/spec/models/set_connection_enabled_payload_spec.rb +46 -0
  438. data/spec/models/sharepoint_data_spec.rb +42 -0
  439. data/spec/models/sharepoint_file_data_spec.rb +52 -0
  440. data/spec/models/sharepoint_site_data_spec.rb +42 -0
  441. data/spec/models/slack_data_spec.rb +42 -0
  442. data/spec/models/source_spec.rb +21 -0
  443. data/spec/models/status_spec.rb +21 -0
  444. data/spec/models/update_document_from_url_params_spec.rb +42 -0
  445. data/spec/models/update_document_raw_params_spec.rb +36 -0
  446. data/spec/models/update_instruction_params_spec.rb +36 -0
  447. data/spec/models/validation_error_loc_inner_spec.rb +21 -0
  448. data/spec/models/validation_error_spec.rb +48 -0
  449. data/spec/models/video_modality_data_spec.rb +46 -0
  450. data/spec/models/word_timestamp_spec.rb +54 -0
  451. data/spec/models/zendesk_credentials_spec.rb +48 -0
  452. data/spec/models/zendesk_data_spec.rb +36 -0
  453. data/spec/spec_helper.rb +111 -0
  454. metadata +680 -0
@@ -0,0 +1,1206 @@
1
+ =begin
2
+ #Ragie API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module RagieRubySdk
16
+ class DocumentsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Document
23
+ # On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [`pending`, `partitioning`, `partitioned`, `refined`, `chunked`, `indexed`, `summary_indexed`, `keyword_indexed`, `ready`, `failed`]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in `indexed` state. However the summary will only be available once the state has changed to `summary_indexed` or `ready`.
24
+ # @param file [File] The binary file to upload, extract, and index for retrieval. The following file types are supported: Plain Text: `.eml` `.html` `.json` `.md` `.msg` `.rst` `.rtf` `.txt` `.xml` Images: `.png` `.webp` `.jpg` `.jpeg` `.tiff` `.bmp` `.heic` Documents: `.csv` `.doc` `.docx` `.epub` `.epub+zip` `.odt` `.pdf` `.ppt` `.pptx` `.tsv` `.xlsx` `.xls`.
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Mode2] :mode
27
+ # @option opts [Hash<String, MetadataValue1>] :metadata Metadata for the document. Keys must be strings. Values may be strings, numbers, booleans, or lists of strings. Numbers may be integers or floating point and will be converted to 64 bit floating point. 1000 total values are allowed. Each item in an array counts towards the total. The following keys are reserved for internal use: &#x60;document_id&#x60;, &#x60;document_type&#x60;, &#x60;document_source&#x60;, &#x60;document_name&#x60;, &#x60;document_uploaded_at&#x60;, &#x60;start_time&#x60;, &#x60;end_time&#x60;.
28
+ # @option opts [String] :external_id An optional identifier for the document. A common value might be an id in an external system or the URL where the source file may be found.
29
+ # @option opts [String] :name An optional name for the document. If set, the document will have this name. Otherwise it will default to the file&#39;s name.
30
+ # @option opts [String] :partition An optional partition identifier. Documents can be scoped to a partition. Partitions must be lowercase alphanumeric and may only include the special characters &#x60;_&#x60; and &#x60;-&#x60;. A partition is created any time a document is created.
31
+ # @return [Document]
32
+ def create_document(file, opts = {})
33
+ data, _status_code, _headers = create_document_with_http_info(file, opts)
34
+ data
35
+ end
36
+
37
+ # Create Document
38
+ # On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [&#x60;pending&#x60;, &#x60;partitioning&#x60;, &#x60;partitioned&#x60;, &#x60;refined&#x60;, &#x60;chunked&#x60;, &#x60;indexed&#x60;, &#x60;summary_indexed&#x60;, &#x60;keyword_indexed&#x60;, &#x60;ready&#x60;, &#x60;failed&#x60;]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in &#x60;indexed&#x60; state. However the summary will only be available once the state has changed to &#x60;summary_indexed&#x60; or &#x60;ready&#x60;.
39
+ # @param file [File] The binary file to upload, extract, and index for retrieval. The following file types are supported: Plain Text: &#x60;.eml&#x60; &#x60;.html&#x60; &#x60;.json&#x60; &#x60;.md&#x60; &#x60;.msg&#x60; &#x60;.rst&#x60; &#x60;.rtf&#x60; &#x60;.txt&#x60; &#x60;.xml&#x60; Images: &#x60;.png&#x60; &#x60;.webp&#x60; &#x60;.jpg&#x60; &#x60;.jpeg&#x60; &#x60;.tiff&#x60; &#x60;.bmp&#x60; &#x60;.heic&#x60; Documents: &#x60;.csv&#x60; &#x60;.doc&#x60; &#x60;.docx&#x60; &#x60;.epub&#x60; &#x60;.epub+zip&#x60; &#x60;.odt&#x60; &#x60;.pdf&#x60; &#x60;.ppt&#x60; &#x60;.pptx&#x60; &#x60;.tsv&#x60; &#x60;.xlsx&#x60; &#x60;.xls&#x60;.
40
+ # @param [Hash] opts the optional parameters
41
+ # @option opts [Mode2] :mode
42
+ # @option opts [Hash<String, MetadataValue1>] :metadata Metadata for the document. Keys must be strings. Values may be strings, numbers, booleans, or lists of strings. Numbers may be integers or floating point and will be converted to 64 bit floating point. 1000 total values are allowed. Each item in an array counts towards the total. The following keys are reserved for internal use: &#x60;document_id&#x60;, &#x60;document_type&#x60;, &#x60;document_source&#x60;, &#x60;document_name&#x60;, &#x60;document_uploaded_at&#x60;, &#x60;start_time&#x60;, &#x60;end_time&#x60;.
43
+ # @option opts [String] :external_id An optional identifier for the document. A common value might be an id in an external system or the URL where the source file may be found.
44
+ # @option opts [String] :name An optional name for the document. If set, the document will have this name. Otherwise it will default to the file&#39;s name.
45
+ # @option opts [String] :partition An optional partition identifier. Documents can be scoped to a partition. Partitions must be lowercase alphanumeric and may only include the special characters &#x60;_&#x60; and &#x60;-&#x60;. A partition is created any time a document is created.
46
+ # @return [Array<(Document, Integer, Hash)>] Document data, response status code and response headers
47
+ def create_document_with_http_info(file, opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.create_document ...'
50
+ end
51
+ # verify the required parameter 'file' is set
52
+ if @api_client.config.client_side_validation && file.nil?
53
+ fail ArgumentError, "Missing the required parameter 'file' when calling DocumentsApi.create_document"
54
+ end
55
+ # resource path
56
+ local_var_path = '/documents'
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
65
+ # HTTP header 'Content-Type'
66
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
67
+ if !content_type.nil?
68
+ header_params['Content-Type'] = content_type
69
+ end
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+ form_params['file'] = file
74
+ form_params['mode'] = opts[:'mode'] if !opts[:'mode'].nil?
75
+ form_params['metadata'] = opts[:'metadata'] if !opts[:'metadata'].nil?
76
+ form_params['external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?
77
+ form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
78
+ form_params['partition'] = opts[:'partition'] if !opts[:'partition'].nil?
79
+
80
+ # http body (model)
81
+ post_body = opts[:debug_body]
82
+
83
+ # return_type
84
+ return_type = opts[:debug_return_type] || 'Document'
85
+
86
+ # auth_names
87
+ auth_names = opts[:debug_auth_names] || ['auth']
88
+
89
+ new_options = opts.merge(
90
+ :operation => :"DocumentsApi.create_document",
91
+ :header_params => header_params,
92
+ :query_params => query_params,
93
+ :form_params => form_params,
94
+ :body => post_body,
95
+ :auth_names => auth_names,
96
+ :return_type => return_type
97
+ )
98
+
99
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug "API called: DocumentsApi#create_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
102
+ end
103
+ return data, status_code, headers
104
+ end
105
+
106
+ # Create Document From Url
107
+ # Ingest a document from a publicly accessible URL. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [`pending`, `partitioning`, `partitioned`, `refined`, `chunked`, `indexed`, `summary_indexed`, `keyword_indexed`, `ready`, `failed`]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in `indexed` state. However the summary will only be available once the state has changed to `summary_indexed` or `ready`.
108
+ # @param create_document_from_url_params [CreateDocumentFromUrlParams]
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [Document]
111
+ def create_document_from_url(create_document_from_url_params, opts = {})
112
+ data, _status_code, _headers = create_document_from_url_with_http_info(create_document_from_url_params, opts)
113
+ data
114
+ end
115
+
116
+ # Create Document From Url
117
+ # Ingest a document from a publicly accessible URL. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [&#x60;pending&#x60;, &#x60;partitioning&#x60;, &#x60;partitioned&#x60;, &#x60;refined&#x60;, &#x60;chunked&#x60;, &#x60;indexed&#x60;, &#x60;summary_indexed&#x60;, &#x60;keyword_indexed&#x60;, &#x60;ready&#x60;, &#x60;failed&#x60;]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in &#x60;indexed&#x60; state. However the summary will only be available once the state has changed to &#x60;summary_indexed&#x60; or &#x60;ready&#x60;.
118
+ # @param create_document_from_url_params [CreateDocumentFromUrlParams]
119
+ # @param [Hash] opts the optional parameters
120
+ # @return [Array<(Document, Integer, Hash)>] Document data, response status code and response headers
121
+ def create_document_from_url_with_http_info(create_document_from_url_params, opts = {})
122
+ if @api_client.config.debugging
123
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.create_document_from_url ...'
124
+ end
125
+ # verify the required parameter 'create_document_from_url_params' is set
126
+ if @api_client.config.client_side_validation && create_document_from_url_params.nil?
127
+ fail ArgumentError, "Missing the required parameter 'create_document_from_url_params' when calling DocumentsApi.create_document_from_url"
128
+ end
129
+ # resource path
130
+ local_var_path = '/documents/url'
131
+
132
+ # query parameters
133
+ query_params = opts[:query_params] || {}
134
+
135
+ # header parameters
136
+ header_params = opts[:header_params] || {}
137
+ # HTTP header 'Accept' (if needed)
138
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
139
+ # HTTP header 'Content-Type'
140
+ content_type = @api_client.select_header_content_type(['application/json'])
141
+ if !content_type.nil?
142
+ header_params['Content-Type'] = content_type
143
+ end
144
+
145
+ # form parameters
146
+ form_params = opts[:form_params] || {}
147
+
148
+ # http body (model)
149
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_document_from_url_params)
150
+
151
+ # return_type
152
+ return_type = opts[:debug_return_type] || 'Document'
153
+
154
+ # auth_names
155
+ auth_names = opts[:debug_auth_names] || ['auth']
156
+
157
+ new_options = opts.merge(
158
+ :operation => :"DocumentsApi.create_document_from_url",
159
+ :header_params => header_params,
160
+ :query_params => query_params,
161
+ :form_params => form_params,
162
+ :body => post_body,
163
+ :auth_names => auth_names,
164
+ :return_type => return_type
165
+ )
166
+
167
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug "API called: DocumentsApi#create_document_from_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
170
+ end
171
+ return data, status_code, headers
172
+ end
173
+
174
+ # Create Document Raw
175
+ # Ingest a document as raw text. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [`pending`, `partitioning`, `partitioned`, `refined`, `chunked`, `indexed`, `summary_indexed`, `keyword_indexed`, `ready`, `failed`]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in `indexed` state. However the summary will only be available once the state has changed to `summary_indexed` or `ready`.
176
+ # @param create_document_raw_params [CreateDocumentRawParams]
177
+ # @param [Hash] opts the optional parameters
178
+ # @return [Document]
179
+ def create_document_raw(create_document_raw_params, opts = {})
180
+ data, _status_code, _headers = create_document_raw_with_http_info(create_document_raw_params, opts)
181
+ data
182
+ end
183
+
184
+ # Create Document Raw
185
+ # Ingest a document as raw text. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [&#x60;pending&#x60;, &#x60;partitioning&#x60;, &#x60;partitioned&#x60;, &#x60;refined&#x60;, &#x60;chunked&#x60;, &#x60;indexed&#x60;, &#x60;summary_indexed&#x60;, &#x60;keyword_indexed&#x60;, &#x60;ready&#x60;, &#x60;failed&#x60;]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in &#x60;indexed&#x60; state. However the summary will only be available once the state has changed to &#x60;summary_indexed&#x60; or &#x60;ready&#x60;.
186
+ # @param create_document_raw_params [CreateDocumentRawParams]
187
+ # @param [Hash] opts the optional parameters
188
+ # @return [Array<(Document, Integer, Hash)>] Document data, response status code and response headers
189
+ def create_document_raw_with_http_info(create_document_raw_params, opts = {})
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.create_document_raw ...'
192
+ end
193
+ # verify the required parameter 'create_document_raw_params' is set
194
+ if @api_client.config.client_side_validation && create_document_raw_params.nil?
195
+ fail ArgumentError, "Missing the required parameter 'create_document_raw_params' when calling DocumentsApi.create_document_raw"
196
+ end
197
+ # resource path
198
+ local_var_path = '/documents/raw'
199
+
200
+ # query parameters
201
+ query_params = opts[:query_params] || {}
202
+
203
+ # header parameters
204
+ header_params = opts[:header_params] || {}
205
+ # HTTP header 'Accept' (if needed)
206
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
207
+ # HTTP header 'Content-Type'
208
+ content_type = @api_client.select_header_content_type(['application/json'])
209
+ if !content_type.nil?
210
+ header_params['Content-Type'] = content_type
211
+ end
212
+
213
+ # form parameters
214
+ form_params = opts[:form_params] || {}
215
+
216
+ # http body (model)
217
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_document_raw_params)
218
+
219
+ # return_type
220
+ return_type = opts[:debug_return_type] || 'Document'
221
+
222
+ # auth_names
223
+ auth_names = opts[:debug_auth_names] || ['auth']
224
+
225
+ new_options = opts.merge(
226
+ :operation => :"DocumentsApi.create_document_raw",
227
+ :header_params => header_params,
228
+ :query_params => query_params,
229
+ :form_params => form_params,
230
+ :body => post_body,
231
+ :auth_names => auth_names,
232
+ :return_type => return_type
233
+ )
234
+
235
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug "API called: DocumentsApi#create_document_raw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
238
+ end
239
+ return data, status_code, headers
240
+ end
241
+
242
+ # Delete Document
243
+ # @param document_id [String] The id of the document.
244
+ # @param [Hash] opts the optional parameters
245
+ # @option opts [Boolean] :async If true, performs document deletion asynchronously
246
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
247
+ # @return [DocumentDelete]
248
+ def delete_document(document_id, opts = {})
249
+ data, _status_code, _headers = delete_document_with_http_info(document_id, opts)
250
+ data
251
+ end
252
+
253
+ # Delete Document
254
+ # @param document_id [String] The id of the document.
255
+ # @param [Hash] opts the optional parameters
256
+ # @option opts [Boolean] :async If true, performs document deletion asynchronously
257
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
258
+ # @return [Array<(DocumentDelete, Integer, Hash)>] DocumentDelete data, response status code and response headers
259
+ def delete_document_with_http_info(document_id, opts = {})
260
+ if @api_client.config.debugging
261
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.delete_document ...'
262
+ end
263
+ # verify the required parameter 'document_id' is set
264
+ if @api_client.config.client_side_validation && document_id.nil?
265
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.delete_document"
266
+ end
267
+ # resource path
268
+ local_var_path = '/documents/{document_id}'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
269
+
270
+ # query parameters
271
+ query_params = opts[:query_params] || {}
272
+ query_params[:'async'] = opts[:'async'] if !opts[:'async'].nil?
273
+
274
+ # header parameters
275
+ header_params = opts[:header_params] || {}
276
+ # HTTP header 'Accept' (if needed)
277
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
278
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
279
+
280
+ # form parameters
281
+ form_params = opts[:form_params] || {}
282
+
283
+ # http body (model)
284
+ post_body = opts[:debug_body]
285
+
286
+ # return_type
287
+ return_type = opts[:debug_return_type] || 'DocumentDelete'
288
+
289
+ # auth_names
290
+ auth_names = opts[:debug_auth_names] || ['auth']
291
+
292
+ new_options = opts.merge(
293
+ :operation => :"DocumentsApi.delete_document",
294
+ :header_params => header_params,
295
+ :query_params => query_params,
296
+ :form_params => form_params,
297
+ :body => post_body,
298
+ :auth_names => auth_names,
299
+ :return_type => return_type
300
+ )
301
+
302
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
303
+ if @api_client.config.debugging
304
+ @api_client.config.logger.debug "API called: DocumentsApi#delete_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
305
+ end
306
+ return data, status_code, headers
307
+ end
308
+
309
+ # Get Document
310
+ # @param document_id [String] The id of the document.
311
+ # @param [Hash] opts the optional parameters
312
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
313
+ # @return [DocumentGet]
314
+ def get_document(document_id, opts = {})
315
+ data, _status_code, _headers = get_document_with_http_info(document_id, opts)
316
+ data
317
+ end
318
+
319
+ # Get Document
320
+ # @param document_id [String] The id of the document.
321
+ # @param [Hash] opts the optional parameters
322
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
323
+ # @return [Array<(DocumentGet, Integer, Hash)>] DocumentGet data, response status code and response headers
324
+ def get_document_with_http_info(document_id, opts = {})
325
+ if @api_client.config.debugging
326
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.get_document ...'
327
+ end
328
+ # verify the required parameter 'document_id' is set
329
+ if @api_client.config.client_side_validation && document_id.nil?
330
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document"
331
+ end
332
+ # resource path
333
+ local_var_path = '/documents/{document_id}'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
334
+
335
+ # query parameters
336
+ query_params = opts[:query_params] || {}
337
+
338
+ # header parameters
339
+ header_params = opts[:header_params] || {}
340
+ # HTTP header 'Accept' (if needed)
341
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
342
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
343
+
344
+ # form parameters
345
+ form_params = opts[:form_params] || {}
346
+
347
+ # http body (model)
348
+ post_body = opts[:debug_body]
349
+
350
+ # return_type
351
+ return_type = opts[:debug_return_type] || 'DocumentGet'
352
+
353
+ # auth_names
354
+ auth_names = opts[:debug_auth_names] || ['auth']
355
+
356
+ new_options = opts.merge(
357
+ :operation => :"DocumentsApi.get_document",
358
+ :header_params => header_params,
359
+ :query_params => query_params,
360
+ :form_params => form_params,
361
+ :body => post_body,
362
+ :auth_names => auth_names,
363
+ :return_type => return_type
364
+ )
365
+
366
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
367
+ if @api_client.config.debugging
368
+ @api_client.config.logger.debug "API called: DocumentsApi#get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
369
+ end
370
+ return data, status_code, headers
371
+ end
372
+
373
+ # Get Document Chunk
374
+ # Gets a document chunk by its document and chunk ID.
375
+ # @param document_id [String] The id of the document.
376
+ # @param chunk_id [String] The ID of the chunk.
377
+ # @param [Hash] opts the optional parameters
378
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
379
+ # @return [DocumentChunkDetail]
380
+ def get_document_chunk(document_id, chunk_id, opts = {})
381
+ data, _status_code, _headers = get_document_chunk_with_http_info(document_id, chunk_id, opts)
382
+ data
383
+ end
384
+
385
+ # Get Document Chunk
386
+ # Gets a document chunk by its document and chunk ID.
387
+ # @param document_id [String] The id of the document.
388
+ # @param chunk_id [String] The ID of the chunk.
389
+ # @param [Hash] opts the optional parameters
390
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
391
+ # @return [Array<(DocumentChunkDetail, Integer, Hash)>] DocumentChunkDetail data, response status code and response headers
392
+ def get_document_chunk_with_http_info(document_id, chunk_id, opts = {})
393
+ if @api_client.config.debugging
394
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.get_document_chunk ...'
395
+ end
396
+ # verify the required parameter 'document_id' is set
397
+ if @api_client.config.client_side_validation && document_id.nil?
398
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document_chunk"
399
+ end
400
+ # verify the required parameter 'chunk_id' is set
401
+ if @api_client.config.client_side_validation && chunk_id.nil?
402
+ fail ArgumentError, "Missing the required parameter 'chunk_id' when calling DocumentsApi.get_document_chunk"
403
+ end
404
+ # resource path
405
+ local_var_path = '/documents/{document_id}/chunks/{chunk_id}'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s)).sub('{' + 'chunk_id' + '}', CGI.escape(chunk_id.to_s))
406
+
407
+ # query parameters
408
+ query_params = opts[:query_params] || {}
409
+
410
+ # header parameters
411
+ header_params = opts[:header_params] || {}
412
+ # HTTP header 'Accept' (if needed)
413
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
414
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
415
+
416
+ # form parameters
417
+ form_params = opts[:form_params] || {}
418
+
419
+ # http body (model)
420
+ post_body = opts[:debug_body]
421
+
422
+ # return_type
423
+ return_type = opts[:debug_return_type] || 'DocumentChunkDetail'
424
+
425
+ # auth_names
426
+ auth_names = opts[:debug_auth_names] || ['auth']
427
+
428
+ new_options = opts.merge(
429
+ :operation => :"DocumentsApi.get_document_chunk",
430
+ :header_params => header_params,
431
+ :query_params => query_params,
432
+ :form_params => form_params,
433
+ :body => post_body,
434
+ :auth_names => auth_names,
435
+ :return_type => return_type
436
+ )
437
+
438
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
439
+ if @api_client.config.debugging
440
+ @api_client.config.logger.debug "API called: DocumentsApi#get_document_chunk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
441
+ end
442
+ return data, status_code, headers
443
+ end
444
+
445
+ # Get Document Chunk Content
446
+ # Returns the content of a document chunk in the requested format. Can be used to stream media of the content for audio/video documents.
447
+ # @param document_id [String] The id of the document.
448
+ # @param chunk_id [String] The ID of the chunk.
449
+ # @param [Hash] opts the optional parameters
450
+ # @option opts [String] :media_type The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the chunk&#39;s document type.
451
+ # @option opts [Boolean] :download Whether to return the content as a file download or a raw stream. If set to &#x60;true&#x60;, the content will be returned as a named file for download. (default to false)
452
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
453
+ # @option opts [String] :range
454
+ # @return [Object]
455
+ def get_document_chunk_content(document_id, chunk_id, opts = {})
456
+ data, _status_code, _headers = get_document_chunk_content_with_http_info(document_id, chunk_id, opts)
457
+ data
458
+ end
459
+
460
+ # Get Document Chunk Content
461
+ # Returns the content of a document chunk in the requested format. Can be used to stream media of the content for audio/video documents.
462
+ # @param document_id [String] The id of the document.
463
+ # @param chunk_id [String] The ID of the chunk.
464
+ # @param [Hash] opts the optional parameters
465
+ # @option opts [String] :media_type The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the chunk&#39;s document type.
466
+ # @option opts [Boolean] :download Whether to return the content as a file download or a raw stream. If set to &#x60;true&#x60;, the content will be returned as a named file for download. (default to false)
467
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
468
+ # @option opts [String] :range
469
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
470
+ def get_document_chunk_content_with_http_info(document_id, chunk_id, opts = {})
471
+ if @api_client.config.debugging
472
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.get_document_chunk_content ...'
473
+ end
474
+ # verify the required parameter 'document_id' is set
475
+ if @api_client.config.client_side_validation && document_id.nil?
476
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document_chunk_content"
477
+ end
478
+ # verify the required parameter 'chunk_id' is set
479
+ if @api_client.config.client_side_validation && chunk_id.nil?
480
+ fail ArgumentError, "Missing the required parameter 'chunk_id' when calling DocumentsApi.get_document_chunk_content"
481
+ end
482
+ allowable_values = ["text/plain", "audio/mpeg", "video/mp4", "image/webp", "image/heic", "image/bmp", "image/png", "image/jpeg", "image/tiff"]
483
+ if @api_client.config.client_side_validation && opts[:'media_type'] && !allowable_values.include?(opts[:'media_type'])
484
+ fail ArgumentError, "invalid value for \"media_type\", must be one of #{allowable_values}"
485
+ end
486
+ # resource path
487
+ local_var_path = '/documents/{document_id}/chunks/{chunk_id}/content'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s)).sub('{' + 'chunk_id' + '}', CGI.escape(chunk_id.to_s))
488
+
489
+ # query parameters
490
+ query_params = opts[:query_params] || {}
491
+ query_params[:'media_type'] = opts[:'media_type'] if !opts[:'media_type'].nil?
492
+ query_params[:'download'] = opts[:'download'] if !opts[:'download'].nil?
493
+
494
+ # header parameters
495
+ header_params = opts[:header_params] || {}
496
+ # HTTP header 'Accept' (if needed)
497
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/octet-stream', 'audio/mpeg', 'text/plain']) unless header_params['Accept']
498
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
499
+ header_params[:'range'] = opts[:'range'] if !opts[:'range'].nil?
500
+
501
+ # form parameters
502
+ form_params = opts[:form_params] || {}
503
+
504
+ # http body (model)
505
+ post_body = opts[:debug_body]
506
+
507
+ # return_type
508
+ return_type = opts[:debug_return_type] || 'Object'
509
+
510
+ # auth_names
511
+ auth_names = opts[:debug_auth_names] || ['auth']
512
+
513
+ new_options = opts.merge(
514
+ :operation => :"DocumentsApi.get_document_chunk_content",
515
+ :header_params => header_params,
516
+ :query_params => query_params,
517
+ :form_params => form_params,
518
+ :body => post_body,
519
+ :auth_names => auth_names,
520
+ :return_type => return_type
521
+ )
522
+
523
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
524
+ if @api_client.config.debugging
525
+ @api_client.config.logger.debug "API called: DocumentsApi#get_document_chunk_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
526
+ end
527
+ return data, status_code, headers
528
+ end
529
+
530
+ # Get Document Chunks
531
+ # List all document chunks sorted by index in ascending order. May be limited to a range of chunk indices with the `start_index` and `end_index` parameters. Documents created prior to 9/18/2024, which have not been updated since, have chunks which do not include an index and their index will be returned as -1. They will be sorted by their ID instead. Updating the document using the `Update Document File` or `Update Document Raw` endpoint will regenerate document chunks, including their index. Results are paginated with a max limit of 100. When more chunks are available, a `cursor` will be provided. Use the `cursor` parameter to retrieve the subsequent page.
532
+ # @param document_id [String] The id of the document.
533
+ # @param [Hash] opts the optional parameters
534
+ # @option opts [Integer] :start_index The inclusive starting index of the chunk range to list. If omitted and &#x60;end_index&#x60; is present effectively limits results to at most one chunk matching &#x60;end_index&#x60;. If both &#x60;start_index&#x60; and &#x60;end_index&#x60; are omitted, results are not limited by index.
535
+ # @option opts [Integer] :end_index The inclusive ending index of the chunk range to list. If omitted and &#x60;start_index&#x60; is present effectively limits results to at most one chunk matching &#x60;start_index&#x60;. If both &#x60;start_index&#x60; and &#x60;end_index&#x60; are omitted, results are not limited by index.
536
+ # @option opts [String] :cursor An opaque cursor for pagination
537
+ # @option opts [Integer] :page_size The number of items per page (must be greater than 0 and less than or equal to 100) (default to 10)
538
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
539
+ # @return [DocumentChunkList]
540
+ def get_document_chunks(document_id, opts = {})
541
+ data, _status_code, _headers = get_document_chunks_with_http_info(document_id, opts)
542
+ data
543
+ end
544
+
545
+ # Get Document Chunks
546
+ # List all document chunks sorted by index in ascending order. May be limited to a range of chunk indices with the &#x60;start_index&#x60; and &#x60;end_index&#x60; parameters. Documents created prior to 9/18/2024, which have not been updated since, have chunks which do not include an index and their index will be returned as -1. They will be sorted by their ID instead. Updating the document using the &#x60;Update Document File&#x60; or &#x60;Update Document Raw&#x60; endpoint will regenerate document chunks, including their index. Results are paginated with a max limit of 100. When more chunks are available, a &#x60;cursor&#x60; will be provided. Use the &#x60;cursor&#x60; parameter to retrieve the subsequent page.
547
+ # @param document_id [String] The id of the document.
548
+ # @param [Hash] opts the optional parameters
549
+ # @option opts [Integer] :start_index The inclusive starting index of the chunk range to list. If omitted and &#x60;end_index&#x60; is present effectively limits results to at most one chunk matching &#x60;end_index&#x60;. If both &#x60;start_index&#x60; and &#x60;end_index&#x60; are omitted, results are not limited by index.
550
+ # @option opts [Integer] :end_index The inclusive ending index of the chunk range to list. If omitted and &#x60;start_index&#x60; is present effectively limits results to at most one chunk matching &#x60;start_index&#x60;. If both &#x60;start_index&#x60; and &#x60;end_index&#x60; are omitted, results are not limited by index.
551
+ # @option opts [String] :cursor An opaque cursor for pagination
552
+ # @option opts [Integer] :page_size The number of items per page (must be greater than 0 and less than or equal to 100) (default to 10)
553
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
554
+ # @return [Array<(DocumentChunkList, Integer, Hash)>] DocumentChunkList data, response status code and response headers
555
+ def get_document_chunks_with_http_info(document_id, opts = {})
556
+ if @api_client.config.debugging
557
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.get_document_chunks ...'
558
+ end
559
+ # verify the required parameter 'document_id' is set
560
+ if @api_client.config.client_side_validation && document_id.nil?
561
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document_chunks"
562
+ end
563
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
564
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DocumentsApi.get_document_chunks, must be smaller than or equal to 100.'
565
+ end
566
+
567
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
568
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DocumentsApi.get_document_chunks, must be greater than or equal to 1.'
569
+ end
570
+
571
+ # resource path
572
+ local_var_path = '/documents/{document_id}/chunks'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
573
+
574
+ # query parameters
575
+ query_params = opts[:query_params] || {}
576
+ query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?
577
+ query_params[:'end_index'] = opts[:'end_index'] if !opts[:'end_index'].nil?
578
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
579
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
580
+
581
+ # header parameters
582
+ header_params = opts[:header_params] || {}
583
+ # HTTP header 'Accept' (if needed)
584
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
585
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
586
+
587
+ # form parameters
588
+ form_params = opts[:form_params] || {}
589
+
590
+ # http body (model)
591
+ post_body = opts[:debug_body]
592
+
593
+ # return_type
594
+ return_type = opts[:debug_return_type] || 'DocumentChunkList'
595
+
596
+ # auth_names
597
+ auth_names = opts[:debug_auth_names] || ['auth']
598
+
599
+ new_options = opts.merge(
600
+ :operation => :"DocumentsApi.get_document_chunks",
601
+ :header_params => header_params,
602
+ :query_params => query_params,
603
+ :form_params => form_params,
604
+ :body => post_body,
605
+ :auth_names => auth_names,
606
+ :return_type => return_type
607
+ )
608
+
609
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
610
+ if @api_client.config.debugging
611
+ @api_client.config.logger.debug "API called: DocumentsApi#get_document_chunks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
612
+ end
613
+ return data, status_code, headers
614
+ end
615
+
616
+ # Get Document Content
617
+ # Get the content of a document. The `media_type` parameter can be used to request the content in a different format. When requesting as `application/json` additional metadata about the document will be included. If the original document contained content such as images or other non-textual media, this response will include a text description of that media instead of the original file data. Using mime types such as `audio/mpeg` or `video/mp4` will stream the file in a format that can be provided to an audio video player.
618
+ # @param document_id [String] The id of the document.
619
+ # @param [Hash] opts the optional parameters
620
+ # @option opts [MediaType] :media_type The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the document&#39;s type.
621
+ # @option opts [Boolean] :download Whether to return the content as a file download or a raw stream. If set to &#x60;true&#x60;, the content will be returned as a named file for download. (default to false)
622
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
623
+ # @option opts [String] :range
624
+ # @return [DocumentWithContent]
625
+ def get_document_content(document_id, opts = {})
626
+ data, _status_code, _headers = get_document_content_with_http_info(document_id, opts)
627
+ data
628
+ end
629
+
630
+ # Get Document Content
631
+ # Get the content of a document. The &#x60;media_type&#x60; parameter can be used to request the content in a different format. When requesting as &#x60;application/json&#x60; additional metadata about the document will be included. If the original document contained content such as images or other non-textual media, this response will include a text description of that media instead of the original file data. Using mime types such as &#x60;audio/mpeg&#x60; or &#x60;video/mp4&#x60; will stream the file in a format that can be provided to an audio video player.
632
+ # @param document_id [String] The id of the document.
633
+ # @param [Hash] opts the optional parameters
634
+ # @option opts [MediaType] :media_type The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the document&#39;s type.
635
+ # @option opts [Boolean] :download Whether to return the content as a file download or a raw stream. If set to &#x60;true&#x60;, the content will be returned as a named file for download. (default to false)
636
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
637
+ # @option opts [String] :range
638
+ # @return [Array<(DocumentWithContent, Integer, Hash)>] DocumentWithContent data, response status code and response headers
639
+ def get_document_content_with_http_info(document_id, opts = {})
640
+ if @api_client.config.debugging
641
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.get_document_content ...'
642
+ end
643
+ # verify the required parameter 'document_id' is set
644
+ if @api_client.config.client_side_validation && document_id.nil?
645
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document_content"
646
+ end
647
+ # resource path
648
+ local_var_path = '/documents/{document_id}/content'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
649
+
650
+ # query parameters
651
+ query_params = opts[:query_params] || {}
652
+ query_params[:'media_type'] = opts[:'media_type'] if !opts[:'media_type'].nil?
653
+ query_params[:'download'] = opts[:'download'] if !opts[:'download'].nil?
654
+
655
+ # header parameters
656
+ header_params = opts[:header_params] || {}
657
+ # HTTP header 'Accept' (if needed)
658
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
659
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
660
+ header_params[:'range'] = opts[:'range'] if !opts[:'range'].nil?
661
+
662
+ # form parameters
663
+ form_params = opts[:form_params] || {}
664
+
665
+ # http body (model)
666
+ post_body = opts[:debug_body]
667
+
668
+ # return_type
669
+ return_type = opts[:debug_return_type] || 'DocumentWithContent'
670
+
671
+ # auth_names
672
+ auth_names = opts[:debug_auth_names] || ['auth']
673
+
674
+ new_options = opts.merge(
675
+ :operation => :"DocumentsApi.get_document_content",
676
+ :header_params => header_params,
677
+ :query_params => query_params,
678
+ :form_params => form_params,
679
+ :body => post_body,
680
+ :auth_names => auth_names,
681
+ :return_type => return_type
682
+ )
683
+
684
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
685
+ if @api_client.config.debugging
686
+ @api_client.config.logger.debug "API called: DocumentsApi#get_document_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
687
+ end
688
+ return data, status_code, headers
689
+ end
690
+
691
+ # Get Document Source
692
+ # Get the source file of a document. The source file is the original file that was uploaded to create the document. If the document was created from a URL, the source file will be the content of the URL. If the document was created by a connection, the source file will vary based on the type of the connection. For example, a Google Drive connection will return the file that was synced from the Google Drive, while a SalesForce connection would return a JSON file of the data synced from SalesForce.
693
+ # @param document_id [String] The id of the document.
694
+ # @param [Hash] opts the optional parameters
695
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
696
+ # @return [File]
697
+ def get_document_source(document_id, opts = {})
698
+ data, _status_code, _headers = get_document_source_with_http_info(document_id, opts)
699
+ data
700
+ end
701
+
702
+ # Get Document Source
703
+ # Get the source file of a document. The source file is the original file that was uploaded to create the document. If the document was created from a URL, the source file will be the content of the URL. If the document was created by a connection, the source file will vary based on the type of the connection. For example, a Google Drive connection will return the file that was synced from the Google Drive, while a SalesForce connection would return a JSON file of the data synced from SalesForce.
704
+ # @param document_id [String] The id of the document.
705
+ # @param [Hash] opts the optional parameters
706
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
707
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
708
+ def get_document_source_with_http_info(document_id, opts = {})
709
+ if @api_client.config.debugging
710
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.get_document_source ...'
711
+ end
712
+ # verify the required parameter 'document_id' is set
713
+ if @api_client.config.client_side_validation && document_id.nil?
714
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document_source"
715
+ end
716
+ # resource path
717
+ local_var_path = '/documents/{document_id}/source'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
718
+
719
+ # query parameters
720
+ query_params = opts[:query_params] || {}
721
+
722
+ # header parameters
723
+ header_params = opts[:header_params] || {}
724
+ # HTTP header 'Accept' (if needed)
725
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) unless header_params['Accept']
726
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
727
+
728
+ # form parameters
729
+ form_params = opts[:form_params] || {}
730
+
731
+ # http body (model)
732
+ post_body = opts[:debug_body]
733
+
734
+ # return_type
735
+ return_type = opts[:debug_return_type] || 'File'
736
+
737
+ # auth_names
738
+ auth_names = opts[:debug_auth_names] || ['auth']
739
+
740
+ new_options = opts.merge(
741
+ :operation => :"DocumentsApi.get_document_source",
742
+ :header_params => header_params,
743
+ :query_params => query_params,
744
+ :form_params => form_params,
745
+ :body => post_body,
746
+ :auth_names => auth_names,
747
+ :return_type => return_type
748
+ )
749
+
750
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
751
+ if @api_client.config.debugging
752
+ @api_client.config.logger.debug "API called: DocumentsApi#get_document_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
753
+ end
754
+ return data, status_code, headers
755
+ end
756
+
757
+ # Get Document Summary
758
+ # Get a LLM generated summary of the document. The summary is created when the document is first created or updated. Documents of types ['xls', 'xlsx', 'csv', 'json'] are not supported for summarization. Documents greater than 1M in token length are not supported. This feature is in beta and may change in the future.
759
+ # @param document_id [String] The id of the document.
760
+ # @param [Hash] opts the optional parameters
761
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
762
+ # @return [DocumentSummary]
763
+ def get_document_summary(document_id, opts = {})
764
+ data, _status_code, _headers = get_document_summary_with_http_info(document_id, opts)
765
+ data
766
+ end
767
+
768
+ # Get Document Summary
769
+ # Get a LLM generated summary of the document. The summary is created when the document is first created or updated. Documents of types [&#39;xls&#39;, &#39;xlsx&#39;, &#39;csv&#39;, &#39;json&#39;] are not supported for summarization. Documents greater than 1M in token length are not supported. This feature is in beta and may change in the future.
770
+ # @param document_id [String] The id of the document.
771
+ # @param [Hash] opts the optional parameters
772
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
773
+ # @return [Array<(DocumentSummary, Integer, Hash)>] DocumentSummary data, response status code and response headers
774
+ def get_document_summary_with_http_info(document_id, opts = {})
775
+ if @api_client.config.debugging
776
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.get_document_summary ...'
777
+ end
778
+ # verify the required parameter 'document_id' is set
779
+ if @api_client.config.client_side_validation && document_id.nil?
780
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document_summary"
781
+ end
782
+ # resource path
783
+ local_var_path = '/documents/{document_id}/summary'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
784
+
785
+ # query parameters
786
+ query_params = opts[:query_params] || {}
787
+
788
+ # header parameters
789
+ header_params = opts[:header_params] || {}
790
+ # HTTP header 'Accept' (if needed)
791
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
792
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
793
+
794
+ # form parameters
795
+ form_params = opts[:form_params] || {}
796
+
797
+ # http body (model)
798
+ post_body = opts[:debug_body]
799
+
800
+ # return_type
801
+ return_type = opts[:debug_return_type] || 'DocumentSummary'
802
+
803
+ # auth_names
804
+ auth_names = opts[:debug_auth_names] || ['auth']
805
+
806
+ new_options = opts.merge(
807
+ :operation => :"DocumentsApi.get_document_summary",
808
+ :header_params => header_params,
809
+ :query_params => query_params,
810
+ :form_params => form_params,
811
+ :body => post_body,
812
+ :auth_names => auth_names,
813
+ :return_type => return_type
814
+ )
815
+
816
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
817
+ if @api_client.config.debugging
818
+ @api_client.config.logger.debug "API called: DocumentsApi#get_document_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
819
+ end
820
+ return data, status_code, headers
821
+ end
822
+
823
+ # List Documents
824
+ # List all documents sorted by created_at in descending order. Results are paginated with a max limit of 100. When more documents are available, a `cursor` will be provided. Use the `cursor` parameter to retrieve the subsequent page.
825
+ # @param [Hash] opts the optional parameters
826
+ # @option opts [String] :cursor An opaque cursor for pagination
827
+ # @option opts [Integer] :page_size The number of items per page (must be greater than 0 and less than or equal to 100) (default to 10)
828
+ # @option opts [String] :filter The metadata search filter. Returns only items which match the filter. The following filter operators are supported: $eq - Equal to (number, string, boolean), $ne - Not equal to (number, string, boolean), $gt - Greater than (number), $gte - Greater than or equal to (number), $lt - Less than (number), $lte - Less than or equal to (number), $in - In array (string or number), $nin - Not in array (string or number). The operators can be combined with AND and OR. Read [Metadata &amp; Filters guide](https://docs.ragie.ai/docs/metadata-filters) for more details and examples.
829
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
830
+ # @return [DocumentList]
831
+ def list_documents(opts = {})
832
+ data, _status_code, _headers = list_documents_with_http_info(opts)
833
+ data
834
+ end
835
+
836
+ # List Documents
837
+ # List all documents sorted by created_at in descending order. Results are paginated with a max limit of 100. When more documents are available, a &#x60;cursor&#x60; will be provided. Use the &#x60;cursor&#x60; parameter to retrieve the subsequent page.
838
+ # @param [Hash] opts the optional parameters
839
+ # @option opts [String] :cursor An opaque cursor for pagination
840
+ # @option opts [Integer] :page_size The number of items per page (must be greater than 0 and less than or equal to 100) (default to 10)
841
+ # @option opts [String] :filter The metadata search filter. Returns only items which match the filter. The following filter operators are supported: $eq - Equal to (number, string, boolean), $ne - Not equal to (number, string, boolean), $gt - Greater than (number), $gte - Greater than or equal to (number), $lt - Less than (number), $lte - Less than or equal to (number), $in - In array (string or number), $nin - Not in array (string or number). The operators can be combined with AND and OR. Read [Metadata &amp; Filters guide](https://docs.ragie.ai/docs/metadata-filters) for more details and examples.
842
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
843
+ # @return [Array<(DocumentList, Integer, Hash)>] DocumentList data, response status code and response headers
844
+ def list_documents_with_http_info(opts = {})
845
+ if @api_client.config.debugging
846
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.list_documents ...'
847
+ end
848
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
849
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DocumentsApi.list_documents, must be smaller than or equal to 100.'
850
+ end
851
+
852
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
853
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DocumentsApi.list_documents, must be greater than or equal to 1.'
854
+ end
855
+
856
+ # resource path
857
+ local_var_path = '/documents'
858
+
859
+ # query parameters
860
+ query_params = opts[:query_params] || {}
861
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
862
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
863
+ query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
864
+
865
+ # header parameters
866
+ header_params = opts[:header_params] || {}
867
+ # HTTP header 'Accept' (if needed)
868
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
869
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
870
+
871
+ # form parameters
872
+ form_params = opts[:form_params] || {}
873
+
874
+ # http body (model)
875
+ post_body = opts[:debug_body]
876
+
877
+ # return_type
878
+ return_type = opts[:debug_return_type] || 'DocumentList'
879
+
880
+ # auth_names
881
+ auth_names = opts[:debug_auth_names] || ['auth']
882
+
883
+ new_options = opts.merge(
884
+ :operation => :"DocumentsApi.list_documents",
885
+ :header_params => header_params,
886
+ :query_params => query_params,
887
+ :form_params => form_params,
888
+ :body => post_body,
889
+ :auth_names => auth_names,
890
+ :return_type => return_type
891
+ )
892
+
893
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
894
+ if @api_client.config.debugging
895
+ @api_client.config.logger.debug "API called: DocumentsApi#list_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
896
+ end
897
+ return data, status_code, headers
898
+ end
899
+
900
+ # Patch Document Metadata
901
+ # @param document_id [String] The id of the document.
902
+ # @param patch_document_metadata_params [PatchDocumentMetadataParams]
903
+ # @param [Hash] opts the optional parameters
904
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
905
+ # @return [ResponsePatchdocumentmetadata]
906
+ def patch_document_metadata(document_id, patch_document_metadata_params, opts = {})
907
+ data, _status_code, _headers = patch_document_metadata_with_http_info(document_id, patch_document_metadata_params, opts)
908
+ data
909
+ end
910
+
911
+ # Patch Document Metadata
912
+ # @param document_id [String] The id of the document.
913
+ # @param patch_document_metadata_params [PatchDocumentMetadataParams]
914
+ # @param [Hash] opts the optional parameters
915
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
916
+ # @return [Array<(ResponsePatchdocumentmetadata, Integer, Hash)>] ResponsePatchdocumentmetadata data, response status code and response headers
917
+ def patch_document_metadata_with_http_info(document_id, patch_document_metadata_params, opts = {})
918
+ if @api_client.config.debugging
919
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.patch_document_metadata ...'
920
+ end
921
+ # verify the required parameter 'document_id' is set
922
+ if @api_client.config.client_side_validation && document_id.nil?
923
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.patch_document_metadata"
924
+ end
925
+ # verify the required parameter 'patch_document_metadata_params' is set
926
+ if @api_client.config.client_side_validation && patch_document_metadata_params.nil?
927
+ fail ArgumentError, "Missing the required parameter 'patch_document_metadata_params' when calling DocumentsApi.patch_document_metadata"
928
+ end
929
+ # resource path
930
+ local_var_path = '/documents/{document_id}/metadata'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
931
+
932
+ # query parameters
933
+ query_params = opts[:query_params] || {}
934
+
935
+ # header parameters
936
+ header_params = opts[:header_params] || {}
937
+ # HTTP header 'Accept' (if needed)
938
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
939
+ # HTTP header 'Content-Type'
940
+ content_type = @api_client.select_header_content_type(['application/json'])
941
+ if !content_type.nil?
942
+ header_params['Content-Type'] = content_type
943
+ end
944
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
945
+
946
+ # form parameters
947
+ form_params = opts[:form_params] || {}
948
+
949
+ # http body (model)
950
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_document_metadata_params)
951
+
952
+ # return_type
953
+ return_type = opts[:debug_return_type] || 'ResponsePatchdocumentmetadata'
954
+
955
+ # auth_names
956
+ auth_names = opts[:debug_auth_names] || ['auth']
957
+
958
+ new_options = opts.merge(
959
+ :operation => :"DocumentsApi.patch_document_metadata",
960
+ :header_params => header_params,
961
+ :query_params => query_params,
962
+ :form_params => form_params,
963
+ :body => post_body,
964
+ :auth_names => auth_names,
965
+ :return_type => return_type
966
+ )
967
+
968
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
969
+ if @api_client.config.debugging
970
+ @api_client.config.logger.debug "API called: DocumentsApi#patch_document_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
971
+ end
972
+ return data, status_code, headers
973
+ end
974
+
975
+ # Update Document File
976
+ # @param document_id [String] The id of the document.
977
+ # @param file [File] The binary file to upload, extract, and index for retrieval. The following file types are supported: Plain Text: &#x60;.eml&#x60; &#x60;.html&#x60; &#x60;.json&#x60; &#x60;.md&#x60; &#x60;.msg&#x60; &#x60;.rst&#x60; &#x60;.rtf&#x60; &#x60;.txt&#x60; &#x60;.xml&#x60; Images: &#x60;.png&#x60; &#x60;.webp&#x60; &#x60;.jpg&#x60; &#x60;.jpeg&#x60; &#x60;.tiff&#x60; &#x60;.bmp&#x60; &#x60;.heic&#x60; Documents: &#x60;.csv&#x60; &#x60;.doc&#x60; &#x60;.docx&#x60; &#x60;.epub&#x60; &#x60;.epub+zip&#x60; &#x60;.odt&#x60; &#x60;.pdf&#x60; &#x60;.ppt&#x60; &#x60;.pptx&#x60; &#x60;.tsv&#x60; &#x60;.xlsx&#x60; &#x60;.xls&#x60;.
978
+ # @param [Hash] opts the optional parameters
979
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
980
+ # @option opts [Mode2] :mode
981
+ # @return [DocumentFileUpdate]
982
+ def update_document_file(document_id, file, opts = {})
983
+ data, _status_code, _headers = update_document_file_with_http_info(document_id, file, opts)
984
+ data
985
+ end
986
+
987
+ # Update Document File
988
+ # @param document_id [String] The id of the document.
989
+ # @param file [File] The binary file to upload, extract, and index for retrieval. The following file types are supported: Plain Text: &#x60;.eml&#x60; &#x60;.html&#x60; &#x60;.json&#x60; &#x60;.md&#x60; &#x60;.msg&#x60; &#x60;.rst&#x60; &#x60;.rtf&#x60; &#x60;.txt&#x60; &#x60;.xml&#x60; Images: &#x60;.png&#x60; &#x60;.webp&#x60; &#x60;.jpg&#x60; &#x60;.jpeg&#x60; &#x60;.tiff&#x60; &#x60;.bmp&#x60; &#x60;.heic&#x60; Documents: &#x60;.csv&#x60; &#x60;.doc&#x60; &#x60;.docx&#x60; &#x60;.epub&#x60; &#x60;.epub+zip&#x60; &#x60;.odt&#x60; &#x60;.pdf&#x60; &#x60;.ppt&#x60; &#x60;.pptx&#x60; &#x60;.tsv&#x60; &#x60;.xlsx&#x60; &#x60;.xls&#x60;.
990
+ # @param [Hash] opts the optional parameters
991
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
992
+ # @option opts [Mode2] :mode
993
+ # @return [Array<(DocumentFileUpdate, Integer, Hash)>] DocumentFileUpdate data, response status code and response headers
994
+ def update_document_file_with_http_info(document_id, file, opts = {})
995
+ if @api_client.config.debugging
996
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.update_document_file ...'
997
+ end
998
+ # verify the required parameter 'document_id' is set
999
+ if @api_client.config.client_side_validation && document_id.nil?
1000
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.update_document_file"
1001
+ end
1002
+ # verify the required parameter 'file' is set
1003
+ if @api_client.config.client_side_validation && file.nil?
1004
+ fail ArgumentError, "Missing the required parameter 'file' when calling DocumentsApi.update_document_file"
1005
+ end
1006
+ # resource path
1007
+ local_var_path = '/documents/{document_id}/file'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
1008
+
1009
+ # query parameters
1010
+ query_params = opts[:query_params] || {}
1011
+
1012
+ # header parameters
1013
+ header_params = opts[:header_params] || {}
1014
+ # HTTP header 'Accept' (if needed)
1015
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1016
+ # HTTP header 'Content-Type'
1017
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
1018
+ if !content_type.nil?
1019
+ header_params['Content-Type'] = content_type
1020
+ end
1021
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
1022
+
1023
+ # form parameters
1024
+ form_params = opts[:form_params] || {}
1025
+ form_params['file'] = file
1026
+ form_params['mode'] = opts[:'mode'] if !opts[:'mode'].nil?
1027
+
1028
+ # http body (model)
1029
+ post_body = opts[:debug_body]
1030
+
1031
+ # return_type
1032
+ return_type = opts[:debug_return_type] || 'DocumentFileUpdate'
1033
+
1034
+ # auth_names
1035
+ auth_names = opts[:debug_auth_names] || ['auth']
1036
+
1037
+ new_options = opts.merge(
1038
+ :operation => :"DocumentsApi.update_document_file",
1039
+ :header_params => header_params,
1040
+ :query_params => query_params,
1041
+ :form_params => form_params,
1042
+ :body => post_body,
1043
+ :auth_names => auth_names,
1044
+ :return_type => return_type
1045
+ )
1046
+
1047
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1048
+ if @api_client.config.debugging
1049
+ @api_client.config.logger.debug "API called: DocumentsApi#update_document_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1050
+ end
1051
+ return data, status_code, headers
1052
+ end
1053
+
1054
+ # Update Document Url
1055
+ # Updates a document from a publicly accessible URL. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [`pending`, `partitioning`, `partitioned`, `refined`, `chunked`, `indexed`, `summary_indexed`, `keyword_indexed`, `ready`, `failed`]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in `indexed` state. However the summary will only be available once the state has changed to `summary_indexed` or `ready`.
1056
+ # @param document_id [String] The id of the document.
1057
+ # @param update_document_from_url_params [UpdateDocumentFromUrlParams]
1058
+ # @param [Hash] opts the optional parameters
1059
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
1060
+ # @return [DocumentUrlUpdate]
1061
+ def update_document_from_url(document_id, update_document_from_url_params, opts = {})
1062
+ data, _status_code, _headers = update_document_from_url_with_http_info(document_id, update_document_from_url_params, opts)
1063
+ data
1064
+ end
1065
+
1066
+ # Update Document Url
1067
+ # Updates a document from a publicly accessible URL. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [&#x60;pending&#x60;, &#x60;partitioning&#x60;, &#x60;partitioned&#x60;, &#x60;refined&#x60;, &#x60;chunked&#x60;, &#x60;indexed&#x60;, &#x60;summary_indexed&#x60;, &#x60;keyword_indexed&#x60;, &#x60;ready&#x60;, &#x60;failed&#x60;]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in &#x60;indexed&#x60; state. However the summary will only be available once the state has changed to &#x60;summary_indexed&#x60; or &#x60;ready&#x60;.
1068
+ # @param document_id [String] The id of the document.
1069
+ # @param update_document_from_url_params [UpdateDocumentFromUrlParams]
1070
+ # @param [Hash] opts the optional parameters
1071
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
1072
+ # @return [Array<(DocumentUrlUpdate, Integer, Hash)>] DocumentUrlUpdate data, response status code and response headers
1073
+ def update_document_from_url_with_http_info(document_id, update_document_from_url_params, opts = {})
1074
+ if @api_client.config.debugging
1075
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.update_document_from_url ...'
1076
+ end
1077
+ # verify the required parameter 'document_id' is set
1078
+ if @api_client.config.client_side_validation && document_id.nil?
1079
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.update_document_from_url"
1080
+ end
1081
+ # verify the required parameter 'update_document_from_url_params' is set
1082
+ if @api_client.config.client_side_validation && update_document_from_url_params.nil?
1083
+ fail ArgumentError, "Missing the required parameter 'update_document_from_url_params' when calling DocumentsApi.update_document_from_url"
1084
+ end
1085
+ # resource path
1086
+ local_var_path = '/documents/{document_id}/url'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
1087
+
1088
+ # query parameters
1089
+ query_params = opts[:query_params] || {}
1090
+
1091
+ # header parameters
1092
+ header_params = opts[:header_params] || {}
1093
+ # HTTP header 'Accept' (if needed)
1094
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1095
+ # HTTP header 'Content-Type'
1096
+ content_type = @api_client.select_header_content_type(['application/json'])
1097
+ if !content_type.nil?
1098
+ header_params['Content-Type'] = content_type
1099
+ end
1100
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
1101
+
1102
+ # form parameters
1103
+ form_params = opts[:form_params] || {}
1104
+
1105
+ # http body (model)
1106
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_document_from_url_params)
1107
+
1108
+ # return_type
1109
+ return_type = opts[:debug_return_type] || 'DocumentUrlUpdate'
1110
+
1111
+ # auth_names
1112
+ auth_names = opts[:debug_auth_names] || ['auth']
1113
+
1114
+ new_options = opts.merge(
1115
+ :operation => :"DocumentsApi.update_document_from_url",
1116
+ :header_params => header_params,
1117
+ :query_params => query_params,
1118
+ :form_params => form_params,
1119
+ :body => post_body,
1120
+ :auth_names => auth_names,
1121
+ :return_type => return_type
1122
+ )
1123
+
1124
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1125
+ if @api_client.config.debugging
1126
+ @api_client.config.logger.debug "API called: DocumentsApi#update_document_from_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1127
+ end
1128
+ return data, status_code, headers
1129
+ end
1130
+
1131
+ # Update Document Raw
1132
+ # @param document_id [String] The id of the document.
1133
+ # @param update_document_raw_params [UpdateDocumentRawParams]
1134
+ # @param [Hash] opts the optional parameters
1135
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
1136
+ # @return [DocumentRawUpdate]
1137
+ def update_document_raw(document_id, update_document_raw_params, opts = {})
1138
+ data, _status_code, _headers = update_document_raw_with_http_info(document_id, update_document_raw_params, opts)
1139
+ data
1140
+ end
1141
+
1142
+ # Update Document Raw
1143
+ # @param document_id [String] The id of the document.
1144
+ # @param update_document_raw_params [UpdateDocumentRawParams]
1145
+ # @param [Hash] opts the optional parameters
1146
+ # @option opts [String] :partition An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition.
1147
+ # @return [Array<(DocumentRawUpdate, Integer, Hash)>] DocumentRawUpdate data, response status code and response headers
1148
+ def update_document_raw_with_http_info(document_id, update_document_raw_params, opts = {})
1149
+ if @api_client.config.debugging
1150
+ @api_client.config.logger.debug 'Calling API: DocumentsApi.update_document_raw ...'
1151
+ end
1152
+ # verify the required parameter 'document_id' is set
1153
+ if @api_client.config.client_side_validation && document_id.nil?
1154
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.update_document_raw"
1155
+ end
1156
+ # verify the required parameter 'update_document_raw_params' is set
1157
+ if @api_client.config.client_side_validation && update_document_raw_params.nil?
1158
+ fail ArgumentError, "Missing the required parameter 'update_document_raw_params' when calling DocumentsApi.update_document_raw"
1159
+ end
1160
+ # resource path
1161
+ local_var_path = '/documents/{document_id}/raw'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
1162
+
1163
+ # query parameters
1164
+ query_params = opts[:query_params] || {}
1165
+
1166
+ # header parameters
1167
+ header_params = opts[:header_params] || {}
1168
+ # HTTP header 'Accept' (if needed)
1169
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1170
+ # HTTP header 'Content-Type'
1171
+ content_type = @api_client.select_header_content_type(['application/json'])
1172
+ if !content_type.nil?
1173
+ header_params['Content-Type'] = content_type
1174
+ end
1175
+ header_params[:'partition'] = opts[:'partition'] if !opts[:'partition'].nil?
1176
+
1177
+ # form parameters
1178
+ form_params = opts[:form_params] || {}
1179
+
1180
+ # http body (model)
1181
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_document_raw_params)
1182
+
1183
+ # return_type
1184
+ return_type = opts[:debug_return_type] || 'DocumentRawUpdate'
1185
+
1186
+ # auth_names
1187
+ auth_names = opts[:debug_auth_names] || ['auth']
1188
+
1189
+ new_options = opts.merge(
1190
+ :operation => :"DocumentsApi.update_document_raw",
1191
+ :header_params => header_params,
1192
+ :query_params => query_params,
1193
+ :form_params => form_params,
1194
+ :body => post_body,
1195
+ :auth_names => auth_names,
1196
+ :return_type => return_type
1197
+ )
1198
+
1199
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1200
+ if @api_client.config.debugging
1201
+ @api_client.config.logger.debug "API called: DocumentsApi#update_document_raw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1202
+ end
1203
+ return data, status_code, headers
1204
+ end
1205
+ end
1206
+ end