carbon_ruby_sdk 0.1.8 → 0.1.10
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +46 -2
- data/lib/carbon_ruby_sdk/api/auth_api.rb +1 -1
- data/lib/carbon_ruby_sdk/api/files_api.rb +15 -4
- data/lib/carbon_ruby_sdk/api/organizations_api.rb +1 -1
- data/lib/carbon_ruby_sdk/api/users_api.rb +98 -2
- data/lib/carbon_ruby_sdk/api/webhooks_api.rb +3 -3
- data/lib/carbon_ruby_sdk/models/auto_sync_enabled_sources_property.rb +227 -0
- data/lib/carbon_ruby_sdk/models/update_users_input.rb +252 -0
- data/lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb +16 -5
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +2 -0
- data/spec/api/files_api_spec.rb +1 -0
- data/spec/api/users_api_spec.rb +11 -0
- data/spec/models/auto_sync_enabled_sources_property_spec.rb +22 -0
- data/spec/models/update_users_input_spec.rb +34 -0
- data/spec/models/upload_file_from_url_input_spec.rb +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e8a8eb45033cb39e0608a9ccc89598496a9ceab4bb7c53d33b4669fc6494670
|
4
|
+
data.tar.gz: 8cf3c4a34982d6a51a79ba7bd9796ff576a0bb2b5bb1ce01eae8ed98ec0aec98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f22bd4a492c7a732de9ff4224be1d645955610d55aa3e401505867da959167ab70915ee850a480094969271e5c0d2b96aa5dad9cb2fb5cecec52db6c33711be3
|
7
|
+
data.tar.gz: ff1670389a050caa7329f3fd10fbc1f4795b19172115d098fa1399886201c911b5b616e0d5d404db102110a7d41f605a7da12ae476c582318a76113c0a4e7355
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect external data to LLMs, no matter the source.
|
8
8
|
|
9
|
-
[](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.10)
|
10
10
|
|
11
11
|
</div>
|
12
12
|
|
@@ -61,6 +61,7 @@ Connect external data to LLMs, no matter the source.
|
|
61
61
|
* [`carbon.users.delete`](#carbonusersdelete)
|
62
62
|
* [`carbon.users.get`](#carbonusersget)
|
63
63
|
* [`carbon.users.toggle_user_features`](#carbonuserstoggle_user_features)
|
64
|
+
* [`carbon.users.update_users`](#carbonusersupdate_users)
|
64
65
|
* [`carbon.utilities.fetch_urls`](#carbonutilitiesfetch_urls)
|
65
66
|
* [`carbon.utilities.fetch_youtube_transcripts`](#carbonutilitiesfetch_youtube_transcripts)
|
66
67
|
* [`carbon.utilities.process_sitemap`](#carbonutilitiesprocess_sitemap)
|
@@ -78,7 +79,7 @@ Connect external data to LLMs, no matter the source.
|
|
78
79
|
Add to Gemfile:
|
79
80
|
|
80
81
|
```ruby
|
81
|
-
gem 'carbon_ruby_sdk', '~> 0.1.
|
82
|
+
gem 'carbon_ruby_sdk', '~> 0.1.10'
|
82
83
|
```
|
83
84
|
|
84
85
|
## Getting Started<a id="getting-started"></a>
|
@@ -944,6 +945,7 @@ result = carbon.files.upload(
|
|
944
945
|
generate_sparse_vectors: false,
|
945
946
|
prepend_filename_to_chunks: false,
|
946
947
|
max_items_per_chunk: 1,
|
948
|
+
parse_pdf_tables_with_ocr: false,
|
947
949
|
)
|
948
950
|
p result
|
949
951
|
```
|
@@ -983,6 +985,9 @@ Whether or not to prepend the file's name to chunks.
|
|
983
985
|
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
984
986
|
Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
985
987
|
|
988
|
+
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
989
|
+
Whether to use rich table parsing when `use_ocr` is enabled.
|
990
|
+
|
986
991
|
#### 🔄 Return<a id="🔄-return"></a>
|
987
992
|
|
988
993
|
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
@@ -1015,6 +1020,7 @@ result = carbon.files.upload_from_url(
|
|
1015
1020
|
use_textract: false,
|
1016
1021
|
prepend_filename_to_chunks: false,
|
1017
1022
|
max_items_per_chunk: 1,
|
1023
|
+
parse_pdf_tables_with_ocr: false,
|
1018
1024
|
)
|
1019
1025
|
p result
|
1020
1026
|
```
|
@@ -1034,6 +1040,7 @@ p result
|
|
1034
1040
|
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
1035
1041
|
Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1036
1042
|
|
1043
|
+
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1037
1044
|
#### 🔄 Return<a id="🔄-return"></a>
|
1038
1045
|
|
1039
1046
|
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
@@ -2157,6 +2164,43 @@ p result
|
|
2157
2164
|
---
|
2158
2165
|
|
2159
2166
|
|
2167
|
+
### `carbon.users.update_users`<a id="carbonusersupdate_users"></a>
|
2168
|
+
|
2169
|
+
Update Users
|
2170
|
+
|
2171
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
2172
|
+
|
2173
|
+
```ruby
|
2174
|
+
result = carbon.users.update_users(
|
2175
|
+
customer_ids: [
|
2176
|
+
"string_example"
|
2177
|
+
],
|
2178
|
+
auto_sync_enabled_sources: [
|
2179
|
+
"string_example"
|
2180
|
+
],
|
2181
|
+
)
|
2182
|
+
p result
|
2183
|
+
```
|
2184
|
+
|
2185
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
2186
|
+
|
2187
|
+
##### customer_ids: Array<`String`><a id="customer_ids-array"></a>
|
2188
|
+
List of organization supplied user IDs
|
2189
|
+
|
2190
|
+
##### auto_sync_enabled_sources: [`AutoSyncEnabledSourcesProperty`](./lib/carbon_ruby_sdk/models/auto_sync_enabled_sources_property.rb)<a id="auto_sync_enabled_sources-autosyncenabledsourcespropertylibcarbon_ruby_sdkmodelsauto_sync_enabled_sources_propertyrb"></a>
|
2191
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
2192
|
+
|
2193
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
2194
|
+
|
2195
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
2196
|
+
|
2197
|
+
`/update_users` `POST`
|
2198
|
+
|
2199
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
2200
|
+
|
2201
|
+
---
|
2202
|
+
|
2203
|
+
|
2160
2204
|
### `carbon.utilities.fetch_urls`<a id="carbonutilitiesfetch_urls"></a>
|
2161
2205
|
|
2162
2206
|
Extracts all URLs from a webpage.
|
@@ -152,7 +152,7 @@ module Carbon
|
|
152
152
|
return_type = opts[:debug_return_type] || 'WhiteLabelingResponse'
|
153
153
|
|
154
154
|
# auth_names
|
155
|
-
auth_names = opts[:debug_auth_names] || ['accessToken']
|
155
|
+
auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
|
156
156
|
|
157
157
|
new_options = opts.merge(
|
158
158
|
:operation => :"AuthApi.get_white_labeling",
|
@@ -1075,9 +1075,10 @@ module Carbon
|
|
1075
1075
|
# @param generate_sparse_vectors [Boolean] Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search.
|
1076
1076
|
# @param prepend_filename_to_chunks [Boolean] Whether or not to prepend the file's name to chunks.
|
1077
1077
|
# @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1078
|
+
# @param parse_pdf_tables_with_ocr [Boolean] Whether to use rich table parsing when `use_ocr` is enabled.
|
1078
1079
|
# @param body [BodyCreateUploadFileUploadfilePost]
|
1079
1080
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1080
|
-
def upload(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: SENTINEL, use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, extra: {})
|
1081
|
+
def upload(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: SENTINEL, use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, extra: {})
|
1081
1082
|
_body = {}
|
1082
1083
|
_body[:file] = file if file != SENTINEL
|
1083
1084
|
body_create_upload_file_uploadfile_post = _body
|
@@ -1090,6 +1091,7 @@ module Carbon
|
|
1090
1091
|
extra[:generate_sparse_vectors] = generate_sparse_vectors if generate_sparse_vectors != SENTINEL
|
1091
1092
|
extra[:prepend_filename_to_chunks] = prepend_filename_to_chunks if prepend_filename_to_chunks != SENTINEL
|
1092
1093
|
extra[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
|
1094
|
+
extra[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1093
1095
|
api_response = upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, extra)
|
1094
1096
|
api_response.data
|
1095
1097
|
end
|
@@ -1132,9 +1134,10 @@ module Carbon
|
|
1132
1134
|
# @param generate_sparse_vectors [Boolean] Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search.
|
1133
1135
|
# @param prepend_filename_to_chunks [Boolean] Whether or not to prepend the file's name to chunks.
|
1134
1136
|
# @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1137
|
+
# @param parse_pdf_tables_with_ocr [Boolean] Whether to use rich table parsing when `use_ocr` is enabled.
|
1135
1138
|
# @param body [BodyCreateUploadFileUploadfilePost]
|
1136
1139
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1137
|
-
def upload_with_http_info(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: SENTINEL, use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, extra: {})
|
1140
|
+
def upload_with_http_info(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: SENTINEL, use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, extra: {})
|
1138
1141
|
_body = {}
|
1139
1142
|
_body[:file] = file if file != SENTINEL
|
1140
1143
|
body_create_upload_file_uploadfile_post = _body
|
@@ -1147,6 +1150,7 @@ module Carbon
|
|
1147
1150
|
extra[:generate_sparse_vectors] = generate_sparse_vectors if generate_sparse_vectors != SENTINEL
|
1148
1151
|
extra[:prepend_filename_to_chunks] = prepend_filename_to_chunks if prepend_filename_to_chunks != SENTINEL
|
1149
1152
|
extra[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
|
1153
|
+
extra[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1150
1154
|
upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, extra)
|
1151
1155
|
end
|
1152
1156
|
|
@@ -1164,6 +1168,7 @@ module Carbon
|
|
1164
1168
|
# @option opts [Boolean] :generate_sparse_vectors Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search. (default to false)
|
1165
1169
|
# @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file's name to chunks. (default to false)
|
1166
1170
|
# @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1171
|
+
# @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
|
1167
1172
|
# @return [UserFile]
|
1168
1173
|
private def upload_impl(file, body_create_upload_file_uploadfile_post, opts = {})
|
1169
1174
|
data, _status_code, _headers = upload_with_http_info(file, body_create_upload_file_uploadfile_post, opts)
|
@@ -1184,6 +1189,7 @@ module Carbon
|
|
1184
1189
|
# @option opts [Boolean] :generate_sparse_vectors Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search. (default to false)
|
1185
1190
|
# @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file's name to chunks. (default to false)
|
1186
1191
|
# @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1192
|
+
# @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
|
1187
1193
|
# @return [APIResponse] data is UserFile, status code, headers and response
|
1188
1194
|
private def upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, opts = {})
|
1189
1195
|
if @api_client.config.debugging
|
@@ -1211,6 +1217,7 @@ module Carbon
|
|
1211
1217
|
query_params[:'generate_sparse_vectors'] = opts[:'generate_sparse_vectors'] if !opts[:'generate_sparse_vectors'].nil?
|
1212
1218
|
query_params[:'prepend_filename_to_chunks'] = opts[:'prepend_filename_to_chunks'] if !opts[:'prepend_filename_to_chunks'].nil?
|
1213
1219
|
query_params[:'max_items_per_chunk'] = opts[:'max_items_per_chunk'] if !opts[:'max_items_per_chunk'].nil?
|
1220
|
+
query_params[:'parse_pdf_tables_with_ocr'] = opts[:'parse_pdf_tables_with_ocr'] if !opts[:'parse_pdf_tables_with_ocr'].nil?
|
1214
1221
|
|
1215
1222
|
# header parameters
|
1216
1223
|
header_params = opts[:header_params] || {}
|
@@ -1266,9 +1273,10 @@ module Carbon
|
|
1266
1273
|
# @param use_textract [Boolean]
|
1267
1274
|
# @param prepend_filename_to_chunks [Boolean]
|
1268
1275
|
# @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1276
|
+
# @param parse_pdf_tables_with_ocr [Boolean]
|
1269
1277
|
# @param body [UploadFileFromUrlInput]
|
1270
1278
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1271
|
-
def upload_from_url(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, extra: {})
|
1279
|
+
def upload_from_url(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, extra: {})
|
1272
1280
|
_body = {}
|
1273
1281
|
_body[:url] = url if url != SENTINEL
|
1274
1282
|
_body[:file_name] = file_name if file_name != SENTINEL
|
@@ -1281,6 +1289,7 @@ module Carbon
|
|
1281
1289
|
_body[:use_textract] = use_textract if use_textract != SENTINEL
|
1282
1290
|
_body[:prepend_filename_to_chunks] = prepend_filename_to_chunks if prepend_filename_to_chunks != SENTINEL
|
1283
1291
|
_body[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
|
1292
|
+
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1284
1293
|
upload_file_from_url_input = _body
|
1285
1294
|
api_response = upload_from_url_with_http_info_impl(upload_file_from_url_input, extra)
|
1286
1295
|
api_response.data
|
@@ -1299,9 +1308,10 @@ module Carbon
|
|
1299
1308
|
# @param use_textract [Boolean]
|
1300
1309
|
# @param prepend_filename_to_chunks [Boolean]
|
1301
1310
|
# @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1311
|
+
# @param parse_pdf_tables_with_ocr [Boolean]
|
1302
1312
|
# @param body [UploadFileFromUrlInput]
|
1303
1313
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1304
|
-
def upload_from_url_with_http_info(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, extra: {})
|
1314
|
+
def upload_from_url_with_http_info(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, extra: {})
|
1305
1315
|
_body = {}
|
1306
1316
|
_body[:url] = url if url != SENTINEL
|
1307
1317
|
_body[:file_name] = file_name if file_name != SENTINEL
|
@@ -1314,6 +1324,7 @@ module Carbon
|
|
1314
1324
|
_body[:use_textract] = use_textract if use_textract != SENTINEL
|
1315
1325
|
_body[:prepend_filename_to_chunks] = prepend_filename_to_chunks if prepend_filename_to_chunks != SENTINEL
|
1316
1326
|
_body[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
|
1327
|
+
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1317
1328
|
upload_file_from_url_input = _body
|
1318
1329
|
upload_from_url_with_http_info_impl(upload_file_from_url_input, extra)
|
1319
1330
|
end
|
@@ -67,7 +67,7 @@ module Carbon
|
|
67
67
|
return_type = opts[:debug_return_type] || 'OrganizationResponse'
|
68
68
|
|
69
69
|
# auth_names
|
70
|
-
auth_names = opts[:debug_auth_names] || ['
|
70
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
71
71
|
|
72
72
|
new_options = opts.merge(
|
73
73
|
:operation => :"OrganizationsApi.get",
|
@@ -88,7 +88,7 @@ module Carbon
|
|
88
88
|
return_type = opts[:debug_return_type] || 'GenericSuccessResponse'
|
89
89
|
|
90
90
|
# auth_names
|
91
|
-
auth_names = opts[:debug_auth_names] || ['
|
91
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
92
92
|
|
93
93
|
new_options = opts.merge(
|
94
94
|
:operation => :"UsersApi.delete",
|
@@ -180,7 +180,7 @@ module Carbon
|
|
180
180
|
return_type = opts[:debug_return_type] || 'UserResponse'
|
181
181
|
|
182
182
|
# auth_names
|
183
|
-
auth_names = opts[:debug_auth_names] || ['
|
183
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
184
184
|
|
185
185
|
new_options = opts.merge(
|
186
186
|
:operation => :"UsersApi.get",
|
@@ -294,6 +294,102 @@ module Carbon
|
|
294
294
|
end
|
295
295
|
APIResponse::new(data, status_code, headers, response)
|
296
296
|
end
|
297
|
+
|
298
|
+
|
299
|
+
# Update Users
|
300
|
+
#
|
301
|
+
# @param customer_ids [Array<String>] List of organization supplied user IDs
|
302
|
+
# @param auto_sync_enabled_sources [AutoSyncEnabledSourcesProperty]
|
303
|
+
# @param body [UpdateUsersInput]
|
304
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
305
|
+
def update_users(customer_ids:, auto_sync_enabled_sources: SENTINEL, extra: {})
|
306
|
+
_body = {}
|
307
|
+
_body[:customer_ids] = customer_ids if customer_ids != SENTINEL
|
308
|
+
_body[:auto_sync_enabled_sources] = auto_sync_enabled_sources if auto_sync_enabled_sources != SENTINEL
|
309
|
+
update_users_input = _body
|
310
|
+
api_response = update_users_with_http_info_impl(update_users_input, extra)
|
311
|
+
api_response.data
|
312
|
+
end
|
313
|
+
|
314
|
+
# Update Users
|
315
|
+
#
|
316
|
+
# @param customer_ids [Array<String>] List of organization supplied user IDs
|
317
|
+
# @param auto_sync_enabled_sources [AutoSyncEnabledSourcesProperty]
|
318
|
+
# @param body [UpdateUsersInput]
|
319
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
320
|
+
def update_users_with_http_info(customer_ids:, auto_sync_enabled_sources: SENTINEL, extra: {})
|
321
|
+
_body = {}
|
322
|
+
_body[:customer_ids] = customer_ids if customer_ids != SENTINEL
|
323
|
+
_body[:auto_sync_enabled_sources] = auto_sync_enabled_sources if auto_sync_enabled_sources != SENTINEL
|
324
|
+
update_users_input = _body
|
325
|
+
update_users_with_http_info_impl(update_users_input, extra)
|
326
|
+
end
|
327
|
+
|
328
|
+
# Update Users
|
329
|
+
# @param update_users_input [UpdateUsersInput]
|
330
|
+
# @param [Hash] opts the optional parameters
|
331
|
+
# @return [GenericSuccessResponse]
|
332
|
+
private def update_users_impl(update_users_input, opts = {})
|
333
|
+
data, _status_code, _headers = update_users_with_http_info(update_users_input, opts)
|
334
|
+
data
|
335
|
+
end
|
336
|
+
|
337
|
+
# Update Users
|
338
|
+
# @param update_users_input [UpdateUsersInput]
|
339
|
+
# @param [Hash] opts the optional parameters
|
340
|
+
# @return [APIResponse] data is GenericSuccessResponse, status code, headers and response
|
341
|
+
private def update_users_with_http_info_impl(update_users_input, opts = {})
|
342
|
+
if @api_client.config.debugging
|
343
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.update_users ...'
|
344
|
+
end
|
345
|
+
# verify the required parameter 'update_users_input' is set
|
346
|
+
if @api_client.config.client_side_validation && update_users_input.nil?
|
347
|
+
fail ArgumentError, "Missing the required parameter 'update_users_input' when calling UsersApi.update_users"
|
348
|
+
end
|
349
|
+
# resource path
|
350
|
+
local_var_path = '/update_users'
|
351
|
+
|
352
|
+
# query parameters
|
353
|
+
query_params = opts[:query_params] || {}
|
354
|
+
|
355
|
+
# header parameters
|
356
|
+
header_params = opts[:header_params] || {}
|
357
|
+
# HTTP header 'Accept' (if needed)
|
358
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
359
|
+
# HTTP header 'Content-Type'
|
360
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
361
|
+
if !content_type.nil?
|
362
|
+
header_params['Content-Type'] = content_type
|
363
|
+
end
|
364
|
+
|
365
|
+
# form parameters
|
366
|
+
form_params = opts[:form_params] || {}
|
367
|
+
|
368
|
+
# http body (model)
|
369
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_users_input)
|
370
|
+
|
371
|
+
# return_type
|
372
|
+
return_type = opts[:debug_return_type] || 'GenericSuccessResponse'
|
373
|
+
|
374
|
+
# auth_names
|
375
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
376
|
+
|
377
|
+
new_options = opts.merge(
|
378
|
+
:operation => :"UsersApi.update_users",
|
379
|
+
:header_params => header_params,
|
380
|
+
:query_params => query_params,
|
381
|
+
:form_params => form_params,
|
382
|
+
:body => post_body,
|
383
|
+
:auth_names => auth_names,
|
384
|
+
:return_type => return_type
|
385
|
+
)
|
386
|
+
|
387
|
+
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
388
|
+
if @api_client.config.debugging
|
389
|
+
@api_client.config.logger.debug "API called: UsersApi#update_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
390
|
+
end
|
391
|
+
APIResponse::new(data, status_code, headers, response)
|
392
|
+
end
|
297
393
|
end
|
298
394
|
|
299
395
|
# top-level client access to avoid having the user to insantiate their own API instances
|
@@ -88,7 +88,7 @@ module Carbon
|
|
88
88
|
return_type = opts[:debug_return_type] || 'Webhook'
|
89
89
|
|
90
90
|
# auth_names
|
91
|
-
auth_names = opts[:debug_auth_names] || ['
|
91
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
92
92
|
|
93
93
|
new_options = opts.merge(
|
94
94
|
:operation => :"WebhooksApi.add_url",
|
@@ -167,7 +167,7 @@ module Carbon
|
|
167
167
|
return_type = opts[:debug_return_type] || 'GenericSuccessResponse'
|
168
168
|
|
169
169
|
# auth_names
|
170
|
-
auth_names = opts[:debug_auth_names] || ['
|
170
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
171
171
|
|
172
172
|
new_options = opts.merge(
|
173
173
|
:operation => :"WebhooksApi.delete_url",
|
@@ -271,7 +271,7 @@ module Carbon
|
|
271
271
|
return_type = opts[:debug_return_type] || 'WebhookQueryResponse'
|
272
272
|
|
273
273
|
# auth_names
|
274
|
-
auth_names = opts[:debug_auth_names] || ['
|
274
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
275
275
|
|
276
276
|
new_options = opts.merge(
|
277
277
|
:operation => :"WebhooksApi.urls",
|
@@ -0,0 +1,227 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
require 'time'
|
11
|
+
|
12
|
+
module Carbon
|
13
|
+
# List of data source types to enable auto sync for. Empty array will remove all sources and the string \"ALL\" will enable it for all data sources
|
14
|
+
class AutoSyncEnabledSourcesProperty
|
15
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
16
|
+
def self.attribute_map
|
17
|
+
{
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
# Returns all the JSON keys this model knows about
|
22
|
+
def self.acceptable_attributes
|
23
|
+
attribute_map.values
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.openapi_types
|
28
|
+
{
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# List of attributes with nullable: true
|
33
|
+
def self.openapi_nullable
|
34
|
+
Set.new([
|
35
|
+
])
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of class defined in anyOf (OpenAPI v3)
|
39
|
+
def self.openapi_any_of
|
40
|
+
[
|
41
|
+
:'Array<DataSourceType>',
|
42
|
+
:'String'
|
43
|
+
]
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::AutoSyncEnabledSourcesProperty` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::AutoSyncEnabledSourcesProperty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properties with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
invalid_properties
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
_any_of_found = false
|
73
|
+
self.class.openapi_any_of.each do |_class|
|
74
|
+
_any_of = Carbon.const_get(_class).build_from_hash(self.to_hash)
|
75
|
+
if _any_of.valid?
|
76
|
+
_any_of_found = true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
if !_any_of_found
|
81
|
+
return false
|
82
|
+
end
|
83
|
+
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(o)
|
90
|
+
return true if self.equal?(o)
|
91
|
+
self.class == o.class
|
92
|
+
end
|
93
|
+
|
94
|
+
# @see the `==` method
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def eql?(o)
|
97
|
+
self == o
|
98
|
+
end
|
99
|
+
|
100
|
+
# Calculates hash code according to all attributes.
|
101
|
+
# @return [Integer] Hash code
|
102
|
+
def hash
|
103
|
+
[].hash
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def self.build_from_hash(attributes)
|
110
|
+
new.build_from_hash(attributes)
|
111
|
+
end
|
112
|
+
|
113
|
+
# Builds the object from hash
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
# @return [Object] Returns the model itself
|
116
|
+
def build_from_hash(attributes)
|
117
|
+
return nil unless attributes.is_a?(Hash)
|
118
|
+
attributes = attributes.transform_keys(&:to_sym)
|
119
|
+
self.class.openapi_types.each_pair do |key, type|
|
120
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
121
|
+
self.send("#{key}=", nil)
|
122
|
+
elsif type =~ /\AArray<(.*)>/i
|
123
|
+
# check to ensure the input is an array given that the attribute
|
124
|
+
# is documented as an array but the input is not
|
125
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
126
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
127
|
+
end
|
128
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
129
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
self
|
134
|
+
end
|
135
|
+
|
136
|
+
# Deserializes the data based on type
|
137
|
+
# @param string type Data type
|
138
|
+
# @param string value Value to be deserialized
|
139
|
+
# @return [Object] Deserialized data
|
140
|
+
def _deserialize(type, value)
|
141
|
+
case type.to_sym
|
142
|
+
when :Time
|
143
|
+
Time.parse(value)
|
144
|
+
when :Date
|
145
|
+
Date.parse(value)
|
146
|
+
when :String
|
147
|
+
value.to_s
|
148
|
+
when :Integer
|
149
|
+
value.to_i
|
150
|
+
when :Float
|
151
|
+
value.to_f
|
152
|
+
when :Boolean
|
153
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
154
|
+
true
|
155
|
+
else
|
156
|
+
false
|
157
|
+
end
|
158
|
+
when :Object
|
159
|
+
# generic object (usually a Hash), return directly
|
160
|
+
value
|
161
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
162
|
+
inner_type = Regexp.last_match[:inner_type]
|
163
|
+
value.map { |v| _deserialize(inner_type, v) }
|
164
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
165
|
+
k_type = Regexp.last_match[:k_type]
|
166
|
+
v_type = Regexp.last_match[:v_type]
|
167
|
+
{}.tap do |hash|
|
168
|
+
value.each do |k, v|
|
169
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
else # model
|
173
|
+
# models (e.g. Pet) or oneOf
|
174
|
+
klass = Carbon.const_get(type)
|
175
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the string representation of the object
|
180
|
+
# @return [String] String presentation of the object
|
181
|
+
def to_s
|
182
|
+
to_hash.to_s
|
183
|
+
end
|
184
|
+
|
185
|
+
# to_body is an alias to to_hash (backward compatibility)
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_body
|
188
|
+
to_hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the object in the form of hash
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_hash
|
194
|
+
hash = {}
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
196
|
+
value = self.send(attr)
|
197
|
+
if value.nil?
|
198
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
199
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
200
|
+
end
|
201
|
+
|
202
|
+
hash[param] = _to_hash(value)
|
203
|
+
end
|
204
|
+
hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Outputs non-array value in the form of hash
|
208
|
+
# For object, use to_hash. Otherwise, just return the value
|
209
|
+
# @param [Object] value Any valid value
|
210
|
+
# @return [Hash] Returns the value in the form of hash
|
211
|
+
def _to_hash(value)
|
212
|
+
if value.is_a?(Array)
|
213
|
+
value.compact.map { |v| _to_hash(v) }
|
214
|
+
elsif value.is_a?(Hash)
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
217
|
+
end
|
218
|
+
elsif value.respond_to? :to_hash
|
219
|
+
value.to_hash
|
220
|
+
else
|
221
|
+
value
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
@@ -0,0 +1,252 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
require 'time'
|
11
|
+
|
12
|
+
module Carbon
|
13
|
+
class UpdateUsersInput
|
14
|
+
# List of organization supplied user IDs
|
15
|
+
attr_accessor :customer_ids
|
16
|
+
|
17
|
+
attr_accessor :auto_sync_enabled_sources
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'customer_ids' => :'customer_ids',
|
23
|
+
:'auto_sync_enabled_sources' => :'auto_sync_enabled_sources'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'customer_ids' => :'Array<String>',
|
36
|
+
:'auto_sync_enabled_sources' => :'AutoSyncEnabledSourcesProperty'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
:'auto_sync_enabled_sources'
|
44
|
+
])
|
45
|
+
end
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
if (!attributes.is_a?(Hash))
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::UpdateUsersInput` initialize method"
|
52
|
+
end
|
53
|
+
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
56
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
57
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::UpdateUsersInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
58
|
+
end
|
59
|
+
h[k.to_sym] = v
|
60
|
+
}
|
61
|
+
|
62
|
+
if attributes.key?(:'customer_ids')
|
63
|
+
if (value = attributes[:'customer_ids']).is_a?(Array)
|
64
|
+
self.customer_ids = value
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'auto_sync_enabled_sources')
|
69
|
+
self.auto_sync_enabled_sources = attributes[:'auto_sync_enabled_sources']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
+
# @return Array for valid properties with the reasons
|
75
|
+
def list_invalid_properties
|
76
|
+
invalid_properties = Array.new
|
77
|
+
if @customer_ids.nil?
|
78
|
+
invalid_properties.push('invalid value for "customer_ids", customer_ids cannot be nil.')
|
79
|
+
end
|
80
|
+
|
81
|
+
if @customer_ids.length > 100
|
82
|
+
invalid_properties.push('invalid value for "customer_ids", number of items must be less than or equal to 100.')
|
83
|
+
end
|
84
|
+
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
return false if @customer_ids.nil?
|
92
|
+
return false if @customer_ids.length > 100
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Custom attribute writer method with validation
|
97
|
+
# @param [Object] customer_ids Value to be assigned
|
98
|
+
def customer_ids=(customer_ids)
|
99
|
+
if customer_ids.nil?
|
100
|
+
fail ArgumentError, 'customer_ids cannot be nil'
|
101
|
+
end
|
102
|
+
|
103
|
+
if customer_ids.length > 100
|
104
|
+
fail ArgumentError, 'invalid value for "customer_ids", number of items must be less than or equal to 100.'
|
105
|
+
end
|
106
|
+
|
107
|
+
@customer_ids = customer_ids
|
108
|
+
end
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def ==(o)
|
113
|
+
return true if self.equal?(o)
|
114
|
+
self.class == o.class &&
|
115
|
+
customer_ids == o.customer_ids &&
|
116
|
+
auto_sync_enabled_sources == o.auto_sync_enabled_sources
|
117
|
+
end
|
118
|
+
|
119
|
+
# @see the `==` method
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def eql?(o)
|
122
|
+
self == o
|
123
|
+
end
|
124
|
+
|
125
|
+
# Calculates hash code according to all attributes.
|
126
|
+
# @return [Integer] Hash code
|
127
|
+
def hash
|
128
|
+
[customer_ids, auto_sync_enabled_sources].hash
|
129
|
+
end
|
130
|
+
|
131
|
+
# Builds the object from hash
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
# @return [Object] Returns the model itself
|
134
|
+
def self.build_from_hash(attributes)
|
135
|
+
new.build_from_hash(attributes)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Builds the object from hash
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
+
# @return [Object] Returns the model itself
|
141
|
+
def build_from_hash(attributes)
|
142
|
+
return nil unless attributes.is_a?(Hash)
|
143
|
+
attributes = attributes.transform_keys(&:to_sym)
|
144
|
+
self.class.openapi_types.each_pair do |key, type|
|
145
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
146
|
+
self.send("#{key}=", nil)
|
147
|
+
elsif type =~ /\AArray<(.*)>/i
|
148
|
+
# check to ensure the input is an array given that the attribute
|
149
|
+
# is documented as an array but the input is not
|
150
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
151
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
152
|
+
end
|
153
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
154
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
self
|
159
|
+
end
|
160
|
+
|
161
|
+
# Deserializes the data based on type
|
162
|
+
# @param string type Data type
|
163
|
+
# @param string value Value to be deserialized
|
164
|
+
# @return [Object] Deserialized data
|
165
|
+
def _deserialize(type, value)
|
166
|
+
case type.to_sym
|
167
|
+
when :Time
|
168
|
+
Time.parse(value)
|
169
|
+
when :Date
|
170
|
+
Date.parse(value)
|
171
|
+
when :String
|
172
|
+
value.to_s
|
173
|
+
when :Integer
|
174
|
+
value.to_i
|
175
|
+
when :Float
|
176
|
+
value.to_f
|
177
|
+
when :Boolean
|
178
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
179
|
+
true
|
180
|
+
else
|
181
|
+
false
|
182
|
+
end
|
183
|
+
when :Object
|
184
|
+
# generic object (usually a Hash), return directly
|
185
|
+
value
|
186
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
187
|
+
inner_type = Regexp.last_match[:inner_type]
|
188
|
+
value.map { |v| _deserialize(inner_type, v) }
|
189
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
190
|
+
k_type = Regexp.last_match[:k_type]
|
191
|
+
v_type = Regexp.last_match[:v_type]
|
192
|
+
{}.tap do |hash|
|
193
|
+
value.each do |k, v|
|
194
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
else # model
|
198
|
+
# models (e.g. Pet) or oneOf
|
199
|
+
klass = Carbon.const_get(type)
|
200
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the string representation of the object
|
205
|
+
# @return [String] String presentation of the object
|
206
|
+
def to_s
|
207
|
+
to_hash.to_s
|
208
|
+
end
|
209
|
+
|
210
|
+
# to_body is an alias to to_hash (backward compatibility)
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_body
|
213
|
+
to_hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns the object in the form of hash
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_hash
|
219
|
+
hash = {}
|
220
|
+
self.class.attribute_map.each_pair do |attr, param|
|
221
|
+
value = self.send(attr)
|
222
|
+
if value.nil?
|
223
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
224
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
225
|
+
end
|
226
|
+
|
227
|
+
hash[param] = _to_hash(value)
|
228
|
+
end
|
229
|
+
hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Outputs non-array value in the form of hash
|
233
|
+
# For object, use to_hash. Otherwise, just return the value
|
234
|
+
# @param [Object] value Any valid value
|
235
|
+
# @return [Hash] Returns the value in the form of hash
|
236
|
+
def _to_hash(value)
|
237
|
+
if value.is_a?(Array)
|
238
|
+
value.compact.map { |v| _to_hash(v) }
|
239
|
+
elsif value.is_a?(Hash)
|
240
|
+
{}.tap do |hash|
|
241
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
242
|
+
end
|
243
|
+
elsif value.respond_to? :to_hash
|
244
|
+
value.to_hash
|
245
|
+
else
|
246
|
+
value
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|
@@ -34,6 +34,8 @@ module Carbon
|
|
34
34
|
# Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
35
35
|
attr_accessor :max_items_per_chunk
|
36
36
|
|
37
|
+
attr_accessor :parse_pdf_tables_with_ocr
|
38
|
+
|
37
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
38
40
|
def self.attribute_map
|
39
41
|
{
|
@@ -47,7 +49,8 @@ module Carbon
|
|
47
49
|
:'generate_sparse_vectors' => :'generate_sparse_vectors',
|
48
50
|
:'use_textract' => :'use_textract',
|
49
51
|
:'prepend_filename_to_chunks' => :'prepend_filename_to_chunks',
|
50
|
-
:'max_items_per_chunk' => :'max_items_per_chunk'
|
52
|
+
:'max_items_per_chunk' => :'max_items_per_chunk',
|
53
|
+
:'parse_pdf_tables_with_ocr' => :'parse_pdf_tables_with_ocr'
|
51
54
|
}
|
52
55
|
end
|
53
56
|
|
@@ -69,7 +72,8 @@ module Carbon
|
|
69
72
|
:'generate_sparse_vectors' => :'Boolean',
|
70
73
|
:'use_textract' => :'Boolean',
|
71
74
|
:'prepend_filename_to_chunks' => :'Boolean',
|
72
|
-
:'max_items_per_chunk' => :'Integer'
|
75
|
+
:'max_items_per_chunk' => :'Integer',
|
76
|
+
:'parse_pdf_tables_with_ocr' => :'Boolean'
|
73
77
|
}
|
74
78
|
end
|
75
79
|
|
@@ -79,7 +83,7 @@ module Carbon
|
|
79
83
|
:'file_name',
|
80
84
|
:'chunk_size',
|
81
85
|
:'chunk_overlap',
|
82
|
-
:'max_items_per_chunk'
|
86
|
+
:'max_items_per_chunk',
|
83
87
|
])
|
84
88
|
end
|
85
89
|
|
@@ -153,6 +157,12 @@ module Carbon
|
|
153
157
|
if attributes.key?(:'max_items_per_chunk')
|
154
158
|
self.max_items_per_chunk = attributes[:'max_items_per_chunk']
|
155
159
|
end
|
160
|
+
|
161
|
+
if attributes.key?(:'parse_pdf_tables_with_ocr')
|
162
|
+
self.parse_pdf_tables_with_ocr = attributes[:'parse_pdf_tables_with_ocr']
|
163
|
+
else
|
164
|
+
self.parse_pdf_tables_with_ocr = false
|
165
|
+
end
|
156
166
|
end
|
157
167
|
|
158
168
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -188,7 +198,8 @@ module Carbon
|
|
188
198
|
generate_sparse_vectors == o.generate_sparse_vectors &&
|
189
199
|
use_textract == o.use_textract &&
|
190
200
|
prepend_filename_to_chunks == o.prepend_filename_to_chunks &&
|
191
|
-
max_items_per_chunk == o.max_items_per_chunk
|
201
|
+
max_items_per_chunk == o.max_items_per_chunk &&
|
202
|
+
parse_pdf_tables_with_ocr == o.parse_pdf_tables_with_ocr
|
192
203
|
end
|
193
204
|
|
194
205
|
# @see the `==` method
|
@@ -200,7 +211,7 @@ module Carbon
|
|
200
211
|
# Calculates hash code according to all attributes.
|
201
212
|
# @return [Integer] Hash code
|
202
213
|
def hash
|
203
|
-
[url, file_name, chunk_size, chunk_overlap, skip_embedding_generation, set_page_as_boundary, embedding_model, generate_sparse_vectors, use_textract, prepend_filename_to_chunks, max_items_per_chunk].hash
|
214
|
+
[url, file_name, chunk_size, chunk_overlap, skip_embedding_generation, set_page_as_boundary, embedding_model, generate_sparse_vectors, use_textract, prepend_filename_to_chunks, max_items_per_chunk, parse_pdf_tables_with_ocr].hash
|
204
215
|
end
|
205
216
|
|
206
217
|
# Builds the object from hash
|
data/lib/carbon_ruby_sdk.rb
CHANGED
@@ -17,6 +17,7 @@ require 'carbon_ruby_sdk/configuration'
|
|
17
17
|
# Models
|
18
18
|
require 'carbon_ruby_sdk/models/add_webhook_props'
|
19
19
|
require 'carbon_ruby_sdk/models/authentication_property'
|
20
|
+
require 'carbon_ruby_sdk/models/auto_sync_enabled_sources_property'
|
20
21
|
require 'carbon_ruby_sdk/models/body_create_upload_file_uploadfile_post'
|
21
22
|
require 'carbon_ruby_sdk/models/chunk_properties'
|
22
23
|
require 'carbon_ruby_sdk/models/chunk_properties_nullable'
|
@@ -112,6 +113,7 @@ require 'carbon_ruby_sdk/models/tags'
|
|
112
113
|
require 'carbon_ruby_sdk/models/tags1'
|
113
114
|
require 'carbon_ruby_sdk/models/text_embedding_generators'
|
114
115
|
require 'carbon_ruby_sdk/models/token_response'
|
116
|
+
require 'carbon_ruby_sdk/models/update_users_input'
|
115
117
|
require 'carbon_ruby_sdk/models/upload_file_from_url_input'
|
116
118
|
require 'carbon_ruby_sdk/models/user_file'
|
117
119
|
require 'carbon_ruby_sdk/models/user_files_v2'
|
data/spec/api/files_api_spec.rb
CHANGED
@@ -145,6 +145,7 @@ describe 'FilesApi' do
|
|
145
145
|
# @option opts [Boolean] :generate_sparse_vectors Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search.
|
146
146
|
# @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file's name to chunks.
|
147
147
|
# @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
148
|
+
# @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled.
|
148
149
|
# @return [UserFile]
|
149
150
|
describe 'upload test' do
|
150
151
|
it 'should work' do
|
data/spec/api/users_api_spec.rb
CHANGED
@@ -59,4 +59,15 @@ describe 'UsersApi' do
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
# unit tests for update_users
|
63
|
+
# Update Users
|
64
|
+
# @param update_users_input
|
65
|
+
# @param [Hash] opts the optional parameters
|
66
|
+
# @return [GenericSuccessResponse]
|
67
|
+
describe 'update_users test' do
|
68
|
+
it 'should work' do
|
69
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
62
73
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'spec_helper'
|
10
|
+
require 'json'
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
# Unit tests for Carbon::AutoSyncEnabledSourcesProperty
|
14
|
+
describe Carbon::AutoSyncEnabledSourcesProperty do
|
15
|
+
let(:instance) { Carbon::AutoSyncEnabledSourcesProperty.new }
|
16
|
+
|
17
|
+
describe 'test an instance of AutoSyncEnabledSourcesProperty' do
|
18
|
+
it 'should create an instance of AutoSyncEnabledSourcesProperty' do
|
19
|
+
expect(instance).to be_instance_of(Carbon::AutoSyncEnabledSourcesProperty)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'spec_helper'
|
10
|
+
require 'json'
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
# Unit tests for Carbon::UpdateUsersInput
|
14
|
+
describe Carbon::UpdateUsersInput do
|
15
|
+
let(:instance) { Carbon::UpdateUsersInput.new }
|
16
|
+
|
17
|
+
describe 'test an instance of UpdateUsersInput' do
|
18
|
+
it 'should create an instance of UpdateUsersInput' do
|
19
|
+
expect(instance).to be_instance_of(Carbon::UpdateUsersInput)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
describe 'test attribute "customer_ids"' do
|
23
|
+
it 'should work' do
|
24
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe 'test attribute "auto_sync_enabled_sources"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -85,4 +85,10 @@ describe Carbon::UploadFileFromUrlInput do
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
describe 'test attribute "parse_pdf_tables_with_ocr"' do
|
89
|
+
it 'should work' do
|
90
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
88
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carbon_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konfig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/carbon_ruby_sdk/configuration.rb
|
101
101
|
- lib/carbon_ruby_sdk/models/add_webhook_props.rb
|
102
102
|
- lib/carbon_ruby_sdk/models/authentication_property.rb
|
103
|
+
- lib/carbon_ruby_sdk/models/auto_sync_enabled_sources_property.rb
|
103
104
|
- lib/carbon_ruby_sdk/models/body_create_upload_file_uploadfile_post.rb
|
104
105
|
- lib/carbon_ruby_sdk/models/chunk_properties.rb
|
105
106
|
- lib/carbon_ruby_sdk/models/chunk_properties_nullable.rb
|
@@ -195,6 +196,7 @@ files:
|
|
195
196
|
- lib/carbon_ruby_sdk/models/tags1.rb
|
196
197
|
- lib/carbon_ruby_sdk/models/text_embedding_generators.rb
|
197
198
|
- lib/carbon_ruby_sdk/models/token_response.rb
|
199
|
+
- lib/carbon_ruby_sdk/models/update_users_input.rb
|
198
200
|
- lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb
|
199
201
|
- lib/carbon_ruby_sdk/models/user_file.rb
|
200
202
|
- lib/carbon_ruby_sdk/models/user_files_v2.rb
|
@@ -228,6 +230,7 @@ files:
|
|
228
230
|
- spec/getting_started_spec.rb
|
229
231
|
- spec/models/add_webhook_props_spec.rb
|
230
232
|
- spec/models/authentication_property_spec.rb
|
233
|
+
- spec/models/auto_sync_enabled_sources_property_spec.rb
|
231
234
|
- spec/models/body_create_upload_file_uploadfile_post_spec.rb
|
232
235
|
- spec/models/chunk_properties_nullable_spec.rb
|
233
236
|
- spec/models/chunk_properties_spec.rb
|
@@ -323,6 +326,7 @@ files:
|
|
323
326
|
- spec/models/tags_spec.rb
|
324
327
|
- spec/models/text_embedding_generators_spec.rb
|
325
328
|
- spec/models/token_response_spec.rb
|
329
|
+
- spec/models/update_users_input_spec.rb
|
326
330
|
- spec/models/upload_file_from_url_input_spec.rb
|
327
331
|
- spec/models/user_file_spec.rb
|
328
332
|
- spec/models/user_files_v2_spec.rb
|
@@ -441,6 +445,7 @@ test_files:
|
|
441
445
|
- spec/models/body_create_upload_file_uploadfile_post_spec.rb
|
442
446
|
- spec/models/gitbook_authetication_spec.rb
|
443
447
|
- spec/models/location_property_inner_spec.rb
|
448
|
+
- spec/models/update_users_input_spec.rb
|
444
449
|
- spec/models/source_property_spec.rb
|
445
450
|
- spec/models/chunks_and_embeddings_spec.rb
|
446
451
|
- spec/models/sync_files_ids_spec.rb
|
@@ -458,6 +463,7 @@ test_files:
|
|
458
463
|
- spec/models/embedding_and_chunk_spec.rb
|
459
464
|
- spec/models/tags_spec.rb
|
460
465
|
- spec/models/embeddings_and_chunks_query_input_spec.rb
|
466
|
+
- spec/models/auto_sync_enabled_sources_property_spec.rb
|
461
467
|
- spec/models/pagination_spec.rb
|
462
468
|
- spec/models/generic_success_response_spec.rb
|
463
469
|
- spec/models/hybrid_search_tuning_params_spec.rb
|