carbon_ruby_sdk 0.2.35 → 0.2.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +335 -2
  4. data/lib/carbon_ruby_sdk/api/crm_api.rb +909 -0
  5. data/lib/carbon_ruby_sdk/models/account.rb +398 -0
  6. data/lib/carbon_ruby_sdk/models/account_filters.rb +226 -0
  7. data/lib/carbon_ruby_sdk/models/account_response.rb +246 -0
  8. data/lib/carbon_ruby_sdk/models/accounts_order_by.rb +39 -0
  9. data/lib/carbon_ruby_sdk/models/accounts_order_by_nullable.rb +39 -0
  10. data/lib/carbon_ruby_sdk/models/accounts_request.rb +293 -0
  11. data/lib/carbon_ruby_sdk/models/address.rb +276 -0
  12. data/lib/carbon_ruby_sdk/models/base_includes.rb +36 -0
  13. data/lib/carbon_ruby_sdk/models/contact.rb +434 -0
  14. data/lib/carbon_ruby_sdk/models/contact_filters.rb +236 -0
  15. data/lib/carbon_ruby_sdk/models/contacts_order_by.rb +39 -0
  16. data/lib/carbon_ruby_sdk/models/contacts_order_by_nullable.rb +39 -0
  17. data/lib/carbon_ruby_sdk/models/contacts_request.rb +293 -0
  18. data/lib/carbon_ruby_sdk/models/contacts_response.rb +246 -0
  19. data/lib/carbon_ruby_sdk/models/data_source_type.rb +2 -1
  20. data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +2 -1
  21. data/lib/carbon_ruby_sdk/models/email.rb +230 -0
  22. data/lib/carbon_ruby_sdk/models/event.rb +370 -0
  23. data/lib/carbon_ruby_sdk/models/file_formats.rb +2 -1
  24. data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +2 -1
  25. data/lib/carbon_ruby_sdk/models/lead.rb +468 -0
  26. data/lib/carbon_ruby_sdk/models/lead_filters.rb +246 -0
  27. data/lib/carbon_ruby_sdk/models/leads_order_by.rb +38 -0
  28. data/lib/carbon_ruby_sdk/models/leads_order_by_nullable.rb +38 -0
  29. data/lib/carbon_ruby_sdk/models/leads_request.rb +293 -0
  30. data/lib/carbon_ruby_sdk/models/leads_response.rb +246 -0
  31. data/lib/carbon_ruby_sdk/models/opportunities_order_by.rb +40 -0
  32. data/lib/carbon_ruby_sdk/models/opportunities_order_by_nullable.rb +40 -0
  33. data/lib/carbon_ruby_sdk/models/opportunities_request.rb +293 -0
  34. data/lib/carbon_ruby_sdk/models/opportunities_response.rb +246 -0
  35. data/lib/carbon_ruby_sdk/models/opportunity.rb +400 -0
  36. data/lib/carbon_ruby_sdk/models/opportunity_filters.rb +246 -0
  37. data/lib/carbon_ruby_sdk/models/opportunity_status.rb +36 -0
  38. data/lib/carbon_ruby_sdk/models/opportunity_status_nullable.rb +36 -0
  39. data/lib/carbon_ruby_sdk/models/order_dir_v2_nullable.rb +36 -0
  40. data/lib/carbon_ruby_sdk/models/partial_account.rb +216 -0
  41. data/lib/carbon_ruby_sdk/models/partial_account_nullable.rb +216 -0
  42. data/lib/carbon_ruby_sdk/models/partial_contact.rb +216 -0
  43. data/lib/carbon_ruby_sdk/models/partial_contact_nullable.rb +216 -0
  44. data/lib/carbon_ruby_sdk/models/partial_owner.rb +216 -0
  45. data/lib/carbon_ruby_sdk/models/partial_owner_nullable.rb +216 -0
  46. data/lib/carbon_ruby_sdk/models/phone_number.rb +230 -0
  47. data/lib/carbon_ruby_sdk/models/sent_webhook_payload.rb +2 -2
  48. data/lib/carbon_ruby_sdk/models/task.rb +346 -0
  49. data/lib/carbon_ruby_sdk/version.rb +1 -1
  50. data/lib/carbon_ruby_sdk.rb +42 -0
  51. data/spec/api/crm_api_spec.rb +129 -0
  52. data/spec/models/account_filters_spec.rb +34 -0
  53. data/spec/models/account_response_spec.rb +40 -0
  54. data/spec/models/account_spec.rb +118 -0
  55. data/spec/models/accounts_order_by_nullable_spec.rb +22 -0
  56. data/spec/models/accounts_order_by_spec.rb +22 -0
  57. data/spec/models/accounts_request_spec.rb +70 -0
  58. data/spec/models/address_spec.rb +64 -0
  59. data/spec/models/base_includes_spec.rb +22 -0
  60. data/spec/models/contact_filters_spec.rb +40 -0
  61. data/spec/models/contact_spec.rb +136 -0
  62. data/spec/models/contacts_order_by_nullable_spec.rb +22 -0
  63. data/spec/models/contacts_order_by_spec.rb +22 -0
  64. data/spec/models/contacts_request_spec.rb +70 -0
  65. data/spec/models/contacts_response_spec.rb +40 -0
  66. data/spec/models/email_spec.rb +34 -0
  67. data/spec/models/event_spec.rb +106 -0
  68. data/spec/models/lead_filters_spec.rb +46 -0
  69. data/spec/models/lead_spec.rb +154 -0
  70. data/spec/models/leads_order_by_nullable_spec.rb +22 -0
  71. data/spec/models/leads_order_by_spec.rb +22 -0
  72. data/spec/models/leads_request_spec.rb +70 -0
  73. data/spec/models/leads_response_spec.rb +40 -0
  74. data/spec/models/opportunities_order_by_nullable_spec.rb +22 -0
  75. data/spec/models/opportunities_order_by_spec.rb +22 -0
  76. data/spec/models/opportunities_request_spec.rb +70 -0
  77. data/spec/models/opportunities_response_spec.rb +40 -0
  78. data/spec/models/opportunity_filters_spec.rb +46 -0
  79. data/spec/models/opportunity_spec.rb +124 -0
  80. data/spec/models/opportunity_status_nullable_spec.rb +22 -0
  81. data/spec/models/opportunity_status_spec.rb +22 -0
  82. data/spec/models/order_dir_v2_nullable_spec.rb +22 -0
  83. data/spec/models/partial_account_nullable_spec.rb +28 -0
  84. data/spec/models/partial_account_spec.rb +28 -0
  85. data/spec/models/partial_contact_nullable_spec.rb +28 -0
  86. data/spec/models/partial_contact_spec.rb +28 -0
  87. data/spec/models/partial_owner_nullable_spec.rb +28 -0
  88. data/spec/models/partial_owner_spec.rb +28 -0
  89. data/spec/models/phone_number_spec.rb +34 -0
  90. data/spec/models/sent_webhook_payload_spec.rb +1 -1
  91. data/spec/models/task_spec.rb +94 -0
  92. metadata +122 -2
@@ -0,0 +1,276 @@
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 Address
14
+ attr_accessor :street_1
15
+
16
+ attr_accessor :street_2
17
+
18
+ attr_accessor :city
19
+
20
+ attr_accessor :state
21
+
22
+ attr_accessor :postal_code
23
+
24
+ attr_accessor :country
25
+
26
+ attr_accessor :address_type
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'street_1' => :'street_1',
32
+ :'street_2' => :'street_2',
33
+ :'city' => :'city',
34
+ :'state' => :'state',
35
+ :'postal_code' => :'postal_code',
36
+ :'country' => :'country',
37
+ :'address_type' => :'address_type'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'street_1' => :'String',
50
+ :'street_2' => :'String',
51
+ :'city' => :'String',
52
+ :'state' => :'String',
53
+ :'postal_code' => :'String',
54
+ :'country' => :'String',
55
+ :'address_type' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ :'street_1',
63
+ :'street_2',
64
+ :'city',
65
+ :'state',
66
+ :'postal_code',
67
+ :'country',
68
+ :'address_type'
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::Address` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'street_1')
88
+ self.street_1 = attributes[:'street_1']
89
+ end
90
+
91
+ if attributes.key?(:'street_2')
92
+ self.street_2 = attributes[:'street_2']
93
+ end
94
+
95
+ if attributes.key?(:'city')
96
+ self.city = attributes[:'city']
97
+ end
98
+
99
+ if attributes.key?(:'state')
100
+ self.state = attributes[:'state']
101
+ end
102
+
103
+ if attributes.key?(:'postal_code')
104
+ self.postal_code = attributes[:'postal_code']
105
+ end
106
+
107
+ if attributes.key?(:'country')
108
+ self.country = attributes[:'country']
109
+ end
110
+
111
+ if attributes.key?(:'address_type')
112
+ self.address_type = attributes[:'address_type']
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ invalid_properties = Array.new
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ true
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ street_1 == o.street_1 &&
135
+ street_2 == o.street_2 &&
136
+ city == o.city &&
137
+ state == o.state &&
138
+ postal_code == o.postal_code &&
139
+ country == o.country &&
140
+ address_type == o.address_type
141
+ end
142
+
143
+ # @see the `==` method
144
+ # @param [Object] Object to be compared
145
+ def eql?(o)
146
+ self == o
147
+ end
148
+
149
+ # Calculates hash code according to all attributes.
150
+ # @return [Integer] Hash code
151
+ def hash
152
+ [street_1, street_2, city, state, postal_code, country, address_type].hash
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def self.build_from_hash(attributes)
159
+ new.build_from_hash(attributes)
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def build_from_hash(attributes)
166
+ return nil unless attributes.is_a?(Hash)
167
+ attributes = attributes.transform_keys(&:to_sym)
168
+ self.class.openapi_types.each_pair do |key, type|
169
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
170
+ self.send("#{key}=", nil)
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
179
+ end
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ # Deserializes the data based on type
186
+ # @param string type Data type
187
+ # @param string value Value to be deserialized
188
+ # @return [Object] Deserialized data
189
+ def _deserialize(type, value)
190
+ case type.to_sym
191
+ when :Time
192
+ Time.parse(value)
193
+ when :Date
194
+ Date.parse(value)
195
+ when :String
196
+ value.to_s
197
+ when :Integer
198
+ value.to_i
199
+ when :Float
200
+ value.to_f
201
+ when :Boolean
202
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
+ true
204
+ else
205
+ false
206
+ end
207
+ when :Object
208
+ # generic object (usually a Hash), return directly
209
+ value
210
+ when /\AArray<(?<inner_type>.+)>\z/
211
+ inner_type = Regexp.last_match[:inner_type]
212
+ value.map { |v| _deserialize(inner_type, v) }
213
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
+ k_type = Regexp.last_match[:k_type]
215
+ v_type = Regexp.last_match[:v_type]
216
+ {}.tap do |hash|
217
+ value.each do |k, v|
218
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
+ end
220
+ end
221
+ else # model
222
+ # models (e.g. Pet) or oneOf
223
+ klass = Carbon.const_get(type)
224
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
225
+ end
226
+ end
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # to_body is an alias to to_hash (backward compatibility)
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_body
237
+ to_hash
238
+ end
239
+
240
+ # Returns the object in the form of hash
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_hash
243
+ hash = {}
244
+ self.class.attribute_map.each_pair do |attr, param|
245
+ value = self.send(attr)
246
+ if value.nil?
247
+ is_nullable = self.class.openapi_nullable.include?(attr)
248
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
249
+ end
250
+
251
+ hash[param] = _to_hash(value)
252
+ end
253
+ hash
254
+ end
255
+
256
+ # Outputs non-array value in the form of hash
257
+ # For object, use to_hash. Otherwise, just return the value
258
+ # @param [Object] value Any valid value
259
+ # @return [Hash] Returns the value in the form of hash
260
+ def _to_hash(value)
261
+ if value.is_a?(Array)
262
+ value.compact.map { |v| _to_hash(v) }
263
+ elsif value.is_a?(Hash)
264
+ {}.tap do |hash|
265
+ value.each { |k, v| hash[k] = _to_hash(v) }
266
+ end
267
+ elsif value.respond_to? :to_hash
268
+ value.to_hash
269
+ else
270
+ value
271
+ end
272
+ end
273
+
274
+ end
275
+
276
+ end
@@ -0,0 +1,36 @@
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 BaseIncludes
14
+ TASKS = "Tasks".freeze
15
+ EVENTS = "Events".freeze
16
+
17
+ def self.all_vars
18
+ @all_vars ||= [TASKS, EVENTS].freeze
19
+ end
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ return value if BaseIncludes.all_vars.include?(value)
33
+ raise "Invalid ENUM value #{value} for class #BaseIncludes"
34
+ end
35
+ end
36
+ end