spartera_api_sdk 1.0.62 → 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 (172) hide show
  1. checksums.yaml +4 -4
  2. data/config.json +1 -1
  3. data/docs/APIKeysApi.md +45 -35
  4. data/docs/AlertsApi.md +71 -57
  5. data/docs/AssetPriceHistoryApi.md +80 -64
  6. data/docs/AssetsApi.md +116 -378
  7. data/docs/CloudProvidersApi.md +18 -215
  8. data/docs/CompaniesApi.md +81 -63
  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 +67 -53
  51. data/docs/FavoritesApi.md +84 -68
  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 +149 -0
  57. data/docs/UsersApi.md +116 -39
  58. data/lib/spartera_api_sdk/api/alerts_api.rb +32 -32
  59. data/lib/spartera_api_sdk/api/api_keys_api.rb +20 -20
  60. data/lib/spartera_api_sdk/api/asset_price_history_api.rb +36 -36
  61. data/lib/spartera_api_sdk/api/assets_api.rb +52 -328
  62. data/lib/spartera_api_sdk/api/cloud_providers_api.rb +8 -185
  63. data/lib/spartera_api_sdk/api/companies_api.rb +36 -36
  64. data/lib/spartera_api_sdk/api/connections_api.rb +30 -30
  65. data/lib/spartera_api_sdk/api/favorites_api.rb +38 -38
  66. data/lib/spartera_api_sdk/api/storage_engines_api.rb +150 -0
  67. data/lib/spartera_api_sdk/api/users_api.rb +77 -22
  68. data/lib/spartera_api_sdk/configuration.rb +2 -10
  69. data/lib/spartera_api_sdk/models/companies_company_id_api_keys_get200_response.rb +248 -0
  70. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_delete200_response.rb +264 -0
  71. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_delete200_response_data.rb +238 -0
  72. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_get200_response.rb +264 -0
  73. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_patch200_response.rb +264 -0
  74. data/lib/spartera_api_sdk/models/companies_company_id_assets_asset_id_patch200_response_data.rb +238 -0
  75. data/lib/spartera_api_sdk/models/companies_company_id_assets_get200_response.rb +266 -0
  76. data/lib/spartera_api_sdk/models/companies_company_id_assets_post200_response.rb +264 -0
  77. data/lib/spartera_api_sdk/models/companies_company_id_assets_post200_response_data.rb +238 -0
  78. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_delete200_response.rb +264 -0
  79. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_delete200_response_data.rb +238 -0
  80. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_get200_response.rb +264 -0
  81. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_patch200_response.rb +264 -0
  82. data/lib/spartera_api_sdk/models/companies_company_id_connections_connection_id_patch200_response_data.rb +238 -0
  83. data/lib/spartera_api_sdk/models/companies_company_id_connections_get200_response.rb +266 -0
  84. data/lib/spartera_api_sdk/models/companies_company_id_connections_post200_response.rb +264 -0
  85. data/lib/spartera_api_sdk/models/companies_company_id_connections_post200_response_data.rb +238 -0
  86. data/lib/spartera_api_sdk/models/companies_company_id_users_get200_response.rb +266 -0
  87. data/lib/spartera_api_sdk/models/companies_company_id_users_post200_response.rb +264 -0
  88. data/lib/spartera_api_sdk/models/companies_company_id_users_post200_response_data.rb +238 -0
  89. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_delete200_response.rb +264 -0
  90. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_delete200_response_data.rb +238 -0
  91. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_get200_response.rb +264 -0
  92. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_patch200_response.rb +264 -0
  93. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_alert_id_patch200_response_data.rb +238 -0
  94. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_get200_response.rb +266 -0
  95. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_post200_response.rb +264 -0
  96. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_alerts_post200_response_data.rb +238 -0
  97. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_delete200_response.rb +264 -0
  98. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_delete200_response_data.rb +238 -0
  99. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_delete200_response.rb +264 -0
  100. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_delete200_response_data.rb +238 -0
  101. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_get200_response.rb +264 -0
  102. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_patch200_response.rb +264 -0
  103. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_favorite_id_patch200_response_data.rb +238 -0
  104. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_get200_response.rb +266 -0
  105. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_post200_response.rb +264 -0
  106. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_favorites_post200_response_data.rb +238 -0
  107. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_get200_response.rb +264 -0
  108. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_patch200_response.rb +264 -0
  109. data/lib/spartera_api_sdk/models/companies_company_id_users_user_id_patch200_response_data.rb +238 -0
  110. data/lib/spartera_api_sdk/models/me_get200_response.rb +417 -0
  111. data/lib/spartera_api_sdk/models/me_get200_response_api_key_info.rb +232 -0
  112. data/lib/spartera_api_sdk/models/me_get200_response_profile.rb +345 -0
  113. data/lib/spartera_api_sdk/models/me_get200_response_token_metadata.rb +252 -0
  114. data/lib/spartera_api_sdk/version.rb +1 -1
  115. data/lib/spartera_api_sdk.rb +46 -0
  116. data/spec/api/alerts_api_spec.rb +9 -9
  117. data/spec/api/api_keys_api_spec.rb +5 -5
  118. data/spec/api/asset_price_history_api_spec.rb +10 -10
  119. data/spec/api/assets_api_spec.rb +14 -64
  120. data/spec/api/cloud_providers_api_spec.rb +2 -34
  121. data/spec/api/companies_api_spec.rb +9 -9
  122. data/spec/api/connections_api_spec.rb +8 -8
  123. data/spec/api/favorites_api_spec.rb +11 -11
  124. data/spec/api/storage_engines_api_spec.rb +58 -0
  125. data/spec/api/users_api_spec.rb +16 -6
  126. data/spec/models/companies_company_id_api_keys_get200_response_spec.rb +42 -0
  127. data/spec/models/companies_company_id_assets_asset_id_delete200_response_data_spec.rb +36 -0
  128. data/spec/models/companies_company_id_assets_asset_id_delete200_response_spec.rb +42 -0
  129. data/spec/models/companies_company_id_assets_asset_id_get200_response_spec.rb +42 -0
  130. data/spec/models/companies_company_id_assets_asset_id_patch200_response_data_spec.rb +36 -0
  131. data/spec/models/companies_company_id_assets_asset_id_patch200_response_spec.rb +42 -0
  132. data/spec/models/companies_company_id_assets_get200_response_spec.rb +42 -0
  133. data/spec/models/companies_company_id_assets_post200_response_data_spec.rb +36 -0
  134. data/spec/models/companies_company_id_assets_post200_response_spec.rb +42 -0
  135. data/spec/models/companies_company_id_connections_connection_id_delete200_response_data_spec.rb +36 -0
  136. data/spec/models/companies_company_id_connections_connection_id_delete200_response_spec.rb +42 -0
  137. data/spec/models/companies_company_id_connections_connection_id_get200_response_spec.rb +42 -0
  138. data/spec/models/companies_company_id_connections_connection_id_patch200_response_data_spec.rb +36 -0
  139. data/spec/models/companies_company_id_connections_connection_id_patch200_response_spec.rb +42 -0
  140. data/spec/models/companies_company_id_connections_get200_response_spec.rb +42 -0
  141. data/spec/models/companies_company_id_connections_post200_response_data_spec.rb +36 -0
  142. data/spec/models/companies_company_id_connections_post200_response_spec.rb +42 -0
  143. data/spec/models/companies_company_id_users_get200_response_spec.rb +42 -0
  144. data/spec/models/companies_company_id_users_post200_response_data_spec.rb +36 -0
  145. data/spec/models/companies_company_id_users_post200_response_spec.rb +42 -0
  146. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_delete200_response_data_spec.rb +36 -0
  147. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_delete200_response_spec.rb +42 -0
  148. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_get200_response_spec.rb +42 -0
  149. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_patch200_response_data_spec.rb +36 -0
  150. data/spec/models/companies_company_id_users_user_id_alerts_alert_id_patch200_response_spec.rb +42 -0
  151. data/spec/models/companies_company_id_users_user_id_alerts_get200_response_spec.rb +42 -0
  152. data/spec/models/companies_company_id_users_user_id_alerts_post200_response_data_spec.rb +36 -0
  153. data/spec/models/companies_company_id_users_user_id_alerts_post200_response_spec.rb +42 -0
  154. data/spec/models/companies_company_id_users_user_id_delete200_response_data_spec.rb +36 -0
  155. data/spec/models/companies_company_id_users_user_id_delete200_response_spec.rb +42 -0
  156. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_delete200_response_data_spec.rb +36 -0
  157. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_delete200_response_spec.rb +42 -0
  158. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_get200_response_spec.rb +42 -0
  159. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_patch200_response_data_spec.rb +36 -0
  160. data/spec/models/companies_company_id_users_user_id_favorites_favorite_id_patch200_response_spec.rb +42 -0
  161. data/spec/models/companies_company_id_users_user_id_favorites_get200_response_spec.rb +42 -0
  162. data/spec/models/companies_company_id_users_user_id_favorites_post200_response_data_spec.rb +36 -0
  163. data/spec/models/companies_company_id_users_user_id_favorites_post200_response_spec.rb +42 -0
  164. data/spec/models/companies_company_id_users_user_id_get200_response_spec.rb +42 -0
  165. data/spec/models/companies_company_id_users_user_id_patch200_response_data_spec.rb +36 -0
  166. data/spec/models/companies_company_id_users_user_id_patch200_response_spec.rb +42 -0
  167. data/spec/models/me_get200_response_api_key_info_spec.rb +42 -0
  168. data/spec/models/me_get200_response_profile_spec.rb +94 -0
  169. data/spec/models/me_get200_response_spec.rb +94 -0
  170. data/spec/models/me_get200_response_token_metadata_spec.rb +54 -0
  171. metadata +208 -22
  172. data/Gemfile.lock +0 -69
@@ -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 CompaniesCompanyIdConnectionsConnectionIdPatch200ResponseData
18
+ # ID of the updated connections
19
+ attr_accessor :connection_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'connection_id' => :'connection_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
+ :'connection_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::CompaniesCompanyIdConnectionsConnectionIdPatch200ResponseData` 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::CompaniesCompanyIdConnectionsConnectionIdPatch200ResponseData`. 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?(:'connection_id')
68
+ self.connection_id = attributes[:'connection_id']
69
+ else
70
+ self.connection_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 @connection_id.nil?
80
+ invalid_properties.push('invalid value for "connection_id", connection_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 @connection_id.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] connection_id Value to be assigned
96
+ def connection_id=(connection_id)
97
+ if connection_id.nil?
98
+ fail ArgumentError, 'connection_id cannot be nil'
99
+ end
100
+
101
+ @connection_id = connection_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
+ connection_id == o.connection_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
+ [connection_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
@@ -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 CompaniesCompanyIdConnectionsGet200Response
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<Connection>'
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::CompaniesCompanyIdConnectionsGet200Response` 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::CompaniesCompanyIdConnectionsGet200Response`. 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