carbon_ruby_sdk 0.1.33 → 0.2.0

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +70 -13
  4. data/lib/carbon_ruby_sdk/api/files_api.rb +9 -2
  5. data/lib/carbon_ruby_sdk/api/integrations_api.rb +34 -22
  6. data/lib/carbon_ruby_sdk/api/organizations_api.rb +83 -0
  7. data/lib/carbon_ruby_sdk/models/data_source_type.rb +9 -2
  8. data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +9 -2
  9. data/lib/carbon_ruby_sdk/models/fetch_urls_response.rb +14 -4
  10. data/lib/carbon_ruby_sdk/models/file_content_types.rb +3 -1
  11. data/lib/carbon_ruby_sdk/models/file_content_types_nullable.rb +3 -1
  12. data/lib/carbon_ruby_sdk/models/file_formats.rb +9 -3
  13. data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +9 -3
  14. data/lib/carbon_ruby_sdk/models/{helpdesk_file_sync_config.rb → file_sync_config.rb} +28 -14
  15. data/lib/carbon_ruby_sdk/models/{helpdesk_file_sync_config_nullable.rb → file_sync_config_nullable.rb} +28 -14
  16. data/lib/carbon_ruby_sdk/models/fresh_desk_connect_request.rb +1 -1
  17. data/lib/carbon_ruby_sdk/models/gmail_sync_input.rb +11 -1
  18. data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +3 -3
  19. data/lib/carbon_ruby_sdk/models/organization_response.rb +39 -1
  20. data/lib/carbon_ruby_sdk/models/outlook_sync_input.rb +11 -1
  21. data/lib/carbon_ruby_sdk/models/s3_file_sync_input.rb +15 -5
  22. data/lib/carbon_ruby_sdk/models/sync_files_request.rb +2 -2
  23. data/lib/carbon_ruby_sdk/models/sync_options.rb +2 -2
  24. data/lib/carbon_ruby_sdk/models/user_file.rb +15 -11
  25. data/lib/carbon_ruby_sdk/models/user_response.rb +85 -1
  26. data/lib/carbon_ruby_sdk/models/webhook.rb +25 -1
  27. data/lib/carbon_ruby_sdk/models/webhook_no_key.rb +25 -1
  28. data/lib/carbon_ruby_sdk/models/webhook_status.rb +36 -0
  29. data/lib/carbon_ruby_sdk/version.rb +1 -1
  30. data/lib/carbon_ruby_sdk.rb +3 -4
  31. data/spec/api/files_api_spec.rb +1 -0
  32. data/spec/api/organizations_api_spec.rb +11 -0
  33. data/spec/models/fetch_urls_response_spec.rb +6 -0
  34. data/spec/models/file_sync_config_nullable_spec.rb +40 -0
  35. data/spec/models/file_sync_config_spec.rb +40 -0
  36. data/spec/models/gmail_sync_input_spec.rb +6 -0
  37. data/spec/models/organization_response_spec.rb +18 -0
  38. data/spec/models/outlook_sync_input_spec.rb +6 -0
  39. data/spec/models/s3_file_sync_input_spec.rb +6 -0
  40. data/spec/models/user_file_spec.rb +2 -2
  41. data/spec/models/user_response_spec.rb +36 -0
  42. data/spec/models/webhook_no_key_spec.rb +12 -0
  43. data/spec/models/webhook_spec.rb +12 -0
  44. data/spec/models/webhook_status_spec.rb +22 -0
  45. metadata +11 -14
  46. data/lib/carbon_ruby_sdk/models/helpdesk_global_file_sync_config.rb +0 -217
  47. data/lib/carbon_ruby_sdk/models/helpdesk_global_file_sync_config_nullable.rb +0 -218
  48. data/spec/models/helpdesk_file_sync_config_nullable_spec.rb +0 -34
  49. data/spec/models/helpdesk_file_sync_config_spec.rb +0 -34
  50. data/spec/models/helpdesk_global_file_sync_config_nullable_spec.rb +0 -28
  51. data/spec/models/helpdesk_global_file_sync_config_spec.rb +0 -28
@@ -1,217 +0,0 @@
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 HelpdeskGlobalFileSyncConfig
14
- attr_accessor :sync_attachments
15
-
16
- # Attribute mapping from ruby-style variable name to JSON key.
17
- def self.attribute_map
18
- {
19
- :'sync_attachments' => :'sync_attachments'
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
- :'sync_attachments' => :'Boolean'
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::HelpdeskGlobalFileSyncConfig` 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::HelpdeskGlobalFileSyncConfig`. 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?(:'sync_attachments')
57
- self.sync_attachments = attributes[:'sync_attachments']
58
- else
59
- self.sync_attachments = false
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
- invalid_properties
68
- end
69
-
70
- # Check to see if the all the properties in the model are valid
71
- # @return true if the model is valid
72
- def valid?
73
- true
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- # @param [Object] Object to be compared
78
- def ==(o)
79
- return true if self.equal?(o)
80
- self.class == o.class &&
81
- sync_attachments == o.sync_attachments
82
- end
83
-
84
- # @see the `==` method
85
- # @param [Object] Object to be compared
86
- def eql?(o)
87
- self == o
88
- end
89
-
90
- # Calculates hash code according to all attributes.
91
- # @return [Integer] Hash code
92
- def hash
93
- [sync_attachments].hash
94
- end
95
-
96
- # Builds the object from hash
97
- # @param [Hash] attributes Model attributes in the form of hash
98
- # @return [Object] Returns the model itself
99
- def self.build_from_hash(attributes)
100
- new.build_from_hash(attributes)
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
- return nil unless attributes.is_a?(Hash)
108
- attributes = attributes.transform_keys(&:to_sym)
109
- self.class.openapi_types.each_pair do |key, type|
110
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
111
- self.send("#{key}=", nil)
112
- elsif type =~ /\AArray<(.*)>/i
113
- # check to ensure the input is an array given that the attribute
114
- # is documented as an array but the input is not
115
- if attributes[self.class.attribute_map[key]].is_a?(Array)
116
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
117
- end
118
- elsif !attributes[self.class.attribute_map[key]].nil?
119
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
- end
121
- end
122
-
123
- self
124
- end
125
-
126
- # Deserializes the data based on type
127
- # @param string type Data type
128
- # @param string value Value to be deserialized
129
- # @return [Object] Deserialized data
130
- def _deserialize(type, value)
131
- case type.to_sym
132
- when :Time
133
- Time.parse(value)
134
- when :Date
135
- Date.parse(value)
136
- when :String
137
- value.to_s
138
- when :Integer
139
- value.to_i
140
- when :Float
141
- value.to_f
142
- when :Boolean
143
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
- true
145
- else
146
- false
147
- end
148
- when :Object
149
- # generic object (usually a Hash), return directly
150
- value
151
- when /\AArray<(?<inner_type>.+)>\z/
152
- inner_type = Regexp.last_match[:inner_type]
153
- value.map { |v| _deserialize(inner_type, v) }
154
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
- k_type = Regexp.last_match[:k_type]
156
- v_type = Regexp.last_match[:v_type]
157
- {}.tap do |hash|
158
- value.each do |k, v|
159
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
- end
161
- end
162
- else # model
163
- # models (e.g. Pet) or oneOf
164
- klass = Carbon.const_get(type)
165
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
166
- end
167
- end
168
-
169
- # Returns the string representation of the object
170
- # @return [String] String presentation of the object
171
- def to_s
172
- to_hash.to_s
173
- end
174
-
175
- # to_body is an alias to to_hash (backward compatibility)
176
- # @return [Hash] Returns the object in the form of hash
177
- def to_body
178
- to_hash
179
- end
180
-
181
- # Returns the object in the form of hash
182
- # @return [Hash] Returns the object in the form of hash
183
- def to_hash
184
- hash = {}
185
- self.class.attribute_map.each_pair do |attr, param|
186
- value = self.send(attr)
187
- if value.nil?
188
- is_nullable = self.class.openapi_nullable.include?(attr)
189
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
- end
191
-
192
- hash[param] = _to_hash(value)
193
- end
194
- hash
195
- end
196
-
197
- # Outputs non-array value in the form of hash
198
- # For object, use to_hash. Otherwise, just return the value
199
- # @param [Object] value Any valid value
200
- # @return [Hash] Returns the value in the form of hash
201
- def _to_hash(value)
202
- if value.is_a?(Array)
203
- value.compact.map { |v| _to_hash(v) }
204
- elsif value.is_a?(Hash)
205
- {}.tap do |hash|
206
- value.each { |k, v| hash[k] = _to_hash(v) }
207
- end
208
- elsif value.respond_to? :to_hash
209
- value.to_hash
210
- else
211
- value
212
- end
213
- end
214
-
215
- end
216
-
217
- end
@@ -1,218 +0,0 @@
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 configure file syncing for certain connectors, for example including attachments
14
- class HelpdeskGlobalFileSyncConfigNullable
15
- attr_accessor :sync_attachments
16
-
17
- # Attribute mapping from ruby-style variable name to JSON key.
18
- def self.attribute_map
19
- {
20
- :'sync_attachments' => :'sync_attachments'
21
- }
22
- end
23
-
24
- # Returns all the JSON keys this model knows about
25
- def self.acceptable_attributes
26
- attribute_map.values
27
- end
28
-
29
- # Attribute type mapping.
30
- def self.openapi_types
31
- {
32
- :'sync_attachments' => :'Boolean'
33
- }
34
- end
35
-
36
- # List of attributes with nullable: true
37
- def self.openapi_nullable
38
- Set.new([
39
- ])
40
- end
41
-
42
- # Initializes the object
43
- # @param [Hash] attributes Model attributes in the form of hash
44
- def initialize(attributes = {})
45
- if (!attributes.is_a?(Hash))
46
- fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::HelpdeskGlobalFileSyncConfigNullable` initialize method"
47
- end
48
-
49
- # check to see if the attribute exists and convert string to symbol for hash key
50
- attributes = attributes.each_with_object({}) { |(k, v), h|
51
- if (!self.class.attribute_map.key?(k.to_sym))
52
- fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::HelpdeskGlobalFileSyncConfigNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
- end
54
- h[k.to_sym] = v
55
- }
56
-
57
- if attributes.key?(:'sync_attachments')
58
- self.sync_attachments = attributes[:'sync_attachments']
59
- else
60
- self.sync_attachments = false
61
- end
62
- end
63
-
64
- # Show invalid properties with the reasons. Usually used together with valid?
65
- # @return Array for valid properties with the reasons
66
- def list_invalid_properties
67
- invalid_properties = Array.new
68
- invalid_properties
69
- end
70
-
71
- # Check to see if the all the properties in the model are valid
72
- # @return true if the model is valid
73
- def valid?
74
- true
75
- end
76
-
77
- # Checks equality by comparing each attribute.
78
- # @param [Object] Object to be compared
79
- def ==(o)
80
- return true if self.equal?(o)
81
- self.class == o.class &&
82
- sync_attachments == o.sync_attachments
83
- end
84
-
85
- # @see the `==` method
86
- # @param [Object] Object to be compared
87
- def eql?(o)
88
- self == o
89
- end
90
-
91
- # Calculates hash code according to all attributes.
92
- # @return [Integer] Hash code
93
- def hash
94
- [sync_attachments].hash
95
- end
96
-
97
- # Builds the object from hash
98
- # @param [Hash] attributes Model attributes in the form of hash
99
- # @return [Object] Returns the model itself
100
- def self.build_from_hash(attributes)
101
- new.build_from_hash(attributes)
102
- end
103
-
104
- # Builds the object from hash
105
- # @param [Hash] attributes Model attributes in the form of hash
106
- # @return [Object] Returns the model itself
107
- def build_from_hash(attributes)
108
- return nil unless attributes.is_a?(Hash)
109
- attributes = attributes.transform_keys(&:to_sym)
110
- self.class.openapi_types.each_pair do |key, type|
111
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
- self.send("#{key}=", nil)
113
- elsif type =~ /\AArray<(.*)>/i
114
- # check to ensure the input is an array given that the attribute
115
- # is documented as an array but the input is not
116
- if attributes[self.class.attribute_map[key]].is_a?(Array)
117
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
- end
119
- elsif !attributes[self.class.attribute_map[key]].nil?
120
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
- end
122
- end
123
-
124
- self
125
- end
126
-
127
- # Deserializes the data based on type
128
- # @param string type Data type
129
- # @param string value Value to be deserialized
130
- # @return [Object] Deserialized data
131
- def _deserialize(type, value)
132
- case type.to_sym
133
- when :Time
134
- Time.parse(value)
135
- when :Date
136
- Date.parse(value)
137
- when :String
138
- value.to_s
139
- when :Integer
140
- value.to_i
141
- when :Float
142
- value.to_f
143
- when :Boolean
144
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
- true
146
- else
147
- false
148
- end
149
- when :Object
150
- # generic object (usually a Hash), return directly
151
- value
152
- when /\AArray<(?<inner_type>.+)>\z/
153
- inner_type = Regexp.last_match[:inner_type]
154
- value.map { |v| _deserialize(inner_type, v) }
155
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
- k_type = Regexp.last_match[:k_type]
157
- v_type = Regexp.last_match[:v_type]
158
- {}.tap do |hash|
159
- value.each do |k, v|
160
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
- end
162
- end
163
- else # model
164
- # models (e.g. Pet) or oneOf
165
- klass = Carbon.const_get(type)
166
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
- end
168
- end
169
-
170
- # Returns the string representation of the object
171
- # @return [String] String presentation of the object
172
- def to_s
173
- to_hash.to_s
174
- end
175
-
176
- # to_body is an alias to to_hash (backward compatibility)
177
- # @return [Hash] Returns the object in the form of hash
178
- def to_body
179
- to_hash
180
- end
181
-
182
- # Returns the object in the form of hash
183
- # @return [Hash] Returns the object in the form of hash
184
- def to_hash
185
- hash = {}
186
- self.class.attribute_map.each_pair do |attr, param|
187
- value = self.send(attr)
188
- if value.nil?
189
- is_nullable = self.class.openapi_nullable.include?(attr)
190
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
- end
192
-
193
- hash[param] = _to_hash(value)
194
- end
195
- hash
196
- end
197
-
198
- # Outputs non-array value in the form of hash
199
- # For object, use to_hash. Otherwise, just return the value
200
- # @param [Object] value Any valid value
201
- # @return [Hash] Returns the value in the form of hash
202
- def _to_hash(value)
203
- if value.is_a?(Array)
204
- value.compact.map { |v| _to_hash(v) }
205
- elsif value.is_a?(Hash)
206
- {}.tap do |hash|
207
- value.each { |k, v| hash[k] = _to_hash(v) }
208
- end
209
- elsif value.respond_to? :to_hash
210
- value.to_hash
211
- else
212
- value
213
- end
214
- end
215
-
216
- end
217
-
218
- end
@@ -1,34 +0,0 @@
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::HelpdeskFileSyncConfigNullable
14
- describe Carbon::HelpdeskFileSyncConfigNullable do
15
- let(:instance) { Carbon::HelpdeskFileSyncConfigNullable.new }
16
-
17
- describe 'test an instance of HelpdeskFileSyncConfigNullable' do
18
- it 'should create an instance of HelpdeskFileSyncConfigNullable' do
19
- expect(instance).to be_instance_of(Carbon::HelpdeskFileSyncConfigNullable)
20
- end
21
- end
22
- describe 'test attribute "file_types"' 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 "sync_attachments"' 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
@@ -1,34 +0,0 @@
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::HelpdeskFileSyncConfig
14
- describe Carbon::HelpdeskFileSyncConfig do
15
- let(:instance) { Carbon::HelpdeskFileSyncConfig.new }
16
-
17
- describe 'test an instance of HelpdeskFileSyncConfig' do
18
- it 'should create an instance of HelpdeskFileSyncConfig' do
19
- expect(instance).to be_instance_of(Carbon::HelpdeskFileSyncConfig)
20
- end
21
- end
22
- describe 'test attribute "file_types"' 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 "sync_attachments"' 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
@@ -1,28 +0,0 @@
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::HelpdeskGlobalFileSyncConfigNullable
14
- describe Carbon::HelpdeskGlobalFileSyncConfigNullable do
15
- let(:instance) { Carbon::HelpdeskGlobalFileSyncConfigNullable.new }
16
-
17
- describe 'test an instance of HelpdeskGlobalFileSyncConfigNullable' do
18
- it 'should create an instance of HelpdeskGlobalFileSyncConfigNullable' do
19
- expect(instance).to be_instance_of(Carbon::HelpdeskGlobalFileSyncConfigNullable)
20
- end
21
- end
22
- describe 'test attribute "sync_attachments"' 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
@@ -1,28 +0,0 @@
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::HelpdeskGlobalFileSyncConfig
14
- describe Carbon::HelpdeskGlobalFileSyncConfig do
15
- let(:instance) { Carbon::HelpdeskGlobalFileSyncConfig.new }
16
-
17
- describe 'test an instance of HelpdeskGlobalFileSyncConfig' do
18
- it 'should create an instance of HelpdeskGlobalFileSyncConfig' do
19
- expect(instance).to be_instance_of(Carbon::HelpdeskGlobalFileSyncConfig)
20
- end
21
- end
22
- describe 'test attribute "sync_attachments"' 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