spartera_api_sdk 1.0.68 → 1.0.69

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 (170) hide show
  1. checksums.yaml +4 -4
  2. data/config.json +1 -1
  3. data/docs/APIKeysApi.md +20 -20
  4. data/docs/AlertsApi.md +28 -28
  5. data/docs/AssetPriceHistoryApi.md +32 -32
  6. data/docs/AssetsApi.md +52 -52
  7. data/docs/CloudProvidersApi.md +8 -8
  8. data/docs/CompaniesApi.md +36 -36
  9. data/docs/CompaniesCompanyIdApiKeysGet200Response.md +20 -0
  10. data/docs/CompaniesCompanyIdAssetsAssetIdDelete200Response.md +20 -0
  11. data/docs/CompaniesCompanyIdAssetsAssetIdDelete200ResponseData.md +18 -0
  12. data/docs/CompaniesCompanyIdAssetsAssetIdGet200Response.md +20 -0
  13. data/docs/CompaniesCompanyIdAssetsAssetIdPatch200Response.md +20 -0
  14. data/docs/CompaniesCompanyIdAssetsAssetIdPatch200ResponseData.md +18 -0
  15. data/docs/CompaniesCompanyIdAssetsGet200Response.md +20 -0
  16. data/docs/CompaniesCompanyIdAssetsPost200Response.md +20 -0
  17. data/docs/CompaniesCompanyIdAssetsPost200ResponseData.md +18 -0
  18. data/docs/CompaniesCompanyIdConnectionsConnectionIdDelete200Response.md +20 -0
  19. data/docs/CompaniesCompanyIdConnectionsConnectionIdDelete200ResponseData.md +18 -0
  20. data/docs/CompaniesCompanyIdConnectionsConnectionIdGet200Response.md +20 -0
  21. data/docs/CompaniesCompanyIdConnectionsConnectionIdPatch200Response.md +20 -0
  22. data/docs/CompaniesCompanyIdConnectionsConnectionIdPatch200ResponseData.md +18 -0
  23. data/docs/CompaniesCompanyIdConnectionsGet200Response.md +20 -0
  24. data/docs/CompaniesCompanyIdConnectionsPost200Response.md +20 -0
  25. data/docs/CompaniesCompanyIdConnectionsPost200ResponseData.md +18 -0
  26. data/docs/CompaniesCompanyIdUsersGet200Response.md +20 -0
  27. data/docs/CompaniesCompanyIdUsersPost200Response.md +20 -0
  28. data/docs/CompaniesCompanyIdUsersPost200ResponseData.md +18 -0
  29. data/docs/CompaniesCompanyIdUsersUserIdAlertsAlertIdDelete200Response.md +20 -0
  30. data/docs/CompaniesCompanyIdUsersUserIdAlertsAlertIdDelete200ResponseData.md +18 -0
  31. data/docs/CompaniesCompanyIdUsersUserIdAlertsAlertIdGet200Response.md +20 -0
  32. data/docs/CompaniesCompanyIdUsersUserIdAlertsAlertIdPatch200Response.md +20 -0
  33. data/docs/CompaniesCompanyIdUsersUserIdAlertsAlertIdPatch200ResponseData.md +18 -0
  34. data/docs/CompaniesCompanyIdUsersUserIdAlertsGet200Response.md +20 -0
  35. data/docs/CompaniesCompanyIdUsersUserIdAlertsPost200Response.md +20 -0
  36. data/docs/CompaniesCompanyIdUsersUserIdAlertsPost200ResponseData.md +18 -0
  37. data/docs/CompaniesCompanyIdUsersUserIdDelete200Response.md +20 -0
  38. data/docs/CompaniesCompanyIdUsersUserIdDelete200ResponseData.md +18 -0
  39. data/docs/CompaniesCompanyIdUsersUserIdFavoritesFavoriteIdDelete200Response.md +20 -0
  40. data/docs/CompaniesCompanyIdUsersUserIdFavoritesFavoriteIdDelete200ResponseData.md +18 -0
  41. data/docs/CompaniesCompanyIdUsersUserIdFavoritesFavoriteIdGet200Response.md +20 -0
  42. data/docs/CompaniesCompanyIdUsersUserIdFavoritesFavoriteIdPatch200Response.md +20 -0
  43. data/docs/CompaniesCompanyIdUsersUserIdFavoritesFavoriteIdPatch200ResponseData.md +18 -0
  44. data/docs/CompaniesCompanyIdUsersUserIdFavoritesGet200Response.md +20 -0
  45. data/docs/CompaniesCompanyIdUsersUserIdFavoritesPost200Response.md +20 -0
  46. data/docs/CompaniesCompanyIdUsersUserIdFavoritesPost200ResponseData.md +18 -0
  47. data/docs/CompaniesCompanyIdUsersUserIdGet200Response.md +20 -0
  48. data/docs/CompaniesCompanyIdUsersUserIdPatch200Response.md +20 -0
  49. data/docs/CompaniesCompanyIdUsersUserIdPatch200ResponseData.md +18 -0
  50. data/docs/ConnectionsApi.md +28 -28
  51. data/docs/FavoritesApi.md +32 -32
  52. data/docs/MeGet200Response.md +36 -0
  53. data/docs/MeGet200ResponseApiKeyInfo.md +20 -0
  54. data/docs/MeGet200ResponseProfile.md +36 -0
  55. data/docs/MeGet200ResponseTokenMetadata.md +24 -0
  56. data/docs/StorageEnginesApi.md +8 -8
  57. data/docs/UsersApi.md +87 -20
  58. data/lib/spartera_api_sdk/api/alerts_api.rb +21 -21
  59. data/lib/spartera_api_sdk/api/api_keys_api.rb +15 -15
  60. data/lib/spartera_api_sdk/api/asset_price_history_api.rb +24 -24
  61. data/lib/spartera_api_sdk/api/assets_api.rb +46 -46
  62. data/lib/spartera_api_sdk/api/cloud_providers_api.rb +6 -6
  63. data/lib/spartera_api_sdk/api/companies_api.rb +27 -27
  64. data/lib/spartera_api_sdk/api/connections_api.rb +21 -21
  65. data/lib/spartera_api_sdk/api/favorites_api.rb +24 -24
  66. data/lib/spartera_api_sdk/api/storage_engines_api.rb +6 -6
  67. data/lib/spartera_api_sdk/api/users_api.rb +70 -15
  68. data/lib/spartera_api_sdk/models/companies_company_id_api_keys_get200_response.rb +248 -0
  69. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_delete200_response.rb +264 -0
  70. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_delete200_response_data.rb +238 -0
  71. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_get200_response.rb +264 -0
  72. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_patch200_response.rb +264 -0
  73. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_patch200_response_data.rb +238 -0
  74. data/lib/spartera_api_sdk/models/companies_company_id_assets_get200_response.rb +266 -0
  75. data/lib/spartera_api_sdk/models/companies_company_id_assets_post200_response.rb +264 -0
  76. data/lib/spartera_api_sdk/models/companies_company_id_assets_post200_response_data.rb +238 -0
  77. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_delete200_response.rb +264 -0
  78. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_delete200_response_data.rb +238 -0
  79. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_get200_response.rb +264 -0
  80. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_patch200_response.rb +264 -0
  81. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_patch200_response_data.rb +238 -0
  82. data/lib/spartera_api_sdk/models/companies_company_id_connections_get200_response.rb +266 -0
  83. data/lib/spartera_api_sdk/models/companies_company_id_connections_post200_response.rb +264 -0
  84. data/lib/spartera_api_sdk/models/companies_company_id_connections_post200_response_data.rb +238 -0
  85. data/lib/spartera_api_sdk/models/companies_company_id_users_get200_response.rb +266 -0
  86. data/lib/spartera_api_sdk/models/companies_company_id_users_post200_response.rb +264 -0
  87. data/lib/spartera_api_sdk/models/companies_company_id_users_post200_response_data.rb +238 -0
  88. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_delete200_response.rb +264 -0
  89. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_delete200_response_data.rb +238 -0
  90. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_get200_response.rb +264 -0
  91. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_patch200_response.rb +264 -0
  92. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_patch200_response_data.rb +238 -0
  93. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_get200_response.rb +266 -0
  94. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_post200_response.rb +264 -0
  95. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_post200_response_data.rb +238 -0
  96. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_delete200_response.rb +264 -0
  97. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_delete200_response_data.rb +238 -0
  98. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_delete200_response.rb +264 -0
  99. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_delete200_response_data.rb +238 -0
  100. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_get200_response.rb +264 -0
  101. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_patch200_response.rb +264 -0
  102. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_patch200_response_data.rb +238 -0
  103. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_get200_response.rb +266 -0
  104. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_post200_response.rb +264 -0
  105. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_post200_response_data.rb +238 -0
  106. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_get200_response.rb +264 -0
  107. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_patch200_response.rb +264 -0
  108. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_patch200_response_data.rb +238 -0
  109. data/lib/spartera_api_sdk/models/me_get200_response.rb +417 -0
  110. data/lib/spartera_api_sdk/models/me_get200_response_api_key_info.rb +232 -0
  111. data/lib/spartera_api_sdk/models/me_get200_response_profile.rb +345 -0
  112. data/lib/spartera_api_sdk/models/me_get200_response_token_metadata.rb +252 -0
  113. data/lib/spartera_api_sdk/version.rb +1 -1
  114. data/lib/spartera_api_sdk.rb +45 -0
  115. data/spec/api/alerts_api_spec.rb +7 -7
  116. data/spec/api/api_keys_api_spec.rb +5 -5
  117. data/spec/api/asset_price_history_api_spec.rb +8 -8
  118. data/spec/api/assets_api_spec.rb +13 -13
  119. data/spec/api/cloud_providers_api_spec.rb +2 -2
  120. data/spec/api/companies_api_spec.rb +9 -9
  121. data/spec/api/connections_api_spec.rb +7 -7
  122. data/spec/api/favorites_api_spec.rb +8 -8
  123. data/spec/api/storage_engines_api_spec.rb +2 -2
  124. data/spec/api/users_api_spec.rb +15 -5
  125. data/spec/models/companies_company_id_api_keys_get200_response_spec.rb +42 -0
  126. data/spec/models/companies_company_id_assets_asset_id_delete200_response_data_spec.rb +36 -0
  127. data/spec/models/companies_company_id_assets_asset_id_delete200_response_spec.rb +42 -0
  128. data/spec/models/companies_company_id_assets_asset_id_get200_response_spec.rb +42 -0
  129. data/spec/models/companies_company_id_assets_asset_id_patch200_response_data_spec.rb +36 -0
  130. data/spec/models/companies_company_id_assets_asset_id_patch200_response_spec.rb +42 -0
  131. data/spec/models/companies_company_id_assets_get200_response_spec.rb +42 -0
  132. data/spec/models/companies_company_id_assets_post200_response_data_spec.rb +36 -0
  133. data/spec/models/companies_company_id_assets_post200_response_spec.rb +42 -0
  134. data/spec/models/companies_company_id_connections_connection_id_delete200_response_data_spec.rb +36 -0
  135. data/spec/models/companies_company_id_connections_connection_id_delete200_response_spec.rb +42 -0
  136. data/spec/models/companies_company_id_connections_connection_id_get200_response_spec.rb +42 -0
  137. data/spec/models/companies_company_id_connections_connection_id_patch200_response_data_spec.rb +36 -0
  138. data/spec/models/companies_company_id_connections_connection_id_patch200_response_spec.rb +42 -0
  139. data/spec/models/companies_company_id_connections_get200_response_spec.rb +42 -0
  140. data/spec/models/companies_company_id_connections_post200_response_data_spec.rb +36 -0
  141. data/spec/models/companies_company_id_connections_post200_response_spec.rb +42 -0
  142. data/spec/models/companies_company_id_users_get200_response_spec.rb +42 -0
  143. data/spec/models/companies_company_id_users_post200_response_data_spec.rb +36 -0
  144. data/spec/models/companies_company_id_users_post200_response_spec.rb +42 -0
  145. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_delete200_response_data_spec.rb +36 -0
  146. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_delete200_response_spec.rb +42 -0
  147. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_get200_response_spec.rb +42 -0
  148. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_patch200_response_data_spec.rb +36 -0
  149. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_patch200_response_spec.rb +42 -0
  150. data/spec/models/companies_company_id_users_user_id_alerts_get200_response_spec.rb +42 -0
  151. data/spec/models/companies_company_id_users_user_id_alerts_post200_response_data_spec.rb +36 -0
  152. data/spec/models/companies_company_id_users_user_id_alerts_post200_response_spec.rb +42 -0
  153. data/spec/models/companies_company_id_users_user_id_delete200_response_data_spec.rb +36 -0
  154. data/spec/models/companies_company_id_users_user_id_delete200_response_spec.rb +42 -0
  155. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_delete200_response_data_spec.rb +36 -0
  156. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_delete200_response_spec.rb +42 -0
  157. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_get200_response_spec.rb +42 -0
  158. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_patch200_response_data_spec.rb +36 -0
  159. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_patch200_response_spec.rb +42 -0
  160. data/spec/models/companies_company_id_users_user_id_favorites_get200_response_spec.rb +42 -0
  161. data/spec/models/companies_company_id_users_user_id_favorites_post200_response_data_spec.rb +36 -0
  162. data/spec/models/companies_company_id_users_user_id_favorites_post200_response_spec.rb +42 -0
  163. data/spec/models/companies_company_id_users_user_id_get200_response_spec.rb +42 -0
  164. data/spec/models/companies_company_id_users_user_id_patch200_response_data_spec.rb +36 -0
  165. data/spec/models/companies_company_id_users_user_id_patch200_response_spec.rb +42 -0
  166. data/spec/models/me_get200_response_api_key_info_spec.rb +42 -0
  167. data/spec/models/me_get200_response_profile_spec.rb +94 -0
  168. data/spec/models/me_get200_response_spec.rb +94 -0
  169. data/spec/models/me_get200_response_token_metadata_spec.rb +54 -0
  170. metadata +181 -1
@@ -0,0 +1,264 @@
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
+ class CompaniesCompanyIdAssetsAssetIdDelete200Response
18
+ # Response status message
19
+ attr_accessor :message
20
+
21
+ attr_accessor :data
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'message' => :'message',
27
+ :'data' => :'data'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'message' => :'String',
45
+ :'data' => :'CompaniesCompanyIdAssetsAssetIdDelete200ResponseData'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SparteraApiSdk::CompaniesCompanyIdAssetsAssetIdDelete200Response` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SparteraApiSdk::CompaniesCompanyIdAssetsAssetIdDelete200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'message')
72
+ self.message = attributes[:'message']
73
+ else
74
+ self.message = nil
75
+ end
76
+
77
+ if attributes.key?(:'data')
78
+ self.data = attributes[:'data']
79
+ else
80
+ self.data = nil
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ if @message.nil?
90
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
91
+ end
92
+
93
+ if @data.nil?
94
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
104
+ return false if @message.nil?
105
+ return false if @data.nil?
106
+ true
107
+ end
108
+
109
+ # Custom attribute writer method with validation
110
+ # @param [Object] message Value to be assigned
111
+ def message=(message)
112
+ if message.nil?
113
+ fail ArgumentError, 'message cannot be nil'
114
+ end
115
+
116
+ @message = message
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] data Value to be assigned
121
+ def data=(data)
122
+ if data.nil?
123
+ fail ArgumentError, 'data cannot be nil'
124
+ end
125
+
126
+ @data = data
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
+ message == o.message &&
135
+ data == o.data
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [message, data].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ transformed_hash = {}
157
+ openapi_types.each_pair do |key, type|
158
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = nil
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
165
+ end
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
168
+ end
169
+ end
170
+ new(transformed_hash)
171
+ end
172
+
173
+ # Deserializes the data based on type
174
+ # @param string type Data type
175
+ # @param string value Value to be deserialized
176
+ # @return [Object] Deserialized data
177
+ def self._deserialize(type, value)
178
+ case type.to_sym
179
+ when :Time
180
+ Time.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :Boolean
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ # models (e.g. Pet) or oneOf
211
+ klass = SparteraApiSdk.const_get(type)
212
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
213
+ end
214
+ end
215
+
216
+ # Returns the string representation of the object
217
+ # @return [String] String presentation of the object
218
+ def to_s
219
+ to_hash.to_s
220
+ end
221
+
222
+ # to_body is an alias to to_hash (backward compatibility)
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_body
225
+ to_hash
226
+ end
227
+
228
+ # Returns the object in the form of hash
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_hash
231
+ hash = {}
232
+ self.class.attribute_map.each_pair do |attr, param|
233
+ value = self.send(attr)
234
+ if value.nil?
235
+ is_nullable = self.class.openapi_nullable.include?(attr)
236
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
237
+ end
238
+
239
+ hash[param] = _to_hash(value)
240
+ end
241
+ hash
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map { |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to? :to_hash
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+
262
+ end
263
+
264
+ end
@@ -0,0 +1,238 @@
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
+ class CompaniesCompanyIdAssetsAssetIdDelete200ResponseData
18
+ # ID of the deleted assets
19
+ attr_accessor :asset_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'asset_id' => :'asset_id'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'asset_id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SparteraApiSdk::CompaniesCompanyIdAssetsAssetIdDelete200ResponseData` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SparteraApiSdk::CompaniesCompanyIdAssetsAssetIdDelete200ResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'asset_id')
68
+ self.asset_id = attributes[:'asset_id']
69
+ else
70
+ self.asset_id = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @asset_id.nil?
80
+ invalid_properties.push('invalid value for "asset_id", asset_id cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @asset_id.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] asset_id Value to be assigned
96
+ def asset_id=(asset_id)
97
+ if asset_id.nil?
98
+ fail ArgumentError, 'asset_id cannot be nil'
99
+ end
100
+
101
+ @asset_id = asset_id
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ asset_id == o.asset_id
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [asset_id].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def self._deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = SparteraApiSdk.const_get(type)
186
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end