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,370 @@
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
+ # API Keys model storing every key created
18
+ class Apikey
19
+ attr_accessor :api_key_id
20
+
21
+ attr_accessor :user_id
22
+
23
+ attr_accessor :company_id
24
+
25
+ attr_accessor :role_id
26
+
27
+ attr_accessor :token
28
+
29
+ attr_accessor :name
30
+
31
+ attr_accessor :expiration_date_utc
32
+
33
+ attr_accessor :date_created
34
+
35
+ attr_accessor :last_updated
36
+
37
+ attr_accessor :active
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'api_key_id' => :'api_key_id',
43
+ :'user_id' => :'user_id',
44
+ :'company_id' => :'company_id',
45
+ :'role_id' => :'role_id',
46
+ :'token' => :'token',
47
+ :'name' => :'name',
48
+ :'expiration_date_utc' => :'expiration_date_utc',
49
+ :'date_created' => :'date_created',
50
+ :'last_updated' => :'last_updated',
51
+ :'active' => :'active'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'api_key_id' => :'String',
69
+ :'user_id' => :'String',
70
+ :'company_id' => :'String',
71
+ :'role_id' => :'String',
72
+ :'token' => :'String',
73
+ :'name' => :'String',
74
+ :'expiration_date_utc' => :'String',
75
+ :'date_created' => :'String',
76
+ :'last_updated' => :'String',
77
+ :'active' => :'String'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ ])
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SparteraApiSdk::Apikey` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ acceptable_attribute_map = self.class.acceptable_attribute_map
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!acceptable_attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SparteraApiSdk::Apikey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'api_key_id')
104
+ self.api_key_id = attributes[:'api_key_id']
105
+ else
106
+ self.api_key_id = nil
107
+ end
108
+
109
+ if attributes.key?(:'user_id')
110
+ self.user_id = attributes[:'user_id']
111
+ end
112
+
113
+ if attributes.key?(:'company_id')
114
+ self.company_id = attributes[:'company_id']
115
+ else
116
+ self.company_id = nil
117
+ end
118
+
119
+ if attributes.key?(:'role_id')
120
+ self.role_id = attributes[:'role_id']
121
+ else
122
+ self.role_id = nil
123
+ end
124
+
125
+ if attributes.key?(:'token')
126
+ self.token = attributes[:'token']
127
+ else
128
+ self.token = nil
129
+ end
130
+
131
+ if attributes.key?(:'name')
132
+ self.name = attributes[:'name']
133
+ end
134
+
135
+ if attributes.key?(:'expiration_date_utc')
136
+ self.expiration_date_utc = attributes[:'expiration_date_utc']
137
+ end
138
+
139
+ if attributes.key?(:'date_created')
140
+ self.date_created = attributes[:'date_created']
141
+ end
142
+
143
+ if attributes.key?(:'last_updated')
144
+ self.last_updated = attributes[:'last_updated']
145
+ end
146
+
147
+ if attributes.key?(:'active')
148
+ self.active = attributes[:'active']
149
+ end
150
+ end
151
+
152
+ # Show invalid properties with the reasons. Usually used together with valid?
153
+ # @return Array for valid properties with the reasons
154
+ def list_invalid_properties
155
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
156
+ invalid_properties = Array.new
157
+ if @api_key_id.nil?
158
+ invalid_properties.push('invalid value for "api_key_id", api_key_id cannot be nil.')
159
+ end
160
+
161
+ if @company_id.nil?
162
+ invalid_properties.push('invalid value for "company_id", company_id cannot be nil.')
163
+ end
164
+
165
+ if @role_id.nil?
166
+ invalid_properties.push('invalid value for "role_id", role_id cannot be nil.')
167
+ end
168
+
169
+ if @token.nil?
170
+ invalid_properties.push('invalid value for "token", token cannot be nil.')
171
+ end
172
+
173
+ invalid_properties
174
+ end
175
+
176
+ # Check to see if the all the properties in the model are valid
177
+ # @return true if the model is valid
178
+ def valid?
179
+ warn '[DEPRECATED] the `valid?` method is obsolete'
180
+ return false if @api_key_id.nil?
181
+ return false if @company_id.nil?
182
+ return false if @role_id.nil?
183
+ return false if @token.nil?
184
+ true
185
+ end
186
+
187
+ # Custom attribute writer method with validation
188
+ # @param [Object] api_key_id Value to be assigned
189
+ def api_key_id=(api_key_id)
190
+ if api_key_id.nil?
191
+ fail ArgumentError, 'api_key_id cannot be nil'
192
+ end
193
+
194
+ @api_key_id = api_key_id
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] company_id Value to be assigned
199
+ def company_id=(company_id)
200
+ if company_id.nil?
201
+ fail ArgumentError, 'company_id cannot be nil'
202
+ end
203
+
204
+ @company_id = company_id
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] role_id Value to be assigned
209
+ def role_id=(role_id)
210
+ if role_id.nil?
211
+ fail ArgumentError, 'role_id cannot be nil'
212
+ end
213
+
214
+ @role_id = role_id
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] token Value to be assigned
219
+ def token=(token)
220
+ if token.nil?
221
+ fail ArgumentError, 'token cannot be nil'
222
+ end
223
+
224
+ @token = token
225
+ end
226
+
227
+ # Checks equality by comparing each attribute.
228
+ # @param [Object] Object to be compared
229
+ def ==(o)
230
+ return true if self.equal?(o)
231
+ self.class == o.class &&
232
+ api_key_id == o.api_key_id &&
233
+ user_id == o.user_id &&
234
+ company_id == o.company_id &&
235
+ role_id == o.role_id &&
236
+ token == o.token &&
237
+ name == o.name &&
238
+ expiration_date_utc == o.expiration_date_utc &&
239
+ date_created == o.date_created &&
240
+ last_updated == o.last_updated &&
241
+ active == o.active
242
+ end
243
+
244
+ # @see the `==` method
245
+ # @param [Object] Object to be compared
246
+ def eql?(o)
247
+ self == o
248
+ end
249
+
250
+ # Calculates hash code according to all attributes.
251
+ # @return [Integer] Hash code
252
+ def hash
253
+ [api_key_id, user_id, company_id, role_id, token, name, expiration_date_utc, date_created, last_updated, active].hash
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 self.build_from_hash(attributes)
260
+ return nil unless attributes.is_a?(Hash)
261
+ attributes = attributes.transform_keys(&:to_sym)
262
+ transformed_hash = {}
263
+ openapi_types.each_pair do |key, type|
264
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
265
+ transformed_hash["#{key}"] = nil
266
+ elsif type =~ /\AArray<(.*)>/i
267
+ # check to ensure the input is an array given that the attribute
268
+ # is documented as an array but the input is not
269
+ if attributes[attribute_map[key]].is_a?(Array)
270
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
271
+ end
272
+ elsif !attributes[attribute_map[key]].nil?
273
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
274
+ end
275
+ end
276
+ new(transformed_hash)
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 self._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 = SparteraApiSdk.const_get(type)
318
+ klass.respond_to?(:openapi_any_of) || 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