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,16 +6,19 @@
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 RoleIn
17
18
  attr_accessor :name
18
19
 
20
+ attr_accessor :display_name
21
+
19
22
  attr_accessor :description
20
23
 
21
24
  attr_accessor :access
@@ -24,15 +27,22 @@ module RBACApiClient
24
27
  def self.attribute_map
25
28
  {
26
29
  :'name' => :'name',
30
+ :'display_name' => :'display_name',
27
31
  :'description' => :'description',
28
32
  :'access' => :'access'
29
33
  }
30
34
  end
31
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
32
41
  # Attribute type mapping.
33
42
  def self.openapi_types
34
43
  {
35
44
  :'name' => :'String',
45
+ :'display_name' => :'String',
36
46
  :'description' => :'String',
37
47
  :'access' => :'Array<Access>'
38
48
  }
@@ -47,8 +57,7 @@ module RBACApiClient
47
57
  # List of class defined in allOf (OpenAPI v3)
48
58
  def self.openapi_all_of
49
59
  [
50
- :'Role',
51
- :'RoleInAllOf'
60
+ :'Role'
52
61
  ]
53
62
  end
54
63
 
@@ -69,6 +78,12 @@ module RBACApiClient
69
78
 
70
79
  if attributes.key?(:'name')
71
80
  self.name = attributes[:'name']
81
+ else
82
+ self.name = nil
83
+ end
84
+
85
+ if attributes.key?(:'display_name')
86
+ self.display_name = attributes[:'display_name']
72
87
  end
73
88
 
74
89
  if attributes.key?(:'description')
@@ -79,12 +94,15 @@ module RBACApiClient
79
94
  if (value = attributes[:'access']).is_a?(Array)
80
95
  self.access = value
81
96
  end
97
+ else
98
+ self.access = nil
82
99
  end
83
100
  end
84
101
 
85
102
  # Show invalid properties with the reasons. Usually used together with valid?
86
103
  # @return Array for valid properties with the reasons
87
104
  def list_invalid_properties
105
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
106
  invalid_properties = Array.new
89
107
  if @name.nil?
90
108
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -100,6 +118,7 @@ module RBACApiClient
100
118
  # Check to see if the all the properties in the model are valid
101
119
  # @return true if the model is valid
102
120
  def valid?
121
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
122
  return false if @name.nil?
104
123
  return false if @access.nil?
105
124
  true
@@ -111,6 +130,7 @@ module RBACApiClient
111
130
  return true if self.equal?(o)
112
131
  self.class == o.class &&
113
132
  name == o.name &&
133
+ display_name == o.display_name &&
114
134
  description == o.description &&
115
135
  access == o.access
116
136
  end
@@ -124,44 +144,40 @@ module RBACApiClient
124
144
  # Calculates hash code according to all attributes.
125
145
  # @return [Integer] Hash code
126
146
  def hash
127
- [name, description, access].hash
147
+ [name, display_name, description, access].hash
128
148
  end
129
149
 
130
150
  # Builds the object from hash
131
151
  # @param [Hash] attributes Model attributes in the form of hash
132
152
  # @return [Object] Returns the model itself
133
153
  def self.build_from_hash(attributes)
134
- new.build_from_hash(attributes)
135
- end
136
-
137
- # Builds the object from hash
138
- # @param [Hash] attributes Model attributes in the form of hash
139
- # @return [Object] Returns the model itself
140
- def build_from_hash(attributes)
141
154
  return nil unless attributes.is_a?(Hash)
142
- self.class.openapi_types.each_pair do |key, type|
143
- if type =~ /\AArray<(.*)>/i
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ transformed_hash = {}
157
+ openapi_types.each_pair do |key, type|
158
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = nil
160
+ elsif type =~ /\AArray<(.*)>/i
144
161
  # check to ensure the input is an array given that the attribute
145
162
  # is documented as an array but the input is not
146
- if attributes[self.class.attribute_map[key]].is_a?(Array)
147
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
165
  end
149
- elsif !attributes[self.class.attribute_map[key]].nil?
150
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
151
- end # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
168
+ end
152
169
  end
153
-
154
- self
170
+ new(transformed_hash)
155
171
  end
156
172
 
157
173
  # Deserializes the data based on type
158
174
  # @param string type Data type
159
175
  # @param string value Value to be deserialized
160
176
  # @return [Object] Deserialized data
161
- def _deserialize(type, value)
177
+ def self._deserialize(type, value)
162
178
  case type.to_sym
163
- when :DateTime
164
- DateTime.parse(value)
179
+ when :Time
180
+ Time.parse(value)
165
181
  when :Date
166
182
  Date.parse(value)
167
183
  when :String
@@ -191,7 +207,9 @@ module RBACApiClient
191
207
  end
192
208
  end
193
209
  else # model
194
- RBACApiClient.const_get(type).build_from_hash(value)
210
+ # models (e.g. Pet) or oneOf
211
+ klass = RBACApiClient.const_get(type)
212
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195
213
  end
196
214
  end
197
215
 
@@ -217,7 +235,7 @@ module RBACApiClient
217
235
  is_nullable = self.class.openapi_nullable.include?(attr)
218
236
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
237
  end
220
-
238
+
221
239
  hash[param] = _to_hash(value)
222
240
  end
223
241
  hash
@@ -240,5 +258,7 @@ module RBACApiClient
240
258
  value
241
259
  end
242
260
  end
261
+
243
262
  end
263
+
244
264
  end
@@ -6,16 +6,19 @@
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 RoleOut
17
18
  attr_accessor :name
18
19
 
20
+ attr_accessor :display_name
21
+
19
22
  attr_accessor :description
20
23
 
21
24
  attr_accessor :uuid
@@ -34,10 +37,17 @@ module RBACApiClient
34
37
 
35
38
  attr_accessor :platform_default
36
39
 
40
+ attr_accessor :admin_default
41
+
42
+ attr_accessor :external_role_id
43
+
44
+ attr_accessor :external_tenant
45
+
37
46
  # Attribute mapping from ruby-style variable name to JSON key.
38
47
  def self.attribute_map
39
48
  {
40
49
  :'name' => :'name',
50
+ :'display_name' => :'display_name',
41
51
  :'description' => :'description',
42
52
  :'uuid' => :'uuid',
43
53
  :'created' => :'created',
@@ -46,23 +56,35 @@ module RBACApiClient
46
56
  :'access_count' => :'accessCount',
47
57
  :'applications' => :'applications',
48
58
  :'system' => :'system',
49
- :'platform_default' => :'platform_default'
59
+ :'platform_default' => :'platform_default',
60
+ :'admin_default' => :'admin_default',
61
+ :'external_role_id' => :'external_role_id',
62
+ :'external_tenant' => :'external_tenant'
50
63
  }
51
64
  end
52
65
 
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ attribute_map.values
69
+ end
70
+
53
71
  # Attribute type mapping.
54
72
  def self.openapi_types
55
73
  {
56
74
  :'name' => :'String',
75
+ :'display_name' => :'String',
57
76
  :'description' => :'String',
58
77
  :'uuid' => :'String',
59
- :'created' => :'DateTime',
60
- :'modified' => :'DateTime',
78
+ :'created' => :'Time',
79
+ :'modified' => :'Time',
61
80
  :'policy_count' => :'Integer',
62
81
  :'access_count' => :'Integer',
63
82
  :'applications' => :'Array<String>',
64
83
  :'system' => :'Boolean',
65
- :'platform_default' => :'Boolean'
84
+ :'platform_default' => :'Boolean',
85
+ :'admin_default' => :'Boolean',
86
+ :'external_role_id' => :'String',
87
+ :'external_tenant' => :'String'
66
88
  }
67
89
  end
68
90
 
@@ -98,6 +120,12 @@ module RBACApiClient
98
120
 
99
121
  if attributes.key?(:'name')
100
122
  self.name = attributes[:'name']
123
+ else
124
+ self.name = nil
125
+ end
126
+
127
+ if attributes.key?(:'display_name')
128
+ self.display_name = attributes[:'display_name']
101
129
  end
102
130
 
103
131
  if attributes.key?(:'description')
@@ -106,14 +134,20 @@ module RBACApiClient
106
134
 
107
135
  if attributes.key?(:'uuid')
108
136
  self.uuid = attributes[:'uuid']
137
+ else
138
+ self.uuid = nil
109
139
  end
110
140
 
111
141
  if attributes.key?(:'created')
112
142
  self.created = attributes[:'created']
143
+ else
144
+ self.created = nil
113
145
  end
114
146
 
115
147
  if attributes.key?(:'modified')
116
148
  self.modified = attributes[:'modified']
149
+ else
150
+ self.modified = nil
117
151
  end
118
152
 
119
153
  if attributes.key?(:'policy_count')
@@ -141,11 +175,26 @@ module RBACApiClient
141
175
  else
142
176
  self.platform_default = false
143
177
  end
178
+
179
+ if attributes.key?(:'admin_default')
180
+ self.admin_default = attributes[:'admin_default']
181
+ else
182
+ self.admin_default = false
183
+ end
184
+
185
+ if attributes.key?(:'external_role_id')
186
+ self.external_role_id = attributes[:'external_role_id']
187
+ end
188
+
189
+ if attributes.key?(:'external_tenant')
190
+ self.external_tenant = attributes[:'external_tenant']
191
+ end
144
192
  end
145
193
 
146
194
  # Show invalid properties with the reasons. Usually used together with valid?
147
195
  # @return Array for valid properties with the reasons
148
196
  def list_invalid_properties
197
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
149
198
  invalid_properties = Array.new
150
199
  if @name.nil?
151
200
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -177,6 +226,7 @@ module RBACApiClient
177
226
  # Check to see if the all the properties in the model are valid
178
227
  # @return true if the model is valid
179
228
  def valid?
229
+ warn '[DEPRECATED] the `valid?` method is obsolete'
180
230
  return false if @name.nil?
181
231
  return false if @uuid.nil?
182
232
  return false if @created.nil?
@@ -189,7 +239,11 @@ module RBACApiClient
189
239
  # Custom attribute writer method with validation
190
240
  # @param [Object] policy_count Value to be assigned
191
241
  def policy_count=(policy_count)
192
- if !policy_count.nil? && policy_count < 0
242
+ if policy_count.nil?
243
+ fail ArgumentError, 'policy_count cannot be nil'
244
+ end
245
+
246
+ if policy_count < 0
193
247
  fail ArgumentError, 'invalid value for "policy_count", must be greater than or equal to 0.'
194
248
  end
195
249
 
@@ -199,7 +253,11 @@ module RBACApiClient
199
253
  # Custom attribute writer method with validation
200
254
  # @param [Object] access_count Value to be assigned
201
255
  def access_count=(access_count)
202
- if !access_count.nil? && access_count < 0
256
+ if access_count.nil?
257
+ fail ArgumentError, 'access_count cannot be nil'
258
+ end
259
+
260
+ if access_count < 0
203
261
  fail ArgumentError, 'invalid value for "access_count", must be greater than or equal to 0.'
204
262
  end
205
263
 
@@ -212,6 +270,7 @@ module RBACApiClient
212
270
  return true if self.equal?(o)
213
271
  self.class == o.class &&
214
272
  name == o.name &&
273
+ display_name == o.display_name &&
215
274
  description == o.description &&
216
275
  uuid == o.uuid &&
217
276
  created == o.created &&
@@ -220,7 +279,10 @@ module RBACApiClient
220
279
  access_count == o.access_count &&
221
280
  applications == o.applications &&
222
281
  system == o.system &&
223
- platform_default == o.platform_default
282
+ platform_default == o.platform_default &&
283
+ admin_default == o.admin_default &&
284
+ external_role_id == o.external_role_id &&
285
+ external_tenant == o.external_tenant
224
286
  end
225
287
 
226
288
  # @see the `==` method
@@ -232,44 +294,40 @@ module RBACApiClient
232
294
  # Calculates hash code according to all attributes.
233
295
  # @return [Integer] Hash code
234
296
  def hash
235
- [name, description, uuid, created, modified, policy_count, access_count, applications, system, platform_default].hash
297
+ [name, display_name, description, uuid, created, modified, policy_count, access_count, applications, system, platform_default, admin_default, external_role_id, external_tenant].hash
236
298
  end
237
299
 
238
300
  # Builds the object from hash
239
301
  # @param [Hash] attributes Model attributes in the form of hash
240
302
  # @return [Object] Returns the model itself
241
303
  def self.build_from_hash(attributes)
242
- new.build_from_hash(attributes)
243
- end
244
-
245
- # Builds the object from hash
246
- # @param [Hash] attributes Model attributes in the form of hash
247
- # @return [Object] Returns the model itself
248
- def build_from_hash(attributes)
249
304
  return nil unless attributes.is_a?(Hash)
250
- self.class.openapi_types.each_pair do |key, type|
251
- if type =~ /\AArray<(.*)>/i
305
+ attributes = attributes.transform_keys(&:to_sym)
306
+ transformed_hash = {}
307
+ openapi_types.each_pair do |key, type|
308
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
309
+ transformed_hash["#{key}"] = nil
310
+ elsif type =~ /\AArray<(.*)>/i
252
311
  # check to ensure the input is an array given that the attribute
253
312
  # is documented as an array but the input is not
254
- if attributes[self.class.attribute_map[key]].is_a?(Array)
255
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
313
+ if attributes[attribute_map[key]].is_a?(Array)
314
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
256
315
  end
257
- elsif !attributes[self.class.attribute_map[key]].nil?
258
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
259
- end # or else data not found in attributes(hash), not an issue as the data can be optional
316
+ elsif !attributes[attribute_map[key]].nil?
317
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
318
+ end
260
319
  end
261
-
262
- self
320
+ new(transformed_hash)
263
321
  end
264
322
 
265
323
  # Deserializes the data based on type
266
324
  # @param string type Data type
267
325
  # @param string value Value to be deserialized
268
326
  # @return [Object] Deserialized data
269
- def _deserialize(type, value)
327
+ def self._deserialize(type, value)
270
328
  case type.to_sym
271
- when :DateTime
272
- DateTime.parse(value)
329
+ when :Time
330
+ Time.parse(value)
273
331
  when :Date
274
332
  Date.parse(value)
275
333
  when :String
@@ -299,7 +357,9 @@ module RBACApiClient
299
357
  end
300
358
  end
301
359
  else # model
302
- RBACApiClient.const_get(type).build_from_hash(value)
360
+ # models (e.g. Pet) or oneOf
361
+ klass = RBACApiClient.const_get(type)
362
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
303
363
  end
304
364
  end
305
365
 
@@ -325,7 +385,7 @@ module RBACApiClient
325
385
  is_nullable = self.class.openapi_nullable.include?(attr)
326
386
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
327
387
  end
328
-
388
+
329
389
  hash[param] = _to_hash(value)
330
390
  end
331
391
  hash
@@ -348,5 +408,7 @@ module RBACApiClient
348
408
  value
349
409
  end
350
410
  end
411
+
351
412
  end
413
+
352
414
  end