carbon_ruby_sdk 0.1.24 → 0.1.25

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.
@@ -0,0 +1,269 @@
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
+ # Used to set organization level defaults for user settings. These settings will apply to all users under the organization that don't have them defined.
14
+ class UserConfigurationNullable
15
+ attr_accessor :auto_sync_enabled_sources
16
+
17
+ # Custom file upload limit for the user over *all* user's files across all uploads. If set, then the user will not be allowed to upload more files than this limit. If not set, or if set to -1, then the user will have no limit.
18
+ attr_accessor :max_files
19
+
20
+ # Custom file upload limit for the user across a single upload. If set, then the user will not be allowed to upload more files than this limit in a single upload. If not set, or if set to -1, then the user will have no limit.
21
+ attr_accessor :max_files_per_upload
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'auto_sync_enabled_sources' => :'auto_sync_enabled_sources',
27
+ :'max_files' => :'max_files',
28
+ :'max_files_per_upload' => :'max_files_per_upload'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'auto_sync_enabled_sources' => :'AutoSyncEnabledSourcesProperty',
41
+ :'max_files' => :'Integer',
42
+ :'max_files_per_upload' => :'Integer'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ :'auto_sync_enabled_sources',
50
+ :'max_files',
51
+ :'max_files_per_upload'
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::UserConfigurationNullable` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::UserConfigurationNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'auto_sync_enabled_sources')
71
+ self.auto_sync_enabled_sources = attributes[:'auto_sync_enabled_sources']
72
+ end
73
+
74
+ if attributes.key?(:'max_files')
75
+ self.max_files = attributes[:'max_files']
76
+ end
77
+
78
+ if attributes.key?(:'max_files_per_upload')
79
+ self.max_files_per_upload = attributes[:'max_files_per_upload']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if !@max_files.nil? && @max_files < -1
88
+ invalid_properties.push('invalid value for "max_files", must be greater than or equal to -1.')
89
+ end
90
+
91
+ if !@max_files_per_upload.nil? && @max_files_per_upload < -1
92
+ invalid_properties.push('invalid value for "max_files_per_upload", must be greater than or equal to -1.')
93
+ end
94
+
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ return false if !@max_files.nil? && @max_files < -1
102
+ return false if !@max_files_per_upload.nil? && @max_files_per_upload < -1
103
+ true
104
+ end
105
+
106
+ # Custom attribute writer method with validation
107
+ # @param [Object] max_files Value to be assigned
108
+ def max_files=(max_files)
109
+ if !max_files.nil? && max_files < -1
110
+ fail ArgumentError, 'invalid value for "max_files", must be greater than or equal to -1.'
111
+ end
112
+
113
+ @max_files = max_files
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param [Object] max_files_per_upload Value to be assigned
118
+ def max_files_per_upload=(max_files_per_upload)
119
+ if !max_files_per_upload.nil? && max_files_per_upload < -1
120
+ fail ArgumentError, 'invalid value for "max_files_per_upload", must be greater than or equal to -1.'
121
+ end
122
+
123
+ @max_files_per_upload = max_files_per_upload
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ auto_sync_enabled_sources == o.auto_sync_enabled_sources &&
132
+ max_files == o.max_files &&
133
+ max_files_per_upload == o.max_files_per_upload
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [auto_sync_enabled_sources, max_files, max_files_per_upload].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ new.build_from_hash(attributes)
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ attributes = attributes.transform_keys(&:to_sym)
161
+ self.class.openapi_types.each_pair do |key, type|
162
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
+ self.send("#{key}=", nil)
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !attributes[self.class.attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
+ end
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :Time
185
+ Time.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :Boolean
195
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ # models (e.g. Pet) or oneOf
216
+ klass = Carbon.const_get(type)
217
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
218
+ end
219
+ end
220
+
221
+ # Returns the string representation of the object
222
+ # @return [String] String presentation of the object
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_hash (backward compatibility)
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_body
230
+ to_hash
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ # Outputs non-array value in the form of hash
250
+ # For object, use to_hash. Otherwise, just return the value
251
+ # @param [Object] value Any valid value
252
+ # @return [Hash] Returns the value in the form of hash
253
+ def _to_hash(value)
254
+ if value.is_a?(Array)
255
+ value.compact.map { |v| _to_hash(v) }
256
+ elsif value.is_a?(Hash)
257
+ {}.tap do |hash|
258
+ value.each { |k, v| hash[k] = _to_hash(v) }
259
+ end
260
+ elsif value.respond_to? :to_hash
261
+ value.to_hash
262
+ else
263
+ value
264
+ end
265
+ end
266
+
267
+ end
268
+
269
+ end
@@ -7,5 +7,5 @@ The version of the OpenAPI document: 1.0.0
7
7
  =end
8
8
 
9
9
  module Carbon
10
- VERSION = '0.1.24'
10
+ VERSION = '0.1.25'
11
11
  end
@@ -122,8 +122,11 @@ require 'carbon_ruby_sdk/models/tags'
122
122
  require 'carbon_ruby_sdk/models/tags1'
123
123
  require 'carbon_ruby_sdk/models/text_embedding_generators'
124
124
  require 'carbon_ruby_sdk/models/token_response'
125
+ require 'carbon_ruby_sdk/models/update_organization_input'
125
126
  require 'carbon_ruby_sdk/models/update_users_input'
126
127
  require 'carbon_ruby_sdk/models/upload_file_from_url_input'
128
+ require 'carbon_ruby_sdk/models/user_configuration'
129
+ require 'carbon_ruby_sdk/models/user_configuration_nullable'
127
130
  require 'carbon_ruby_sdk/models/user_file'
128
131
  require 'carbon_ruby_sdk/models/user_files_v2'
129
132
  require 'carbon_ruby_sdk/models/user_request_content'
@@ -36,4 +36,15 @@ describe 'OrganizationsApi' do
36
36
  end
37
37
  end
38
38
 
39
+ # unit tests for update
40
+ # Update Organization
41
+ # @param update_organization_input
42
+ # @param [Hash] opts the optional parameters
43
+ # @return [GenericSuccessResponse]
44
+ describe 'update test' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
39
50
  end
@@ -49,4 +49,10 @@ describe Carbon::FileStatisticsNullable do
49
49
  end
50
50
  end
51
51
 
52
+ describe 'test attribute "mime_type"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
52
58
  end
@@ -49,4 +49,10 @@ describe Carbon::FileStatistics do
49
49
  end
50
50
  end
51
51
 
52
+ describe 'test attribute "mime_type"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
52
58
  end
@@ -91,6 +91,12 @@ describe Carbon::OrganizationResponse do
91
91
  end
92
92
  end
93
93
 
94
+ describe 'test attribute "global_user_config"' do
95
+ it 'should work' do
96
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
97
+ end
98
+ end
99
+
94
100
  describe 'test attribute "created_at"' do
95
101
  it 'should work' do
96
102
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -0,0 +1,28 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'spec_helper'
10
+ require 'json'
11
+ require 'date'
12
+
13
+ # Unit tests for Carbon::UpdateOrganizationInput
14
+ describe Carbon::UpdateOrganizationInput do
15
+ let(:instance) { Carbon::UpdateOrganizationInput.new }
16
+
17
+ describe 'test an instance of UpdateOrganizationInput' do
18
+ it 'should create an instance of UpdateOrganizationInput' do
19
+ expect(instance).to be_instance_of(Carbon::UpdateOrganizationInput)
20
+ end
21
+ end
22
+ describe 'test attribute "global_user_config"' do
23
+ it 'should work' do
24
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
25
+ end
26
+ end
27
+
28
+ end
@@ -19,25 +19,25 @@ describe Carbon::UpdateUsersInput do
19
19
  expect(instance).to be_instance_of(Carbon::UpdateUsersInput)
20
20
  end
21
21
  end
22
- describe 'test attribute "customer_ids"' do
22
+ describe 'test attribute "auto_sync_enabled_sources"' do
23
23
  it 'should work' do
24
24
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
25
25
  end
26
26
  end
27
27
 
28
- describe 'test attribute "auto_sync_enabled_sources"' do
28
+ describe 'test attribute "max_files"' do
29
29
  it 'should work' do
30
30
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
31
  end
32
32
  end
33
33
 
34
- describe 'test attribute "max_files"' do
34
+ describe 'test attribute "max_files_per_upload"' do
35
35
  it 'should work' do
36
36
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
37
  end
38
38
  end
39
39
 
40
- describe 'test attribute "max_files_per_upload"' do
40
+ describe 'test attribute "customer_ids"' do
41
41
  it 'should work' do
42
42
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
43
  end
@@ -0,0 +1,40 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'spec_helper'
10
+ require 'json'
11
+ require 'date'
12
+
13
+ # Unit tests for Carbon::UserConfigurationNullable
14
+ describe Carbon::UserConfigurationNullable do
15
+ let(:instance) { Carbon::UserConfigurationNullable.new }
16
+
17
+ describe 'test an instance of UserConfigurationNullable' do
18
+ it 'should create an instance of UserConfigurationNullable' do
19
+ expect(instance).to be_instance_of(Carbon::UserConfigurationNullable)
20
+ end
21
+ end
22
+ describe 'test attribute "auto_sync_enabled_sources"' do
23
+ it 'should work' do
24
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
25
+ end
26
+ end
27
+
28
+ describe 'test attribute "max_files"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "max_files_per_upload"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ end
@@ -0,0 +1,40 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'spec_helper'
10
+ require 'json'
11
+ require 'date'
12
+
13
+ # Unit tests for Carbon::UserConfiguration
14
+ describe Carbon::UserConfiguration do
15
+ let(:instance) { Carbon::UserConfiguration.new }
16
+
17
+ describe 'test an instance of UserConfiguration' do
18
+ it 'should create an instance of UserConfiguration' do
19
+ expect(instance).to be_instance_of(Carbon::UserConfiguration)
20
+ end
21
+ end
22
+ describe 'test attribute "auto_sync_enabled_sources"' do
23
+ it 'should work' do
24
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
25
+ end
26
+ end
27
+
28
+ describe 'test attribute "max_files"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "max_files_per_upload"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carbon_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konfig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-02 00:00:00.000000000 Z
11
+ date: 2024-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -205,8 +205,11 @@ files:
205
205
  - lib/carbon_ruby_sdk/models/tags1.rb
206
206
  - lib/carbon_ruby_sdk/models/text_embedding_generators.rb
207
207
  - lib/carbon_ruby_sdk/models/token_response.rb
208
+ - lib/carbon_ruby_sdk/models/update_organization_input.rb
208
209
  - lib/carbon_ruby_sdk/models/update_users_input.rb
209
210
  - lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb
211
+ - lib/carbon_ruby_sdk/models/user_configuration.rb
212
+ - lib/carbon_ruby_sdk/models/user_configuration_nullable.rb
210
213
  - lib/carbon_ruby_sdk/models/user_file.rb
211
214
  - lib/carbon_ruby_sdk/models/user_files_v2.rb
212
215
  - lib/carbon_ruby_sdk/models/user_request_content.rb
@@ -344,8 +347,11 @@ files:
344
347
  - spec/models/tags_spec.rb
345
348
  - spec/models/text_embedding_generators_spec.rb
346
349
  - spec/models/token_response_spec.rb
350
+ - spec/models/update_organization_input_spec.rb
347
351
  - spec/models/update_users_input_spec.rb
348
352
  - spec/models/upload_file_from_url_input_spec.rb
353
+ - spec/models/user_configuration_nullable_spec.rb
354
+ - spec/models/user_configuration_spec.rb
349
355
  - spec/models/user_file_spec.rb
350
356
  - spec/models/user_files_v2_spec.rb
351
357
  - spec/models/user_request_content_spec.rb
@@ -422,6 +428,7 @@ test_files:
422
428
  - spec/models/token_response_spec.rb
423
429
  - spec/models/sync_options_spec.rb
424
430
  - spec/models/file_formats_spec.rb
431
+ - spec/models/update_organization_input_spec.rb
425
432
  - spec/models/user_request_content_spec.rb
426
433
  - spec/models/gmail_sync_input_spec.rb
427
434
  - spec/models/delete_files_query_input_spec.rb
@@ -432,6 +439,7 @@ test_files:
432
439
  - spec/models/youtube_transcript_response_spec.rb
433
440
  - spec/models/o_auth_authentication_spec.rb
434
441
  - spec/models/file_content_types_nullable_spec.rb
442
+ - spec/models/user_configuration_spec.rb
435
443
  - spec/models/zendesk_authentication_spec.rb
436
444
  - spec/models/connect_data_source_response_spec.rb
437
445
  - spec/models/simple_o_auth_data_sources_spec.rb
@@ -520,6 +528,7 @@ test_files:
520
528
  - spec/models/outh_url_response_spec.rb
521
529
  - spec/models/sync_directory_request_spec.rb
522
530
  - spec/models/file_statistics_nullable_spec.rb
531
+ - spec/models/user_configuration_nullable_spec.rb
523
532
  - spec/models/embeddings_and_chunks_order_by_columns_spec.rb
524
533
  - spec/models/webhook_query_response_spec.rb
525
534
  - spec/models/user_file_spec.rb