carbon_ruby_sdk 0.2.34 → 0.2.36
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 +460 -2
- data/lib/carbon_ruby_sdk/api/crm_api.rb +909 -0
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +298 -0
- data/lib/carbon_ruby_sdk/models/account.rb +398 -0
- data/lib/carbon_ruby_sdk/models/account_filters.rb +226 -0
- data/lib/carbon_ruby_sdk/models/account_response.rb +246 -0
- data/lib/carbon_ruby_sdk/models/accounts_order_by.rb +39 -0
- data/lib/carbon_ruby_sdk/models/accounts_order_by_nullable.rb +39 -0
- data/lib/carbon_ruby_sdk/models/accounts_request.rb +293 -0
- data/lib/carbon_ruby_sdk/models/address.rb +276 -0
- data/lib/carbon_ruby_sdk/models/authentication_property.rb +32 -6
- data/lib/carbon_ruby_sdk/models/azure_blob_auth_request.rb +245 -0
- data/lib/carbon_ruby_sdk/models/azure_blob_file_sync_input.rb +379 -0
- data/lib/carbon_ruby_sdk/models/azure_blob_get_file_input.rb +226 -0
- data/lib/carbon_ruby_sdk/models/azure_blob_storage_authentication.rb +244 -0
- data/lib/carbon_ruby_sdk/models/base_includes.rb +36 -0
- data/lib/carbon_ruby_sdk/models/contact.rb +434 -0
- data/lib/carbon_ruby_sdk/models/contact_filters.rb +236 -0
- data/lib/carbon_ruby_sdk/models/contacts_order_by.rb +39 -0
- data/lib/carbon_ruby_sdk/models/contacts_order_by_nullable.rb +39 -0
- data/lib/carbon_ruby_sdk/models/contacts_request.rb +293 -0
- data/lib/carbon_ruby_sdk/models/contacts_response.rb +246 -0
- 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/email.rb +230 -0
- data/lib/carbon_ruby_sdk/models/event.rb +370 -0
- data/lib/carbon_ruby_sdk/models/lead.rb +468 -0
- data/lib/carbon_ruby_sdk/models/lead_filters.rb +246 -0
- data/lib/carbon_ruby_sdk/models/leads_order_by.rb +38 -0
- data/lib/carbon_ruby_sdk/models/leads_order_by_nullable.rb +38 -0
- data/lib/carbon_ruby_sdk/models/leads_request.rb +293 -0
- data/lib/carbon_ruby_sdk/models/leads_response.rb +246 -0
- data/lib/carbon_ruby_sdk/models/one_drive_authentication.rb +250 -0
- data/lib/carbon_ruby_sdk/models/opportunities_order_by.rb +40 -0
- data/lib/carbon_ruby_sdk/models/opportunities_order_by_nullable.rb +40 -0
- data/lib/carbon_ruby_sdk/models/opportunities_request.rb +293 -0
- data/lib/carbon_ruby_sdk/models/opportunities_response.rb +246 -0
- data/lib/carbon_ruby_sdk/models/opportunity.rb +400 -0
- data/lib/carbon_ruby_sdk/models/opportunity_filters.rb +246 -0
- data/lib/carbon_ruby_sdk/models/opportunity_status.rb +36 -0
- data/lib/carbon_ruby_sdk/models/opportunity_status_nullable.rb +36 -0
- data/lib/carbon_ruby_sdk/models/order_dir_v2_nullable.rb +36 -0
- data/lib/carbon_ruby_sdk/models/partial_account.rb +216 -0
- data/lib/carbon_ruby_sdk/models/partial_account_nullable.rb +216 -0
- data/lib/carbon_ruby_sdk/models/partial_contact.rb +216 -0
- data/lib/carbon_ruby_sdk/models/partial_contact_nullable.rb +216 -0
- data/lib/carbon_ruby_sdk/models/partial_owner.rb +216 -0
- data/lib/carbon_ruby_sdk/models/partial_owner_nullable.rb +216 -0
- data/lib/carbon_ruby_sdk/models/phone_number.rb +230 -0
- data/lib/carbon_ruby_sdk/models/sent_webhook_payload.rb +2 -2
- data/lib/carbon_ruby_sdk/models/sharepoint_authentication.rb +1 -5
- data/lib/carbon_ruby_sdk/models/task.rb +346 -0
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +47 -0
- data/spec/api/crm_api_spec.rb +129 -0
- data/spec/api/integrations_api_spec.rb +24 -0
- data/spec/models/account_filters_spec.rb +34 -0
- data/spec/models/account_response_spec.rb +40 -0
- data/spec/models/account_spec.rb +118 -0
- data/spec/models/accounts_order_by_nullable_spec.rb +22 -0
- data/spec/models/accounts_order_by_spec.rb +22 -0
- data/spec/models/accounts_request_spec.rb +70 -0
- data/spec/models/address_spec.rb +64 -0
- data/spec/models/authentication_property_spec.rb +12 -0
- data/spec/models/azure_blob_auth_request_spec.rb +40 -0
- data/spec/models/azure_blob_file_sync_input_spec.rb +112 -0
- data/spec/models/azure_blob_get_file_input_spec.rb +34 -0
- data/spec/models/azure_blob_storage_authentication_spec.rb +40 -0
- data/spec/models/base_includes_spec.rb +22 -0
- data/spec/models/contact_filters_spec.rb +40 -0
- data/spec/models/contact_spec.rb +136 -0
- data/spec/models/contacts_order_by_nullable_spec.rb +22 -0
- data/spec/models/contacts_order_by_spec.rb +22 -0
- data/spec/models/contacts_request_spec.rb +70 -0
- data/spec/models/contacts_response_spec.rb +40 -0
- data/spec/models/email_spec.rb +34 -0
- data/spec/models/event_spec.rb +106 -0
- data/spec/models/lead_filters_spec.rb +46 -0
- data/spec/models/lead_spec.rb +154 -0
- data/spec/models/leads_order_by_nullable_spec.rb +22 -0
- data/spec/models/leads_order_by_spec.rb +22 -0
- data/spec/models/leads_request_spec.rb +70 -0
- data/spec/models/leads_response_spec.rb +40 -0
- data/spec/models/one_drive_authentication_spec.rb +46 -0
- data/spec/models/opportunities_order_by_nullable_spec.rb +22 -0
- data/spec/models/opportunities_order_by_spec.rb +22 -0
- data/spec/models/opportunities_request_spec.rb +70 -0
- data/spec/models/opportunities_response_spec.rb +40 -0
- data/spec/models/opportunity_filters_spec.rb +46 -0
- data/spec/models/opportunity_spec.rb +124 -0
- data/spec/models/opportunity_status_nullable_spec.rb +22 -0
- data/spec/models/opportunity_status_spec.rb +22 -0
- data/spec/models/order_dir_v2_nullable_spec.rb +22 -0
- data/spec/models/partial_account_nullable_spec.rb +28 -0
- data/spec/models/partial_account_spec.rb +28 -0
- data/spec/models/partial_contact_nullable_spec.rb +28 -0
- data/spec/models/partial_contact_spec.rb +28 -0
- data/spec/models/partial_owner_nullable_spec.rb +28 -0
- data/spec/models/partial_owner_spec.rb +28 -0
- data/spec/models/phone_number_spec.rb +34 -0
- data/spec/models/sent_webhook_payload_spec.rb +1 -1
- data/spec/models/task_spec.rb +94 -0
- metadata +137 -2
@@ -0,0 +1,370 @@
|
|
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 Event
|
14
|
+
attr_accessor :description
|
15
|
+
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
attr_accessor :owner
|
19
|
+
|
20
|
+
attr_accessor :subject
|
21
|
+
|
22
|
+
attr_accessor :location
|
23
|
+
|
24
|
+
attr_accessor :is_all_day
|
25
|
+
|
26
|
+
attr_accessor :start_date
|
27
|
+
|
28
|
+
attr_accessor :end_date
|
29
|
+
|
30
|
+
attr_accessor :account
|
31
|
+
|
32
|
+
attr_accessor :contact
|
33
|
+
|
34
|
+
attr_accessor :created_at
|
35
|
+
|
36
|
+
attr_accessor :updated_at
|
37
|
+
|
38
|
+
attr_accessor :is_deleted
|
39
|
+
|
40
|
+
attr_accessor :remote_data
|
41
|
+
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
|
+
def self.attribute_map
|
44
|
+
{
|
45
|
+
:'description' => :'description',
|
46
|
+
:'id' => :'id',
|
47
|
+
:'owner' => :'owner',
|
48
|
+
:'subject' => :'subject',
|
49
|
+
:'location' => :'location',
|
50
|
+
:'is_all_day' => :'is_all_day',
|
51
|
+
:'start_date' => :'start_date',
|
52
|
+
:'end_date' => :'end_date',
|
53
|
+
:'account' => :'account',
|
54
|
+
:'contact' => :'contact',
|
55
|
+
:'created_at' => :'created_at',
|
56
|
+
:'updated_at' => :'updated_at',
|
57
|
+
:'is_deleted' => :'is_deleted',
|
58
|
+
:'remote_data' => :'remote_data'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Returns all the JSON keys this model knows about
|
63
|
+
def self.acceptable_attributes
|
64
|
+
attribute_map.values
|
65
|
+
end
|
66
|
+
|
67
|
+
# Attribute type mapping.
|
68
|
+
def self.openapi_types
|
69
|
+
{
|
70
|
+
:'description' => :'String',
|
71
|
+
:'id' => :'String',
|
72
|
+
:'owner' => :'PartialOwner',
|
73
|
+
:'subject' => :'String',
|
74
|
+
:'location' => :'String',
|
75
|
+
:'is_all_day' => :'Boolean',
|
76
|
+
:'start_date' => :'String',
|
77
|
+
:'end_date' => :'String',
|
78
|
+
:'account' => :'PartialAccountNullable',
|
79
|
+
:'contact' => :'PartialContactNullable',
|
80
|
+
:'created_at' => :'String',
|
81
|
+
:'updated_at' => :'String',
|
82
|
+
:'is_deleted' => :'Boolean',
|
83
|
+
:'remote_data' => :'Object'
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
# List of attributes with nullable: true
|
88
|
+
def self.openapi_nullable
|
89
|
+
Set.new([
|
90
|
+
:'description',
|
91
|
+
:'subject',
|
92
|
+
:'location',
|
93
|
+
:'start_date',
|
94
|
+
:'end_date',
|
95
|
+
:'account',
|
96
|
+
:'contact',
|
97
|
+
:'remote_data'
|
98
|
+
])
|
99
|
+
end
|
100
|
+
|
101
|
+
# Initializes the object
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
def initialize(attributes = {})
|
104
|
+
if (!attributes.is_a?(Hash))
|
105
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::Event` initialize method"
|
106
|
+
end
|
107
|
+
|
108
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
109
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
110
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
111
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::Event`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
112
|
+
end
|
113
|
+
h[k.to_sym] = v
|
114
|
+
}
|
115
|
+
|
116
|
+
if attributes.key?(:'description')
|
117
|
+
self.description = attributes[:'description']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'id')
|
121
|
+
self.id = attributes[:'id']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'owner')
|
125
|
+
self.owner = attributes[:'owner']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'subject')
|
129
|
+
self.subject = attributes[:'subject']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'location')
|
133
|
+
self.location = attributes[:'location']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'is_all_day')
|
137
|
+
self.is_all_day = attributes[:'is_all_day']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'start_date')
|
141
|
+
self.start_date = attributes[:'start_date']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'end_date')
|
145
|
+
self.end_date = attributes[:'end_date']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'account')
|
149
|
+
self.account = attributes[:'account']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'contact')
|
153
|
+
self.contact = attributes[:'contact']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'created_at')
|
157
|
+
self.created_at = attributes[:'created_at']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'updated_at')
|
161
|
+
self.updated_at = attributes[:'updated_at']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'is_deleted')
|
165
|
+
self.is_deleted = attributes[:'is_deleted']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'remote_data')
|
169
|
+
self.remote_data = attributes[:'remote_data']
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
174
|
+
# @return Array for valid properties with the reasons
|
175
|
+
def list_invalid_properties
|
176
|
+
invalid_properties = Array.new
|
177
|
+
if @id.nil?
|
178
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
179
|
+
end
|
180
|
+
|
181
|
+
if @owner.nil?
|
182
|
+
invalid_properties.push('invalid value for "owner", owner cannot be nil.')
|
183
|
+
end
|
184
|
+
|
185
|
+
if @is_all_day.nil?
|
186
|
+
invalid_properties.push('invalid value for "is_all_day", is_all_day cannot be nil.')
|
187
|
+
end
|
188
|
+
|
189
|
+
if @created_at.nil?
|
190
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
191
|
+
end
|
192
|
+
|
193
|
+
if @updated_at.nil?
|
194
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
195
|
+
end
|
196
|
+
|
197
|
+
if @is_deleted.nil?
|
198
|
+
invalid_properties.push('invalid value for "is_deleted", is_deleted cannot be nil.')
|
199
|
+
end
|
200
|
+
|
201
|
+
invalid_properties
|
202
|
+
end
|
203
|
+
|
204
|
+
# Check to see if the all the properties in the model are valid
|
205
|
+
# @return true if the model is valid
|
206
|
+
def valid?
|
207
|
+
return false if @id.nil?
|
208
|
+
return false if @owner.nil?
|
209
|
+
return false if @is_all_day.nil?
|
210
|
+
return false if @created_at.nil?
|
211
|
+
return false if @updated_at.nil?
|
212
|
+
return false if @is_deleted.nil?
|
213
|
+
true
|
214
|
+
end
|
215
|
+
|
216
|
+
# Checks equality by comparing each attribute.
|
217
|
+
# @param [Object] Object to be compared
|
218
|
+
def ==(o)
|
219
|
+
return true if self.equal?(o)
|
220
|
+
self.class == o.class &&
|
221
|
+
description == o.description &&
|
222
|
+
id == o.id &&
|
223
|
+
owner == o.owner &&
|
224
|
+
subject == o.subject &&
|
225
|
+
location == o.location &&
|
226
|
+
is_all_day == o.is_all_day &&
|
227
|
+
start_date == o.start_date &&
|
228
|
+
end_date == o.end_date &&
|
229
|
+
account == o.account &&
|
230
|
+
contact == o.contact &&
|
231
|
+
created_at == o.created_at &&
|
232
|
+
updated_at == o.updated_at &&
|
233
|
+
is_deleted == o.is_deleted &&
|
234
|
+
remote_data == o.remote_data
|
235
|
+
end
|
236
|
+
|
237
|
+
# @see the `==` method
|
238
|
+
# @param [Object] Object to be compared
|
239
|
+
def eql?(o)
|
240
|
+
self == o
|
241
|
+
end
|
242
|
+
|
243
|
+
# Calculates hash code according to all attributes.
|
244
|
+
# @return [Integer] Hash code
|
245
|
+
def hash
|
246
|
+
[description, id, owner, subject, location, is_all_day, start_date, end_date, account, contact, created_at, updated_at, is_deleted, remote_data].hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Builds the object from hash
|
250
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
251
|
+
# @return [Object] Returns the model itself
|
252
|
+
def self.build_from_hash(attributes)
|
253
|
+
new.build_from_hash(attributes)
|
254
|
+
end
|
255
|
+
|
256
|
+
# Builds the object from hash
|
257
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
258
|
+
# @return [Object] Returns the model itself
|
259
|
+
def build_from_hash(attributes)
|
260
|
+
return nil unless attributes.is_a?(Hash)
|
261
|
+
attributes = attributes.transform_keys(&:to_sym)
|
262
|
+
self.class.openapi_types.each_pair do |key, type|
|
263
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
264
|
+
self.send("#{key}=", nil)
|
265
|
+
elsif type =~ /\AArray<(.*)>/i
|
266
|
+
# check to ensure the input is an array given that the attribute
|
267
|
+
# is documented as an array but the input is not
|
268
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
269
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
270
|
+
end
|
271
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
272
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
self
|
277
|
+
end
|
278
|
+
|
279
|
+
# Deserializes the data based on type
|
280
|
+
# @param string type Data type
|
281
|
+
# @param string value Value to be deserialized
|
282
|
+
# @return [Object] Deserialized data
|
283
|
+
def _deserialize(type, value)
|
284
|
+
case type.to_sym
|
285
|
+
when :Time
|
286
|
+
Time.parse(value)
|
287
|
+
when :Date
|
288
|
+
Date.parse(value)
|
289
|
+
when :String
|
290
|
+
value.to_s
|
291
|
+
when :Integer
|
292
|
+
value.to_i
|
293
|
+
when :Float
|
294
|
+
value.to_f
|
295
|
+
when :Boolean
|
296
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
297
|
+
true
|
298
|
+
else
|
299
|
+
false
|
300
|
+
end
|
301
|
+
when :Object
|
302
|
+
# generic object (usually a Hash), return directly
|
303
|
+
value
|
304
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
305
|
+
inner_type = Regexp.last_match[:inner_type]
|
306
|
+
value.map { |v| _deserialize(inner_type, v) }
|
307
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
308
|
+
k_type = Regexp.last_match[:k_type]
|
309
|
+
v_type = Regexp.last_match[:v_type]
|
310
|
+
{}.tap do |hash|
|
311
|
+
value.each do |k, v|
|
312
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
313
|
+
end
|
314
|
+
end
|
315
|
+
else # model
|
316
|
+
# models (e.g. Pet) or oneOf
|
317
|
+
klass = Carbon.const_get(type)
|
318
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
# Returns the string representation of the object
|
323
|
+
# @return [String] String presentation of the object
|
324
|
+
def to_s
|
325
|
+
to_hash.to_s
|
326
|
+
end
|
327
|
+
|
328
|
+
# to_body is an alias to to_hash (backward compatibility)
|
329
|
+
# @return [Hash] Returns the object in the form of hash
|
330
|
+
def to_body
|
331
|
+
to_hash
|
332
|
+
end
|
333
|
+
|
334
|
+
# Returns the object in the form of hash
|
335
|
+
# @return [Hash] Returns the object in the form of hash
|
336
|
+
def to_hash
|
337
|
+
hash = {}
|
338
|
+
self.class.attribute_map.each_pair do |attr, param|
|
339
|
+
value = self.send(attr)
|
340
|
+
if value.nil?
|
341
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
342
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
343
|
+
end
|
344
|
+
|
345
|
+
hash[param] = _to_hash(value)
|
346
|
+
end
|
347
|
+
hash
|
348
|
+
end
|
349
|
+
|
350
|
+
# Outputs non-array value in the form of hash
|
351
|
+
# For object, use to_hash. Otherwise, just return the value
|
352
|
+
# @param [Object] value Any valid value
|
353
|
+
# @return [Hash] Returns the value in the form of hash
|
354
|
+
def _to_hash(value)
|
355
|
+
if value.is_a?(Array)
|
356
|
+
value.compact.map { |v| _to_hash(v) }
|
357
|
+
elsif value.is_a?(Hash)
|
358
|
+
{}.tap do |hash|
|
359
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
360
|
+
end
|
361
|
+
elsif value.respond_to? :to_hash
|
362
|
+
value.to_hash
|
363
|
+
else
|
364
|
+
value
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
end
|
369
|
+
|
370
|
+
end
|