carbon_ruby_sdk 0.2.38 → 0.2.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +310 -2
- data/lib/carbon_ruby_sdk/api/github_api.rb +825 -0
- data/lib/carbon_ruby_sdk/models/comments_input.rb +330 -0
- data/lib/carbon_ruby_sdk/models/comments_order_by.rb +36 -0
- data/lib/carbon_ruby_sdk/models/comments_response.rb +232 -0
- data/lib/carbon_ruby_sdk/models/commit.rb +282 -0
- data/lib/carbon_ruby_sdk/models/commit_user.rb +234 -0
- data/lib/carbon_ruby_sdk/models/commit_user_nullable.rb +234 -0
- data/lib/carbon_ruby_sdk/models/commits_input.rb +307 -0
- data/lib/carbon_ruby_sdk/models/commits_response.rb +232 -0
- data/lib/carbon_ruby_sdk/models/file_status.rb +41 -0
- data/lib/carbon_ruby_sdk/models/files_input.rb +307 -0
- data/lib/carbon_ruby_sdk/models/files_response.rb +232 -0
- data/lib/carbon_ruby_sdk/models/head_or_base.rb +248 -0
- data/lib/carbon_ruby_sdk/models/issue.rb +434 -0
- data/lib/carbon_ruby_sdk/models/issue_pr.rb +230 -0
- data/lib/carbon_ruby_sdk/models/issue_pr_nullable.rb +230 -0
- data/lib/carbon_ruby_sdk/models/issues_filter.rb +217 -0
- data/lib/carbon_ruby_sdk/models/issues_input.rb +325 -0
- data/lib/carbon_ruby_sdk/models/issues_order_by.rb +37 -0
- data/lib/carbon_ruby_sdk/models/issues_response.rb +232 -0
- data/lib/carbon_ruby_sdk/models/label.rb +234 -0
- data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb +29 -1
- data/lib/carbon_ruby_sdk/models/pr_comment.rb +358 -0
- data/lib/carbon_ruby_sdk/models/pr_commit.rb +264 -0
- data/lib/carbon_ruby_sdk/models/pr_file.rb +342 -0
- data/lib/carbon_ruby_sdk/models/pr_order_by.rb +37 -0
- data/lib/carbon_ruby_sdk/models/pr_state.rb +36 -0
- data/lib/carbon_ruby_sdk/models/pr_state_input.rb +37 -0
- data/lib/carbon_ruby_sdk/models/pull_request.rb +438 -0
- data/lib/carbon_ruby_sdk/models/pull_request_extended.rb +536 -0
- data/lib/carbon_ruby_sdk/models/pull_request_filters.rb +239 -0
- data/lib/carbon_ruby_sdk/models/pull_request_response.rb +232 -0
- data/lib/carbon_ruby_sdk/models/pull_requests_input.rb +325 -0
- data/lib/carbon_ruby_sdk/models/sent_webhook_payload.rb +2 -2
- data/lib/carbon_ruby_sdk/models/team.rb +234 -0
- data/lib/carbon_ruby_sdk/models/tree.rb +234 -0
- data/lib/carbon_ruby_sdk/models/user.rb +234 -0
- data/lib/carbon_ruby_sdk/models/user_file.rb +11 -1
- data/lib/carbon_ruby_sdk/models/user_nullable.rb +234 -0
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +38 -0
- data/spec/api/github_api_spec.rb +112 -0
- data/spec/models/comments_input_spec.rb +76 -0
- data/spec/models/comments_order_by_spec.rb +22 -0
- data/spec/models/comments_response_spec.rb +34 -0
- data/spec/models/commit_spec.rb +58 -0
- data/spec/models/commit_user_nullable_spec.rb +34 -0
- data/spec/models/commit_user_spec.rb +34 -0
- data/spec/models/commits_input_spec.rb +64 -0
- data/spec/models/commits_response_spec.rb +34 -0
- data/spec/models/file_status_spec.rb +22 -0
- data/spec/models/files_input_spec.rb +64 -0
- data/spec/models/files_response_spec.rb +34 -0
- data/spec/models/head_or_base_spec.rb +40 -0
- data/spec/models/issue_pr_nullable_spec.rb +34 -0
- data/spec/models/issue_pr_spec.rb +34 -0
- data/spec/models/issue_spec.rb +124 -0
- data/spec/models/issues_filter_spec.rb +28 -0
- data/spec/models/issues_input_spec.rb +76 -0
- data/spec/models/issues_order_by_spec.rb +22 -0
- data/spec/models/issues_response_spec.rb +34 -0
- data/spec/models/label_spec.rb +34 -0
- data/spec/models/organization_user_files_to_sync_filters_spec.rb +6 -0
- data/spec/models/pr_comment_spec.rb +94 -0
- data/spec/models/pr_commit_spec.rb +52 -0
- data/spec/models/pr_file_spec.rb +82 -0
- data/spec/models/pr_order_by_spec.rb +22 -0
- data/spec/models/pr_state_input_spec.rb +22 -0
- data/spec/models/pr_state_spec.rb +22 -0
- data/spec/models/pull_request_extended_spec.rb +166 -0
- data/spec/models/pull_request_filters_spec.rb +40 -0
- data/spec/models/pull_request_response_spec.rb +34 -0
- data/spec/models/pull_request_spec.rb +124 -0
- data/spec/models/pull_requests_input_spec.rb +76 -0
- data/spec/models/sent_webhook_payload_spec.rb +1 -1
- data/spec/models/team_spec.rb +34 -0
- data/spec/models/tree_spec.rb +34 -0
- data/spec/models/user_file_spec.rb +6 -0
- data/spec/models/user_nullable_spec.rb +34 -0
- data/spec/models/user_spec.rb +34 -0
- metadata +301 -193
@@ -0,0 +1,234 @@
|
|
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 Tree
|
14
|
+
attr_accessor :sha
|
15
|
+
|
16
|
+
attr_accessor :url
|
17
|
+
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
+
def self.attribute_map
|
20
|
+
{
|
21
|
+
:'sha' => :'sha',
|
22
|
+
:'url' => :'url'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns all the JSON keys this model knows about
|
27
|
+
def self.acceptable_attributes
|
28
|
+
attribute_map.values
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'sha' => :'String',
|
35
|
+
:'url' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::Tree` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::Tree`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'sha')
|
61
|
+
self.sha = attributes[:'sha']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'url')
|
65
|
+
self.url = attributes[:'url']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
if @sha.nil?
|
74
|
+
invalid_properties.push('invalid value for "sha", sha cannot be nil.')
|
75
|
+
end
|
76
|
+
|
77
|
+
if @url.nil?
|
78
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
79
|
+
end
|
80
|
+
|
81
|
+
invalid_properties
|
82
|
+
end
|
83
|
+
|
84
|
+
# Check to see if the all the properties in the model are valid
|
85
|
+
# @return true if the model is valid
|
86
|
+
def valid?
|
87
|
+
return false if @sha.nil?
|
88
|
+
return false if @url.nil?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Checks equality by comparing each attribute.
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def ==(o)
|
95
|
+
return true if self.equal?(o)
|
96
|
+
self.class == o.class &&
|
97
|
+
sha == o.sha &&
|
98
|
+
url == o.url
|
99
|
+
end
|
100
|
+
|
101
|
+
# @see the `==` method
|
102
|
+
# @param [Object] Object to be compared
|
103
|
+
def eql?(o)
|
104
|
+
self == o
|
105
|
+
end
|
106
|
+
|
107
|
+
# Calculates hash code according to all attributes.
|
108
|
+
# @return [Integer] Hash code
|
109
|
+
def hash
|
110
|
+
[sha, url].hash
|
111
|
+
end
|
112
|
+
|
113
|
+
# Builds the object from hash
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
# @return [Object] Returns the model itself
|
116
|
+
def self.build_from_hash(attributes)
|
117
|
+
new.build_from_hash(attributes)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
123
|
+
def build_from_hash(attributes)
|
124
|
+
return nil unless attributes.is_a?(Hash)
|
125
|
+
attributes = attributes.transform_keys(&:to_sym)
|
126
|
+
self.class.openapi_types.each_pair do |key, type|
|
127
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
128
|
+
self.send("#{key}=", nil)
|
129
|
+
elsif type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :Time
|
150
|
+
Time.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :Boolean
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
# models (e.g. Pet) or oneOf
|
181
|
+
klass = Carbon.const_get(type)
|
182
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
if value.nil?
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
|
+
end
|
208
|
+
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
@@ -0,0 +1,234 @@
|
|
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 User
|
14
|
+
attr_accessor :id
|
15
|
+
|
16
|
+
attr_accessor :login
|
17
|
+
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
+
def self.attribute_map
|
20
|
+
{
|
21
|
+
:'id' => :'id',
|
22
|
+
:'login' => :'login'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns all the JSON keys this model knows about
|
27
|
+
def self.acceptable_attributes
|
28
|
+
attribute_map.values
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'id' => :'Integer',
|
35
|
+
:'login' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::User` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'id')
|
61
|
+
self.id = attributes[:'id']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'login')
|
65
|
+
self.login = attributes[:'login']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
if @id.nil?
|
74
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
75
|
+
end
|
76
|
+
|
77
|
+
if @login.nil?
|
78
|
+
invalid_properties.push('invalid value for "login", login cannot be nil.')
|
79
|
+
end
|
80
|
+
|
81
|
+
invalid_properties
|
82
|
+
end
|
83
|
+
|
84
|
+
# Check to see if the all the properties in the model are valid
|
85
|
+
# @return true if the model is valid
|
86
|
+
def valid?
|
87
|
+
return false if @id.nil?
|
88
|
+
return false if @login.nil?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Checks equality by comparing each attribute.
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def ==(o)
|
95
|
+
return true if self.equal?(o)
|
96
|
+
self.class == o.class &&
|
97
|
+
id == o.id &&
|
98
|
+
login == o.login
|
99
|
+
end
|
100
|
+
|
101
|
+
# @see the `==` method
|
102
|
+
# @param [Object] Object to be compared
|
103
|
+
def eql?(o)
|
104
|
+
self == o
|
105
|
+
end
|
106
|
+
|
107
|
+
# Calculates hash code according to all attributes.
|
108
|
+
# @return [Integer] Hash code
|
109
|
+
def hash
|
110
|
+
[id, login].hash
|
111
|
+
end
|
112
|
+
|
113
|
+
# Builds the object from hash
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
# @return [Object] Returns the model itself
|
116
|
+
def self.build_from_hash(attributes)
|
117
|
+
new.build_from_hash(attributes)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
123
|
+
def build_from_hash(attributes)
|
124
|
+
return nil unless attributes.is_a?(Hash)
|
125
|
+
attributes = attributes.transform_keys(&:to_sym)
|
126
|
+
self.class.openapi_types.each_pair do |key, type|
|
127
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
128
|
+
self.send("#{key}=", nil)
|
129
|
+
elsif type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :Time
|
150
|
+
Time.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :Boolean
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
# models (e.g. Pet) or oneOf
|
181
|
+
klass = Carbon.const_get(type)
|
182
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
if value.nil?
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
|
+
end
|
208
|
+
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
@@ -69,6 +69,8 @@ module Carbon
|
|
69
69
|
|
70
70
|
attr_accessor :request_id
|
71
71
|
|
72
|
+
attr_accessor :upload_id
|
73
|
+
|
72
74
|
attr_accessor :sync_properties
|
73
75
|
|
74
76
|
attr_accessor :messages_metadata
|
@@ -117,6 +119,7 @@ module Carbon
|
|
117
119
|
:'source_created_at' => :'source_created_at',
|
118
120
|
:'generate_sparse_vectors' => :'generate_sparse_vectors',
|
119
121
|
:'request_id' => :'request_id',
|
122
|
+
:'upload_id' => :'upload_id',
|
120
123
|
:'sync_properties' => :'sync_properties',
|
121
124
|
:'messages_metadata' => :'messages_metadata',
|
122
125
|
:'file_contents_deleted' => :'file_contents_deleted',
|
@@ -165,6 +168,7 @@ module Carbon
|
|
165
168
|
:'source_created_at' => :'Time',
|
166
169
|
:'generate_sparse_vectors' => :'Boolean',
|
167
170
|
:'request_id' => :'String',
|
171
|
+
:'upload_id' => :'String',
|
168
172
|
:'sync_properties' => :'Object',
|
169
173
|
:'messages_metadata' => :'Object',
|
170
174
|
:'file_contents_deleted' => :'Boolean',
|
@@ -200,6 +204,7 @@ module Carbon
|
|
200
204
|
:'source_created_at',
|
201
205
|
:'generate_sparse_vectors',
|
202
206
|
:'request_id',
|
207
|
+
:'upload_id',
|
203
208
|
:'hot_storage_time_to_live',
|
204
209
|
])
|
205
210
|
end
|
@@ -337,6 +342,10 @@ module Carbon
|
|
337
342
|
self.request_id = attributes[:'request_id']
|
338
343
|
end
|
339
344
|
|
345
|
+
if attributes.key?(:'upload_id')
|
346
|
+
self.upload_id = attributes[:'upload_id']
|
347
|
+
end
|
348
|
+
|
340
349
|
if attributes.key?(:'sync_properties')
|
341
350
|
self.sync_properties = attributes[:'sync_properties']
|
342
351
|
end
|
@@ -494,6 +503,7 @@ module Carbon
|
|
494
503
|
source_created_at == o.source_created_at &&
|
495
504
|
generate_sparse_vectors == o.generate_sparse_vectors &&
|
496
505
|
request_id == o.request_id &&
|
506
|
+
upload_id == o.upload_id &&
|
497
507
|
sync_properties == o.sync_properties &&
|
498
508
|
messages_metadata == o.messages_metadata &&
|
499
509
|
file_contents_deleted == o.file_contents_deleted &&
|
@@ -513,7 +523,7 @@ module Carbon
|
|
513
523
|
# Calculates hash code according to all attributes.
|
514
524
|
# @return [Integer] Hash code
|
515
525
|
def hash
|
516
|
-
[tags, id, source, organization_id, organization_supplied_user_id, organization_user_data_source_id, external_file_id, external_url, sync_status, sync_error_message, last_sync, file_statistics, file_metadata, embedding_properties, chunk_size, chunk_overlap, chunk_properties, ocr_properties, ocr_job_started_at, name, parent_id, enable_auto_sync, presigned_url, parsed_text_url, additional_presigned_urls, skip_embedding_generation, source_created_at, generate_sparse_vectors, request_id, sync_properties, messages_metadata, file_contents_deleted, supports_cold_storage, hot_storage_time_to_live, embedding_storage_status, created_at, updated_at].hash
|
526
|
+
[tags, id, source, organization_id, organization_supplied_user_id, organization_user_data_source_id, external_file_id, external_url, sync_status, sync_error_message, last_sync, file_statistics, file_metadata, embedding_properties, chunk_size, chunk_overlap, chunk_properties, ocr_properties, ocr_job_started_at, name, parent_id, enable_auto_sync, presigned_url, parsed_text_url, additional_presigned_urls, skip_embedding_generation, source_created_at, generate_sparse_vectors, request_id, upload_id, sync_properties, messages_metadata, file_contents_deleted, supports_cold_storage, hot_storage_time_to_live, embedding_storage_status, created_at, updated_at].hash
|
517
527
|
end
|
518
528
|
|
519
529
|
# Builds the object from hash
|