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,417 @@
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 MeGet200Response
18
+ # Firebase user ID
19
+ attr_accessor :user_id
20
+
21
+ # User email address
22
+ attr_accessor :email
23
+
24
+ # Authentication method used
25
+ attr_accessor :auth_method
26
+
27
+ # Platform origin
28
+ attr_accessor :platform
29
+
30
+ # Request origin domain
31
+ attr_accessor :origin_domain
32
+
33
+ attr_accessor :profile
34
+
35
+ # Company ID from authentication claims
36
+ attr_accessor :company_id
37
+
38
+ # Role ID from authentication claims
39
+ attr_accessor :role_id
40
+
41
+ attr_accessor :token_metadata
42
+
43
+ attr_accessor :api_key_info
44
+
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'user_id' => :'user_id',
71
+ :'email' => :'email',
72
+ :'auth_method' => :'auth_method',
73
+ :'platform' => :'platform',
74
+ :'origin_domain' => :'origin_domain',
75
+ :'profile' => :'profile',
76
+ :'company_id' => :'company_id',
77
+ :'role_id' => :'role_id',
78
+ :'token_metadata' => :'token_metadata',
79
+ :'api_key_info' => :'api_key_info'
80
+ }
81
+ end
82
+
83
+ # Returns attribute mapping this model knows about
84
+ def self.acceptable_attribute_map
85
+ attribute_map
86
+ end
87
+
88
+ # Returns all the JSON keys this model knows about
89
+ def self.acceptable_attributes
90
+ acceptable_attribute_map.values
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.openapi_types
95
+ {
96
+ :'user_id' => :'String',
97
+ :'email' => :'String',
98
+ :'auth_method' => :'String',
99
+ :'platform' => :'String',
100
+ :'origin_domain' => :'String',
101
+ :'profile' => :'MeGet200ResponseProfile',
102
+ :'company_id' => :'String',
103
+ :'role_id' => :'Integer',
104
+ :'token_metadata' => :'MeGet200ResponseTokenMetadata',
105
+ :'api_key_info' => :'MeGet200ResponseApiKeyInfo'
106
+ }
107
+ end
108
+
109
+ # List of attributes with nullable: true
110
+ def self.openapi_nullable
111
+ Set.new([
112
+ ])
113
+ end
114
+
115
+ # Initializes the object
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ def initialize(attributes = {})
118
+ if (!attributes.is_a?(Hash))
119
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SparteraApiSdk::MeGet200Response` initialize method"
120
+ end
121
+
122
+ # check to see if the attribute exists and convert string to symbol for hash key
123
+ acceptable_attribute_map = self.class.acceptable_attribute_map
124
+ attributes = attributes.each_with_object({}) { |(k, v), h|
125
+ if (!acceptable_attribute_map.key?(k.to_sym))
126
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SparteraApiSdk::MeGet200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
127
+ end
128
+ h[k.to_sym] = v
129
+ }
130
+
131
+ if attributes.key?(:'user_id')
132
+ self.user_id = attributes[:'user_id']
133
+ else
134
+ self.user_id = nil
135
+ end
136
+
137
+ if attributes.key?(:'email')
138
+ self.email = attributes[:'email']
139
+ end
140
+
141
+ if attributes.key?(:'auth_method')
142
+ self.auth_method = attributes[:'auth_method']
143
+ else
144
+ self.auth_method = nil
145
+ end
146
+
147
+ if attributes.key?(:'platform')
148
+ self.platform = attributes[:'platform']
149
+ end
150
+
151
+ if attributes.key?(:'origin_domain')
152
+ self.origin_domain = attributes[:'origin_domain']
153
+ end
154
+
155
+ if attributes.key?(:'profile')
156
+ self.profile = attributes[:'profile']
157
+ else
158
+ self.profile = nil
159
+ end
160
+
161
+ if attributes.key?(:'company_id')
162
+ self.company_id = attributes[:'company_id']
163
+ else
164
+ self.company_id = nil
165
+ end
166
+
167
+ if attributes.key?(:'role_id')
168
+ self.role_id = attributes[:'role_id']
169
+ else
170
+ self.role_id = nil
171
+ end
172
+
173
+ if attributes.key?(:'token_metadata')
174
+ self.token_metadata = attributes[:'token_metadata']
175
+ end
176
+
177
+ if attributes.key?(:'api_key_info')
178
+ self.api_key_info = attributes[:'api_key_info']
179
+ end
180
+ end
181
+
182
+ # Show invalid properties with the reasons. Usually used together with valid?
183
+ # @return Array for valid properties with the reasons
184
+ def list_invalid_properties
185
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
186
+ invalid_properties = Array.new
187
+ if @user_id.nil?
188
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
189
+ end
190
+
191
+ if @auth_method.nil?
192
+ invalid_properties.push('invalid value for "auth_method", auth_method cannot be nil.')
193
+ end
194
+
195
+ if @profile.nil?
196
+ invalid_properties.push('invalid value for "profile", profile cannot be nil.')
197
+ end
198
+
199
+ if @company_id.nil?
200
+ invalid_properties.push('invalid value for "company_id", company_id cannot be nil.')
201
+ end
202
+
203
+ if @role_id.nil?
204
+ invalid_properties.push('invalid value for "role_id", role_id cannot be nil.')
205
+ end
206
+
207
+ invalid_properties
208
+ end
209
+
210
+ # Check to see if the all the properties in the model are valid
211
+ # @return true if the model is valid
212
+ def valid?
213
+ warn '[DEPRECATED] the `valid?` method is obsolete'
214
+ return false if @user_id.nil?
215
+ return false if @auth_method.nil?
216
+ auth_method_validator = EnumAttributeValidator.new('String', ["jwt_token", "api_key"])
217
+ return false unless auth_method_validator.valid?(@auth_method)
218
+ return false if @profile.nil?
219
+ return false if @company_id.nil?
220
+ return false if @role_id.nil?
221
+ true
222
+ end
223
+
224
+ # Custom attribute writer method with validation
225
+ # @param [Object] user_id Value to be assigned
226
+ def user_id=(user_id)
227
+ if user_id.nil?
228
+ fail ArgumentError, 'user_id cannot be nil'
229
+ end
230
+
231
+ @user_id = user_id
232
+ end
233
+
234
+ # Custom attribute writer method checking allowed values (enum).
235
+ # @param [Object] auth_method Object to be assigned
236
+ def auth_method=(auth_method)
237
+ validator = EnumAttributeValidator.new('String', ["jwt_token", "api_key"])
238
+ unless validator.valid?(auth_method)
239
+ fail ArgumentError, "invalid value for \"auth_method\", must be one of #{validator.allowable_values}."
240
+ end
241
+ @auth_method = auth_method
242
+ end
243
+
244
+ # Custom attribute writer method with validation
245
+ # @param [Object] profile Value to be assigned
246
+ def profile=(profile)
247
+ if profile.nil?
248
+ fail ArgumentError, 'profile cannot be nil'
249
+ end
250
+
251
+ @profile = profile
252
+ end
253
+
254
+ # Custom attribute writer method with validation
255
+ # @param [Object] company_id Value to be assigned
256
+ def company_id=(company_id)
257
+ if company_id.nil?
258
+ fail ArgumentError, 'company_id cannot be nil'
259
+ end
260
+
261
+ @company_id = company_id
262
+ end
263
+
264
+ # Custom attribute writer method with validation
265
+ # @param [Object] role_id Value to be assigned
266
+ def role_id=(role_id)
267
+ if role_id.nil?
268
+ fail ArgumentError, 'role_id cannot be nil'
269
+ end
270
+
271
+ @role_id = role_id
272
+ end
273
+
274
+ # Checks equality by comparing each attribute.
275
+ # @param [Object] Object to be compared
276
+ def ==(o)
277
+ return true if self.equal?(o)
278
+ self.class == o.class &&
279
+ user_id == o.user_id &&
280
+ email == o.email &&
281
+ auth_method == o.auth_method &&
282
+ platform == o.platform &&
283
+ origin_domain == o.origin_domain &&
284
+ profile == o.profile &&
285
+ company_id == o.company_id &&
286
+ role_id == o.role_id &&
287
+ token_metadata == o.token_metadata &&
288
+ api_key_info == o.api_key_info
289
+ end
290
+
291
+ # @see the `==` method
292
+ # @param [Object] Object to be compared
293
+ def eql?(o)
294
+ self == o
295
+ end
296
+
297
+ # Calculates hash code according to all attributes.
298
+ # @return [Integer] Hash code
299
+ def hash
300
+ [user_id, email, auth_method, platform, origin_domain, profile, company_id, role_id, token_metadata, api_key_info].hash
301
+ end
302
+
303
+ # Builds the object from hash
304
+ # @param [Hash] attributes Model attributes in the form of hash
305
+ # @return [Object] Returns the model itself
306
+ def self.build_from_hash(attributes)
307
+ return nil unless attributes.is_a?(Hash)
308
+ attributes = attributes.transform_keys(&:to_sym)
309
+ transformed_hash = {}
310
+ openapi_types.each_pair do |key, type|
311
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
312
+ transformed_hash["#{key}"] = nil
313
+ elsif type =~ /\AArray<(.*)>/i
314
+ # check to ensure the input is an array given that the attribute
315
+ # is documented as an array but the input is not
316
+ if attributes[attribute_map[key]].is_a?(Array)
317
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
318
+ end
319
+ elsif !attributes[attribute_map[key]].nil?
320
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
321
+ end
322
+ end
323
+ new(transformed_hash)
324
+ end
325
+
326
+ # Deserializes the data based on type
327
+ # @param string type Data type
328
+ # @param string value Value to be deserialized
329
+ # @return [Object] Deserialized data
330
+ def self._deserialize(type, value)
331
+ case type.to_sym
332
+ when :Time
333
+ Time.parse(value)
334
+ when :Date
335
+ Date.parse(value)
336
+ when :String
337
+ value.to_s
338
+ when :Integer
339
+ value.to_i
340
+ when :Float
341
+ value.to_f
342
+ when :Boolean
343
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
344
+ true
345
+ else
346
+ false
347
+ end
348
+ when :Object
349
+ # generic object (usually a Hash), return directly
350
+ value
351
+ when /\AArray<(?<inner_type>.+)>\z/
352
+ inner_type = Regexp.last_match[:inner_type]
353
+ value.map { |v| _deserialize(inner_type, v) }
354
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
355
+ k_type = Regexp.last_match[:k_type]
356
+ v_type = Regexp.last_match[:v_type]
357
+ {}.tap do |hash|
358
+ value.each do |k, v|
359
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
360
+ end
361
+ end
362
+ else # model
363
+ # models (e.g. Pet) or oneOf
364
+ klass = SparteraApiSdk.const_get(type)
365
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
366
+ end
367
+ end
368
+
369
+ # Returns the string representation of the object
370
+ # @return [String] String presentation of the object
371
+ def to_s
372
+ to_hash.to_s
373
+ end
374
+
375
+ # to_body is an alias to to_hash (backward compatibility)
376
+ # @return [Hash] Returns the object in the form of hash
377
+ def to_body
378
+ to_hash
379
+ end
380
+
381
+ # Returns the object in the form of hash
382
+ # @return [Hash] Returns the object in the form of hash
383
+ def to_hash
384
+ hash = {}
385
+ self.class.attribute_map.each_pair do |attr, param|
386
+ value = self.send(attr)
387
+ if value.nil?
388
+ is_nullable = self.class.openapi_nullable.include?(attr)
389
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
390
+ end
391
+
392
+ hash[param] = _to_hash(value)
393
+ end
394
+ hash
395
+ end
396
+
397
+ # Outputs non-array value in the form of hash
398
+ # For object, use to_hash. Otherwise, just return the value
399
+ # @param [Object] value Any valid value
400
+ # @return [Hash] Returns the value in the form of hash
401
+ def _to_hash(value)
402
+ if value.is_a?(Array)
403
+ value.compact.map { |v| _to_hash(v) }
404
+ elsif value.is_a?(Hash)
405
+ {}.tap do |hash|
406
+ value.each { |k, v| hash[k] = _to_hash(v) }
407
+ end
408
+ elsif value.respond_to? :to_hash
409
+ value.to_hash
410
+ else
411
+ value
412
+ end
413
+ end
414
+
415
+ end
416
+
417
+ end
@@ -0,0 +1,232 @@
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 key information (only for API key authentication)
18
+ class MeGet200ResponseApiKeyInfo
19
+ # API key ID
20
+ attr_accessor :api_key_id
21
+
22
+ # API key name
23
+ attr_accessor :api_key_name
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'api_key_id' => :'api_key_id',
29
+ :'api_key_name' => :'api_key_name'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'api_key_id' => :'String',
47
+ :'api_key_name' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SparteraApiSdk::MeGet200ResponseApiKeyInfo` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SparteraApiSdk::MeGet200ResponseApiKeyInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'api_key_id')
74
+ self.api_key_id = attributes[:'api_key_id']
75
+ end
76
+
77
+ if attributes.key?(:'api_key_name')
78
+ self.api_key_name = attributes[:'api_key_name']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ api_key_id == o.api_key_id &&
103
+ api_key_name == o.api_key_name
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [api_key_id, api_key_name].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def self._deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = SparteraApiSdk.const_get(type)
180
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end