carbon_ruby_sdk 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9c7ff7931389e8516a48d8b467cc7db1d6925702496bea05e830bfbbbfd90a8
4
- data.tar.gz: aaa25efcf862e38ae9584d05df4f6fa936a931f762973fbc7b76567b0e132acc
3
+ metadata.gz: 5179770ad5d7c1f5b1c2ef1af3458c580828918db3f930a6ee35647a86a87ad9
4
+ data.tar.gz: b36c127b805ea1bd77d83e300fb5a34ef8a4578a4ce2b81895000381ff3231d5
5
5
  SHA512:
6
- metadata.gz: 854c40e59b73acdf65eeab2c62f6f8ddb14a99a966ed3f73ac90e66e6cf439f978b3761bb87230081bc04c3cf592f2fba2c19fc3baf8395accd77f074dad7ce4
7
- data.tar.gz: a502ad7b8a1a4d48166a2efcd2976e69d3865c8d7c4dff7739504bdd684d12a10ba3c4eed8a637154f67c87f6d02e0bd1fd38bb8375e69618abd6f1869faecc7
6
+ metadata.gz: 1933c50cbc17a4665a8dce352a75454899c8a6335c69382a71490dbacfa8cc37064b2122cfd77c7de2c9afa711d3483b7cf40a939d92d35e90b631ee83383eee
7
+ data.tar.gz: c1355a71d679989804e3d33119a9e3ebcd2176974372003f0db176b406079b5de1b1d455b2f0b91674a8d66fa35fe8ce1d3b6884f355dd9021ecac709d3818eb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carbon_ruby_sdk (0.1.11)
4
+ carbon_ruby_sdk (0.1.12)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect external data to LLMs, no matter the source.
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v0.1.11-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.11)
9
+ [![npm](https://img.shields.io/badge/gem-v0.1.12-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.12)
10
10
 
11
11
  </div>
12
12
 
@@ -80,7 +80,7 @@ Connect external data to LLMs, no matter the source.
80
80
  Add to Gemfile:
81
81
 
82
82
  ```ruby
83
- gem 'carbon_ruby_sdk', '~> 0.1.11'
83
+ gem 'carbon_ruby_sdk', '~> 0.1.12'
84
84
  ```
85
85
 
86
86
  ## Getting Started<a id="getting-started"></a>
@@ -1475,6 +1475,8 @@ List Data Source Items
1475
1475
  result = carbon.integrations.list_data_source_items(
1476
1476
  data_source_id: 1,
1477
1477
  parent_id: "string_example",
1478
+ filters: {
1479
+ },
1478
1480
  pagination: {
1479
1481
  "limit" => 10,
1480
1482
  "offset" => 0,
@@ -1487,6 +1489,7 @@ p result
1487
1489
 
1488
1490
  ##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
1489
1491
  ##### parent_id: `String`<a id="parent_id-string"></a>
1492
+ ##### filters: [`ListItemsFiltersNullable`](./lib/carbon_ruby_sdk/models/list_items_filters_nullable.rb)<a id="filters-listitemsfiltersnullablelibcarbon_ruby_sdkmodelslist_items_filters_nullablerb"></a>
1490
1493
  ##### pagination: [`Pagination`](./lib/carbon_ruby_sdk/models/pagination.rb)<a id="pagination-paginationlibcarbon_ruby_sdkmodelspaginationrb"></a>
1491
1494
  #### 🔄 Return<a id="🔄-return"></a>
1492
1495
 
@@ -802,13 +802,15 @@ module Carbon
802
802
  #
803
803
  # @param data_source_id [Integer]
804
804
  # @param parent_id [String]
805
+ # @param filters [ListItemsFiltersNullable]
805
806
  # @param pagination [Pagination]
806
807
  # @param body [ListDataSourceItemsRequest]
807
808
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
808
- def list_data_source_items(data_source_id:, parent_id: SENTINEL, pagination: SENTINEL, extra: {})
809
+ def list_data_source_items(data_source_id:, parent_id: SENTINEL, filters: SENTINEL, pagination: SENTINEL, extra: {})
809
810
  _body = {}
810
811
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
811
812
  _body[:parent_id] = parent_id if parent_id != SENTINEL
813
+ _body[:filters] = filters if filters != SENTINEL
812
814
  _body[:pagination] = pagination if pagination != SENTINEL
813
815
  list_data_source_items_request = _body
814
816
  api_response = list_data_source_items_with_http_info_impl(list_data_source_items_request, extra)
@@ -819,13 +821,15 @@ module Carbon
819
821
  #
820
822
  # @param data_source_id [Integer]
821
823
  # @param parent_id [String]
824
+ # @param filters [ListItemsFiltersNullable]
822
825
  # @param pagination [Pagination]
823
826
  # @param body [ListDataSourceItemsRequest]
824
827
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
825
- def list_data_source_items_with_http_info(data_source_id:, parent_id: SENTINEL, pagination: SENTINEL, extra: {})
828
+ def list_data_source_items_with_http_info(data_source_id:, parent_id: SENTINEL, filters: SENTINEL, pagination: SENTINEL, extra: {})
826
829
  _body = {}
827
830
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
828
831
  _body[:parent_id] = parent_id if parent_id != SENTINEL
832
+ _body[:filters] = filters if filters != SENTINEL
829
833
  _body[:pagination] = pagination if pagination != SENTINEL
830
834
  list_data_source_items_request = _body
831
835
  list_data_source_items_with_http_info_impl(list_data_source_items_request, extra)
@@ -41,6 +41,8 @@ module Carbon
41
41
 
42
42
  attr_accessor :root_external_id
43
43
 
44
+ attr_accessor :external_url
45
+
44
46
  attr_accessor :created_at
45
47
 
46
48
  attr_accessor :updated_at
@@ -63,6 +65,7 @@ module Carbon
63
65
  :'parent_external_id' => :'parent_external_id',
64
66
  :'item_type' => :'item_type',
65
67
  :'root_external_id' => :'root_external_id',
68
+ :'external_url' => :'external_url',
66
69
  :'created_at' => :'created_at',
67
70
  :'updated_at' => :'updated_at'
68
71
  }
@@ -91,6 +94,7 @@ module Carbon
91
94
  :'parent_external_id' => :'String',
92
95
  :'item_type' => :'String',
93
96
  :'root_external_id' => :'String',
97
+ :'external_url' => :'String',
94
98
  :'created_at' => :'Time',
95
99
  :'updated_at' => :'Time'
96
100
  }
@@ -105,6 +109,7 @@ module Carbon
105
109
  :'parent_external_id',
106
110
  :'item_type',
107
111
  :'root_external_id',
112
+ :'external_url',
108
113
  ])
109
114
  end
110
115
 
@@ -183,6 +188,10 @@ module Carbon
183
188
  self.root_external_id = attributes[:'root_external_id']
184
189
  end
185
190
 
191
+ if attributes.key?(:'external_url')
192
+ self.external_url = attributes[:'external_url']
193
+ end
194
+
186
195
  if attributes.key?(:'created_at')
187
196
  self.created_at = attributes[:'created_at']
188
197
  end
@@ -280,6 +289,7 @@ module Carbon
280
289
  parent_external_id == o.parent_external_id &&
281
290
  item_type == o.item_type &&
282
291
  root_external_id == o.root_external_id &&
292
+ external_url == o.external_url &&
283
293
  created_at == o.created_at &&
284
294
  updated_at == o.updated_at
285
295
  end
@@ -293,7 +303,7 @@ module Carbon
293
303
  # Calculates hash code according to all attributes.
294
304
  # @return [Integer] Hash code
295
305
  def hash
296
- [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, created_at, updated_at].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
297
307
  end
298
308
 
299
309
  # Builds the object from hash
@@ -15,6 +15,8 @@ module Carbon
15
15
 
16
16
  attr_accessor :parent_id
17
17
 
18
+ attr_accessor :filters
19
+
18
20
  attr_accessor :pagination
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -22,6 +24,7 @@ module Carbon
22
24
  {
23
25
  :'data_source_id' => :'data_source_id',
24
26
  :'parent_id' => :'parent_id',
27
+ :'filters' => :'filters',
25
28
  :'pagination' => :'pagination'
26
29
  }
27
30
  end
@@ -36,6 +39,7 @@ module Carbon
36
39
  {
37
40
  :'data_source_id' => :'Integer',
38
41
  :'parent_id' => :'String',
42
+ :'filters' => :'ListItemsFiltersNullable',
39
43
  :'pagination' => :'Pagination'
40
44
  }
41
45
  end
@@ -44,6 +48,7 @@ module Carbon
44
48
  def self.openapi_nullable
45
49
  Set.new([
46
50
  :'parent_id',
51
+ :'filters',
47
52
  ])
48
53
  end
49
54
 
@@ -70,6 +75,10 @@ module Carbon
70
75
  self.parent_id = attributes[:'parent_id']
71
76
  end
72
77
 
78
+ if attributes.key?(:'filters')
79
+ self.filters = attributes[:'filters']
80
+ end
81
+
73
82
  if attributes.key?(:'pagination')
74
83
  self.pagination = attributes[:'pagination']
75
84
  end
@@ -100,6 +109,7 @@ module Carbon
100
109
  self.class == o.class &&
101
110
  data_source_id == o.data_source_id &&
102
111
  parent_id == o.parent_id &&
112
+ filters == o.filters &&
103
113
  pagination == o.pagination
104
114
  end
105
115
 
@@ -112,7 +122,7 @@ module Carbon
112
122
  # Calculates hash code according to all attributes.
113
123
  # @return [Integer] Hash code
114
124
  def hash
115
- [data_source_id, parent_id, pagination].hash
125
+ [data_source_id, parent_id, filters, pagination].hash
116
126
  end
117
127
 
118
128
  # Builds the object from hash
@@ -0,0 +1,250 @@
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 ListItemsFilters
14
+ attr_accessor :external_ids
15
+
16
+ attr_accessor :ids
17
+
18
+ attr_accessor :name
19
+
20
+ attr_accessor :root_files_only
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'external_ids' => :'external_ids',
26
+ :'ids' => :'ids',
27
+ :'name' => :'name',
28
+ :'root_files_only' => :'root_files_only'
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
+ :'external_ids' => :'Array<String>',
41
+ :'ids' => :'Array<Integer>',
42
+ :'name' => :'String',
43
+ :'root_files_only' => :'Boolean'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'external_ids',
51
+ :'ids',
52
+ :'name',
53
+ :'root_files_only'
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::ListItemsFilters` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::ListItemsFilters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'external_ids')
73
+ if (value = attributes[:'external_ids']).is_a?(Array)
74
+ self.external_ids = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'ids')
79
+ if (value = attributes[:'ids']).is_a?(Array)
80
+ self.ids = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'name')
85
+ self.name = attributes[:'name']
86
+ end
87
+
88
+ if attributes.key?(:'root_files_only')
89
+ self.root_files_only = attributes[:'root_files_only']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ external_ids == o.external_ids &&
112
+ ids == o.ids &&
113
+ name == o.name &&
114
+ root_files_only == o.root_files_only
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [external_ids, ids, name, root_files_only].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = Carbon.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -0,0 +1,250 @@
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 ListItemsFiltersNullable
14
+ attr_accessor :external_ids
15
+
16
+ attr_accessor :ids
17
+
18
+ attr_accessor :name
19
+
20
+ attr_accessor :root_files_only
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'external_ids' => :'external_ids',
26
+ :'ids' => :'ids',
27
+ :'name' => :'name',
28
+ :'root_files_only' => :'root_files_only'
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
+ :'external_ids' => :'Array<String>',
41
+ :'ids' => :'Array<Integer>',
42
+ :'name' => :'String',
43
+ :'root_files_only' => :'Boolean'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'external_ids',
51
+ :'ids',
52
+ :'name',
53
+ :'root_files_only'
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::ListItemsFiltersNullable` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::ListItemsFiltersNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'external_ids')
73
+ if (value = attributes[:'external_ids']).is_a?(Array)
74
+ self.external_ids = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'ids')
79
+ if (value = attributes[:'ids']).is_a?(Array)
80
+ self.ids = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'name')
85
+ self.name = attributes[:'name']
86
+ end
87
+
88
+ if attributes.key?(:'root_files_only')
89
+ self.root_files_only = attributes[:'root_files_only']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ external_ids == o.external_ids &&
112
+ ids == o.ids &&
113
+ name == o.name &&
114
+ root_files_only == o.root_files_only
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [external_ids, ids, name, root_files_only].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = Carbon.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ 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.11'
10
+ VERSION = '0.1.12'
11
11
  end
@@ -67,6 +67,8 @@ require 'carbon_ruby_sdk/models/hybrid_search_tuning_params_nullable'
67
67
  require 'carbon_ruby_sdk/models/ids_property'
68
68
  require 'carbon_ruby_sdk/models/list_data_source_items_request'
69
69
  require 'carbon_ruby_sdk/models/list_data_source_items_response'
70
+ require 'carbon_ruby_sdk/models/list_items_filters'
71
+ require 'carbon_ruby_sdk/models/list_items_filters_nullable'
70
72
  require 'carbon_ruby_sdk/models/list_request'
71
73
  require 'carbon_ruby_sdk/models/list_response'
72
74
  require 'carbon_ruby_sdk/models/location_property_inner'
@@ -109,6 +109,12 @@ describe Carbon::ExternalSourceItem do
109
109
  end
110
110
  end
111
111
 
112
+ describe 'test attribute "external_url"' do
113
+ it 'should work' do
114
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
115
+ end
116
+ end
117
+
112
118
  describe 'test attribute "created_at"' do
113
119
  it 'should work' do
114
120
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -31,6 +31,12 @@ describe Carbon::ListDataSourceItemsRequest do
31
31
  end
32
32
  end
33
33
 
34
+ describe 'test attribute "filters"' 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
+
34
40
  describe 'test attribute "pagination"' do
35
41
  it 'should work' do
36
42
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -0,0 +1,46 @@
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::ListItemsFiltersNullable
14
+ describe Carbon::ListItemsFiltersNullable do
15
+ let(:instance) { Carbon::ListItemsFiltersNullable.new }
16
+
17
+ describe 'test an instance of ListItemsFiltersNullable' do
18
+ it 'should create an instance of ListItemsFiltersNullable' do
19
+ expect(instance).to be_instance_of(Carbon::ListItemsFiltersNullable)
20
+ end
21
+ end
22
+ describe 'test attribute "external_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 "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
+ describe 'test attribute "name"' 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 "root_files_only"' 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
+ end
@@ -0,0 +1,46 @@
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::ListItemsFilters
14
+ describe Carbon::ListItemsFilters do
15
+ let(:instance) { Carbon::ListItemsFilters.new }
16
+
17
+ describe 'test an instance of ListItemsFilters' do
18
+ it 'should create an instance of ListItemsFilters' do
19
+ expect(instance).to be_instance_of(Carbon::ListItemsFilters)
20
+ end
21
+ end
22
+ describe 'test attribute "external_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 "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
+ describe 'test attribute "name"' 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 "root_files_only"' 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
+ 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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konfig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-25 00:00:00.000000000 Z
11
+ date: 2024-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -150,6 +150,8 @@ files:
150
150
  - lib/carbon_ruby_sdk/models/ids_property.rb
151
151
  - lib/carbon_ruby_sdk/models/list_data_source_items_request.rb
152
152
  - lib/carbon_ruby_sdk/models/list_data_source_items_response.rb
153
+ - lib/carbon_ruby_sdk/models/list_items_filters.rb
154
+ - lib/carbon_ruby_sdk/models/list_items_filters_nullable.rb
153
155
  - lib/carbon_ruby_sdk/models/list_request.rb
154
156
  - lib/carbon_ruby_sdk/models/list_response.rb
155
157
  - lib/carbon_ruby_sdk/models/location_property_inner.rb
@@ -281,6 +283,8 @@ files:
281
283
  - spec/models/ids_property_spec.rb
282
284
  - spec/models/list_data_source_items_request_spec.rb
283
285
  - spec/models/list_data_source_items_response_spec.rb
286
+ - spec/models/list_items_filters_nullable_spec.rb
287
+ - spec/models/list_items_filters_spec.rb
284
288
  - spec/models/list_request_spec.rb
285
289
  - spec/models/list_response_spec.rb
286
290
  - spec/models/location_property_inner_spec.rb
@@ -419,6 +423,7 @@ test_files:
419
423
  - spec/models/add_webhook_props_spec.rb
420
424
  - spec/models/white_labeling_response_spec.rb
421
425
  - spec/models/single_chunks_and_embeddings_upload_input_spec.rb
426
+ - spec/models/list_items_filters_spec.rb
422
427
  - spec/models/document_response_list_spec.rb
423
428
  - spec/models/list_data_source_items_request_spec.rb
424
429
  - spec/models/organization_user_data_source_response_spec.rb
@@ -454,6 +459,7 @@ test_files:
454
459
  - spec/models/s3_get_file_input_spec.rb
455
460
  - spec/models/upload_file_from_url_input_spec.rb
456
461
  - spec/models/gitbook_sync_request_spec.rb
462
+ - spec/models/list_items_filters_nullable_spec.rb
457
463
  - spec/models/data_source_sync_statuses_spec.rb
458
464
  - spec/models/resync_file_query_input_spec.rb
459
465
  - spec/models/modify_user_configuration_input_spec.rb