spartera_api_sdk 1.0.68 → 1.0.72

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