carbon_ruby_sdk 0.1.1 → 0.1.2

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: b0079046fb886087dd02811d7d0e550a31890f70ff9028e4f058410be329bf3a
4
- data.tar.gz: 58492681bfb20d468b52e3664b5b9b3c0d51e0899f727a22a90b120fbb7e8ba1
3
+ metadata.gz: 0ac0406a2bcc091f1b785056208818772d945edc8634ccc1b4cb2a8bf5f73cd7
4
+ data.tar.gz: e5682cad97249914d7c5f922e80b2ee86a467d3634f6db822ea2cf5086f08795
5
5
  SHA512:
6
- metadata.gz: 17bb4c1f38cbc7da7d15edfaf71266422107be105dbdf1f4d50970ac4ae6da145526b91901e4f2fb0bcd42e5b9285384ba3de9ab5e7edcf124ff7693bde6735d
7
- data.tar.gz: 030cc1d03e549e6f00ac1dddf6aeefb439ce34af91a7deb6cc6869dbfcf6fffe037be43c8137e911807ca3adadd8b7e32ea6fad6b17d0763c0003f8920ce0e46
6
+ metadata.gz: d63ba01faf33b9020042e0ab85c476e2cf574313ad326f4a852991c1dbb763a87a93a13d8454bbc8ee6bf3d103c0a08b7f6a4e00837a442d7f8982bab75d396a
7
+ data.tar.gz: 9f7f119910df0a84786c48a82cee23fb2aa5e8775251e87e71ccde038545db693af9244b7305c328b63cd8bca07ba71bcb91aa2f485e275fd2eb83a35d6ea959
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carbon_ruby_sdk (0.1.1)
4
+ carbon_ruby_sdk (0.1.2)
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.1-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.1)
9
+ [![npm](https://img.shields.io/badge/gem-v0.1.2-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.2)
10
10
 
11
11
  </div>
12
12
 
@@ -57,6 +57,7 @@ Connect external data to LLMs, no matter the source.
57
57
  * [`carbon.integrations.sync_rss_feed`](#carbonintegrationssync_rss_feed)
58
58
  * [`carbon.integrations.sync_s3_files`](#carbonintegrationssync_s3_files)
59
59
  * [`carbon.organizations.get`](#carbonorganizationsget)
60
+ * [`carbon.users.delete`](#carbonusersdelete)
60
61
  * [`carbon.users.get`](#carbonusersget)
61
62
  * [`carbon.users.toggle_user_features`](#carbonuserstoggle_user_features)
62
63
  * [`carbon.utilities.fetch_urls`](#carbonutilitiesfetch_urls)
@@ -76,7 +77,7 @@ Connect external data to LLMs, no matter the source.
76
77
  Add to Gemfile:
77
78
 
78
79
  ```ruby
79
- gem 'carbon_ruby_sdk', '~> 0.1.1'
80
+ gem 'carbon_ruby_sdk', '~> 0.1.2'
80
81
  ```
81
82
 
82
83
  ## Getting Started<a id="getting-started"></a>
@@ -1941,6 +1942,37 @@ p result
1941
1942
  ---
1942
1943
 
1943
1944
 
1945
+ ### `carbon.users.delete`<a id="carbonusersdelete"></a>
1946
+
1947
+ Delete Users
1948
+
1949
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
1950
+
1951
+ ```ruby
1952
+ result = carbon.users.delete(
1953
+ customer_ids: [
1954
+ "string_example"
1955
+ ],
1956
+ )
1957
+ p result
1958
+ ```
1959
+
1960
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1961
+
1962
+ ##### customer_ids: Array<`String`><a id="customer_ids-array"></a>
1963
+ #### 🔄 Return<a id="🔄-return"></a>
1964
+
1965
+ [GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
1966
+
1967
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1968
+
1969
+ `/delete_users` `POST`
1970
+
1971
+ [🔙 **Back to Table of Contents**](#table-of-contents)
1972
+
1973
+ ---
1974
+
1975
+
1944
1976
  ### `carbon.users.get`<a id="carbonusersget"></a>
1945
1977
 
1946
1978
  User Endpoint
@@ -16,6 +16,98 @@ module Carbon
16
16
  @api_client = api_client
17
17
  end
18
18
 
19
+ # Delete Users
20
+ #
21
+ # @param customer_ids [Array<String>]
22
+ # @param body [DeleteUsersInput]
23
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
24
+ def delete(customer_ids:, extra: {})
25
+ _body = {}
26
+ _body[:customer_ids] = customer_ids if customer_ids != SENTINEL
27
+ delete_users_input = _body
28
+ api_response = delete_with_http_info_impl(delete_users_input, extra)
29
+ api_response.data
30
+ end
31
+
32
+ # Delete Users
33
+ #
34
+ # @param customer_ids [Array<String>]
35
+ # @param body [DeleteUsersInput]
36
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
37
+ def delete_with_http_info(customer_ids:, extra: {})
38
+ _body = {}
39
+ _body[:customer_ids] = customer_ids if customer_ids != SENTINEL
40
+ delete_users_input = _body
41
+ delete_with_http_info_impl(delete_users_input, extra)
42
+ end
43
+
44
+ # Delete Users
45
+ # @param delete_users_input [DeleteUsersInput]
46
+ # @param [Hash] opts the optional parameters
47
+ # @return [GenericSuccessResponse]
48
+ private def delete_impl(delete_users_input, opts = {})
49
+ data, _status_code, _headers = delete_with_http_info(delete_users_input, opts)
50
+ data
51
+ end
52
+
53
+ # Delete Users
54
+ # @param delete_users_input [DeleteUsersInput]
55
+ # @param [Hash] opts the optional parameters
56
+ # @return [APIResponse] data is GenericSuccessResponse, status code, headers and response
57
+ private def delete_with_http_info_impl(delete_users_input, opts = {})
58
+ if @api_client.config.debugging
59
+ @api_client.config.logger.debug 'Calling API: UsersApi.delete ...'
60
+ end
61
+ # verify the required parameter 'delete_users_input' is set
62
+ if @api_client.config.client_side_validation && delete_users_input.nil?
63
+ fail ArgumentError, "Missing the required parameter 'delete_users_input' when calling UsersApi.delete"
64
+ end
65
+ # resource path
66
+ local_var_path = '/delete_users'
67
+
68
+ # query parameters
69
+ query_params = opts[:query_params] || {}
70
+
71
+ # header parameters
72
+ header_params = opts[:header_params] || {}
73
+ # HTTP header 'Accept' (if needed)
74
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
75
+ # HTTP header 'Content-Type'
76
+ content_type = @api_client.select_header_content_type(['application/json'])
77
+ if !content_type.nil?
78
+ header_params['Content-Type'] = content_type
79
+ end
80
+
81
+ # form parameters
82
+ form_params = opts[:form_params] || {}
83
+
84
+ # http body (model)
85
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(delete_users_input)
86
+
87
+ # return_type
88
+ return_type = opts[:debug_return_type] || 'GenericSuccessResponse'
89
+
90
+ # auth_names
91
+ auth_names = opts[:debug_auth_names] || ['accessToken']
92
+
93
+ new_options = opts.merge(
94
+ :operation => :"UsersApi.delete",
95
+ :header_params => header_params,
96
+ :query_params => query_params,
97
+ :form_params => form_params,
98
+ :body => post_body,
99
+ :auth_names => auth_names,
100
+ :return_type => return_type
101
+ )
102
+
103
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug "API called: UsersApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
106
+ end
107
+ APIResponse::new(data, status_code, headers, response)
108
+ end
109
+
110
+
19
111
  # User Endpoint
20
112
  #
21
113
  # @param customer_id [String]
@@ -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 DeleteUsersInput
14
+ attr_accessor :customer_ids
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ :'customer_ids' => :'customer_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
+ :'customer_ids' => :'Array<String>'
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::DeleteUsersInput` 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::DeleteUsersInput`. 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?(:'customer_ids')
57
+ if (value = attributes[:'customer_ids']).is_a?(Array)
58
+ self.customer_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 @customer_ids.nil?
68
+ invalid_properties.push('invalid value for "customer_ids", customer_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 @customer_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
+ customer_ids == o.customer_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
+ [customer_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
@@ -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.1'
10
+ VERSION = '0.1.2'
11
11
  end
@@ -26,6 +26,7 @@ require 'carbon_ruby_sdk/models/data_source_sync_statuses'
26
26
  require 'carbon_ruby_sdk/models/data_source_type'
27
27
  require 'carbon_ruby_sdk/models/data_source_type_nullable'
28
28
  require 'carbon_ruby_sdk/models/delete_files_query_input'
29
+ require 'carbon_ruby_sdk/models/delete_users_input'
29
30
  require 'carbon_ruby_sdk/models/directory_item'
30
31
  require 'carbon_ruby_sdk/models/document_response'
31
32
  require 'carbon_ruby_sdk/models/document_response_list'
@@ -26,6 +26,17 @@ describe 'UsersApi' do
26
26
  end
27
27
  end
28
28
 
29
+ # unit tests for delete
30
+ # Delete Users
31
+ # @param delete_users_input
32
+ # @param [Hash] opts the optional parameters
33
+ # @return [GenericSuccessResponse]
34
+ describe 'delete test' 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
+
29
40
  # unit tests for get
30
41
  # User Endpoint
31
42
  # @param user_request_content
@@ -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::DeleteUsersInput
14
+ describe Carbon::DeleteUsersInput do
15
+ let(:instance) { Carbon::DeleteUsersInput.new }
16
+
17
+ describe 'test an instance of DeleteUsersInput' do
18
+ it 'should create an instance of DeleteUsersInput' do
19
+ expect(instance).to be_instance_of(Carbon::DeleteUsersInput)
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
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carbon_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konfig
@@ -109,6 +109,7 @@ files:
109
109
  - lib/carbon_ruby_sdk/models/data_source_type.rb
110
110
  - lib/carbon_ruby_sdk/models/data_source_type_nullable.rb
111
111
  - lib/carbon_ruby_sdk/models/delete_files_query_input.rb
112
+ - lib/carbon_ruby_sdk/models/delete_users_input.rb
112
113
  - lib/carbon_ruby_sdk/models/directory_item.rb
113
114
  - lib/carbon_ruby_sdk/models/document_response.rb
114
115
  - lib/carbon_ruby_sdk/models/document_response_list.rb
@@ -218,6 +219,7 @@ files:
218
219
  - spec/models/data_source_type_nullable_spec.rb
219
220
  - spec/models/data_source_type_spec.rb
220
221
  - spec/models/delete_files_query_input_spec.rb
222
+ - spec/models/delete_users_input_spec.rb
221
223
  - spec/models/directory_item_spec.rb
222
224
  - spec/models/document_response_list_spec.rb
223
225
  - spec/models/document_response_spec.rb
@@ -429,6 +431,7 @@ test_files:
429
431
  - spec/models/fresh_desk_connect_request_spec.rb
430
432
  - spec/models/embeddings_and_chunks_filters_spec.rb
431
433
  - spec/models/raw_transcript_property_inner_value_spec.rb
434
+ - spec/models/delete_users_input_spec.rb
432
435
  - spec/models/webhook_no_key_spec.rb
433
436
  - spec/models/s3_file_sync_input_spec.rb
434
437
  - spec/models/sync_directory_request_spec.rb