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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +49 -22
- data/client-meta.json +1 -1
- data/docs/Access.md +10 -9
- data/docs/AccessApi.md +39 -19
- data/docs/AccessPagination.md +12 -11
- data/docs/AddRoleToGroup200Response.md +18 -0
- data/docs/AdditionalGroup.md +12 -11
- data/docs/CrossAccountRequest.md +30 -0
- data/docs/CrossAccountRequestApi.md +386 -0
- data/docs/CrossAccountRequestByAccount.md +36 -0
- data/docs/CrossAccountRequestByUserId.md +32 -0
- data/docs/CrossAccountRequestDetail.md +49 -0
- data/docs/CrossAccountRequestDetailByAccount.md +38 -0
- data/docs/CrossAccountRequestDetailByUseId.md +34 -0
- data/docs/CrossAccountRequestIn.md +26 -0
- data/docs/CrossAccountRequestOut.md +34 -0
- data/docs/CrossAccountRequestPagination.md +22 -0
- data/docs/CrossAccountRequestPaginationAllOfDataInner.md +49 -0
- data/docs/CrossAccountRequestPatch.md +24 -0
- data/docs/CrossAccountRequestUpdateIn.md +22 -0
- data/docs/CrossAccountRequestWithRoles.md +32 -0
- data/docs/CrossAccountRequestWithRolesRolesInner.md +22 -0
- data/docs/Error.md +8 -7
- data/docs/Error403.md +8 -7
- data/docs/Error403ErrorsInner.md +22 -0
- data/docs/ErrorErrorsInner.md +20 -0
- data/docs/ErrorNotFound.md +18 -0
- data/docs/ErrorNotFoundErrorsInner.md +22 -0
- data/docs/Group.md +10 -9
- data/docs/GroupApi.md +369 -163
- data/docs/GroupOut.md +26 -23
- data/docs/GroupPagination.md +12 -11
- data/docs/GroupPrincipalIn.md +8 -7
- data/docs/GroupRoleIn.md +8 -7
- data/docs/GroupRolesPagination.md +12 -11
- data/docs/GroupWithPrincipals.md +18 -17
- data/docs/GroupWithPrincipalsAndRoles.md +20 -19
- data/docs/ListPagination.md +10 -9
- data/docs/PaginationLinks.md +14 -13
- data/docs/PaginationMeta.md +8 -7
- data/docs/Permission.md +26 -0
- data/docs/PermissionApi.md +185 -0
- data/docs/PermissionOptionsPagination.md +22 -0
- data/docs/PermissionPagination.md +22 -0
- data/docs/Policy.md +10 -9
- data/docs/PolicyApi.md +153 -69
- data/docs/PolicyExtended.md +20 -19
- data/docs/PolicyIn.md +14 -13
- data/docs/PolicyPagination.md +12 -11
- data/docs/Principal.md +20 -15
- data/docs/PrincipalApi.md +49 -23
- data/docs/PrincipalExternalSourceId.md +49 -0
- data/docs/PrincipalIn.md +8 -7
- data/docs/PrincipalMinimal.md +18 -0
- data/docs/PrincipalOut.md +22 -17
- data/docs/PrincipalPagination.md +12 -11
- data/docs/PrincipalPaginationAllOfDataInner.md +49 -0
- data/docs/ResourceDefinition.md +8 -7
- data/docs/ResourceDefinitionFilter.md +12 -11
- data/docs/ResourceDefinitionFilterValue.md +49 -0
- data/docs/ResourceDefinitionFilterValueOneOfInner.md +47 -0
- data/docs/Role.md +12 -9
- data/docs/RoleApi.md +279 -89
- data/docs/RoleIn.md +14 -11
- data/docs/RoleOut.md +34 -25
- data/docs/RoleOutDynamic.md +40 -29
- data/docs/RolePagination.md +12 -11
- data/docs/RolePaginationDynamic.md +12 -11
- data/docs/RolePatch.md +22 -0
- data/docs/RoleWithAccess.md +36 -27
- data/docs/Status.md +10 -17
- data/docs/StatusApi.md +27 -10
- data/docs/Timestamped.md +10 -9
- data/docs/UUID.md +8 -7
- data/git_push.sh +3 -4
- data/insights-rbac-api-client.gemspec +3 -4
- data/lib/insights-rbac-api-client/api/access_api.rb +21 -6
- data/lib/insights-rbac-api-client/api/cross_account_request_api.rb +423 -0
- data/lib/insights-rbac-api-client/api/group_api.rb +120 -55
- data/lib/insights-rbac-api-client/api/permission_api.rb +243 -0
- data/lib/insights-rbac-api-client/api/policy_api.rb +38 -23
- data/lib/insights-rbac-api-client/api/principal_api.rb +44 -12
- data/lib/insights-rbac-api-client/api/role_api.rb +154 -41
- data/lib/insights-rbac-api-client/api/status_api.rb +5 -4
- data/lib/insights-rbac-api-client/api_client.rb +57 -51
- data/lib/insights-rbac-api-client/api_error.rb +2 -1
- data/lib/insights-rbac-api-client/configuration.rb +62 -13
- data/lib/insights-rbac-api-client/models/access.rb +34 -22
- data/lib/insights-rbac-api-client/models/access_pagination.rb +32 -23
- data/lib/insights-rbac-api-client/models/{inline_response200.rb → add_role_to_group200_response.rb} +35 -25
- data/lib/insights-rbac-api-client/models/additional_group.rb +30 -22
- data/lib/insights-rbac-api-client/models/cross_account_request.rb +270 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_by_account.rb +304 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_by_user_id.rb +286 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_detail.rb +105 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_detail_by_account.rb +316 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_detail_by_use_id.rb +296 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_in.rb +280 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_out.rb +295 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_pagination.rb +248 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_pagination_all_of_data_inner.rb +105 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_patch.rb +277 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_update_in.rb +255 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_with_roles.rb +279 -0
- data/lib/insights-rbac-api-client/models/cross_account_request_with_roles_roles_inner.rb +234 -0
- data/lib/insights-rbac-api-client/models/error.rb +33 -23
- data/lib/insights-rbac-api-client/models/error403.rb +33 -23
- data/lib/insights-rbac-api-client/models/{policy_extended_all_of.rb → error403_errors_inner.rb} +55 -50
- data/lib/insights-rbac-api-client/models/{group_with_principals_all_of.rb → error_errors_inner.rb} +49 -39
- data/lib/insights-rbac-api-client/models/{policy_in_all_of.rb → error_not_found.rb} +47 -50
- data/lib/insights-rbac-api-client/models/{principal_pagination_all_of.rb → error_not_found_errors_inner.rb} +61 -39
- data/lib/insights-rbac-api-client/models/group.rb +32 -22
- data/lib/insights-rbac-api-client/models/group_out.rb +65 -30
- data/lib/insights-rbac-api-client/models/group_pagination.rb +32 -23
- data/lib/insights-rbac-api-client/models/group_principal_in.rb +32 -22
- data/lib/insights-rbac-api-client/models/group_role_in.rb +32 -22
- data/lib/insights-rbac-api-client/models/group_roles_pagination.rb +32 -23
- data/lib/insights-rbac-api-client/models/group_with_principals.rb +42 -25
- data/lib/insights-rbac-api-client/models/group_with_principals_and_roles.rb +44 -25
- data/lib/insights-rbac-api-client/models/list_pagination.rb +30 -22
- data/lib/insights-rbac-api-client/models/pagination_links.rb +30 -22
- data/lib/insights-rbac-api-client/models/pagination_meta.rb +30 -22
- data/lib/insights-rbac-api-client/models/permission.rb +250 -0
- data/lib/insights-rbac-api-client/models/{policy_pagination_all_of.rb → permission_options_pagination.rb} +62 -27
- data/lib/insights-rbac-api-client/models/{group_pagination_all_of.rb → permission_pagination.rb} +62 -27
- data/lib/insights-rbac-api-client/models/policy.rb +32 -22
- data/lib/insights-rbac-api-client/models/policy_extended.rb +44 -25
- data/lib/insights-rbac-api-client/models/policy_in.rb +37 -24
- data/lib/insights-rbac-api-client/models/policy_pagination.rb +33 -24
- data/lib/insights-rbac-api-client/models/principal.rb +56 -26
- data/lib/insights-rbac-api-client/models/principal_external_source_id.rb +105 -0
- data/lib/insights-rbac-api-client/models/principal_in.rb +32 -22
- data/lib/insights-rbac-api-client/models/{access_pagination_all_of.rb → principal_minimal.rb} +45 -37
- data/lib/insights-rbac-api-client/models/principal_out.rb +55 -23
- data/lib/insights-rbac-api-client/models/principal_pagination.rb +34 -25
- data/lib/insights-rbac-api-client/models/principal_pagination_all_of_data_inner.rb +105 -0
- data/lib/insights-rbac-api-client/models/resource_definition.rb +32 -22
- data/lib/insights-rbac-api-client/models/resource_definition_filter.rb +37 -23
- data/lib/insights-rbac-api-client/models/resource_definition_filter_value.rb +105 -0
- data/lib/insights-rbac-api-client/models/resource_definition_filter_value_one_of_inner.rb +104 -0
- data/lib/insights-rbac-api-client/models/role.rb +42 -23
- data/lib/insights-rbac-api-client/models/role_in.rb +45 -25
- data/lib/insights-rbac-api-client/models/role_out.rb +92 -30
- data/lib/insights-rbac-api-client/models/role_out_dynamic.rb +109 -30
- data/lib/insights-rbac-api-client/models/role_pagination.rb +32 -23
- data/lib/insights-rbac-api-client/models/role_pagination_dynamic.rb +33 -24
- data/lib/insights-rbac-api-client/models/{group_with_principals_and_roles_all_of.rb → role_patch.rb} +55 -52
- data/lib/insights-rbac-api-client/models/role_with_access.rb +91 -28
- data/lib/insights-rbac-api-client/models/status.rb +36 -62
- data/lib/insights-rbac-api-client/models/timestamped.rb +36 -24
- data/lib/insights-rbac-api-client/models/uuid.rb +32 -22
- data/lib/insights-rbac-api-client/version.rb +2 -2
- data/lib/insights-rbac-api-client.rb +31 -13
- data/openapi.json +1741 -162
- data/spec/api/access_api_spec.rb +4 -2
- data/spec/api/cross_account_request_api_spec.rb +105 -0
- data/spec/api/group_api_spec.rb +26 -16
- data/spec/api/permission_api_spec.rb +75 -0
- data/spec/api/policy_api_spec.rb +7 -7
- data/spec/api/principal_api_spec.rb +10 -5
- data/spec/api/role_api_spec.rb +32 -13
- data/spec/api/status_api_spec.rb +2 -2
- data/spec/api_client_spec.rb +6 -4
- data/spec/configuration_spec.rb +4 -4
- data/spec/models/access_pagination_spec.rb +9 -14
- data/spec/models/access_spec.rb +8 -13
- data/spec/models/add_role_to_group200_response_spec.rb +36 -0
- data/spec/models/additional_group_spec.rb +9 -14
- data/spec/models/cross_account_request_by_account_spec.rb +90 -0
- data/spec/models/cross_account_request_by_user_id_spec.rb +78 -0
- data/spec/models/cross_account_request_detail_by_account_spec.rb +96 -0
- data/spec/models/cross_account_request_detail_by_use_id_spec.rb +84 -0
- data/spec/models/cross_account_request_detail_spec.rb +32 -0
- data/spec/models/cross_account_request_in_spec.rb +60 -0
- data/spec/models/cross_account_request_out_spec.rb +84 -0
- data/spec/models/cross_account_request_pagination_all_of_data_inner_spec.rb +32 -0
- data/spec/models/cross_account_request_pagination_spec.rb +48 -0
- data/spec/models/cross_account_request_patch_spec.rb +58 -0
- data/spec/models/cross_account_request_spec.rb +72 -0
- data/spec/models/cross_account_request_update_in_spec.rb +48 -0
- data/spec/models/cross_account_request_with_roles_roles_inner_spec.rb +48 -0
- data/spec/models/cross_account_request_with_roles_spec.rb +78 -0
- data/spec/models/error403_errors_inner_spec.rb +48 -0
- data/spec/models/error403_spec.rb +7 -12
- data/spec/models/error_errors_inner_spec.rb +42 -0
- data/spec/models/error_not_found_errors_inner_spec.rb +48 -0
- data/spec/models/error_not_found_spec.rb +36 -0
- data/spec/models/error_spec.rb +7 -12
- data/spec/models/group_out_spec.rb +21 -20
- data/spec/models/group_pagination_spec.rb +9 -14
- data/spec/models/group_principal_in_spec.rb +7 -12
- data/spec/models/group_role_in_spec.rb +7 -12
- data/spec/models/group_roles_pagination_spec.rb +9 -14
- data/spec/models/group_spec.rb +8 -13
- data/spec/models/group_with_principals_and_roles_spec.rb +13 -18
- data/spec/models/group_with_principals_spec.rb +12 -17
- data/spec/models/list_pagination_spec.rb +8 -13
- data/spec/models/pagination_links_spec.rb +10 -15
- data/spec/models/pagination_meta_spec.rb +7 -12
- data/spec/models/permission_options_pagination_spec.rb +48 -0
- data/spec/models/permission_pagination_spec.rb +48 -0
- data/spec/models/permission_spec.rb +60 -0
- data/spec/models/policy_extended_spec.rb +13 -18
- data/spec/models/policy_in_spec.rb +10 -15
- data/spec/models/policy_pagination_spec.rb +9 -14
- data/spec/models/policy_spec.rb +8 -13
- data/spec/models/principal_external_source_id_spec.rb +32 -0
- data/spec/models/principal_in_spec.rb +7 -12
- data/spec/models/principal_minimal_spec.rb +36 -0
- data/spec/models/principal_out_spec.rb +24 -17
- data/spec/models/principal_pagination_all_of_data_inner_spec.rb +32 -0
- data/spec/models/principal_pagination_spec.rb +9 -14
- data/spec/models/principal_spec.rb +23 -16
- data/spec/models/resource_definition_filter_spec.rb +10 -15
- data/spec/models/resource_definition_filter_value_one_of_inner_spec.rb +32 -0
- data/spec/models/resource_definition_filter_value_spec.rb +32 -0
- data/spec/models/resource_definition_spec.rb +7 -12
- data/spec/models/role_in_spec.rb +15 -14
- data/spec/models/role_out_dynamic_spec.rb +48 -23
- data/spec/models/role_out_spec.rb +40 -21
- data/spec/models/role_pagination_dynamic_spec.rb +9 -14
- data/spec/models/role_pagination_spec.rb +9 -14
- data/spec/models/role_patch_spec.rb +48 -0
- data/spec/models/role_spec.rb +14 -13
- data/spec/models/role_with_access_spec.rb +41 -22
- data/spec/models/status_spec.rb +8 -37
- data/spec/models/timestamped_spec.rb +8 -13
- data/spec/models/uuid_spec.rb +7 -12
- data/spec/spec_helper.rb +1 -1
- metadata +161 -109
- data/docs/AccessPaginationAllOf.md +0 -17
- data/docs/GroupPaginationAllOf.md +0 -17
- data/docs/GroupWithPrincipalsAllOf.md +0 -17
- data/docs/GroupWithPrincipalsAndRolesAllOf.md +0 -19
- data/docs/InlineResponse200.md +0 -17
- data/docs/PolicyExtendedAllOf.md +0 -19
- data/docs/PolicyInAllOf.md +0 -19
- data/docs/PolicyPaginationAllOf.md +0 -17
- data/docs/PrincipalPaginationAllOf.md +0 -17
- data/docs/RoleInAllOf.md +0 -17
- data/docs/RoleOutDynamicAllOf.md +0 -29
- data/docs/RolePaginationDynamicAllOf.md +0 -17
- data/lib/insights-rbac-api-client/models/role_in_all_of.rb +0 -213
- data/lib/insights-rbac-api-client/models/role_out_dynamic_all_of.rb +0 -346
- data/lib/insights-rbac-api-client/models/role_pagination_dynamic_all_of.rb +0 -213
- data/spec/models/access_pagination_all_of_spec.rb +0 -41
- data/spec/models/group_pagination_all_of_spec.rb +0 -41
- data/spec/models/group_with_principals_all_of_spec.rb +0 -41
- data/spec/models/group_with_principals_and_roles_all_of_spec.rb +0 -47
- data/spec/models/inline_response200_spec.rb +0 -41
- data/spec/models/policy_extended_all_of_spec.rb +0 -47
- data/spec/models/policy_in_all_of_spec.rb +0 -47
- data/spec/models/policy_pagination_all_of_spec.rb +0 -41
- data/spec/models/principal_pagination_all_of_spec.rb +0 -41
- data/spec/models/role_in_all_of_spec.rb +0 -41
- data/spec/models/role_out_dynamic_all_of_spec.rb +0 -77
- 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:
|
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
|
-
|
132
|
-
|
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[
|
136
|
-
|
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[
|
139
|
-
|
140
|
-
end
|
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 :
|
153
|
-
|
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
|
-
|
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:
|
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
|
-
|
105
|
-
|
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[
|
109
|
-
|
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[
|
112
|
-
|
113
|
-
end
|
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 :
|
126
|
-
|
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
|
-
|
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:
|
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
|
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
|
-
:'
|
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::
|
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::
|
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
|
-
|
112
|
-
|
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[
|
116
|
-
|
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[
|
119
|
-
|
120
|
-
end
|
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 :
|
133
|
-
|
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
|
-
|
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
|