carbon_ruby_sdk 0.1.33 → 0.1.34
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.
- checksums.yaml +4 -4
- data/README.md +37 -13
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +34 -22
- data/lib/carbon_ruby_sdk/models/data_source_type.rb +2 -1
- data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +2 -1
- data/lib/carbon_ruby_sdk/models/fetch_urls_response.rb +14 -4
- data/lib/carbon_ruby_sdk/models/{helpdesk_file_sync_config.rb → file_sync_config.rb} +28 -14
- data/lib/carbon_ruby_sdk/models/{helpdesk_file_sync_config_nullable.rb → file_sync_config_nullable.rb} +28 -14
- data/lib/carbon_ruby_sdk/models/fresh_desk_connect_request.rb +1 -1
- data/lib/carbon_ruby_sdk/models/gmail_sync_input.rb +11 -1
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +3 -3
- data/lib/carbon_ruby_sdk/models/outlook_sync_input.rb +11 -1
- data/lib/carbon_ruby_sdk/models/s3_file_sync_input.rb +15 -5
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +2 -2
- data/lib/carbon_ruby_sdk/models/sync_options.rb +2 -2
- data/lib/carbon_ruby_sdk/models/user_file.rb +15 -11
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +2 -4
- data/spec/models/fetch_urls_response_spec.rb +6 -0
- data/spec/models/file_sync_config_nullable_spec.rb +40 -0
- data/spec/models/file_sync_config_spec.rb +40 -0
- data/spec/models/gmail_sync_input_spec.rb +6 -0
- data/spec/models/outlook_sync_input_spec.rb +6 -0
- data/spec/models/s3_file_sync_input_spec.rb +6 -0
- data/spec/models/user_file_spec.rb +2 -2
- metadata +8 -14
- data/lib/carbon_ruby_sdk/models/helpdesk_global_file_sync_config.rb +0 -217
- data/lib/carbon_ruby_sdk/models/helpdesk_global_file_sync_config_nullable.rb +0 -218
- data/spec/models/helpdesk_file_sync_config_nullable_spec.rb +0 -34
- data/spec/models/helpdesk_file_sync_config_spec.rb +0 -34
- data/spec/models/helpdesk_global_file_sync_config_nullable_spec.rb +0 -28
- data/spec/models/helpdesk_global_file_sync_config_spec.rb +0 -28
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.
|
4
|
+
version: 0.1.34
|
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-
|
11
|
+
date: 2024-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -138,6 +138,8 @@ files:
|
|
138
138
|
- lib/carbon_ruby_sdk/models/file_formats_nullable.rb
|
139
139
|
- lib/carbon_ruby_sdk/models/file_statistics.rb
|
140
140
|
- lib/carbon_ruby_sdk/models/file_statistics_nullable.rb
|
141
|
+
- lib/carbon_ruby_sdk/models/file_sync_config.rb
|
142
|
+
- lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb
|
141
143
|
- lib/carbon_ruby_sdk/models/fresh_desk_connect_request.rb
|
142
144
|
- lib/carbon_ruby_sdk/models/freskdesk_authentication.rb
|
143
145
|
- lib/carbon_ruby_sdk/models/generic_success_response.rb
|
@@ -149,11 +151,7 @@ files:
|
|
149
151
|
- lib/carbon_ruby_sdk/models/github_connect_request.rb
|
150
152
|
- lib/carbon_ruby_sdk/models/github_fetch_repos_request.rb
|
151
153
|
- lib/carbon_ruby_sdk/models/gmail_sync_input.rb
|
152
|
-
- lib/carbon_ruby_sdk/models/helpdesk_file_sync_config.rb
|
153
|
-
- lib/carbon_ruby_sdk/models/helpdesk_file_sync_config_nullable.rb
|
154
154
|
- lib/carbon_ruby_sdk/models/helpdesk_file_types.rb
|
155
|
-
- lib/carbon_ruby_sdk/models/helpdesk_global_file_sync_config.rb
|
156
|
-
- lib/carbon_ruby_sdk/models/helpdesk_global_file_sync_config_nullable.rb
|
157
155
|
- lib/carbon_ruby_sdk/models/http_validation_error.rb
|
158
156
|
- lib/carbon_ruby_sdk/models/hybrid_search_tuning_params.rb
|
159
157
|
- lib/carbon_ruby_sdk/models/hybrid_search_tuning_params_nullable.rb
|
@@ -285,6 +283,8 @@ files:
|
|
285
283
|
- spec/models/file_formats_spec.rb
|
286
284
|
- spec/models/file_statistics_nullable_spec.rb
|
287
285
|
- spec/models/file_statistics_spec.rb
|
286
|
+
- spec/models/file_sync_config_nullable_spec.rb
|
287
|
+
- spec/models/file_sync_config_spec.rb
|
288
288
|
- spec/models/fresh_desk_connect_request_spec.rb
|
289
289
|
- spec/models/freskdesk_authentication_spec.rb
|
290
290
|
- spec/models/generic_success_response_spec.rb
|
@@ -296,11 +296,7 @@ files:
|
|
296
296
|
- spec/models/github_connect_request_spec.rb
|
297
297
|
- spec/models/github_fetch_repos_request_spec.rb
|
298
298
|
- spec/models/gmail_sync_input_spec.rb
|
299
|
-
- spec/models/helpdesk_file_sync_config_nullable_spec.rb
|
300
|
-
- spec/models/helpdesk_file_sync_config_spec.rb
|
301
299
|
- spec/models/helpdesk_file_types_spec.rb
|
302
|
-
- spec/models/helpdesk_global_file_sync_config_nullable_spec.rb
|
303
|
-
- spec/models/helpdesk_global_file_sync_config_spec.rb
|
304
300
|
- spec/models/http_validation_error_spec.rb
|
305
301
|
- spec/models/hybrid_search_tuning_params_nullable_spec.rb
|
306
302
|
- spec/models/hybrid_search_tuning_params_spec.rb
|
@@ -452,7 +448,6 @@ test_files:
|
|
452
448
|
- spec/models/user_configuration_spec.rb
|
453
449
|
- spec/models/zendesk_authentication_spec.rb
|
454
450
|
- spec/models/connect_data_source_response_spec.rb
|
455
|
-
- spec/models/helpdesk_global_file_sync_config_nullable_spec.rb
|
456
451
|
- spec/models/simple_o_auth_data_sources_spec.rb
|
457
452
|
- spec/models/add_webhook_props_spec.rb
|
458
453
|
- spec/models/white_labeling_response_spec.rb
|
@@ -476,6 +471,7 @@ test_files:
|
|
476
471
|
- spec/models/zotero_authentication_spec.rb
|
477
472
|
- spec/models/helpdesk_file_types_spec.rb
|
478
473
|
- spec/models/document_response_spec.rb
|
474
|
+
- spec/models/file_sync_config_spec.rb
|
479
475
|
- spec/models/data_source_last_sync_actions_spec.rb
|
480
476
|
- spec/models/organization_user_file_tags_remove_spec.rb
|
481
477
|
- spec/models/embedding_properties_spec.rb
|
@@ -502,7 +498,6 @@ test_files:
|
|
502
498
|
- spec/models/chunk_properties_spec.rb
|
503
499
|
- spec/models/fetch_urls_response_spec.rb
|
504
500
|
- spec/models/data_source_type_nullable_spec.rb
|
505
|
-
- spec/models/helpdesk_file_sync_config_spec.rb
|
506
501
|
- spec/models/http_validation_error_spec.rb
|
507
502
|
- spec/models/embedding_and_chunk_spec.rb
|
508
503
|
- spec/models/tags_spec.rb
|
@@ -520,7 +515,6 @@ test_files:
|
|
520
515
|
- spec/models/organization_user_file_tag_create_spec.rb
|
521
516
|
- spec/models/organization_user_data_source_order_by_columns_spec.rb
|
522
517
|
- spec/models/custom_credentials_type_spec.rb
|
523
|
-
- spec/models/helpdesk_global_file_sync_config_spec.rb
|
524
518
|
- spec/models/file_formats_nullable_spec.rb
|
525
519
|
- spec/models/s3_authentication_spec.rb
|
526
520
|
- spec/models/file_statistics_spec.rb
|
@@ -534,9 +528,9 @@ test_files:
|
|
534
528
|
- spec/models/file_content_types_spec.rb
|
535
529
|
- spec/models/freskdesk_authentication_spec.rb
|
536
530
|
- spec/models/fresh_desk_connect_request_spec.rb
|
531
|
+
- spec/models/file_sync_config_nullable_spec.rb
|
537
532
|
- spec/models/embeddings_and_chunks_filters_spec.rb
|
538
533
|
- spec/models/raw_transcript_property_inner_value_spec.rb
|
539
|
-
- spec/models/helpdesk_file_sync_config_nullable_spec.rb
|
540
534
|
- spec/models/delete_users_input_spec.rb
|
541
535
|
- spec/models/webhook_no_key_spec.rb
|
542
536
|
- spec/models/s3_file_sync_input_spec.rb
|
@@ -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
|