insights-rbac-api-client 1.0.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +49 -22
  4. data/client-meta.json +1 -1
  5. data/docs/Access.md +10 -9
  6. data/docs/AccessApi.md +39 -19
  7. data/docs/AccessPagination.md +12 -11
  8. data/docs/AddRoleToGroup200Response.md +18 -0
  9. data/docs/AdditionalGroup.md +12 -11
  10. data/docs/CrossAccountRequest.md +30 -0
  11. data/docs/CrossAccountRequestApi.md +386 -0
  12. data/docs/CrossAccountRequestByAccount.md +36 -0
  13. data/docs/CrossAccountRequestByUserId.md +32 -0
  14. data/docs/CrossAccountRequestDetail.md +49 -0
  15. data/docs/CrossAccountRequestDetailByAccount.md +38 -0
  16. data/docs/CrossAccountRequestDetailByUseId.md +34 -0
  17. data/docs/CrossAccountRequestIn.md +26 -0
  18. data/docs/CrossAccountRequestOut.md +34 -0
  19. data/docs/CrossAccountRequestPagination.md +22 -0
  20. data/docs/CrossAccountRequestPaginationAllOfDataInner.md +49 -0
  21. data/docs/CrossAccountRequestPatch.md +24 -0
  22. data/docs/CrossAccountRequestUpdateIn.md +22 -0
  23. data/docs/CrossAccountRequestWithRoles.md +32 -0
  24. data/docs/CrossAccountRequestWithRolesRolesInner.md +22 -0
  25. data/docs/Error.md +8 -7
  26. data/docs/Error403.md +8 -7
  27. data/docs/Error403ErrorsInner.md +22 -0
  28. data/docs/ErrorErrorsInner.md +20 -0
  29. data/docs/ErrorNotFound.md +18 -0
  30. data/docs/ErrorNotFoundErrorsInner.md +22 -0
  31. data/docs/Group.md +10 -9
  32. data/docs/GroupApi.md +369 -163
  33. data/docs/GroupOut.md +26 -23
  34. data/docs/GroupPagination.md +12 -11
  35. data/docs/GroupPrincipalIn.md +8 -7
  36. data/docs/GroupRoleIn.md +8 -7
  37. data/docs/GroupRolesPagination.md +12 -11
  38. data/docs/GroupWithPrincipals.md +18 -17
  39. data/docs/GroupWithPrincipalsAndRoles.md +20 -19
  40. data/docs/ListPagination.md +10 -9
  41. data/docs/PaginationLinks.md +14 -13
  42. data/docs/PaginationMeta.md +8 -7
  43. data/docs/Permission.md +26 -0
  44. data/docs/PermissionApi.md +185 -0
  45. data/docs/PermissionOptionsPagination.md +22 -0
  46. data/docs/PermissionPagination.md +22 -0
  47. data/docs/Policy.md +10 -9
  48. data/docs/PolicyApi.md +153 -69
  49. data/docs/PolicyExtended.md +20 -19
  50. data/docs/PolicyIn.md +14 -13
  51. data/docs/PolicyPagination.md +12 -11
  52. data/docs/Principal.md +20 -15
  53. data/docs/PrincipalApi.md +49 -23
  54. data/docs/PrincipalExternalSourceId.md +49 -0
  55. data/docs/PrincipalIn.md +8 -7
  56. data/docs/PrincipalMinimal.md +18 -0
  57. data/docs/PrincipalOut.md +22 -17
  58. data/docs/PrincipalPagination.md +12 -11
  59. data/docs/PrincipalPaginationAllOfDataInner.md +49 -0
  60. data/docs/ResourceDefinition.md +8 -7
  61. data/docs/ResourceDefinitionFilter.md +12 -11
  62. data/docs/ResourceDefinitionFilterValue.md +49 -0
  63. data/docs/ResourceDefinitionFilterValueOneOfInner.md +47 -0
  64. data/docs/Role.md +12 -9
  65. data/docs/RoleApi.md +279 -89
  66. data/docs/RoleIn.md +14 -11
  67. data/docs/RoleOut.md +34 -25
  68. data/docs/RoleOutDynamic.md +40 -29
  69. data/docs/RolePagination.md +12 -11
  70. data/docs/RolePaginationDynamic.md +12 -11
  71. data/docs/RolePatch.md +22 -0
  72. data/docs/RoleWithAccess.md +36 -27
  73. data/docs/Status.md +10 -17
  74. data/docs/StatusApi.md +27 -10
  75. data/docs/Timestamped.md +10 -9
  76. data/docs/UUID.md +8 -7
  77. data/git_push.sh +3 -4
  78. data/insights-rbac-api-client.gemspec +3 -4
  79. data/lib/insights-rbac-api-client/api/access_api.rb +21 -6
  80. data/lib/insights-rbac-api-client/api/cross_account_request_api.rb +423 -0
  81. data/lib/insights-rbac-api-client/api/group_api.rb +120 -55
  82. data/lib/insights-rbac-api-client/api/permission_api.rb +243 -0
  83. data/lib/insights-rbac-api-client/api/policy_api.rb +38 -23
  84. data/lib/insights-rbac-api-client/api/principal_api.rb +44 -12
  85. data/lib/insights-rbac-api-client/api/role_api.rb +154 -41
  86. data/lib/insights-rbac-api-client/api/status_api.rb +5 -4
  87. data/lib/insights-rbac-api-client/api_client.rb +57 -51
  88. data/lib/insights-rbac-api-client/api_error.rb +2 -1
  89. data/lib/insights-rbac-api-client/configuration.rb +62 -13
  90. data/lib/insights-rbac-api-client/models/access.rb +34 -22
  91. data/lib/insights-rbac-api-client/models/access_pagination.rb +32 -23
  92. data/lib/insights-rbac-api-client/models/{inline_response200.rb → add_role_to_group200_response.rb} +35 -25
  93. data/lib/insights-rbac-api-client/models/additional_group.rb +30 -22
  94. data/lib/insights-rbac-api-client/models/cross_account_request.rb +270 -0
  95. data/lib/insights-rbac-api-client/models/cross_account_request_by_account.rb +304 -0
  96. data/lib/insights-rbac-api-client/models/cross_account_request_by_user_id.rb +286 -0
  97. data/lib/insights-rbac-api-client/models/cross_account_request_detail.rb +105 -0
  98. data/lib/insights-rbac-api-client/models/cross_account_request_detail_by_account.rb +316 -0
  99. data/lib/insights-rbac-api-client/models/cross_account_request_detail_by_use_id.rb +296 -0
  100. data/lib/insights-rbac-api-client/models/cross_account_request_in.rb +280 -0
  101. data/lib/insights-rbac-api-client/models/cross_account_request_out.rb +295 -0
  102. data/lib/insights-rbac-api-client/models/cross_account_request_pagination.rb +248 -0
  103. data/lib/insights-rbac-api-client/models/cross_account_request_pagination_all_of_data_inner.rb +105 -0
  104. data/lib/insights-rbac-api-client/models/cross_account_request_patch.rb +277 -0
  105. data/lib/insights-rbac-api-client/models/cross_account_request_update_in.rb +255 -0
  106. data/lib/insights-rbac-api-client/models/cross_account_request_with_roles.rb +279 -0
  107. data/lib/insights-rbac-api-client/models/cross_account_request_with_roles_roles_inner.rb +234 -0
  108. data/lib/insights-rbac-api-client/models/error.rb +33 -23
  109. data/lib/insights-rbac-api-client/models/error403.rb +33 -23
  110. data/lib/insights-rbac-api-client/models/{policy_extended_all_of.rb → error403_errors_inner.rb} +55 -50
  111. data/lib/insights-rbac-api-client/models/{group_with_principals_all_of.rb → error_errors_inner.rb} +49 -39
  112. data/lib/insights-rbac-api-client/models/{policy_in_all_of.rb → error_not_found.rb} +47 -50
  113. data/lib/insights-rbac-api-client/models/{principal_pagination_all_of.rb → error_not_found_errors_inner.rb} +61 -39
  114. data/lib/insights-rbac-api-client/models/group.rb +32 -22
  115. data/lib/insights-rbac-api-client/models/group_out.rb +65 -30
  116. data/lib/insights-rbac-api-client/models/group_pagination.rb +32 -23
  117. data/lib/insights-rbac-api-client/models/group_principal_in.rb +32 -22
  118. data/lib/insights-rbac-api-client/models/group_role_in.rb +32 -22
  119. data/lib/insights-rbac-api-client/models/group_roles_pagination.rb +32 -23
  120. data/lib/insights-rbac-api-client/models/group_with_principals.rb +42 -25
  121. data/lib/insights-rbac-api-client/models/group_with_principals_and_roles.rb +44 -25
  122. data/lib/insights-rbac-api-client/models/list_pagination.rb +30 -22
  123. data/lib/insights-rbac-api-client/models/pagination_links.rb +30 -22
  124. data/lib/insights-rbac-api-client/models/pagination_meta.rb +30 -22
  125. data/lib/insights-rbac-api-client/models/permission.rb +250 -0
  126. data/lib/insights-rbac-api-client/models/{policy_pagination_all_of.rb → permission_options_pagination.rb} +62 -27
  127. data/lib/insights-rbac-api-client/models/{group_pagination_all_of.rb → permission_pagination.rb} +62 -27
  128. data/lib/insights-rbac-api-client/models/policy.rb +32 -22
  129. data/lib/insights-rbac-api-client/models/policy_extended.rb +44 -25
  130. data/lib/insights-rbac-api-client/models/policy_in.rb +37 -24
  131. data/lib/insights-rbac-api-client/models/policy_pagination.rb +33 -24
  132. data/lib/insights-rbac-api-client/models/principal.rb +56 -26
  133. data/lib/insights-rbac-api-client/models/principal_external_source_id.rb +105 -0
  134. data/lib/insights-rbac-api-client/models/principal_in.rb +32 -22
  135. data/lib/insights-rbac-api-client/models/{access_pagination_all_of.rb → principal_minimal.rb} +45 -37
  136. data/lib/insights-rbac-api-client/models/principal_out.rb +55 -23
  137. data/lib/insights-rbac-api-client/models/principal_pagination.rb +34 -25
  138. data/lib/insights-rbac-api-client/models/principal_pagination_all_of_data_inner.rb +105 -0
  139. data/lib/insights-rbac-api-client/models/resource_definition.rb +32 -22
  140. data/lib/insights-rbac-api-client/models/resource_definition_filter.rb +37 -23
  141. data/lib/insights-rbac-api-client/models/resource_definition_filter_value.rb +105 -0
  142. data/lib/insights-rbac-api-client/models/resource_definition_filter_value_one_of_inner.rb +104 -0
  143. data/lib/insights-rbac-api-client/models/role.rb +42 -23
  144. data/lib/insights-rbac-api-client/models/role_in.rb +45 -25
  145. data/lib/insights-rbac-api-client/models/role_out.rb +92 -30
  146. data/lib/insights-rbac-api-client/models/role_out_dynamic.rb +109 -30
  147. data/lib/insights-rbac-api-client/models/role_pagination.rb +32 -23
  148. data/lib/insights-rbac-api-client/models/role_pagination_dynamic.rb +33 -24
  149. data/lib/insights-rbac-api-client/models/{group_with_principals_and_roles_all_of.rb → role_patch.rb} +55 -52
  150. data/lib/insights-rbac-api-client/models/role_with_access.rb +91 -28
  151. data/lib/insights-rbac-api-client/models/status.rb +36 -62
  152. data/lib/insights-rbac-api-client/models/timestamped.rb +36 -24
  153. data/lib/insights-rbac-api-client/models/uuid.rb +32 -22
  154. data/lib/insights-rbac-api-client/version.rb +2 -2
  155. data/lib/insights-rbac-api-client.rb +31 -13
  156. data/openapi.json +1741 -162
  157. data/spec/api/access_api_spec.rb +4 -2
  158. data/spec/api/cross_account_request_api_spec.rb +105 -0
  159. data/spec/api/group_api_spec.rb +26 -16
  160. data/spec/api/permission_api_spec.rb +75 -0
  161. data/spec/api/policy_api_spec.rb +7 -7
  162. data/spec/api/principal_api_spec.rb +10 -5
  163. data/spec/api/role_api_spec.rb +32 -13
  164. data/spec/api/status_api_spec.rb +2 -2
  165. data/spec/api_client_spec.rb +6 -4
  166. data/spec/configuration_spec.rb +4 -4
  167. data/spec/models/access_pagination_spec.rb +9 -14
  168. data/spec/models/access_spec.rb +8 -13
  169. data/spec/models/add_role_to_group200_response_spec.rb +36 -0
  170. data/spec/models/additional_group_spec.rb +9 -14
  171. data/spec/models/cross_account_request_by_account_spec.rb +90 -0
  172. data/spec/models/cross_account_request_by_user_id_spec.rb +78 -0
  173. data/spec/models/cross_account_request_detail_by_account_spec.rb +96 -0
  174. data/spec/models/cross_account_request_detail_by_use_id_spec.rb +84 -0
  175. data/spec/models/cross_account_request_detail_spec.rb +32 -0
  176. data/spec/models/cross_account_request_in_spec.rb +60 -0
  177. data/spec/models/cross_account_request_out_spec.rb +84 -0
  178. data/spec/models/cross_account_request_pagination_all_of_data_inner_spec.rb +32 -0
  179. data/spec/models/cross_account_request_pagination_spec.rb +48 -0
  180. data/spec/models/cross_account_request_patch_spec.rb +58 -0
  181. data/spec/models/cross_account_request_spec.rb +72 -0
  182. data/spec/models/cross_account_request_update_in_spec.rb +48 -0
  183. data/spec/models/cross_account_request_with_roles_roles_inner_spec.rb +48 -0
  184. data/spec/models/cross_account_request_with_roles_spec.rb +78 -0
  185. data/spec/models/error403_errors_inner_spec.rb +48 -0
  186. data/spec/models/error403_spec.rb +7 -12
  187. data/spec/models/error_errors_inner_spec.rb +42 -0
  188. data/spec/models/error_not_found_errors_inner_spec.rb +48 -0
  189. data/spec/models/error_not_found_spec.rb +36 -0
  190. data/spec/models/error_spec.rb +7 -12
  191. data/spec/models/group_out_spec.rb +21 -20
  192. data/spec/models/group_pagination_spec.rb +9 -14
  193. data/spec/models/group_principal_in_spec.rb +7 -12
  194. data/spec/models/group_role_in_spec.rb +7 -12
  195. data/spec/models/group_roles_pagination_spec.rb +9 -14
  196. data/spec/models/group_spec.rb +8 -13
  197. data/spec/models/group_with_principals_and_roles_spec.rb +13 -18
  198. data/spec/models/group_with_principals_spec.rb +12 -17
  199. data/spec/models/list_pagination_spec.rb +8 -13
  200. data/spec/models/pagination_links_spec.rb +10 -15
  201. data/spec/models/pagination_meta_spec.rb +7 -12
  202. data/spec/models/permission_options_pagination_spec.rb +48 -0
  203. data/spec/models/permission_pagination_spec.rb +48 -0
  204. data/spec/models/permission_spec.rb +60 -0
  205. data/spec/models/policy_extended_spec.rb +13 -18
  206. data/spec/models/policy_in_spec.rb +10 -15
  207. data/spec/models/policy_pagination_spec.rb +9 -14
  208. data/spec/models/policy_spec.rb +8 -13
  209. data/spec/models/principal_external_source_id_spec.rb +32 -0
  210. data/spec/models/principal_in_spec.rb +7 -12
  211. data/spec/models/principal_minimal_spec.rb +36 -0
  212. data/spec/models/principal_out_spec.rb +24 -17
  213. data/spec/models/principal_pagination_all_of_data_inner_spec.rb +32 -0
  214. data/spec/models/principal_pagination_spec.rb +9 -14
  215. data/spec/models/principal_spec.rb +23 -16
  216. data/spec/models/resource_definition_filter_spec.rb +10 -15
  217. data/spec/models/resource_definition_filter_value_one_of_inner_spec.rb +32 -0
  218. data/spec/models/resource_definition_filter_value_spec.rb +32 -0
  219. data/spec/models/resource_definition_spec.rb +7 -12
  220. data/spec/models/role_in_spec.rb +15 -14
  221. data/spec/models/role_out_dynamic_spec.rb +48 -23
  222. data/spec/models/role_out_spec.rb +40 -21
  223. data/spec/models/role_pagination_dynamic_spec.rb +9 -14
  224. data/spec/models/role_pagination_spec.rb +9 -14
  225. data/spec/models/role_patch_spec.rb +48 -0
  226. data/spec/models/role_spec.rb +14 -13
  227. data/spec/models/role_with_access_spec.rb +41 -22
  228. data/spec/models/status_spec.rb +8 -37
  229. data/spec/models/timestamped_spec.rb +8 -13
  230. data/spec/models/uuid_spec.rb +7 -12
  231. data/spec/spec_helper.rb +1 -1
  232. metadata +161 -109
  233. data/docs/AccessPaginationAllOf.md +0 -17
  234. data/docs/GroupPaginationAllOf.md +0 -17
  235. data/docs/GroupWithPrincipalsAllOf.md +0 -17
  236. data/docs/GroupWithPrincipalsAndRolesAllOf.md +0 -19
  237. data/docs/InlineResponse200.md +0 -17
  238. data/docs/PolicyExtendedAllOf.md +0 -19
  239. data/docs/PolicyInAllOf.md +0 -19
  240. data/docs/PolicyPaginationAllOf.md +0 -17
  241. data/docs/PrincipalPaginationAllOf.md +0 -17
  242. data/docs/RoleInAllOf.md +0 -17
  243. data/docs/RoleOutDynamicAllOf.md +0 -29
  244. data/docs/RolePaginationDynamicAllOf.md +0 -17
  245. data/lib/insights-rbac-api-client/models/role_in_all_of.rb +0 -213
  246. data/lib/insights-rbac-api-client/models/role_out_dynamic_all_of.rb +0 -346
  247. data/lib/insights-rbac-api-client/models/role_pagination_dynamic_all_of.rb +0 -213
  248. data/spec/models/access_pagination_all_of_spec.rb +0 -41
  249. data/spec/models/group_pagination_all_of_spec.rb +0 -41
  250. data/spec/models/group_with_principals_all_of_spec.rb +0 -41
  251. data/spec/models/group_with_principals_and_roles_all_of_spec.rb +0 -47
  252. data/spec/models/inline_response200_spec.rb +0 -41
  253. data/spec/models/policy_extended_all_of_spec.rb +0 -47
  254. data/spec/models/policy_in_all_of_spec.rb +0 -47
  255. data/spec/models/policy_pagination_all_of_spec.rb +0 -41
  256. data/spec/models/principal_pagination_all_of_spec.rb +0 -41
  257. data/spec/models/role_in_all_of_spec.rb +0 -41
  258. data/spec/models/role_out_dynamic_all_of_spec.rb +0 -77
  259. data/spec/models/role_pagination_dynamic_all_of_spec.rb +0 -41
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module RBACApiClient
16
17
  class PaginationLinks
@@ -32,6 +33,11 @@ module RBACApiClient
32
33
  }
33
34
  end
34
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
35
41
  # Attribute type mapping.
36
42
  def self.openapi_types
37
43
  {
@@ -83,6 +89,7 @@ module RBACApiClient
83
89
  # Show invalid properties with the reasons. Usually used together with valid?
84
90
  # @return Array for valid properties with the reasons
85
91
  def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
93
  invalid_properties = Array.new
87
94
  invalid_properties
88
95
  end
@@ -90,6 +97,7 @@ module RBACApiClient
90
97
  # Check to see if the all the properties in the model are valid
91
98
  # @return true if the model is valid
92
99
  def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
101
  true
94
102
  end
95
103
 
@@ -120,37 +128,33 @@ module RBACApiClient
120
128
  # @param [Hash] attributes Model attributes in the form of hash
121
129
  # @return [Object] Returns the model itself
122
130
  def self.build_from_hash(attributes)
123
- new.build_from_hash(attributes)
124
- end
125
-
126
- # Builds the object from hash
127
- # @param [Hash] attributes Model attributes in the form of hash
128
- # @return [Object] Returns the model itself
129
- def build_from_hash(attributes)
130
131
  return nil unless attributes.is_a?(Hash)
131
- self.class.openapi_types.each_pair do |key, type|
132
- if type =~ /\AArray<(.*)>/i
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
133
138
  # check to ensure the input is an array given that the attribute
134
139
  # is documented as an array but the input is not
135
- if attributes[self.class.attribute_map[key]].is_a?(Array)
136
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
137
142
  end
138
- elsif !attributes[self.class.attribute_map[key]].nil?
139
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
- end # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
141
146
  end
142
-
143
- self
147
+ new(transformed_hash)
144
148
  end
145
149
 
146
150
  # Deserializes the data based on type
147
151
  # @param string type Data type
148
152
  # @param string value Value to be deserialized
149
153
  # @return [Object] Deserialized data
150
- def _deserialize(type, value)
154
+ def self._deserialize(type, value)
151
155
  case type.to_sym
152
- when :DateTime
153
- DateTime.parse(value)
156
+ when :Time
157
+ Time.parse(value)
154
158
  when :Date
155
159
  Date.parse(value)
156
160
  when :String
@@ -180,7 +184,9 @@ module RBACApiClient
180
184
  end
181
185
  end
182
186
  else # model
183
- RBACApiClient.const_get(type).build_from_hash(value)
187
+ # models (e.g. Pet) or oneOf
188
+ klass = RBACApiClient.const_get(type)
189
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
184
190
  end
185
191
  end
186
192
 
@@ -206,7 +212,7 @@ module RBACApiClient
206
212
  is_nullable = self.class.openapi_nullable.include?(attr)
207
213
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
214
  end
209
-
215
+
210
216
  hash[param] = _to_hash(value)
211
217
  end
212
218
  hash
@@ -229,5 +235,7 @@ module RBACApiClient
229
235
  value
230
236
  end
231
237
  end
238
+
232
239
  end
240
+
233
241
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module RBACApiClient
16
17
  class PaginationMeta
@@ -23,6 +24,11 @@ module RBACApiClient
23
24
  }
24
25
  end
25
26
 
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
26
32
  # Attribute type mapping.
27
33
  def self.openapi_types
28
34
  {
@@ -59,6 +65,7 @@ module RBACApiClient
59
65
  # Show invalid properties with the reasons. Usually used together with valid?
60
66
  # @return Array for valid properties with the reasons
61
67
  def list_invalid_properties
68
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
62
69
  invalid_properties = Array.new
63
70
  invalid_properties
64
71
  end
@@ -66,6 +73,7 @@ module RBACApiClient
66
73
  # Check to see if the all the properties in the model are valid
67
74
  # @return true if the model is valid
68
75
  def valid?
76
+ warn '[DEPRECATED] the `valid?` method is obsolete'
69
77
  true
70
78
  end
71
79
 
@@ -93,37 +101,33 @@ module RBACApiClient
93
101
  # @param [Hash] attributes Model attributes in the form of hash
94
102
  # @return [Object] Returns the model itself
95
103
  def self.build_from_hash(attributes)
96
- new.build_from_hash(attributes)
97
- end
98
-
99
- # Builds the object from hash
100
- # @param [Hash] attributes Model attributes in the form of hash
101
- # @return [Object] Returns the model itself
102
- def build_from_hash(attributes)
103
104
  return nil unless attributes.is_a?(Hash)
104
- self.class.openapi_types.each_pair do |key, type|
105
- if type =~ /\AArray<(.*)>/i
105
+ attributes = attributes.transform_keys(&:to_sym)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
110
+ elsif type =~ /\AArray<(.*)>/i
106
111
  # check to ensure the input is an array given that the attribute
107
112
  # is documented as an array but the input is not
108
- if attributes[self.class.attribute_map[key]].is_a?(Array)
109
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
110
115
  end
111
- elsif !attributes[self.class.attribute_map[key]].nil?
112
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
- end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
118
+ end
114
119
  end
115
-
116
- self
120
+ new(transformed_hash)
117
121
  end
118
122
 
119
123
  # Deserializes the data based on type
120
124
  # @param string type Data type
121
125
  # @param string value Value to be deserialized
122
126
  # @return [Object] Deserialized data
123
- def _deserialize(type, value)
127
+ def self._deserialize(type, value)
124
128
  case type.to_sym
125
- when :DateTime
126
- DateTime.parse(value)
129
+ when :Time
130
+ Time.parse(value)
127
131
  when :Date
128
132
  Date.parse(value)
129
133
  when :String
@@ -153,7 +157,9 @@ module RBACApiClient
153
157
  end
154
158
  end
155
159
  else # model
156
- RBACApiClient.const_get(type).build_from_hash(value)
160
+ # models (e.g. Pet) or oneOf
161
+ klass = RBACApiClient.const_get(type)
162
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
157
163
  end
158
164
  end
159
165
 
@@ -179,7 +185,7 @@ module RBACApiClient
179
185
  is_nullable = self.class.openapi_nullable.include?(attr)
180
186
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
187
  end
182
-
188
+
183
189
  hash[param] = _to_hash(value)
184
190
  end
185
191
  hash
@@ -202,5 +208,7 @@ module RBACApiClient
202
208
  value
203
209
  end
204
210
  end
211
+
205
212
  end
213
+
206
214
  end
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #Role Based Access Control
3
+
4
+ #The API for Role Based Access Control.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RBACApiClient
17
+ class Permission
18
+ attr_accessor :application
19
+
20
+ attr_accessor :resource_type
21
+
22
+ attr_accessor :verb
23
+
24
+ attr_accessor :permission
25
+
26
+ attr_accessor :description
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'application' => :'application',
32
+ :'resource_type' => :'resource_type',
33
+ :'verb' => :'verb',
34
+ :'permission' => :'permission',
35
+ :'description' => :'description'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'application' => :'String',
48
+ :'resource_type' => :'String',
49
+ :'verb' => :'String',
50
+ :'permission' => :'String',
51
+ :'description' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RBACApiClient::Permission` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RBACApiClient::Permission`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'application')
77
+ self.application = attributes[:'application']
78
+ end
79
+
80
+ if attributes.key?(:'resource_type')
81
+ self.resource_type = attributes[:'resource_type']
82
+ end
83
+
84
+ if attributes.key?(:'verb')
85
+ self.verb = attributes[:'verb']
86
+ end
87
+
88
+ if attributes.key?(:'permission')
89
+ self.permission = attributes[:'permission']
90
+ end
91
+
92
+ if attributes.key?(:'description')
93
+ self.description = attributes[:'description']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ application == o.application &&
118
+ resource_type == o.resource_type &&
119
+ verb == o.verb &&
120
+ permission == o.permission &&
121
+ description == o.description
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [application, resource_type, verb, permission, description].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def self._deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = RBACApiClient.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -6,27 +6,41 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module RBACApiClient
16
- class PolicyPaginationAllOf
17
+ class PermissionOptionsPagination
18
+ attr_accessor :meta
19
+
20
+ attr_accessor :links
21
+
17
22
  attr_accessor :data
18
23
 
19
24
  # Attribute mapping from ruby-style variable name to JSON key.
20
25
  def self.attribute_map
21
26
  {
27
+ :'meta' => :'meta',
28
+ :'links' => :'links',
22
29
  :'data' => :'data'
23
30
  }
24
31
  end
25
32
 
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
26
38
  # Attribute type mapping.
27
39
  def self.openapi_types
28
40
  {
29
- :'data' => :'Array<PolicyExtended>'
41
+ :'meta' => :'PaginationMeta',
42
+ :'links' => :'PaginationLinks',
43
+ :'data' => :'Array<String>'
30
44
  }
31
45
  end
32
46
 
@@ -36,31 +50,49 @@ module RBACApiClient
36
50
  ])
37
51
  end
38
52
 
53
+ # List of class defined in allOf (OpenAPI v3)
54
+ def self.openapi_all_of
55
+ [
56
+ :'ListPagination'
57
+ ]
58
+ end
59
+
39
60
  # Initializes the object
40
61
  # @param [Hash] attributes Model attributes in the form of hash
41
62
  def initialize(attributes = {})
42
63
  if (!attributes.is_a?(Hash))
43
- fail ArgumentError, "The input argument (attributes) must be a hash in `RBACApiClient::PolicyPaginationAllOf` initialize method"
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RBACApiClient::PermissionOptionsPagination` initialize method"
44
65
  end
45
66
 
46
67
  # check to see if the attribute exists and convert string to symbol for hash key
47
68
  attributes = attributes.each_with_object({}) { |(k, v), h|
48
69
  if (!self.class.attribute_map.key?(k.to_sym))
49
- fail ArgumentError, "`#{k}` is not a valid attribute in `RBACApiClient::PolicyPaginationAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RBACApiClient::PermissionOptionsPagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
71
  end
51
72
  h[k.to_sym] = v
52
73
  }
53
74
 
75
+ if attributes.key?(:'meta')
76
+ self.meta = attributes[:'meta']
77
+ end
78
+
79
+ if attributes.key?(:'links')
80
+ self.links = attributes[:'links']
81
+ end
82
+
54
83
  if attributes.key?(:'data')
55
84
  if (value = attributes[:'data']).is_a?(Array)
56
85
  self.data = value
57
86
  end
87
+ else
88
+ self.data = nil
58
89
  end
59
90
  end
60
91
 
61
92
  # Show invalid properties with the reasons. Usually used together with valid?
62
93
  # @return Array for valid properties with the reasons
63
94
  def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
64
96
  invalid_properties = Array.new
65
97
  if @data.nil?
66
98
  invalid_properties.push('invalid value for "data", data cannot be nil.')
@@ -72,6 +104,7 @@ module RBACApiClient
72
104
  # Check to see if the all the properties in the model are valid
73
105
  # @return true if the model is valid
74
106
  def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
108
  return false if @data.nil?
76
109
  true
77
110
  end
@@ -81,6 +114,8 @@ module RBACApiClient
81
114
  def ==(o)
82
115
  return true if self.equal?(o)
83
116
  self.class == o.class &&
117
+ meta == o.meta &&
118
+ links == o.links &&
84
119
  data == o.data
85
120
  end
86
121
 
@@ -93,44 +128,40 @@ module RBACApiClient
93
128
  # Calculates hash code according to all attributes.
94
129
  # @return [Integer] Hash code
95
130
  def hash
96
- [data].hash
131
+ [meta, links, data].hash
97
132
  end
98
133
 
99
134
  # Builds the object from hash
100
135
  # @param [Hash] attributes Model attributes in the form of hash
101
136
  # @return [Object] Returns the model itself
102
137
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
138
  return nil unless attributes.is_a?(Hash)
111
- self.class.openapi_types.each_pair do |key, type|
112
- if type =~ /\AArray<(.*)>/i
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
+ elsif type =~ /\AArray<(.*)>/i
113
145
  # check to ensure the input is an array given that the attribute
114
146
  # is documented as an array but the input is not
115
- if attributes[self.class.attribute_map[key]].is_a?(Array)
116
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
117
149
  end
118
- elsif !attributes[self.class.attribute_map[key]].nil?
119
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
- end # or else data not found in attributes(hash), not an issue as the data can be optional
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
+ end
121
153
  end
122
-
123
- self
154
+ new(transformed_hash)
124
155
  end
125
156
 
126
157
  # Deserializes the data based on type
127
158
  # @param string type Data type
128
159
  # @param string value Value to be deserialized
129
160
  # @return [Object] Deserialized data
130
- def _deserialize(type, value)
161
+ def self._deserialize(type, value)
131
162
  case type.to_sym
132
- when :DateTime
133
- DateTime.parse(value)
163
+ when :Time
164
+ Time.parse(value)
134
165
  when :Date
135
166
  Date.parse(value)
136
167
  when :String
@@ -160,7 +191,9 @@ module RBACApiClient
160
191
  end
161
192
  end
162
193
  else # model
163
- RBACApiClient.const_get(type).build_from_hash(value)
194
+ # models (e.g. Pet) or oneOf
195
+ klass = RBACApiClient.const_get(type)
196
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
164
197
  end
165
198
  end
166
199
 
@@ -186,7 +219,7 @@ module RBACApiClient
186
219
  is_nullable = self.class.openapi_nullable.include?(attr)
187
220
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
221
  end
189
-
222
+
190
223
  hash[param] = _to_hash(value)
191
224
  end
192
225
  hash
@@ -209,5 +242,7 @@ module RBACApiClient
209
242
  value
210
243
  end
211
244
  end
245
+
212
246
  end
247
+
213
248
  end