spartera_api_sdk 1.0.58

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 (87) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +11 -0
  3. data/Gemfile.lock +69 -0
  4. data/LICENSE +21 -0
  5. data/README.md +360 -0
  6. data/Rakefile +10 -0
  7. data/config.json +10 -0
  8. data/docs/APIKeysApi.md +353 -0
  9. data/docs/Alert.md +36 -0
  10. data/docs/AlertsApi.md +511 -0
  11. data/docs/Apikey.md +36 -0
  12. data/docs/Asset.md +110 -0
  13. data/docs/AssetPriceHistoryApi.md +573 -0
  14. data/docs/Assetpricehistory.md +38 -0
  15. data/docs/AssetsApi.md +1131 -0
  16. data/docs/CloudProvidersApi.md +341 -0
  17. data/docs/Cloudprovider.md +30 -0
  18. data/docs/CompaniesApi.md +619 -0
  19. data/docs/Company.md +44 -0
  20. data/docs/Connection.md +54 -0
  21. data/docs/ConnectionsApi.md +497 -0
  22. data/docs/Error.md +24 -0
  23. data/docs/Favorite.md +36 -0
  24. data/docs/FavoritesApi.md +581 -0
  25. data/docs/InlineObject.md +22 -0
  26. data/docs/InlineObject1.md +20 -0
  27. data/docs/InlineObject2.md +20 -0
  28. data/docs/InlineObject3.md +20 -0
  29. data/docs/User.md +34 -0
  30. data/docs/UsersApi.md +357 -0
  31. data/example.rb +51 -0
  32. data/git_push.sh +57 -0
  33. data/lib/spartera_api_sdk/api/alerts_api.rb +543 -0
  34. data/lib/spartera_api_sdk/api/api_keys_api.rb +345 -0
  35. data/lib/spartera_api_sdk/api/asset_price_history_api.rb +576 -0
  36. data/lib/spartera_api_sdk/api/assets_api.rb +1106 -0
  37. data/lib/spartera_api_sdk/api/cloud_providers_api.rb +315 -0
  38. data/lib/spartera_api_sdk/api/companies_api.rb +571 -0
  39. data/lib/spartera_api_sdk/api/connections_api.rb +501 -0
  40. data/lib/spartera_api_sdk/api/favorites_api.rb +610 -0
  41. data/lib/spartera_api_sdk/api/users_api.rb +367 -0
  42. data/lib/spartera_api_sdk/api_client.rb +393 -0
  43. data/lib/spartera_api_sdk/api_error.rb +58 -0
  44. data/lib/spartera_api_sdk/configuration.rb +320 -0
  45. data/lib/spartera_api_sdk/models/alert.rb +353 -0
  46. data/lib/spartera_api_sdk/models/apikey.rb +370 -0
  47. data/lib/spartera_api_sdk/models/asset.rb +686 -0
  48. data/lib/spartera_api_sdk/models/assetpricehistory.rb +345 -0
  49. data/lib/spartera_api_sdk/models/cloudprovider.rb +292 -0
  50. data/lib/spartera_api_sdk/models/company.rb +389 -0
  51. data/lib/spartera_api_sdk/models/connection.rb +434 -0
  52. data/lib/spartera_api_sdk/models/error.rb +285 -0
  53. data/lib/spartera_api_sdk/models/favorite.rb +353 -0
  54. data/lib/spartera_api_sdk/models/inline_object.rb +240 -0
  55. data/lib/spartera_api_sdk/models/inline_object1.rb +229 -0
  56. data/lib/spartera_api_sdk/models/inline_object2.rb +229 -0
  57. data/lib/spartera_api_sdk/models/inline_object3.rb +229 -0
  58. data/lib/spartera_api_sdk/models/user.rb +327 -0
  59. data/lib/spartera_api_sdk/version.rb +15 -0
  60. data/lib/spartera_api_sdk.rb +62 -0
  61. data/spartera_api_sdk.gemspec +28 -0
  62. data/spec/api/alerts_api_spec.rb +126 -0
  63. data/spec/api/api_keys_api_spec.rb +93 -0
  64. data/spec/api/asset_price_history_api_spec.rb +134 -0
  65. data/spec/api/assets_api_spec.rb +228 -0
  66. data/spec/api/cloud_providers_api_spec.rb +88 -0
  67. data/spec/api/companies_api_spec.rb +134 -0
  68. data/spec/api/connections_api_spec.rb +119 -0
  69. data/spec/api/favorites_api_spec.rb +138 -0
  70. data/spec/api/users_api_spec.rb +95 -0
  71. data/spec/models/alert_spec.rb +90 -0
  72. data/spec/models/apikey_spec.rb +90 -0
  73. data/spec/models/asset_spec.rb +312 -0
  74. data/spec/models/assetpricehistory_spec.rb +96 -0
  75. data/spec/models/cloudprovider_spec.rb +72 -0
  76. data/spec/models/company_spec.rb +114 -0
  77. data/spec/models/connection_spec.rb +144 -0
  78. data/spec/models/error_spec.rb +54 -0
  79. data/spec/models/favorite_spec.rb +90 -0
  80. data/spec/models/inline_object1_spec.rb +42 -0
  81. data/spec/models/inline_object2_spec.rb +42 -0
  82. data/spec/models/inline_object3_spec.rb +42 -0
  83. data/spec/models/inline_object_spec.rb +48 -0
  84. data/spec/models/user_spec.rb +84 -0
  85. data/spec/spec_helper.rb +111 -0
  86. data/test.sh +42 -0
  87. metadata +204 -0
@@ -0,0 +1,389 @@
1
+ =begin
2
+ #Spartera API Documentation
3
+
4
+ #Auto-generated API documentation for REST services of the Spartera platform
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+ Contact: support@spartera.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SparteraApiSdk
17
+ # All of our customer company entities
18
+ class Company
19
+ attr_accessor :company_id
20
+
21
+ attr_accessor :industry_id
22
+
23
+ attr_accessor :country_id
24
+
25
+ attr_accessor :company_name
26
+
27
+ attr_accessor :company_description
28
+
29
+ attr_accessor :company_handle
30
+
31
+ attr_accessor :company_domain
32
+
33
+ attr_accessor :credits_balance
34
+
35
+ attr_accessor :accepted_eula
36
+
37
+ attr_accessor :stripe_account_id
38
+
39
+ attr_accessor :stripe_account_status
40
+
41
+ attr_accessor :date_created
42
+
43
+ attr_accessor :last_updated
44
+
45
+ attr_accessor :active
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'company_id' => :'company_id',
51
+ :'industry_id' => :'industry_id',
52
+ :'country_id' => :'country_id',
53
+ :'company_name' => :'company_name',
54
+ :'company_description' => :'company_description',
55
+ :'company_handle' => :'company_handle',
56
+ :'company_domain' => :'company_domain',
57
+ :'credits_balance' => :'credits_balance',
58
+ :'accepted_eula' => :'accepted_eula',
59
+ :'stripe_account_id' => :'stripe_account_id',
60
+ :'stripe_account_status' => :'stripe_account_status',
61
+ :'date_created' => :'date_created',
62
+ :'last_updated' => :'last_updated',
63
+ :'active' => :'active'
64
+ }
65
+ end
66
+
67
+ # Returns attribute mapping this model knows about
68
+ def self.acceptable_attribute_map
69
+ attribute_map
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ acceptable_attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'company_id' => :'String',
81
+ :'industry_id' => :'String',
82
+ :'country_id' => :'String',
83
+ :'company_name' => :'String',
84
+ :'company_description' => :'String',
85
+ :'company_handle' => :'String',
86
+ :'company_domain' => :'String',
87
+ :'credits_balance' => :'String',
88
+ :'accepted_eula' => :'String',
89
+ :'stripe_account_id' => :'String',
90
+ :'stripe_account_status' => :'String',
91
+ :'date_created' => :'String',
92
+ :'last_updated' => :'String',
93
+ :'active' => :'String'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SparteraApiSdk::Company` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ acceptable_attribute_map = self.class.acceptable_attribute_map
112
+ attributes = attributes.each_with_object({}) { |(k, v), h|
113
+ if (!acceptable_attribute_map.key?(k.to_sym))
114
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SparteraApiSdk::Company`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
115
+ end
116
+ h[k.to_sym] = v
117
+ }
118
+
119
+ if attributes.key?(:'company_id')
120
+ self.company_id = attributes[:'company_id']
121
+ end
122
+
123
+ if attributes.key?(:'industry_id')
124
+ self.industry_id = attributes[:'industry_id']
125
+ end
126
+
127
+ if attributes.key?(:'country_id')
128
+ self.country_id = attributes[:'country_id']
129
+ end
130
+
131
+ if attributes.key?(:'company_name')
132
+ self.company_name = attributes[:'company_name']
133
+ end
134
+
135
+ if attributes.key?(:'company_description')
136
+ self.company_description = attributes[:'company_description']
137
+ end
138
+
139
+ if attributes.key?(:'company_handle')
140
+ self.company_handle = attributes[:'company_handle']
141
+ else
142
+ self.company_handle = nil
143
+ end
144
+
145
+ if attributes.key?(:'company_domain')
146
+ self.company_domain = attributes[:'company_domain']
147
+ else
148
+ self.company_domain = nil
149
+ end
150
+
151
+ if attributes.key?(:'credits_balance')
152
+ self.credits_balance = attributes[:'credits_balance']
153
+ else
154
+ self.credits_balance = nil
155
+ end
156
+
157
+ if attributes.key?(:'accepted_eula')
158
+ self.accepted_eula = attributes[:'accepted_eula']
159
+ end
160
+
161
+ if attributes.key?(:'stripe_account_id')
162
+ self.stripe_account_id = attributes[:'stripe_account_id']
163
+ end
164
+
165
+ if attributes.key?(:'stripe_account_status')
166
+ self.stripe_account_status = attributes[:'stripe_account_status']
167
+ end
168
+
169
+ if attributes.key?(:'date_created')
170
+ self.date_created = attributes[:'date_created']
171
+ end
172
+
173
+ if attributes.key?(:'last_updated')
174
+ self.last_updated = attributes[:'last_updated']
175
+ end
176
+
177
+ if attributes.key?(:'active')
178
+ self.active = attributes[:'active']
179
+ end
180
+ end
181
+
182
+ # Show invalid properties with the reasons. Usually used together with valid?
183
+ # @return Array for valid properties with the reasons
184
+ def list_invalid_properties
185
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
186
+ invalid_properties = Array.new
187
+ if @company_handle.nil?
188
+ invalid_properties.push('invalid value for "company_handle", company_handle cannot be nil.')
189
+ end
190
+
191
+ if @company_domain.nil?
192
+ invalid_properties.push('invalid value for "company_domain", company_domain cannot be nil.')
193
+ end
194
+
195
+ if @credits_balance.nil?
196
+ invalid_properties.push('invalid value for "credits_balance", credits_balance cannot be nil.')
197
+ end
198
+
199
+ invalid_properties
200
+ end
201
+
202
+ # Check to see if the all the properties in the model are valid
203
+ # @return true if the model is valid
204
+ def valid?
205
+ warn '[DEPRECATED] the `valid?` method is obsolete'
206
+ return false if @company_handle.nil?
207
+ return false if @company_domain.nil?
208
+ return false if @credits_balance.nil?
209
+ true
210
+ end
211
+
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] company_handle Value to be assigned
214
+ def company_handle=(company_handle)
215
+ if company_handle.nil?
216
+ fail ArgumentError, 'company_handle cannot be nil'
217
+ end
218
+
219
+ @company_handle = company_handle
220
+ end
221
+
222
+ # Custom attribute writer method with validation
223
+ # @param [Object] company_domain Value to be assigned
224
+ def company_domain=(company_domain)
225
+ if company_domain.nil?
226
+ fail ArgumentError, 'company_domain cannot be nil'
227
+ end
228
+
229
+ @company_domain = company_domain
230
+ end
231
+
232
+ # Custom attribute writer method with validation
233
+ # @param [Object] credits_balance Value to be assigned
234
+ def credits_balance=(credits_balance)
235
+ if credits_balance.nil?
236
+ fail ArgumentError, 'credits_balance cannot be nil'
237
+ end
238
+
239
+ @credits_balance = credits_balance
240
+ end
241
+
242
+ # Checks equality by comparing each attribute.
243
+ # @param [Object] Object to be compared
244
+ def ==(o)
245
+ return true if self.equal?(o)
246
+ self.class == o.class &&
247
+ company_id == o.company_id &&
248
+ industry_id == o.industry_id &&
249
+ country_id == o.country_id &&
250
+ company_name == o.company_name &&
251
+ company_description == o.company_description &&
252
+ company_handle == o.company_handle &&
253
+ company_domain == o.company_domain &&
254
+ credits_balance == o.credits_balance &&
255
+ accepted_eula == o.accepted_eula &&
256
+ stripe_account_id == o.stripe_account_id &&
257
+ stripe_account_status == o.stripe_account_status &&
258
+ date_created == o.date_created &&
259
+ last_updated == o.last_updated &&
260
+ active == o.active
261
+ end
262
+
263
+ # @see the `==` method
264
+ # @param [Object] Object to be compared
265
+ def eql?(o)
266
+ self == o
267
+ end
268
+
269
+ # Calculates hash code according to all attributes.
270
+ # @return [Integer] Hash code
271
+ def hash
272
+ [company_id, industry_id, country_id, company_name, company_description, company_handle, company_domain, credits_balance, accepted_eula, stripe_account_id, stripe_account_status, date_created, last_updated, active].hash
273
+ end
274
+
275
+ # Builds the object from hash
276
+ # @param [Hash] attributes Model attributes in the form of hash
277
+ # @return [Object] Returns the model itself
278
+ def self.build_from_hash(attributes)
279
+ return nil unless attributes.is_a?(Hash)
280
+ attributes = attributes.transform_keys(&:to_sym)
281
+ transformed_hash = {}
282
+ openapi_types.each_pair do |key, type|
283
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
284
+ transformed_hash["#{key}"] = nil
285
+ elsif type =~ /\AArray<(.*)>/i
286
+ # check to ensure the input is an array given that the attribute
287
+ # is documented as an array but the input is not
288
+ if attributes[attribute_map[key]].is_a?(Array)
289
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
290
+ end
291
+ elsif !attributes[attribute_map[key]].nil?
292
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
293
+ end
294
+ end
295
+ new(transformed_hash)
296
+ end
297
+
298
+ # Deserializes the data based on type
299
+ # @param string type Data type
300
+ # @param string value Value to be deserialized
301
+ # @return [Object] Deserialized data
302
+ def self._deserialize(type, value)
303
+ case type.to_sym
304
+ when :Time
305
+ Time.parse(value)
306
+ when :Date
307
+ Date.parse(value)
308
+ when :String
309
+ value.to_s
310
+ when :Integer
311
+ value.to_i
312
+ when :Float
313
+ value.to_f
314
+ when :Boolean
315
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
316
+ true
317
+ else
318
+ false
319
+ end
320
+ when :Object
321
+ # generic object (usually a Hash), return directly
322
+ value
323
+ when /\AArray<(?<inner_type>.+)>\z/
324
+ inner_type = Regexp.last_match[:inner_type]
325
+ value.map { |v| _deserialize(inner_type, v) }
326
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
327
+ k_type = Regexp.last_match[:k_type]
328
+ v_type = Regexp.last_match[:v_type]
329
+ {}.tap do |hash|
330
+ value.each do |k, v|
331
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
332
+ end
333
+ end
334
+ else # model
335
+ # models (e.g. Pet) or oneOf
336
+ klass = SparteraApiSdk.const_get(type)
337
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
338
+ end
339
+ end
340
+
341
+ # Returns the string representation of the object
342
+ # @return [String] String presentation of the object
343
+ def to_s
344
+ to_hash.to_s
345
+ end
346
+
347
+ # to_body is an alias to to_hash (backward compatibility)
348
+ # @return [Hash] Returns the object in the form of hash
349
+ def to_body
350
+ to_hash
351
+ end
352
+
353
+ # Returns the object in the form of hash
354
+ # @return [Hash] Returns the object in the form of hash
355
+ def to_hash
356
+ hash = {}
357
+ self.class.attribute_map.each_pair do |attr, param|
358
+ value = self.send(attr)
359
+ if value.nil?
360
+ is_nullable = self.class.openapi_nullable.include?(attr)
361
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
362
+ end
363
+
364
+ hash[param] = _to_hash(value)
365
+ end
366
+ hash
367
+ end
368
+
369
+ # Outputs non-array value in the form of hash
370
+ # For object, use to_hash. Otherwise, just return the value
371
+ # @param [Object] value Any valid value
372
+ # @return [Hash] Returns the value in the form of hash
373
+ def _to_hash(value)
374
+ if value.is_a?(Array)
375
+ value.compact.map { |v| _to_hash(v) }
376
+ elsif value.is_a?(Hash)
377
+ {}.tap do |hash|
378
+ value.each { |k, v| hash[k] = _to_hash(v) }
379
+ end
380
+ elsif value.respond_to? :to_hash
381
+ value.to_hash
382
+ else
383
+ value
384
+ end
385
+ end
386
+
387
+ end
388
+
389
+ end