carbon_ruby_sdk 0.2.8 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,232 @@
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 UserListResponse
14
+ attr_accessor :users
15
+
16
+ attr_accessor :count
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'users' => :'users',
22
+ :'count' => :'count'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'users' => :'Array<ListUserResponse>',
35
+ :'count' => :'Integer'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ :'count'
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::UserListResponse` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::UserListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'users')
62
+ if (value = attributes[:'users']).is_a?(Array)
63
+ self.users = value
64
+ end
65
+ end
66
+
67
+ if attributes.key?(:'count')
68
+ self.count = attributes[:'count']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ if @users.nil?
77
+ invalid_properties.push('invalid value for "users", users cannot be nil.')
78
+ end
79
+
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ return false if @users.nil?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ users == o.users &&
96
+ count == o.count
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [users, count].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
126
+ self.send("#{key}=", nil)
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = Carbon.const_get(type)
180
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ 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.2.8'
10
+ VERSION = '0.2.10'
11
11
  end
@@ -45,6 +45,7 @@ require 'carbon_ruby_sdk/models/embedding_properties'
45
45
  require 'carbon_ruby_sdk/models/embeddings_and_chunks_filters'
46
46
  require 'carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns'
47
47
  require 'carbon_ruby_sdk/models/embeddings_and_chunks_query_input'
48
+ require 'carbon_ruby_sdk/models/embeddings_and_chunks_query_input_v2'
48
49
  require 'carbon_ruby_sdk/models/embeddings_and_chunks_response'
49
50
  require 'carbon_ruby_sdk/models/external_file_sync_statuses'
50
51
  require 'carbon_ruby_sdk/models/external_source_item'
@@ -81,6 +82,10 @@ require 'carbon_ruby_sdk/models/list_items_filters'
81
82
  require 'carbon_ruby_sdk/models/list_items_filters_nullable'
82
83
  require 'carbon_ruby_sdk/models/list_request'
83
84
  require 'carbon_ruby_sdk/models/list_response'
85
+ require 'carbon_ruby_sdk/models/list_user_response'
86
+ require 'carbon_ruby_sdk/models/list_users_filters'
87
+ require 'carbon_ruby_sdk/models/list_users_order_by_types'
88
+ require 'carbon_ruby_sdk/models/list_users_request'
84
89
  require 'carbon_ruby_sdk/models/location_property_inner'
85
90
  require 'carbon_ruby_sdk/models/modify_user_configuration_input'
86
91
  require 'carbon_ruby_sdk/models/notion_authentication'
@@ -136,6 +141,7 @@ require 'carbon_ruby_sdk/models/user_configuration'
136
141
  require 'carbon_ruby_sdk/models/user_configuration_nullable'
137
142
  require 'carbon_ruby_sdk/models/user_file'
138
143
  require 'carbon_ruby_sdk/models/user_files_v2'
144
+ require 'carbon_ruby_sdk/models/user_list_response'
139
145
  require 'carbon_ruby_sdk/models/user_request_content'
140
146
  require 'carbon_ruby_sdk/models/user_response'
141
147
  require 'carbon_ruby_sdk/models/user_web_page_order_by_types'
@@ -49,6 +49,17 @@ describe 'EmbeddingsApi' do
49
49
  end
50
50
  end
51
51
 
52
+ # unit tests for list
53
+ # Retrieve Embeddings And Content V2
54
+ # @param embeddings_and_chunks_query_input_v2
55
+ # @param [Hash] opts the optional parameters
56
+ # @return [EmbeddingsAndChunksResponse]
57
+ describe 'list test' do
58
+ it 'should work' do
59
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
60
+ end
61
+ end
62
+
52
63
  # unit tests for upload_chunks_and_embeddings
53
64
  # Upload Chunks And Embeddings
54
65
  # @param chunks_and_embeddings_upload_input
@@ -48,6 +48,18 @@ describe 'UsersApi' do
48
48
  end
49
49
  end
50
50
 
51
+ # unit tests for list
52
+ # List Users Endpoint
53
+ # List users within an organization
54
+ # @param list_users_request
55
+ # @param [Hash] opts the optional parameters
56
+ # @return [UserListResponse]
57
+ describe 'list test' do
58
+ it 'should work' do
59
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
60
+ end
61
+ end
62
+
51
63
  # unit tests for toggle_user_features
52
64
  # Toggle User Features
53
65
  # @param modify_user_configuration_input
@@ -0,0 +1,52 @@
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::EmbeddingsAndChunksQueryInputV2
14
+ describe Carbon::EmbeddingsAndChunksQueryInputV2 do
15
+ let(:instance) { Carbon::EmbeddingsAndChunksQueryInputV2.new }
16
+
17
+ describe 'test an instance of EmbeddingsAndChunksQueryInputV2' do
18
+ it 'should create an instance of EmbeddingsAndChunksQueryInputV2' do
19
+ expect(instance).to be_instance_of(Carbon::EmbeddingsAndChunksQueryInputV2)
20
+ end
21
+ end
22
+ describe 'test attribute "pagination"' 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 "order_by"' 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 "order_dir"' 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
+ describe 'test attribute "filters"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "include_vectors"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ end
@@ -109,4 +109,10 @@ describe Carbon::GetEmbeddingDocumentsBody do
109
109
  end
110
110
  end
111
111
 
112
+ describe 'test attribute "include_file_level_metadata"' 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
@@ -0,0 +1,76 @@
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::ListUserResponse
14
+ describe Carbon::ListUserResponse do
15
+ let(:instance) { Carbon::ListUserResponse.new }
16
+
17
+ describe 'test an instance of ListUserResponse' do
18
+ it 'should create an instance of ListUserResponse' do
19
+ expect(instance).to be_instance_of(Carbon::ListUserResponse)
20
+ end
21
+ end
22
+ describe 'test attribute "id"' 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 "organization_id"' 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 "organization_supplied_user_id"' 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
+ describe 'test attribute "created_at"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "updated_at"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ describe 'test attribute "deleted_at"' 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
+
58
+ describe 'test attribute "enabled_features"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
64
+ describe 'test attribute "custom_limits"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ describe 'test attribute "auto_sync_enabled_sources"' do
71
+ it 'should work' do
72
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
73
+ end
74
+ end
75
+
76
+ end
@@ -0,0 +1,34 @@
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::ListUsersFilters
14
+ describe Carbon::ListUsersFilters do
15
+ let(:instance) { Carbon::ListUsersFilters.new }
16
+
17
+ describe 'test an instance of ListUsersFilters' do
18
+ it 'should create an instance of ListUsersFilters' do
19
+ expect(instance).to be_instance_of(Carbon::ListUsersFilters)
20
+ end
21
+ end
22
+ describe 'test attribute "customer_ids"' 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 "carbon_user_ids"' 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
+ end
@@ -0,0 +1,22 @@
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::ListUsersOrderByTypes
14
+ describe Carbon::ListUsersOrderByTypes do
15
+ let(:instance) { Carbon::ListUsersOrderByTypes.new }
16
+
17
+ describe 'test an instance of ListUsersOrderByTypes' do
18
+ it 'should create an instance of ListUsersOrderByTypes' do
19
+ expect(instance).to be_instance_of(Carbon::ListUsersOrderByTypes)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,52 @@
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::ListUsersRequest
14
+ describe Carbon::ListUsersRequest do
15
+ let(:instance) { Carbon::ListUsersRequest.new }
16
+
17
+ describe 'test an instance of ListUsersRequest' do
18
+ it 'should create an instance of ListUsersRequest' do
19
+ expect(instance).to be_instance_of(Carbon::ListUsersRequest)
20
+ end
21
+ end
22
+ describe 'test attribute "pagination"' 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 "filters"' 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 "order_by"' 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
+ describe 'test attribute "order_dir"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "include_count"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ end
@@ -0,0 +1,34 @@
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::UserListResponse
14
+ describe Carbon::UserListResponse do
15
+ let(:instance) { Carbon::UserListResponse.new }
16
+
17
+ describe 'test an instance of UserListResponse' do
18
+ it 'should create an instance of UserListResponse' do
19
+ expect(instance).to be_instance_of(Carbon::UserListResponse)
20
+ end
21
+ end
22
+ describe 'test attribute "users"' 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 "count"' 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
+ end