carbon_ruby_sdk 0.2.41 → 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 +273 -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/api/white_label_api.rb +393 -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/credentials.rb +244 -0
- data/lib/carbon_ruby_sdk/models/delete_white_label_request.rb +222 -0
- 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/google_drive_credentials.rb +254 -0
- data/lib/carbon_ruby_sdk/models/google_drive_white_label_input.rb +230 -0
- data/lib/carbon_ruby_sdk/models/guru_connect_request.rb +15 -5
- data/lib/carbon_ruby_sdk/models/list_white_label_request.rb +246 -0
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +15 -5
- data/lib/carbon_ruby_sdk/models/one_drive_sharepoint_credentials.rb +264 -0
- data/lib/carbon_ruby_sdk/models/one_drive_sharepoint_white_label_input.rb +234 -0
- data/lib/carbon_ruby_sdk/models/one_drive_sharepoint_white_label_input_data_source_type.rb +36 -0
- 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_label_create_request_inner.rb +255 -0
- data/lib/carbon_ruby_sdk/models/white_label_filters.rb +230 -0
- data/lib/carbon_ruby_sdk/models/white_label_input.rb +234 -0
- data/lib/carbon_ruby_sdk/models/white_label_input_data_source_type.rb +48 -0
- data/lib/carbon_ruby_sdk/models/white_label_order_by_columns.rb +36 -0
- data/lib/carbon_ruby_sdk/models/white_label_update_request.rb +255 -0
- 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 +19 -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/api/white_label_api_spec.rb +73 -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/credentials_spec.rb +40 -0
- data/spec/models/delete_white_label_request_spec.rb +28 -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/google_drive_credentials_spec.rb +46 -0
- data/spec/models/google_drive_white_label_input_spec.rb +34 -0
- data/spec/models/guru_connect_request_spec.rb +6 -0
- data/spec/models/list_white_label_request_spec.rb +46 -0
- data/spec/models/o_auth_url_request_spec.rb +6 -0
- data/spec/models/one_drive_sharepoint_credentials_spec.rb +52 -0
- data/spec/models/one_drive_sharepoint_white_label_input_data_source_type_spec.rb +22 -0
- data/spec/models/one_drive_sharepoint_white_label_input_spec.rb +34 -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_label_create_request_inner_spec.rb +34 -0
- data/spec/models/white_label_filters_spec.rb +34 -0
- data/spec/models/white_label_input_data_source_type_spec.rb +22 -0
- data/spec/models/white_label_input_spec.rb +34 -0
- data/spec/models/white_label_order_by_columns_spec.rb +22 -0
- data/spec/models/white_label_update_request_spec.rb +34 -0
- data/spec/models/white_labeling_response_spec.rb +6 -0
- metadata +53 -2
@@ -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 Credentials
|
14
|
+
attr_accessor :client_id
|
15
|
+
|
16
|
+
attr_accessor :redirect_uri
|
17
|
+
|
18
|
+
attr_accessor :client_secret
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'client_id' => :'client_id',
|
24
|
+
:'redirect_uri' => :'redirect_uri',
|
25
|
+
:'client_secret' => :'client_secret'
|
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
|
+
:'client_id' => :'String',
|
38
|
+
:'redirect_uri' => :'String',
|
39
|
+
:'client_secret' => :'String'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
:'client_secret'
|
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::Credentials` 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::Credentials`. 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?(:'client_id')
|
66
|
+
self.client_id = attributes[:'client_id']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'redirect_uri')
|
70
|
+
self.redirect_uri = attributes[:'redirect_uri']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'client_secret')
|
74
|
+
self.client_secret = attributes[:'client_secret']
|
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 @client_id.nil?
|
83
|
+
invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
|
84
|
+
end
|
85
|
+
|
86
|
+
if @redirect_uri.nil?
|
87
|
+
invalid_properties.push('invalid value for "redirect_uri", redirect_uri 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 @client_id.nil?
|
97
|
+
return false if @redirect_uri.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
|
+
client_id == o.client_id &&
|
107
|
+
redirect_uri == o.redirect_uri &&
|
108
|
+
client_secret == o.client_secret
|
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
|
+
[client_id, redirect_uri, client_secret].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,222 @@
|
|
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 DeleteWhiteLabelRequest
|
14
|
+
attr_accessor :ids
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:'ids' => :'ids'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns all the JSON keys this model knows about
|
24
|
+
def self.acceptable_attributes
|
25
|
+
attribute_map.values
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.openapi_types
|
30
|
+
{
|
31
|
+
:'ids' => :'Array<Integer>'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([
|
38
|
+
])
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
if (!attributes.is_a?(Hash))
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::DeleteWhiteLabelRequest` initialize method"
|
46
|
+
end
|
47
|
+
|
48
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
50
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
51
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::DeleteWhiteLabelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
52
|
+
end
|
53
|
+
h[k.to_sym] = v
|
54
|
+
}
|
55
|
+
|
56
|
+
if attributes.key?(:'ids')
|
57
|
+
if (value = attributes[:'ids']).is_a?(Array)
|
58
|
+
self.ids = value
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
64
|
+
# @return Array for valid properties with the reasons
|
65
|
+
def list_invalid_properties
|
66
|
+
invalid_properties = Array.new
|
67
|
+
if @ids.nil?
|
68
|
+
invalid_properties.push('invalid value for "ids", ids cannot be nil.')
|
69
|
+
end
|
70
|
+
|
71
|
+
invalid_properties
|
72
|
+
end
|
73
|
+
|
74
|
+
# Check to see if the all the properties in the model are valid
|
75
|
+
# @return true if the model is valid
|
76
|
+
def valid?
|
77
|
+
return false if @ids.nil?
|
78
|
+
true
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def ==(o)
|
84
|
+
return true if self.equal?(o)
|
85
|
+
self.class == o.class &&
|
86
|
+
ids == o.ids
|
87
|
+
end
|
88
|
+
|
89
|
+
# @see the `==` method
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def eql?(o)
|
92
|
+
self == o
|
93
|
+
end
|
94
|
+
|
95
|
+
# Calculates hash code according to all attributes.
|
96
|
+
# @return [Integer] Hash code
|
97
|
+
def hash
|
98
|
+
[ids].hash
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def self.build_from_hash(attributes)
|
105
|
+
new.build_from_hash(attributes)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Builds the object from hash
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
+
# @return [Object] Returns the model itself
|
111
|
+
def build_from_hash(attributes)
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
114
|
+
self.class.openapi_types.each_pair do |key, type|
|
115
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
116
|
+
self.send("#{key}=", nil)
|
117
|
+
elsif type =~ /\AArray<(.*)>/i
|
118
|
+
# check to ensure the input is an array given that the attribute
|
119
|
+
# is documented as an array but the input is not
|
120
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
121
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
122
|
+
end
|
123
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
124
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
self
|
129
|
+
end
|
130
|
+
|
131
|
+
# Deserializes the data based on type
|
132
|
+
# @param string type Data type
|
133
|
+
# @param string value Value to be deserialized
|
134
|
+
# @return [Object] Deserialized data
|
135
|
+
def _deserialize(type, value)
|
136
|
+
case type.to_sym
|
137
|
+
when :Time
|
138
|
+
Time.parse(value)
|
139
|
+
when :Date
|
140
|
+
Date.parse(value)
|
141
|
+
when :String
|
142
|
+
value.to_s
|
143
|
+
when :Integer
|
144
|
+
value.to_i
|
145
|
+
when :Float
|
146
|
+
value.to_f
|
147
|
+
when :Boolean
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
149
|
+
true
|
150
|
+
else
|
151
|
+
false
|
152
|
+
end
|
153
|
+
when :Object
|
154
|
+
# generic object (usually a Hash), return directly
|
155
|
+
value
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
162
|
+
{}.tap do |hash|
|
163
|
+
value.each do |k, v|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
else # model
|
168
|
+
# models (e.g. Pet) or oneOf
|
169
|
+
klass = Carbon.const_get(type)
|
170
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the string representation of the object
|
175
|
+
# @return [String] String presentation of the object
|
176
|
+
def to_s
|
177
|
+
to_hash.to_s
|
178
|
+
end
|
179
|
+
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_body
|
183
|
+
to_hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the object in the form of hash
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_hash
|
189
|
+
hash = {}
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
191
|
+
value = self.send(attr)
|
192
|
+
if value.nil?
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
195
|
+
end
|
196
|
+
|
197
|
+
hash[param] = _to_hash(value)
|
198
|
+
end
|
199
|
+
hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Outputs non-array value in the form of hash
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
204
|
+
# @param [Object] value Any valid value
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
206
|
+
def _to_hash(value)
|
207
|
+
if value.is_a?(Array)
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
209
|
+
elsif value.is_a?(Hash)
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
+
end
|
213
|
+
elsif value.respond_to? :to_hash
|
214
|
+
value.to_hash
|
215
|
+
else
|
216
|
+
value
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
@@ -43,6 +43,8 @@ module Carbon
|
|
43
43
|
|
44
44
|
attr_accessor :external_url
|
45
45
|
|
46
|
+
attr_accessor :file_format
|
47
|
+
|
46
48
|
attr_accessor :created_at
|
47
49
|
|
48
50
|
attr_accessor :updated_at
|
@@ -66,6 +68,7 @@ module Carbon
|
|
66
68
|
:'item_type' => :'item_type',
|
67
69
|
:'root_external_id' => :'root_external_id',
|
68
70
|
:'external_url' => :'external_url',
|
71
|
+
:'file_format' => :'file_format',
|
69
72
|
:'created_at' => :'created_at',
|
70
73
|
:'updated_at' => :'updated_at'
|
71
74
|
}
|
@@ -95,6 +98,7 @@ module Carbon
|
|
95
98
|
:'item_type' => :'String',
|
96
99
|
:'root_external_id' => :'String',
|
97
100
|
:'external_url' => :'String',
|
101
|
+
:'file_format' => :'String',
|
98
102
|
:'created_at' => :'Time',
|
99
103
|
:'updated_at' => :'Time'
|
100
104
|
}
|
@@ -110,6 +114,7 @@ module Carbon
|
|
110
114
|
:'item_type',
|
111
115
|
:'root_external_id',
|
112
116
|
:'external_url',
|
117
|
+
:'file_format',
|
113
118
|
])
|
114
119
|
end
|
115
120
|
|
@@ -192,6 +197,10 @@ module Carbon
|
|
192
197
|
self.external_url = attributes[:'external_url']
|
193
198
|
end
|
194
199
|
|
200
|
+
if attributes.key?(:'file_format')
|
201
|
+
self.file_format = attributes[:'file_format']
|
202
|
+
end
|
203
|
+
|
195
204
|
if attributes.key?(:'created_at')
|
196
205
|
self.created_at = attributes[:'created_at']
|
197
206
|
end
|
@@ -290,6 +299,7 @@ module Carbon
|
|
290
299
|
item_type == o.item_type &&
|
291
300
|
root_external_id == o.root_external_id &&
|
292
301
|
external_url == o.external_url &&
|
302
|
+
file_format == o.file_format &&
|
293
303
|
created_at == o.created_at &&
|
294
304
|
updated_at == o.updated_at
|
295
305
|
end
|
@@ -303,7 +313,7 @@ module Carbon
|
|
303
313
|
# Calculates hash code according to all attributes.
|
304
314
|
# @return [Integer] Hash code
|
305
315
|
def hash
|
306
|
-
[id, external_id, source, name, synced_at, is_selectable, is_expandable, organization_id, organization_supplied_user_id, organization_user_id, organization_user_data_source_id, organization_user_file_to_sync_id, parent_external_id, item_type, root_external_id, external_url, created_at, updated_at].hash
|
316
|
+
[id, external_id, source, name, synced_at, is_selectable, is_expandable, organization_id, organization_supplied_user_id, organization_user_id, organization_user_data_source_id, organization_user_file_to_sync_id, parent_external_id, item_type, root_external_id, external_url, file_format, created_at, updated_at].hash
|
307
317
|
end
|
308
318
|
|
309
319
|
# Builds the object from hash
|
@@ -38,6 +38,9 @@ module Carbon
|
|
38
38
|
|
39
39
|
attr_accessor :file_sync_config
|
40
40
|
|
41
|
+
# Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
42
|
+
attr_accessor :data_source_tags
|
43
|
+
|
41
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
45
|
def self.attribute_map
|
43
46
|
{
|
@@ -53,7 +56,8 @@ module Carbon
|
|
53
56
|
:'sync_files_on_connection' => :'sync_files_on_connection',
|
54
57
|
:'request_id' => :'request_id',
|
55
58
|
:'sync_source_items' => :'sync_source_items',
|
56
|
-
:'file_sync_config' => :'file_sync_config'
|
59
|
+
:'file_sync_config' => :'file_sync_config',
|
60
|
+
:'data_source_tags' => :'data_source_tags'
|
57
61
|
}
|
58
62
|
end
|
59
63
|
|
@@ -77,7 +81,8 @@ module Carbon
|
|
77
81
|
:'sync_files_on_connection' => :'Boolean',
|
78
82
|
:'request_id' => :'String',
|
79
83
|
:'sync_source_items' => :'Boolean',
|
80
|
-
:'file_sync_config' => :'FileSyncConfigNullable'
|
84
|
+
:'file_sync_config' => :'FileSyncConfigNullable',
|
85
|
+
:'data_source_tags' => :'Object'
|
81
86
|
}
|
82
87
|
end
|
83
88
|
|
@@ -93,7 +98,7 @@ module Carbon
|
|
93
98
|
:'prepend_filename_to_chunks',
|
94
99
|
:'sync_files_on_connection',
|
95
100
|
:'request_id',
|
96
|
-
:'file_sync_config'
|
101
|
+
:'file_sync_config',
|
97
102
|
])
|
98
103
|
end
|
99
104
|
|
@@ -179,6 +184,10 @@ module Carbon
|
|
179
184
|
if attributes.key?(:'file_sync_config')
|
180
185
|
self.file_sync_config = attributes[:'file_sync_config']
|
181
186
|
end
|
187
|
+
|
188
|
+
if attributes.key?(:'data_source_tags')
|
189
|
+
self.data_source_tags = attributes[:'data_source_tags']
|
190
|
+
end
|
182
191
|
end
|
183
192
|
|
184
193
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -221,7 +230,8 @@ module Carbon
|
|
221
230
|
sync_files_on_connection == o.sync_files_on_connection &&
|
222
231
|
request_id == o.request_id &&
|
223
232
|
sync_source_items == o.sync_source_items &&
|
224
|
-
file_sync_config == o.file_sync_config
|
233
|
+
file_sync_config == o.file_sync_config &&
|
234
|
+
data_source_tags == o.data_source_tags
|
225
235
|
end
|
226
236
|
|
227
237
|
# @see the `==` method
|
@@ -233,7 +243,7 @@ module Carbon
|
|
233
243
|
# Calculates hash code according to all attributes.
|
234
244
|
# @return [Integer] Hash code
|
235
245
|
def hash
|
236
|
-
[tags, domain, api_key, 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
|
246
|
+
[tags, domain, api_key, 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, data_source_tags].hash
|
237
247
|
end
|
238
248
|
|
239
249
|
# Builds the object from hash
|
@@ -38,6 +38,9 @@ module Carbon
|
|
38
38
|
|
39
39
|
attr_accessor :file_sync_config
|
40
40
|
|
41
|
+
# Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
|
42
|
+
attr_accessor :data_source_tags
|
43
|
+
|
41
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
45
|
def self.attribute_map
|
43
46
|
{
|
@@ -53,7 +56,8 @@ module Carbon
|
|
53
56
|
:'sync_files_on_connection' => :'sync_files_on_connection',
|
54
57
|
:'request_id' => :'request_id',
|
55
58
|
:'sync_source_items' => :'sync_source_items',
|
56
|
-
:'file_sync_config' => :'file_sync_config'
|
59
|
+
:'file_sync_config' => :'file_sync_config',
|
60
|
+
:'data_source_tags' => :'data_source_tags'
|
57
61
|
}
|
58
62
|
end
|
59
63
|
|
@@ -77,7 +81,8 @@ module Carbon
|
|
77
81
|
:'sync_files_on_connection' => :'Boolean',
|
78
82
|
:'request_id' => :'String',
|
79
83
|
:'sync_source_items' => :'Boolean',
|
80
|
-
:'file_sync_config' => :'FileSyncConfigNullable'
|
84
|
+
:'file_sync_config' => :'FileSyncConfigNullable',
|
85
|
+
:'data_source_tags' => :'Object'
|
81
86
|
}
|
82
87
|
end
|
83
88
|
|
@@ -92,7 +97,7 @@ module Carbon
|
|
92
97
|
:'prepend_filename_to_chunks',
|
93
98
|
:'sync_files_on_connection',
|
94
99
|
:'request_id',
|
95
|
-
:'file_sync_config'
|
100
|
+
:'file_sync_config',
|
96
101
|
])
|
97
102
|
end
|
98
103
|
|
@@ -178,6 +183,10 @@ module Carbon
|
|
178
183
|
if attributes.key?(:'file_sync_config')
|
179
184
|
self.file_sync_config = attributes[:'file_sync_config']
|
180
185
|
end
|
186
|
+
|
187
|
+
if attributes.key?(:'data_source_tags')
|
188
|
+
self.data_source_tags = attributes[:'data_source_tags']
|
189
|
+
end
|
181
190
|
end
|
182
191
|
|
183
192
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -220,7 +229,8 @@ module Carbon
|
|
220
229
|
sync_files_on_connection == o.sync_files_on_connection &&
|
221
230
|
request_id == o.request_id &&
|
222
231
|
sync_source_items == o.sync_source_items &&
|
223
|
-
file_sync_config == o.file_sync_config
|
232
|
+
file_sync_config == o.file_sync_config &&
|
233
|
+
data_source_tags == o.data_source_tags
|
224
234
|
end
|
225
235
|
|
226
236
|
# @see the `==` method
|
@@ -232,7 +242,7 @@ module Carbon
|
|
232
242
|
# Calculates hash code according to all attributes.
|
233
243
|
# @return [Integer] Hash code
|
234
244
|
def hash
|
235
|
-
[tags, organization, 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
|
245
|
+
[tags, organization, 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, data_source_tags].hash
|
236
246
|
end
|
237
247
|
|
238
248
|
# Builds the object from hash
|