carbon_ruby_sdk 0.2.42 → 0.2.43
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 +2 -2
- data/README.md +135 -3
- data/lib/carbon_ruby_sdk/api/data_sources_api.rb +196 -0
- data/lib/carbon_ruby_sdk/api/files_api.rb +4 -4
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +48 -16
- data/lib/carbon_ruby_sdk/api/users_api.rb +71 -0
- data/lib/carbon_ruby_sdk/models/add_data_source_tags_input.rb +234 -0
- data/lib/carbon_ruby_sdk/models/azure_blob_auth_request.rb +14 -4
- data/lib/carbon_ruby_sdk/models/cold_storage_props.rb +1 -1
- data/lib/carbon_ruby_sdk/models/external_source_item.rb +11 -1
- data/lib/carbon_ruby_sdk/models/fresh_desk_connect_request.rb +15 -5
- data/lib/carbon_ruby_sdk/models/gitbook_connect_request.rb +15 -5
- data/lib/carbon_ruby_sdk/models/github_connect_request.rb +14 -4
- data/lib/carbon_ruby_sdk/models/guru_connect_request.rb +15 -5
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +15 -5
- data/lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb +15 -1
- data/lib/carbon_ruby_sdk/models/organization_user_data_source_filters.rb +12 -1
- data/lib/carbon_ruby_sdk/models/remove_data_source_tags_input.rb +242 -0
- data/lib/carbon_ruby_sdk/models/rss_feed_input.rb +15 -5
- data/lib/carbon_ruby_sdk/models/s3_auth_request.rb +15 -5
- data/lib/carbon_ruby_sdk/models/sync_options.rb +15 -5
- data/lib/carbon_ruby_sdk/models/user_response.rb +18 -4
- data/lib/carbon_ruby_sdk/models/white_labeling_response.rb +18 -4
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +2 -0
- data/spec/api/data_sources_api_spec.rb +22 -0
- data/spec/api/files_api_spec.rb +1 -1
- data/spec/api/users_api_spec.rb +10 -0
- data/spec/models/add_data_source_tags_input_spec.rb +34 -0
- data/spec/models/azure_blob_auth_request_spec.rb +6 -0
- data/spec/models/external_source_item_spec.rb +6 -0
- data/spec/models/fresh_desk_connect_request_spec.rb +6 -0
- data/spec/models/gitbook_connect_request_spec.rb +6 -0
- data/spec/models/github_connect_request_spec.rb +6 -0
- data/spec/models/guru_connect_request_spec.rb +6 -0
- data/spec/models/o_auth_url_request_spec.rb +6 -0
- data/spec/models/organization_user_data_source_api_spec.rb +6 -0
- data/spec/models/organization_user_data_source_filters_spec.rb +6 -0
- data/spec/models/remove_data_source_tags_input_spec.rb +40 -0
- data/spec/models/rss_feed_input_spec.rb +6 -0
- data/spec/models/s3_auth_request_spec.rb +6 -0
- data/spec/models/sync_options_spec.rb +6 -0
- data/spec/models/user_response_spec.rb +6 -0
- data/spec/models/white_labeling_response_spec.rb +6 -0
- metadata +8 -2
@@ -225,9 +225,10 @@ module Carbon
|
|
225
225
|
# @param request_id [String]
|
226
226
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
227
227
|
# @param file_sync_config [FileSyncConfigNullable]
|
228
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
228
229
|
# @param body [FreshDeskConnectRequest]
|
229
230
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
230
|
-
def connect_freshdesk(domain:, api_key:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, extra: {})
|
231
|
+
def connect_freshdesk(domain:, api_key:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
231
232
|
_body = {}
|
232
233
|
_body[:tags] = tags if tags != SENTINEL
|
233
234
|
_body[:domain] = domain if domain != SENTINEL
|
@@ -242,6 +243,7 @@ module Carbon
|
|
242
243
|
_body[:request_id] = request_id if request_id != SENTINEL
|
243
244
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
244
245
|
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
246
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
245
247
|
fresh_desk_connect_request = _body
|
246
248
|
api_response = connect_freshdesk_with_http_info_impl(fresh_desk_connect_request, extra)
|
247
249
|
api_response.data
|
@@ -268,9 +270,10 @@ module Carbon
|
|
268
270
|
# @param request_id [String]
|
269
271
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
270
272
|
# @param file_sync_config [FileSyncConfigNullable]
|
273
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
271
274
|
# @param body [FreshDeskConnectRequest]
|
272
275
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
273
|
-
def connect_freshdesk_with_http_info(domain:, api_key:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, extra: {})
|
276
|
+
def connect_freshdesk_with_http_info(domain:, api_key:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
274
277
|
_body = {}
|
275
278
|
_body[:tags] = tags if tags != SENTINEL
|
276
279
|
_body[:domain] = domain if domain != SENTINEL
|
@@ -285,6 +288,7 @@ module Carbon
|
|
285
288
|
_body[:request_id] = request_id if request_id != SENTINEL
|
286
289
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
287
290
|
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
291
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
288
292
|
fresh_desk_connect_request = _body
|
289
293
|
connect_freshdesk_with_http_info_impl(fresh_desk_connect_request, extra)
|
290
294
|
end
|
@@ -378,9 +382,10 @@ module Carbon
|
|
378
382
|
# @param request_id [String]
|
379
383
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
380
384
|
# @param file_sync_config [FileSyncConfigNullable]
|
385
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
381
386
|
# @param body [GitbookConnectRequest]
|
382
387
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
383
|
-
def connect_gitbook(organization:, access_token:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, extra: {})
|
388
|
+
def connect_gitbook(organization:, access_token:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
384
389
|
_body = {}
|
385
390
|
_body[:tags] = tags if tags != SENTINEL
|
386
391
|
_body[:organization] = organization if organization != SENTINEL
|
@@ -395,6 +400,7 @@ module Carbon
|
|
395
400
|
_body[:request_id] = request_id if request_id != SENTINEL
|
396
401
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
397
402
|
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
403
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
398
404
|
gitbook_connect_request = _body
|
399
405
|
api_response = connect_gitbook_with_http_info_impl(gitbook_connect_request, extra)
|
400
406
|
api_response.data
|
@@ -420,9 +426,10 @@ module Carbon
|
|
420
426
|
# @param request_id [String]
|
421
427
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
422
428
|
# @param file_sync_config [FileSyncConfigNullable]
|
429
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
423
430
|
# @param body [GitbookConnectRequest]
|
424
431
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
425
|
-
def connect_gitbook_with_http_info(organization:, access_token:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, extra: {})
|
432
|
+
def connect_gitbook_with_http_info(organization:, access_token:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
426
433
|
_body = {}
|
427
434
|
_body[:tags] = tags if tags != SENTINEL
|
428
435
|
_body[:organization] = organization if organization != SENTINEL
|
@@ -437,6 +444,7 @@ module Carbon
|
|
437
444
|
_body[:request_id] = request_id if request_id != SENTINEL
|
438
445
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
439
446
|
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
447
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
440
448
|
gitbook_connect_request = _body
|
441
449
|
connect_gitbook_with_http_info_impl(gitbook_connect_request, extra)
|
442
450
|
end
|
@@ -528,9 +536,10 @@ module Carbon
|
|
528
536
|
# @param request_id [String]
|
529
537
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
530
538
|
# @param file_sync_config [FileSyncConfigNullable]
|
539
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
531
540
|
# @param body [GuruConnectRequest]
|
532
541
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
533
|
-
def connect_guru(username:, access_token:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, extra: {})
|
542
|
+
def connect_guru(username:, access_token:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
534
543
|
_body = {}
|
535
544
|
_body[:tags] = tags if tags != SENTINEL
|
536
545
|
_body[:username] = username if username != SENTINEL
|
@@ -545,6 +554,7 @@ module Carbon
|
|
545
554
|
_body[:request_id] = request_id if request_id != SENTINEL
|
546
555
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
547
556
|
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
557
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
548
558
|
guru_connect_request = _body
|
549
559
|
api_response = connect_guru_with_http_info_impl(guru_connect_request, extra)
|
550
560
|
api_response.data
|
@@ -568,9 +578,10 @@ module Carbon
|
|
568
578
|
# @param request_id [String]
|
569
579
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
570
580
|
# @param file_sync_config [FileSyncConfigNullable]
|
581
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
571
582
|
# @param body [GuruConnectRequest]
|
572
583
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
573
|
-
def connect_guru_with_http_info(username:, access_token:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, extra: {})
|
584
|
+
def connect_guru_with_http_info(username:, access_token:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, sync_files_on_connection: true, request_id: SENTINEL, sync_source_items: true, file_sync_config: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
574
585
|
_body = {}
|
575
586
|
_body[:tags] = tags if tags != SENTINEL
|
576
587
|
_body[:username] = username if username != SENTINEL
|
@@ -585,6 +596,7 @@ module Carbon
|
|
585
596
|
_body[:request_id] = request_id if request_id != SENTINEL
|
586
597
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
587
598
|
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
599
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
588
600
|
guru_connect_request = _body
|
589
601
|
connect_guru_with_http_info_impl(guru_connect_request, extra)
|
590
602
|
end
|
@@ -675,14 +687,16 @@ module Carbon
|
|
675
687
|
# @param access_key_secret [String]
|
676
688
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
677
689
|
# @param endpoint_url [String] You can specify a Digital Ocean endpoint URL to connect a Digital Ocean Space through this endpoint. The URL should be of format <region>.digitaloceanspaces.com. It's not required for S3 buckets.
|
690
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
678
691
|
# @param body [S3AuthRequest]
|
679
692
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
680
|
-
def create_aws_iam_user(access_key:, access_key_secret:, sync_source_items: true, endpoint_url: SENTINEL, extra: {})
|
693
|
+
def create_aws_iam_user(access_key:, access_key_secret:, sync_source_items: true, endpoint_url: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
681
694
|
_body = {}
|
682
695
|
_body[:access_key] = access_key if access_key != SENTINEL
|
683
696
|
_body[:access_key_secret] = access_key_secret if access_key_secret != SENTINEL
|
684
697
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
685
698
|
_body[:endpoint_url] = endpoint_url if endpoint_url != SENTINEL
|
699
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
686
700
|
s3_auth_request = _body
|
687
701
|
api_response = create_aws_iam_user_with_http_info_impl(s3_auth_request, extra)
|
688
702
|
api_response.data
|
@@ -705,14 +719,16 @@ module Carbon
|
|
705
719
|
# @param access_key_secret [String]
|
706
720
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
707
721
|
# @param endpoint_url [String] You can specify a Digital Ocean endpoint URL to connect a Digital Ocean Space through this endpoint. The URL should be of format <region>.digitaloceanspaces.com. It's not required for S3 buckets.
|
722
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
708
723
|
# @param body [S3AuthRequest]
|
709
724
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
710
|
-
def create_aws_iam_user_with_http_info(access_key:, access_key_secret:, sync_source_items: true, endpoint_url: SENTINEL, extra: {})
|
725
|
+
def create_aws_iam_user_with_http_info(access_key:, access_key_secret:, sync_source_items: true, endpoint_url: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
711
726
|
_body = {}
|
712
727
|
_body[:access_key] = access_key if access_key != SENTINEL
|
713
728
|
_body[:access_key_secret] = access_key_secret if access_key_secret != SENTINEL
|
714
729
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
715
730
|
_body[:endpoint_url] = endpoint_url if endpoint_url != SENTINEL
|
731
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
716
732
|
s3_auth_request = _body
|
717
733
|
create_aws_iam_user_with_http_info_impl(s3_auth_request, extra)
|
718
734
|
end
|
@@ -822,9 +838,10 @@ module Carbon
|
|
822
838
|
# @param automatically_open_file_picker [Boolean] Automatically open source file picker after the OAuth flow is complete. This flag is currently supported by BOX, DROPBOX, GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT. It will be ignored for other data sources.
|
823
839
|
# @param gong_account_email [String] If you are connecting a Gong account, you need to input the email of the account you wish to connect. This email will be used to identify your carbon data source.
|
824
840
|
# @param servicenow_credentials [ServiceNowCredentialsNullable]
|
841
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
825
842
|
# @param body [OAuthURLRequest]
|
826
843
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
827
|
-
def get_oauth_url(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, automatically_open_file_picker: SENTINEL, gong_account_email: SENTINEL, servicenow_credentials: SENTINEL, extra: {})
|
844
|
+
def get_oauth_url(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, automatically_open_file_picker: SENTINEL, gong_account_email: SENTINEL, servicenow_credentials: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
828
845
|
_body = {}
|
829
846
|
_body[:tags] = tags if tags != SENTINEL
|
830
847
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -855,6 +872,7 @@ module Carbon
|
|
855
872
|
_body[:automatically_open_file_picker] = automatically_open_file_picker if automatically_open_file_picker != SENTINEL
|
856
873
|
_body[:gong_account_email] = gong_account_email if gong_account_email != SENTINEL
|
857
874
|
_body[:servicenow_credentials] = servicenow_credentials if servicenow_credentials != SENTINEL
|
875
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
858
876
|
o_auth_url_request = _body
|
859
877
|
api_response = get_oauth_url_with_http_info_impl(o_auth_url_request, extra)
|
860
878
|
api_response.data
|
@@ -896,9 +914,10 @@ module Carbon
|
|
896
914
|
# @param automatically_open_file_picker [Boolean] Automatically open source file picker after the OAuth flow is complete. This flag is currently supported by BOX, DROPBOX, GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT. It will be ignored for other data sources.
|
897
915
|
# @param gong_account_email [String] If you are connecting a Gong account, you need to input the email of the account you wish to connect. This email will be used to identify your carbon data source.
|
898
916
|
# @param servicenow_credentials [ServiceNowCredentialsNullable]
|
917
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
899
918
|
# @param body [OAuthURLRequest]
|
900
919
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
901
|
-
def get_oauth_url_with_http_info(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, automatically_open_file_picker: SENTINEL, gong_account_email: SENTINEL, servicenow_credentials: SENTINEL, extra: {})
|
920
|
+
def get_oauth_url_with_http_info(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, automatically_open_file_picker: SENTINEL, gong_account_email: SENTINEL, servicenow_credentials: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
902
921
|
_body = {}
|
903
922
|
_body[:tags] = tags if tags != SENTINEL
|
904
923
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -929,6 +948,7 @@ module Carbon
|
|
929
948
|
_body[:automatically_open_file_picker] = automatically_open_file_picker if automatically_open_file_picker != SENTINEL
|
930
949
|
_body[:gong_account_email] = gong_account_email if gong_account_email != SENTINEL
|
931
950
|
_body[:servicenow_credentials] = servicenow_credentials if servicenow_credentials != SENTINEL
|
951
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
932
952
|
o_auth_url_request = _body
|
933
953
|
get_oauth_url_with_http_info_impl(o_auth_url_request, extra)
|
934
954
|
end
|
@@ -1975,13 +1995,15 @@ module Carbon
|
|
1975
1995
|
# @param account_name [String]
|
1976
1996
|
# @param account_key [String]
|
1977
1997
|
# @param sync_source_items [Boolean]
|
1998
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
1978
1999
|
# @param body [AzureBlobAuthRequest]
|
1979
2000
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1980
|
-
def sync_azure_blob_storage(account_name:, account_key:, sync_source_items: true, extra: {})
|
2001
|
+
def sync_azure_blob_storage(account_name:, account_key:, sync_source_items: true, data_source_tags: SENTINEL, extra: {})
|
1981
2002
|
_body = {}
|
1982
2003
|
_body[:account_name] = account_name if account_name != SENTINEL
|
1983
2004
|
_body[:account_key] = account_key if account_key != SENTINEL
|
1984
2005
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
2006
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
1985
2007
|
azure_blob_auth_request = _body
|
1986
2008
|
api_response = sync_azure_blob_storage_with_http_info_impl(azure_blob_auth_request, extra)
|
1987
2009
|
api_response.data
|
@@ -2011,13 +2033,15 @@ module Carbon
|
|
2011
2033
|
# @param account_name [String]
|
2012
2034
|
# @param account_key [String]
|
2013
2035
|
# @param sync_source_items [Boolean]
|
2036
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
2014
2037
|
# @param body [AzureBlobAuthRequest]
|
2015
2038
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
2016
|
-
def sync_azure_blob_storage_with_http_info(account_name:, account_key:, sync_source_items: true, extra: {})
|
2039
|
+
def sync_azure_blob_storage_with_http_info(account_name:, account_key:, sync_source_items: true, data_source_tags: SENTINEL, extra: {})
|
2017
2040
|
_body = {}
|
2018
2041
|
_body[:account_name] = account_name if account_name != SENTINEL
|
2019
2042
|
_body[:account_key] = account_key if account_key != SENTINEL
|
2020
2043
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
2044
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
2021
2045
|
azure_blob_auth_request = _body
|
2022
2046
|
sync_azure_blob_storage_with_http_info_impl(azure_blob_auth_request, extra)
|
2023
2047
|
end
|
@@ -2524,13 +2548,15 @@ module Carbon
|
|
2524
2548
|
# @param username [String]
|
2525
2549
|
# @param access_token [String]
|
2526
2550
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
2551
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
2527
2552
|
# @param body [GithubConnectRequest]
|
2528
2553
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
2529
|
-
def sync_git_hub(username:, access_token:, sync_source_items: false, extra: {})
|
2554
|
+
def sync_git_hub(username:, access_token:, sync_source_items: false, data_source_tags: SENTINEL, extra: {})
|
2530
2555
|
_body = {}
|
2531
2556
|
_body[:username] = username if username != SENTINEL
|
2532
2557
|
_body[:access_token] = access_token if access_token != SENTINEL
|
2533
2558
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
2559
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
2534
2560
|
github_connect_request = _body
|
2535
2561
|
api_response = sync_git_hub_with_http_info_impl(github_connect_request, extra)
|
2536
2562
|
api_response.data
|
@@ -2545,13 +2571,15 @@ module Carbon
|
|
2545
2571
|
# @param username [String]
|
2546
2572
|
# @param access_token [String]
|
2547
2573
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
2574
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
2548
2575
|
# @param body [GithubConnectRequest]
|
2549
2576
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
2550
|
-
def sync_git_hub_with_http_info(username:, access_token:, sync_source_items: false, extra: {})
|
2577
|
+
def sync_git_hub_with_http_info(username:, access_token:, sync_source_items: false, data_source_tags: SENTINEL, extra: {})
|
2551
2578
|
_body = {}
|
2552
2579
|
_body[:username] = username if username != SENTINEL
|
2553
2580
|
_body[:access_token] = access_token if access_token != SENTINEL
|
2554
2581
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
2582
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
2555
2583
|
github_connect_request = _body
|
2556
2584
|
sync_git_hub_with_http_info_impl(github_connect_request, extra)
|
2557
2585
|
end
|
@@ -3404,9 +3432,10 @@ module Carbon
|
|
3404
3432
|
# @param generate_sparse_vectors [Boolean]
|
3405
3433
|
# @param prepend_filename_to_chunks [Boolean]
|
3406
3434
|
# @param request_id [String]
|
3435
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
3407
3436
|
# @param body [RSSFeedInput]
|
3408
3437
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
3409
|
-
def sync_rss_feed(url:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, request_id: SENTINEL, extra: {})
|
3438
|
+
def sync_rss_feed(url:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, request_id: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
3410
3439
|
_body = {}
|
3411
3440
|
_body[:tags] = tags if tags != SENTINEL
|
3412
3441
|
_body[:url] = url if url != SENTINEL
|
@@ -3417,6 +3446,7 @@ module Carbon
|
|
3417
3446
|
_body[:generate_sparse_vectors] = generate_sparse_vectors if generate_sparse_vectors != SENTINEL
|
3418
3447
|
_body[:prepend_filename_to_chunks] = prepend_filename_to_chunks if prepend_filename_to_chunks != SENTINEL
|
3419
3448
|
_body[:request_id] = request_id if request_id != SENTINEL
|
3449
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
3420
3450
|
rss_feed_input = _body
|
3421
3451
|
api_response = sync_rss_feed_with_http_info_impl(rss_feed_input, extra)
|
3422
3452
|
api_response.data
|
@@ -3433,9 +3463,10 @@ module Carbon
|
|
3433
3463
|
# @param generate_sparse_vectors [Boolean]
|
3434
3464
|
# @param prepend_filename_to_chunks [Boolean]
|
3435
3465
|
# @param request_id [String]
|
3466
|
+
# @param data_source_tags [Object] Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
3436
3467
|
# @param body [RSSFeedInput]
|
3437
3468
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
3438
|
-
def sync_rss_feed_with_http_info(url:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, request_id: SENTINEL, extra: {})
|
3469
|
+
def sync_rss_feed_with_http_info(url:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, request_id: SENTINEL, data_source_tags: SENTINEL, extra: {})
|
3439
3470
|
_body = {}
|
3440
3471
|
_body[:tags] = tags if tags != SENTINEL
|
3441
3472
|
_body[:url] = url if url != SENTINEL
|
@@ -3446,6 +3477,7 @@ module Carbon
|
|
3446
3477
|
_body[:generate_sparse_vectors] = generate_sparse_vectors if generate_sparse_vectors != SENTINEL
|
3447
3478
|
_body[:prepend_filename_to_chunks] = prepend_filename_to_chunks if prepend_filename_to_chunks != SENTINEL
|
3448
3479
|
_body[:request_id] = request_id if request_id != SENTINEL
|
3480
|
+
_body[:data_source_tags] = data_source_tags if data_source_tags != SENTINEL
|
3449
3481
|
rss_feed_input = _body
|
3450
3482
|
sync_rss_feed_with_http_info_impl(rss_feed_input, extra)
|
3451
3483
|
end
|
@@ -524,6 +524,77 @@ module Carbon
|
|
524
524
|
end
|
525
525
|
APIResponse::new(data, status_code, headers, response)
|
526
526
|
end
|
527
|
+
|
528
|
+
|
529
|
+
# Me Endpoint
|
530
|
+
#
|
531
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
532
|
+
def who_am_i(extra: {})
|
533
|
+
api_response = who_am_i_with_http_info_impl(extra)
|
534
|
+
api_response.data
|
535
|
+
end
|
536
|
+
|
537
|
+
# Me Endpoint
|
538
|
+
#
|
539
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
540
|
+
def who_am_i_with_http_info(extra: {})
|
541
|
+
who_am_i_with_http_info_impl(extra)
|
542
|
+
end
|
543
|
+
|
544
|
+
# Me Endpoint
|
545
|
+
# @param [Hash] opts the optional parameters
|
546
|
+
# @return [UserResponse]
|
547
|
+
private def who_am_i_impl(opts = {})
|
548
|
+
data, _status_code, _headers = who_am_i_with_http_info(opts)
|
549
|
+
data
|
550
|
+
end
|
551
|
+
|
552
|
+
# Me Endpoint
|
553
|
+
# @param [Hash] opts the optional parameters
|
554
|
+
# @return [APIResponse] data is UserResponse, status code, headers and response
|
555
|
+
private def who_am_i_with_http_info_impl(opts = {})
|
556
|
+
if @api_client.config.debugging
|
557
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.who_am_i ...'
|
558
|
+
end
|
559
|
+
# resource path
|
560
|
+
local_var_path = '/whoami'
|
561
|
+
|
562
|
+
# query parameters
|
563
|
+
query_params = opts[:query_params] || {}
|
564
|
+
|
565
|
+
# header parameters
|
566
|
+
header_params = opts[:header_params] || {}
|
567
|
+
# HTTP header 'Accept' (if needed)
|
568
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
569
|
+
|
570
|
+
# form parameters
|
571
|
+
form_params = opts[:form_params] || {}
|
572
|
+
|
573
|
+
# http body (model)
|
574
|
+
post_body = opts[:debug_body]
|
575
|
+
|
576
|
+
# return_type
|
577
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
578
|
+
|
579
|
+
# auth_names
|
580
|
+
auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
|
581
|
+
|
582
|
+
new_options = opts.merge(
|
583
|
+
:operation => :"UsersApi.who_am_i",
|
584
|
+
:header_params => header_params,
|
585
|
+
:query_params => query_params,
|
586
|
+
:form_params => form_params,
|
587
|
+
:body => post_body,
|
588
|
+
:auth_names => auth_names,
|
589
|
+
:return_type => return_type
|
590
|
+
)
|
591
|
+
|
592
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
593
|
+
if @api_client.config.debugging
|
594
|
+
@api_client.config.logger.debug "API called: UsersApi#who_am_i\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
595
|
+
end
|
596
|
+
APIResponse::new(data, status_code, headers, response)
|
597
|
+
end
|
527
598
|
end
|
528
599
|
|
529
600
|
# top-level client access to avoid having the user to insantiate their own API instances
|
@@ -0,0 +1,234 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
require 'time'
|
11
|
+
|
12
|
+
module Carbon
|
13
|
+
class AddDataSourceTagsInput
|
14
|
+
attr_accessor :tags
|
15
|
+
|
16
|
+
attr_accessor :data_source_id
|
17
|
+
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
+
def self.attribute_map
|
20
|
+
{
|
21
|
+
:'tags' => :'tags',
|
22
|
+
:'data_source_id' => :'data_source_id'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns all the JSON keys this model knows about
|
27
|
+
def self.acceptable_attributes
|
28
|
+
attribute_map.values
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'tags' => :'Object',
|
35
|
+
:'data_source_id' => :'Integer'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::AddDataSourceTagsInput` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::AddDataSourceTagsInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'tags')
|
61
|
+
self.tags = attributes[:'tags']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'data_source_id')
|
65
|
+
self.data_source_id = attributes[:'data_source_id']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
if @tags.nil?
|
74
|
+
invalid_properties.push('invalid value for "tags", tags cannot be nil.')
|
75
|
+
end
|
76
|
+
|
77
|
+
if @data_source_id.nil?
|
78
|
+
invalid_properties.push('invalid value for "data_source_id", data_source_id cannot be nil.')
|
79
|
+
end
|
80
|
+
|
81
|
+
invalid_properties
|
82
|
+
end
|
83
|
+
|
84
|
+
# Check to see if the all the properties in the model are valid
|
85
|
+
# @return true if the model is valid
|
86
|
+
def valid?
|
87
|
+
return false if @tags.nil?
|
88
|
+
return false if @data_source_id.nil?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Checks equality by comparing each attribute.
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def ==(o)
|
95
|
+
return true if self.equal?(o)
|
96
|
+
self.class == o.class &&
|
97
|
+
tags == o.tags &&
|
98
|
+
data_source_id == o.data_source_id
|
99
|
+
end
|
100
|
+
|
101
|
+
# @see the `==` method
|
102
|
+
# @param [Object] Object to be compared
|
103
|
+
def eql?(o)
|
104
|
+
self == o
|
105
|
+
end
|
106
|
+
|
107
|
+
# Calculates hash code according to all attributes.
|
108
|
+
# @return [Integer] Hash code
|
109
|
+
def hash
|
110
|
+
[tags, data_source_id].hash
|
111
|
+
end
|
112
|
+
|
113
|
+
# Builds the object from hash
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
# @return [Object] Returns the model itself
|
116
|
+
def self.build_from_hash(attributes)
|
117
|
+
new.build_from_hash(attributes)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
123
|
+
def build_from_hash(attributes)
|
124
|
+
return nil unless attributes.is_a?(Hash)
|
125
|
+
attributes = attributes.transform_keys(&:to_sym)
|
126
|
+
self.class.openapi_types.each_pair do |key, type|
|
127
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
128
|
+
self.send("#{key}=", nil)
|
129
|
+
elsif type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :Time
|
150
|
+
Time.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :Boolean
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
# models (e.g. Pet) or oneOf
|
181
|
+
klass = Carbon.const_get(type)
|
182
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
if value.nil?
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
|
+
end
|
208
|
+
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|