carbon_ruby_sdk 0.2.28 → 0.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -7
  3. data/README.md +109 -6
  4. data/lib/carbon_ruby_sdk/api/embeddings_api.rb +2 -2
  5. data/lib/carbon_ruby_sdk/api/files_api.rb +21 -6
  6. data/lib/carbon_ruby_sdk/api/integrations_api.rb +166 -10
  7. data/lib/carbon_ruby_sdk/api/utilities_api.rb +6 -2
  8. data/lib/carbon_ruby_sdk/models/authentication_property.rb +63 -5
  9. data/lib/carbon_ruby_sdk/models/auto_synced_source_types_property_inner.rb +226 -0
  10. data/lib/carbon_ruby_sdk/models/data_source_type.rb +4 -1
  11. data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +4 -1
  12. data/lib/carbon_ruby_sdk/models/external_data_source_type.rb +2 -1
  13. data/lib/carbon_ruby_sdk/models/file_formats.rb +4 -1
  14. data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +4 -1
  15. data/lib/carbon_ruby_sdk/models/file_sync_config.rb +17 -5
  16. data/lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb +17 -5
  17. data/lib/carbon_ruby_sdk/models/get_embedding_documents_body.rb +1 -1
  18. data/lib/carbon_ruby_sdk/models/guru_authentication.rb +244 -0
  19. data/lib/carbon_ruby_sdk/models/guru_connect_request.rb +359 -0
  20. data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +16 -6
  21. data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb +1 -1
  22. data/lib/carbon_ruby_sdk/models/raw_text_input.rb +16 -4
  23. data/lib/carbon_ruby_sdk/models/service_now_authentication.rb +296 -0
  24. data/lib/carbon_ruby_sdk/models/service_now_credentials.rb +262 -0
  25. data/lib/carbon_ruby_sdk/models/service_now_credentials_nullable.rb +263 -0
  26. data/lib/carbon_ruby_sdk/models/service_now_file_types.rb +37 -0
  27. data/lib/carbon_ruby_sdk/models/sitemap_scrape_request.rb +17 -5
  28. data/lib/carbon_ruby_sdk/models/sync_files_request.rb +1 -1
  29. data/lib/carbon_ruby_sdk/models/sync_options.rb +1 -1
  30. data/lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb +16 -4
  31. data/lib/carbon_ruby_sdk/models/webscrape_request.rb +17 -5
  32. data/lib/carbon_ruby_sdk/version.rb +1 -1
  33. data/lib/carbon_ruby_sdk.rb +7 -0
  34. data/spec/api/files_api_spec.rb +1 -0
  35. data/spec/api/integrations_api_spec.rb +13 -1
  36. data/spec/models/authentication_property_spec.rb +24 -0
  37. data/spec/models/auto_synced_source_types_property_inner_spec.rb +22 -0
  38. data/spec/models/file_sync_config_nullable_spec.rb +6 -0
  39. data/spec/models/file_sync_config_spec.rb +6 -0
  40. data/spec/models/guru_authentication_spec.rb +40 -0
  41. data/spec/models/guru_connect_request_spec.rb +100 -0
  42. data/spec/models/o_auth_url_request_spec.rb +6 -0
  43. data/spec/models/raw_text_input_spec.rb +6 -0
  44. data/spec/models/service_now_authentication_spec.rb +64 -0
  45. data/spec/models/service_now_credentials_nullable_spec.rb +46 -0
  46. data/spec/models/service_now_credentials_spec.rb +46 -0
  47. data/spec/models/service_now_file_types_spec.rb +22 -0
  48. data/spec/models/sitemap_scrape_request_spec.rb +6 -0
  49. data/spec/models/upload_file_from_url_input_spec.rb +6 -0
  50. data/spec/models/webscrape_request_spec.rb +6 -0
  51. metadata +169 -148
@@ -0,0 +1,244 @@
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 GuruAuthentication
14
+ attr_accessor :source
15
+
16
+ attr_accessor :access_token
17
+
18
+ attr_accessor :username
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'source' => :'source',
24
+ :'access_token' => :'access_token',
25
+ :'username' => :'username'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'source' => :'Object',
38
+ :'access_token' => :'String',
39
+ :'username' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ :'source',
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::GuruAuthentication` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::GuruAuthentication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'source')
66
+ self.source = attributes[:'source']
67
+ end
68
+
69
+ if attributes.key?(:'access_token')
70
+ self.access_token = attributes[:'access_token']
71
+ end
72
+
73
+ if attributes.key?(:'username')
74
+ self.username = attributes[:'username']
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ if @access_token.nil?
83
+ invalid_properties.push('invalid value for "access_token", access_token cannot be nil.')
84
+ end
85
+
86
+ if @username.nil?
87
+ invalid_properties.push('invalid value for "username", username cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ return false if @access_token.nil?
97
+ return false if @username.nil?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ source == o.source &&
107
+ access_token == o.access_token &&
108
+ username == o.username
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [source, access_token, username].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ attributes = attributes.transform_keys(&:to_sym)
136
+ self.class.openapi_types.each_pair do |key, type|
137
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
138
+ self.send("#{key}=", nil)
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = Carbon.const_get(type)
192
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -0,0 +1,359 @@
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 GuruConnectRequest
14
+ attr_accessor :tags
15
+
16
+ attr_accessor :username
17
+
18
+ attr_accessor :access_token
19
+
20
+ attr_accessor :chunk_size
21
+
22
+ attr_accessor :chunk_overlap
23
+
24
+ attr_accessor :skip_embedding_generation
25
+
26
+ attr_accessor :embedding_model
27
+
28
+ attr_accessor :generate_sparse_vectors
29
+
30
+ attr_accessor :prepend_filename_to_chunks
31
+
32
+ attr_accessor :sync_files_on_connection
33
+
34
+ attr_accessor :request_id
35
+
36
+ # Enabling this flag will fetch all available content from the source to be listed via list items endpoint
37
+ attr_accessor :sync_source_items
38
+
39
+ attr_accessor :file_sync_config
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'tags' => :'tags',
45
+ :'username' => :'username',
46
+ :'access_token' => :'access_token',
47
+ :'chunk_size' => :'chunk_size',
48
+ :'chunk_overlap' => :'chunk_overlap',
49
+ :'skip_embedding_generation' => :'skip_embedding_generation',
50
+ :'embedding_model' => :'embedding_model',
51
+ :'generate_sparse_vectors' => :'generate_sparse_vectors',
52
+ :'prepend_filename_to_chunks' => :'prepend_filename_to_chunks',
53
+ :'sync_files_on_connection' => :'sync_files_on_connection',
54
+ :'request_id' => :'request_id',
55
+ :'sync_source_items' => :'sync_source_items',
56
+ :'file_sync_config' => :'file_sync_config'
57
+ }
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'tags' => :'Object',
69
+ :'username' => :'String',
70
+ :'access_token' => :'String',
71
+ :'chunk_size' => :'Integer',
72
+ :'chunk_overlap' => :'Integer',
73
+ :'skip_embedding_generation' => :'Boolean',
74
+ :'embedding_model' => :'EmbeddingGenerators',
75
+ :'generate_sparse_vectors' => :'Boolean',
76
+ :'prepend_filename_to_chunks' => :'Boolean',
77
+ :'sync_files_on_connection' => :'Boolean',
78
+ :'request_id' => :'String',
79
+ :'sync_source_items' => :'Boolean',
80
+ :'file_sync_config' => :'FileSyncConfigNullable'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ :'tags',
88
+ :'chunk_size',
89
+ :'chunk_overlap',
90
+ :'skip_embedding_generation',
91
+ :'generate_sparse_vectors',
92
+ :'prepend_filename_to_chunks',
93
+ :'sync_files_on_connection',
94
+ :'request_id',
95
+ :'file_sync_config'
96
+ ])
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::GuruConnectRequest` initialize method"
104
+ end
105
+
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!self.class.attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::GuruConnectRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
113
+
114
+ if attributes.key?(:'tags')
115
+ self.tags = attributes[:'tags']
116
+ end
117
+
118
+ if attributes.key?(:'username')
119
+ self.username = attributes[:'username']
120
+ end
121
+
122
+ if attributes.key?(:'access_token')
123
+ self.access_token = attributes[:'access_token']
124
+ end
125
+
126
+ if attributes.key?(:'chunk_size')
127
+ self.chunk_size = attributes[:'chunk_size']
128
+ else
129
+ self.chunk_size = 1500
130
+ end
131
+
132
+ if attributes.key?(:'chunk_overlap')
133
+ self.chunk_overlap = attributes[:'chunk_overlap']
134
+ else
135
+ self.chunk_overlap = 20
136
+ end
137
+
138
+ if attributes.key?(:'skip_embedding_generation')
139
+ self.skip_embedding_generation = attributes[:'skip_embedding_generation']
140
+ else
141
+ self.skip_embedding_generation = false
142
+ end
143
+
144
+ if attributes.key?(:'embedding_model')
145
+ self.embedding_model = attributes[:'embedding_model']
146
+ else
147
+ self.embedding_model = 'OPENAI'
148
+ end
149
+
150
+ if attributes.key?(:'generate_sparse_vectors')
151
+ self.generate_sparse_vectors = attributes[:'generate_sparse_vectors']
152
+ else
153
+ self.generate_sparse_vectors = false
154
+ end
155
+
156
+ if attributes.key?(:'prepend_filename_to_chunks')
157
+ self.prepend_filename_to_chunks = attributes[:'prepend_filename_to_chunks']
158
+ else
159
+ self.prepend_filename_to_chunks = false
160
+ end
161
+
162
+ if attributes.key?(:'sync_files_on_connection')
163
+ self.sync_files_on_connection = attributes[:'sync_files_on_connection']
164
+ else
165
+ self.sync_files_on_connection = true
166
+ end
167
+
168
+ if attributes.key?(:'request_id')
169
+ self.request_id = attributes[:'request_id']
170
+ end
171
+
172
+ if attributes.key?(:'sync_source_items')
173
+ self.sync_source_items = attributes[:'sync_source_items']
174
+ else
175
+ self.sync_source_items = true
176
+ end
177
+
178
+ if attributes.key?(:'file_sync_config')
179
+ self.file_sync_config = attributes[:'file_sync_config']
180
+ end
181
+ end
182
+
183
+ # Show invalid properties with the reasons. Usually used together with valid?
184
+ # @return Array for valid properties with the reasons
185
+ def list_invalid_properties
186
+ invalid_properties = Array.new
187
+ if @username.nil?
188
+ invalid_properties.push('invalid value for "username", username cannot be nil.')
189
+ end
190
+
191
+ if @access_token.nil?
192
+ invalid_properties.push('invalid value for "access_token", access_token cannot be nil.')
193
+ end
194
+
195
+ invalid_properties
196
+ end
197
+
198
+ # Check to see if the all the properties in the model are valid
199
+ # @return true if the model is valid
200
+ def valid?
201
+ return false if @username.nil?
202
+ return false if @access_token.nil?
203
+ true
204
+ end
205
+
206
+ # Checks equality by comparing each attribute.
207
+ # @param [Object] Object to be compared
208
+ def ==(o)
209
+ return true if self.equal?(o)
210
+ self.class == o.class &&
211
+ tags == o.tags &&
212
+ username == o.username &&
213
+ access_token == o.access_token &&
214
+ chunk_size == o.chunk_size &&
215
+ chunk_overlap == o.chunk_overlap &&
216
+ skip_embedding_generation == o.skip_embedding_generation &&
217
+ embedding_model == o.embedding_model &&
218
+ generate_sparse_vectors == o.generate_sparse_vectors &&
219
+ prepend_filename_to_chunks == o.prepend_filename_to_chunks &&
220
+ sync_files_on_connection == o.sync_files_on_connection &&
221
+ request_id == o.request_id &&
222
+ sync_source_items == o.sync_source_items &&
223
+ file_sync_config == o.file_sync_config
224
+ end
225
+
226
+ # @see the `==` method
227
+ # @param [Object] Object to be compared
228
+ def eql?(o)
229
+ self == o
230
+ end
231
+
232
+ # Calculates hash code according to all attributes.
233
+ # @return [Integer] Hash code
234
+ def hash
235
+ [tags, username, access_token, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, generate_sparse_vectors, prepend_filename_to_chunks, sync_files_on_connection, request_id, sync_source_items, file_sync_config].hash
236
+ end
237
+
238
+ # Builds the object from hash
239
+ # @param [Hash] attributes Model attributes in the form of hash
240
+ # @return [Object] Returns the model itself
241
+ def self.build_from_hash(attributes)
242
+ new.build_from_hash(attributes)
243
+ end
244
+
245
+ # Builds the object from hash
246
+ # @param [Hash] attributes Model attributes in the form of hash
247
+ # @return [Object] Returns the model itself
248
+ def build_from_hash(attributes)
249
+ return nil unless attributes.is_a?(Hash)
250
+ attributes = attributes.transform_keys(&:to_sym)
251
+ self.class.openapi_types.each_pair do |key, type|
252
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
253
+ self.send("#{key}=", nil)
254
+ elsif type =~ /\AArray<(.*)>/i
255
+ # check to ensure the input is an array given that the attribute
256
+ # is documented as an array but the input is not
257
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
258
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
259
+ end
260
+ elsif !attributes[self.class.attribute_map[key]].nil?
261
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
262
+ end
263
+ end
264
+
265
+ self
266
+ end
267
+
268
+ # Deserializes the data based on type
269
+ # @param string type Data type
270
+ # @param string value Value to be deserialized
271
+ # @return [Object] Deserialized data
272
+ def _deserialize(type, value)
273
+ case type.to_sym
274
+ when :Time
275
+ Time.parse(value)
276
+ when :Date
277
+ Date.parse(value)
278
+ when :String
279
+ value.to_s
280
+ when :Integer
281
+ value.to_i
282
+ when :Float
283
+ value.to_f
284
+ when :Boolean
285
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
286
+ true
287
+ else
288
+ false
289
+ end
290
+ when :Object
291
+ # generic object (usually a Hash), return directly
292
+ value
293
+ when /\AArray<(?<inner_type>.+)>\z/
294
+ inner_type = Regexp.last_match[:inner_type]
295
+ value.map { |v| _deserialize(inner_type, v) }
296
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
297
+ k_type = Regexp.last_match[:k_type]
298
+ v_type = Regexp.last_match[:v_type]
299
+ {}.tap do |hash|
300
+ value.each do |k, v|
301
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
302
+ end
303
+ end
304
+ else # model
305
+ # models (e.g. Pet) or oneOf
306
+ klass = Carbon.const_get(type)
307
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
308
+ end
309
+ end
310
+
311
+ # Returns the string representation of the object
312
+ # @return [String] String presentation of the object
313
+ def to_s
314
+ to_hash.to_s
315
+ end
316
+
317
+ # to_body is an alias to to_hash (backward compatibility)
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_body
320
+ to_hash
321
+ end
322
+
323
+ # Returns the object in the form of hash
324
+ # @return [Hash] Returns the object in the form of hash
325
+ def to_hash
326
+ hash = {}
327
+ self.class.attribute_map.each_pair do |attr, param|
328
+ value = self.send(attr)
329
+ if value.nil?
330
+ is_nullable = self.class.openapi_nullable.include?(attr)
331
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
332
+ end
333
+
334
+ hash[param] = _to_hash(value)
335
+ end
336
+ hash
337
+ end
338
+
339
+ # Outputs non-array value in the form of hash
340
+ # For object, use to_hash. Otherwise, just return the value
341
+ # @param [Object] value Any valid value
342
+ # @return [Hash] Returns the value in the form of hash
343
+ def _to_hash(value)
344
+ if value.is_a?(Array)
345
+ value.compact.map { |v| _to_hash(v) }
346
+ elsif value.is_a?(Hash)
347
+ {}.tap do |hash|
348
+ value.each { |k, v| hash[k] = _to_hash(v) }
349
+ end
350
+ elsif value.respond_to? :to_hash
351
+ value.to_hash
352
+ else
353
+ value
354
+ end
355
+ end
356
+
357
+ end
358
+
359
+ end
@@ -67,7 +67,7 @@ module Carbon
67
67
  # Enabling this flag will fetch all available content from the source to be listed via list items endpoint
68
68
  attr_accessor :sync_source_items
69
69
 
70
- # Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX, INTERCOM, GMAIL, OUTLOOK, ZENDESK, CONFLUENCE, NOTION, SHAREPOINT. It will be ignored for other data sources.
70
+ # Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX, INTERCOM, GMAIL, OUTLOOK, ZENDESK, CONFLUENCE, NOTION, SHAREPOINT, SERVICENOW. It will be ignored for other data sources.
71
71
  attr_accessor :incremental_sync
72
72
 
73
73
  attr_accessor :file_sync_config
@@ -75,6 +75,8 @@ module Carbon
75
75
  # 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.
76
76
  attr_accessor :automatically_open_file_picker
77
77
 
78
+ attr_accessor :servicenow_credentials
79
+
78
80
  # Attribute mapping from ruby-style variable name to JSON key.
79
81
  def self.attribute_map
80
82
  {
@@ -104,7 +106,8 @@ module Carbon
104
106
  :'sync_source_items' => :'sync_source_items',
105
107
  :'incremental_sync' => :'incremental_sync',
106
108
  :'file_sync_config' => :'file_sync_config',
107
- :'automatically_open_file_picker' => :'automatically_open_file_picker'
109
+ :'automatically_open_file_picker' => :'automatically_open_file_picker',
110
+ :'servicenow_credentials' => :'servicenow_credentials'
108
111
  }
109
112
  end
110
113
 
@@ -142,7 +145,8 @@ module Carbon
142
145
  :'sync_source_items' => :'Boolean',
143
146
  :'incremental_sync' => :'Boolean',
144
147
  :'file_sync_config' => :'FileSyncConfigNullable',
145
- :'automatically_open_file_picker' => :'Boolean'
148
+ :'automatically_open_file_picker' => :'Boolean',
149
+ :'servicenow_credentials' => :'ServiceNowCredentialsNullable'
146
150
  }
147
151
  end
148
152
 
@@ -170,7 +174,8 @@ module Carbon
170
174
  :'use_ocr',
171
175
  :'parse_pdf_tables_with_ocr',
172
176
  :'file_sync_config',
173
- :'automatically_open_file_picker'
177
+ :'automatically_open_file_picker',
178
+ :'servicenow_credentials'
174
179
  ])
175
180
  end
176
181
 
@@ -324,6 +329,10 @@ module Carbon
324
329
  if attributes.key?(:'automatically_open_file_picker')
325
330
  self.automatically_open_file_picker = attributes[:'automatically_open_file_picker']
326
331
  end
332
+
333
+ if attributes.key?(:'servicenow_credentials')
334
+ self.servicenow_credentials = attributes[:'servicenow_credentials']
335
+ end
327
336
  end
328
337
 
329
338
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -375,7 +384,8 @@ module Carbon
375
384
  sync_source_items == o.sync_source_items &&
376
385
  incremental_sync == o.incremental_sync &&
377
386
  file_sync_config == o.file_sync_config &&
378
- automatically_open_file_picker == o.automatically_open_file_picker
387
+ automatically_open_file_picker == o.automatically_open_file_picker &&
388
+ servicenow_credentials == o.servicenow_credentials
379
389
  end
380
390
 
381
391
  # @see the `==` method
@@ -387,7 +397,7 @@ module Carbon
387
397
  # Calculates hash code according to all attributes.
388
398
  # @return [Integer] Hash code
389
399
  def hash
390
- [tags, scope, service, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, zendesk_subdomain, microsoft_tenant, sharepoint_site_name, confluence_subdomain, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, salesforce_domain, sync_files_on_connection, set_page_as_boundary, data_source_id, connecting_new_account, request_id, use_ocr, parse_pdf_tables_with_ocr, enable_file_picker, sync_source_items, incremental_sync, file_sync_config, automatically_open_file_picker].hash
400
+ [tags, scope, service, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, zendesk_subdomain, microsoft_tenant, sharepoint_site_name, confluence_subdomain, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, salesforce_domain, sync_files_on_connection, set_page_as_boundary, data_source_id, connecting_new_account, request_id, use_ocr, parse_pdf_tables_with_ocr, enable_file_picker, sync_source_items, incremental_sync, file_sync_config, automatically_open_file_picker, servicenow_credentials].hash
391
401
  end
392
402
 
393
403
  # Builds the object from hash
@@ -111,7 +111,7 @@ module Carbon
111
111
  :'sync_error_message' => :'String',
112
112
  :'include_containers' => :'Boolean',
113
113
  :'external_urls' => :'Array<String>',
114
- :'file_types_at_source' => :'Array<HelpdeskFileTypes>'
114
+ :'file_types_at_source' => :'Array<AutoSyncedSourceTypesPropertyInner>'
115
115
  }
116
116
  end
117
117