carbon_ruby_sdk 0.2.17 → 0.2.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +24 -22
- data/README.md +25 -10
- data/lib/carbon_ruby_sdk/api/embeddings_api.rb +6 -2
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +24 -14
- data/lib/carbon_ruby_sdk/models/authentication_property.rb +15 -4
- data/lib/carbon_ruby_sdk/models/data_source_type.rb +2 -1
- data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +2 -1
- data/lib/carbon_ruby_sdk/models/get_embedding_documents_body.rb +18 -5
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +1 -2
- data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb +18 -5
- data/lib/carbon_ruby_sdk/models/s3_auth_request.rb +15 -4
- data/lib/carbon_ruby_sdk/models/s3_authentication.rb +15 -4
- data/lib/carbon_ruby_sdk/models/sent_webhook_payload.rb +2 -2
- data/lib/carbon_ruby_sdk/models/simple_o_auth_data_sources.rb +2 -1
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +1 -2
- data/lib/carbon_ruby_sdk/models/sync_options.rb +1 -2
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/spec/api/integrations_api_spec.rb +1 -1
- data/spec/models/authentication_property_spec.rb +6 -0
- data/spec/models/get_embedding_documents_body_spec.rb +6 -0
- data/spec/models/organization_user_files_to_sync_filters_spec.rb +6 -0
- data/spec/models/s3_auth_request_spec.rb +6 -0
- data/spec/models/s3_authentication_spec.rb +6 -0
- data/spec/models/sent_webhook_payload_spec.rb +1 -1
- metadata +142 -142
@@ -59,6 +59,9 @@ module Carbon
|
|
59
59
|
# The external URLs of the files. The query will return files with these external URLs.
|
60
60
|
attr_accessor :external_urls
|
61
61
|
|
62
|
+
# Filter files based on their type at the source (for example help center tickets and articles)
|
63
|
+
attr_accessor :file_types_at_source
|
64
|
+
|
62
65
|
# Attribute mapping from ruby-style variable name to JSON key.
|
63
66
|
def self.attribute_map
|
64
67
|
{
|
@@ -78,7 +81,8 @@ module Carbon
|
|
78
81
|
:'request_ids' => :'request_ids',
|
79
82
|
:'sync_error_message' => :'sync_error_message',
|
80
83
|
:'include_containers' => :'include_containers',
|
81
|
-
:'external_urls' => :'external_urls'
|
84
|
+
:'external_urls' => :'external_urls',
|
85
|
+
:'file_types_at_source' => :'file_types_at_source'
|
82
86
|
}
|
83
87
|
end
|
84
88
|
|
@@ -106,7 +110,8 @@ module Carbon
|
|
106
110
|
:'request_ids' => :'Array<String>',
|
107
111
|
:'sync_error_message' => :'String',
|
108
112
|
:'include_containers' => :'Boolean',
|
109
|
-
:'external_urls' => :'Array<String>'
|
113
|
+
:'external_urls' => :'Array<String>',
|
114
|
+
:'file_types_at_source' => :'Array<HelpdeskFileTypes>'
|
110
115
|
}
|
111
116
|
end
|
112
117
|
|
@@ -127,7 +132,8 @@ module Carbon
|
|
127
132
|
:'request_ids',
|
128
133
|
:'sync_error_message',
|
129
134
|
:'include_containers',
|
130
|
-
:'external_urls'
|
135
|
+
:'external_urls',
|
136
|
+
:'file_types_at_source'
|
131
137
|
])
|
132
138
|
end
|
133
139
|
|
@@ -235,6 +241,12 @@ module Carbon
|
|
235
241
|
self.external_urls = value
|
236
242
|
end
|
237
243
|
end
|
244
|
+
|
245
|
+
if attributes.key?(:'file_types_at_source')
|
246
|
+
if (value = attributes[:'file_types_at_source']).is_a?(Array)
|
247
|
+
self.file_types_at_source = value
|
248
|
+
end
|
249
|
+
end
|
238
250
|
end
|
239
251
|
|
240
252
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -286,7 +298,8 @@ module Carbon
|
|
286
298
|
request_ids == o.request_ids &&
|
287
299
|
sync_error_message == o.sync_error_message &&
|
288
300
|
include_containers == o.include_containers &&
|
289
|
-
external_urls == o.external_urls
|
301
|
+
external_urls == o.external_urls &&
|
302
|
+
file_types_at_source == o.file_types_at_source
|
290
303
|
end
|
291
304
|
|
292
305
|
# @see the `==` method
|
@@ -298,7 +311,7 @@ module Carbon
|
|
298
311
|
# Calculates hash code according to all attributes.
|
299
312
|
# @return [Integer] Hash code
|
300
313
|
def hash
|
301
|
-
[tags, source, name, tags_v2, ids, external_file_ids, sync_statuses, parent_file_ids, organization_user_data_source_id, embedding_generators, root_files_only, include_all_children, non_synced_only, request_ids, sync_error_message, include_containers, external_urls].hash
|
314
|
+
[tags, source, name, tags_v2, ids, external_file_ids, sync_statuses, parent_file_ids, organization_user_data_source_id, embedding_generators, root_files_only, include_all_children, non_synced_only, request_ids, sync_error_message, include_containers, external_urls, file_types_at_source].hash
|
302
315
|
end
|
303
316
|
|
304
317
|
# Builds the object from hash
|
@@ -18,12 +18,16 @@ module Carbon
|
|
18
18
|
# Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
19
19
|
attr_accessor :sync_source_items
|
20
20
|
|
21
|
+
# 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.
|
22
|
+
attr_accessor :endpoint_url
|
23
|
+
|
21
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
25
|
def self.attribute_map
|
23
26
|
{
|
24
27
|
:'access_key' => :'access_key',
|
25
28
|
:'access_key_secret' => :'access_key_secret',
|
26
|
-
:'sync_source_items' => :'sync_source_items'
|
29
|
+
:'sync_source_items' => :'sync_source_items',
|
30
|
+
:'endpoint_url' => :'endpoint_url'
|
27
31
|
}
|
28
32
|
end
|
29
33
|
|
@@ -37,13 +41,15 @@ module Carbon
|
|
37
41
|
{
|
38
42
|
:'access_key' => :'String',
|
39
43
|
:'access_key_secret' => :'String',
|
40
|
-
:'sync_source_items' => :'Boolean'
|
44
|
+
:'sync_source_items' => :'Boolean',
|
45
|
+
:'endpoint_url' => :'String'
|
41
46
|
}
|
42
47
|
end
|
43
48
|
|
44
49
|
# List of attributes with nullable: true
|
45
50
|
def self.openapi_nullable
|
46
51
|
Set.new([
|
52
|
+
:'endpoint_url'
|
47
53
|
])
|
48
54
|
end
|
49
55
|
|
@@ -75,6 +81,10 @@ module Carbon
|
|
75
81
|
else
|
76
82
|
self.sync_source_items = true
|
77
83
|
end
|
84
|
+
|
85
|
+
if attributes.key?(:'endpoint_url')
|
86
|
+
self.endpoint_url = attributes[:'endpoint_url']
|
87
|
+
end
|
78
88
|
end
|
79
89
|
|
80
90
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -107,7 +117,8 @@ module Carbon
|
|
107
117
|
self.class == o.class &&
|
108
118
|
access_key == o.access_key &&
|
109
119
|
access_key_secret == o.access_key_secret &&
|
110
|
-
sync_source_items == o.sync_source_items
|
120
|
+
sync_source_items == o.sync_source_items &&
|
121
|
+
endpoint_url == o.endpoint_url
|
111
122
|
end
|
112
123
|
|
113
124
|
# @see the `==` method
|
@@ -119,7 +130,7 @@ module Carbon
|
|
119
130
|
# Calculates hash code according to all attributes.
|
120
131
|
# @return [Integer] Hash code
|
121
132
|
def hash
|
122
|
-
[access_key, access_key_secret, sync_source_items].hash
|
133
|
+
[access_key, access_key_secret, sync_source_items, endpoint_url].hash
|
123
134
|
end
|
124
135
|
|
125
136
|
# Builds the object from hash
|
@@ -17,12 +17,16 @@ module Carbon
|
|
17
17
|
|
18
18
|
attr_accessor :access_key_secret
|
19
19
|
|
20
|
+
# 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.
|
21
|
+
attr_accessor :endpoint_url
|
22
|
+
|
20
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
21
24
|
def self.attribute_map
|
22
25
|
{
|
23
26
|
:'source' => :'source',
|
24
27
|
:'access_key' => :'access_key',
|
25
|
-
:'access_key_secret' => :'access_key_secret'
|
28
|
+
:'access_key_secret' => :'access_key_secret',
|
29
|
+
:'endpoint_url' => :'endpoint_url'
|
26
30
|
}
|
27
31
|
end
|
28
32
|
|
@@ -36,7 +40,8 @@ module Carbon
|
|
36
40
|
{
|
37
41
|
:'source' => :'Object',
|
38
42
|
:'access_key' => :'String',
|
39
|
-
:'access_key_secret' => :'String'
|
43
|
+
:'access_key_secret' => :'String',
|
44
|
+
:'endpoint_url' => :'String'
|
40
45
|
}
|
41
46
|
end
|
42
47
|
|
@@ -44,6 +49,7 @@ module Carbon
|
|
44
49
|
def self.openapi_nullable
|
45
50
|
Set.new([
|
46
51
|
:'source',
|
52
|
+
:'endpoint_url'
|
47
53
|
])
|
48
54
|
end
|
49
55
|
|
@@ -73,6 +79,10 @@ module Carbon
|
|
73
79
|
if attributes.key?(:'access_key_secret')
|
74
80
|
self.access_key_secret = attributes[:'access_key_secret']
|
75
81
|
end
|
82
|
+
|
83
|
+
if attributes.key?(:'endpoint_url')
|
84
|
+
self.endpoint_url = attributes[:'endpoint_url']
|
85
|
+
end
|
76
86
|
end
|
77
87
|
|
78
88
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -105,7 +115,8 @@ module Carbon
|
|
105
115
|
self.class == o.class &&
|
106
116
|
source == o.source &&
|
107
117
|
access_key == o.access_key &&
|
108
|
-
access_key_secret == o.access_key_secret
|
118
|
+
access_key_secret == o.access_key_secret &&
|
119
|
+
endpoint_url == o.endpoint_url
|
109
120
|
end
|
110
121
|
|
111
122
|
# @see the `==` method
|
@@ -117,7 +128,7 @@ module Carbon
|
|
117
128
|
# Calculates hash code according to all attributes.
|
118
129
|
# @return [Integer] Hash code
|
119
130
|
def hash
|
120
|
-
[source, access_key, access_key_secret].hash
|
131
|
+
[source, access_key, access_key_secret, endpoint_url].hash
|
121
132
|
end
|
122
133
|
|
123
134
|
# Builds the object from hash
|
@@ -114,7 +114,7 @@ module Carbon
|
|
114
114
|
# Check to see if the all the properties in the model are valid
|
115
115
|
# @return true if the model is valid
|
116
116
|
def valid?
|
117
|
-
webhook_type_validator = EnumAttributeValidator.new('String', ["ALL_UPLOADED_FILES_QUEUED", "CHECKUP", "DATA_SOURCE_READY", "FILES_CREATED", "FILES_SKIPPED", "FILE_DELETED", "FILE_ERROR", "FILE_READY", "FILE_STATISTICS_AGGREGATED", "FILE_SYNC_LIMIT_REACHED", "ORGANIZATION_USER_DELETED", "RATE_LIMIT_ERROR", "SPARSE_VECTOR_QUEUE_STATUS", "WEBPAGE_ERROR", "WEBPAGE_READY", "WEBSCRAPE_URLS_READY"])
|
117
|
+
webhook_type_validator = EnumAttributeValidator.new('String', ["ADD", "ALL_UPLOADED_FILES_QUEUED", "CANCEL", "CHECKUP", "DATA_SOURCE_READY", "FILES_CREATED", "FILES_SKIPPED", "FILE_DELETED", "FILE_ERROR", "FILE_READY", "FILE_STATISTICS_AGGREGATED", "FILE_SYNC_LIMIT_REACHED", "ORGANIZATION_USER_DELETED", "RATE_LIMIT_ERROR", "REVOKE", "SPARSE_VECTOR_QUEUE_STATUS", "UPDATE", "WEBPAGE_ERROR", "WEBPAGE_READY", "WEBSCRAPE_URLS_READY"])
|
118
118
|
return false unless webhook_type_validator.valid?(@webhook_type)
|
119
119
|
true
|
120
120
|
end
|
@@ -122,7 +122,7 @@ module Carbon
|
|
122
122
|
# Custom attribute writer method checking allowed values (enum).
|
123
123
|
# @param [Object] webhook_type Object to be assigned
|
124
124
|
def webhook_type=(webhook_type)
|
125
|
-
validator = EnumAttributeValidator.new('String', ["ALL_UPLOADED_FILES_QUEUED", "CHECKUP", "DATA_SOURCE_READY", "FILES_CREATED", "FILES_SKIPPED", "FILE_DELETED", "FILE_ERROR", "FILE_READY", "FILE_STATISTICS_AGGREGATED", "FILE_SYNC_LIMIT_REACHED", "ORGANIZATION_USER_DELETED", "RATE_LIMIT_ERROR", "SPARSE_VECTOR_QUEUE_STATUS", "WEBPAGE_ERROR", "WEBPAGE_READY", "WEBSCRAPE_URLS_READY"])
|
125
|
+
validator = EnumAttributeValidator.new('String', ["ADD", "ALL_UPLOADED_FILES_QUEUED", "CANCEL", "CHECKUP", "DATA_SOURCE_READY", "FILES_CREATED", "FILES_SKIPPED", "FILE_DELETED", "FILE_ERROR", "FILE_READY", "FILE_STATISTICS_AGGREGATED", "FILE_SYNC_LIMIT_REACHED", "ORGANIZATION_USER_DELETED", "RATE_LIMIT_ERROR", "REVOKE", "SPARSE_VECTOR_QUEUE_STATUS", "UPDATE", "WEBPAGE_ERROR", "WEBPAGE_READY", "WEBSCRAPE_URLS_READY"])
|
126
126
|
unless validator.valid?(webhook_type)
|
127
127
|
fail ArgumentError, "invalid value for \"webhook_type\", must be one of #{validator.allowable_values}."
|
128
128
|
end
|
@@ -19,9 +19,10 @@ module Carbon
|
|
19
19
|
GMAIL = "GMAIL".freeze
|
20
20
|
OUTLOOK = "OUTLOOK".freeze
|
21
21
|
SLACK = "SLACK".freeze
|
22
|
+
GOOGLE_CLOUD_STORAGE = "GOOGLE_CLOUD_STORAGE".freeze
|
22
23
|
|
23
24
|
def self.all_vars
|
24
|
-
@all_vars ||= [GOOGLE_DRIVE, INTERCOM, DROPBOX, ONEDRIVE, BOX, GMAIL, OUTLOOK, SLACK].freeze
|
25
|
+
@all_vars ||= [GOOGLE_DRIVE, INTERCOM, DROPBOX, ONEDRIVE, BOX, GMAIL, OUTLOOK, SLACK, GOOGLE_CLOUD_STORAGE].freeze
|
25
26
|
end
|
26
27
|
|
27
28
|
# Builds the enum from string
|
@@ -105,6 +105,7 @@ module Carbon
|
|
105
105
|
:'generate_sparse_vectors',
|
106
106
|
:'prepend_filename_to_chunks',
|
107
107
|
:'max_items_per_chunk',
|
108
|
+
:'request_id',
|
108
109
|
:'use_ocr',
|
109
110
|
:'parse_pdf_tables_with_ocr',
|
110
111
|
:'file_sync_config'
|
@@ -186,8 +187,6 @@ module Carbon
|
|
186
187
|
|
187
188
|
if attributes.key?(:'request_id')
|
188
189
|
self.request_id = attributes[:'request_id']
|
189
|
-
else
|
190
|
-
self.request_id = '0a2f743b-fe89-4193-86c3-87ca6d2ffc43'
|
191
190
|
end
|
192
191
|
|
193
192
|
if attributes.key?(:'use_ocr')
|
@@ -104,6 +104,7 @@ module Carbon
|
|
104
104
|
:'prepend_filename_to_chunks',
|
105
105
|
:'max_items_per_chunk',
|
106
106
|
:'sync_files_on_connection',
|
107
|
+
:'request_id',
|
107
108
|
:'file_sync_config'
|
108
109
|
])
|
109
110
|
end
|
@@ -181,8 +182,6 @@ module Carbon
|
|
181
182
|
|
182
183
|
if attributes.key?(:'request_id')
|
183
184
|
self.request_id = attributes[:'request_id']
|
184
|
-
else
|
185
|
-
self.request_id = 'bdd2d0b8-c211-49bd-b70a-4889ae5fab99'
|
186
185
|
end
|
187
186
|
|
188
187
|
if attributes.key?(:'enable_file_picker')
|
@@ -74,7 +74,7 @@ describe 'IntegrationsApi' do
|
|
74
74
|
|
75
75
|
# unit tests for create_aws_iam_user
|
76
76
|
# S3 Auth
|
77
|
-
#
|
77
|
+
# This endpoint can be used to connect S3 as well as Digital Ocean Spaces (S3 compatible) For S3, create a new IAM user with permissions to: <ol> <li>List all buckets.</li> <li>Read from the specific buckets and objects to sync with Carbon. Ensure any future buckets or objects carry the same permissions.</li> </ol> Once created, generate an access key for this user and share the credentials with us. We recommend testing this key beforehand. For Digital Ocean Spaces, generate the above credentials in your Applications and API page here https://cloud.digitalocean.com/account/api/spaces. Endpoint URL is required to connect Digital Ocean Spaces.
|
78
78
|
# @param s3_auth_request
|
79
79
|
# @param [Hash] opts the optional parameters
|
80
80
|
# @return [OrganizationUserDataSourceAPI]
|
@@ -109,4 +109,10 @@ describe Carbon::AuthenticationProperty do
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
+
describe 'test attribute "endpoint_url"' do
|
113
|
+
it 'should work' do
|
114
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
112
118
|
end
|
@@ -127,4 +127,10 @@ describe Carbon::GetEmbeddingDocumentsBody do
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
+
describe 'test attribute "file_types_at_source"' do
|
131
|
+
it 'should work' do
|
132
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
130
136
|
end
|
@@ -121,4 +121,10 @@ describe Carbon::OrganizationUserFilesToSyncFilters do
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
+
describe 'test attribute "file_types_at_source"' do
|
125
|
+
it 'should work' do
|
126
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
124
130
|
end
|
@@ -22,7 +22,7 @@ describe Carbon::SentWebhookPayload do
|
|
22
22
|
describe 'test attribute "webhook_type"' do
|
23
23
|
it 'should work' do
|
24
24
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
25
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["ALL_UPLOADED_FILES_QUEUED", "CHECKUP", "DATA_SOURCE_READY", "FILES_CREATED", "FILES_SKIPPED", "FILE_DELETED", "FILE_ERROR", "FILE_READY", "FILE_STATISTICS_AGGREGATED", "FILE_SYNC_LIMIT_REACHED", "ORGANIZATION_USER_DELETED", "RATE_LIMIT_ERROR", "SPARSE_VECTOR_QUEUE_STATUS", "WEBPAGE_ERROR", "WEBPAGE_READY", "WEBSCRAPE_URLS_READY"])
|
25
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["ADD", "ALL_UPLOADED_FILES_QUEUED", "CANCEL", "CHECKUP", "DATA_SOURCE_READY", "FILES_CREATED", "FILES_SKIPPED", "FILE_DELETED", "FILE_ERROR", "FILE_READY", "FILE_STATISTICS_AGGREGATED", "FILE_SYNC_LIMIT_REACHED", "ORGANIZATION_USER_DELETED", "RATE_LIMIT_ERROR", "REVOKE", "SPARSE_VECTOR_QUEUE_STATUS", "UPDATE", "WEBPAGE_ERROR", "WEBPAGE_READY", "WEBSCRAPE_URLS_READY"])
|
26
26
|
# validator.allowable_values.each do |value|
|
27
27
|
# expect { instance.webhook_type = value }.not_to raise_error
|
28
28
|
# end
|