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 PolicyPagination
|
@@ -29,6 +30,11 @@ module RBACApiClient
|
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
32
38
|
# Attribute type mapping.
|
33
39
|
def self.openapi_types
|
34
40
|
{
|
@@ -47,8 +53,7 @@ module RBACApiClient
|
|
47
53
|
# List of class defined in allOf (OpenAPI v3)
|
48
54
|
def self.openapi_all_of
|
49
55
|
[
|
50
|
-
:'ListPagination'
|
51
|
-
:'PolicyPaginationAllOf'
|
56
|
+
:'ListPagination'
|
52
57
|
]
|
53
58
|
end
|
54
59
|
|
@@ -79,12 +84,15 @@ module RBACApiClient
|
|
79
84
|
if (value = attributes[:'data']).is_a?(Array)
|
80
85
|
self.data = value
|
81
86
|
end
|
87
|
+
else
|
88
|
+
self.data = nil
|
82
89
|
end
|
83
90
|
end
|
84
91
|
|
85
92
|
# Show invalid properties with the reasons. Usually used together with valid?
|
86
93
|
# @return Array for valid properties with the reasons
|
87
94
|
def list_invalid_properties
|
95
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
88
96
|
invalid_properties = Array.new
|
89
97
|
if @data.nil?
|
90
98
|
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
@@ -96,6 +104,7 @@ module RBACApiClient
|
|
96
104
|
# Check to see if the all the properties in the model are valid
|
97
105
|
# @return true if the model is valid
|
98
106
|
def valid?
|
107
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
99
108
|
return false if @data.nil?
|
100
109
|
true
|
101
110
|
end
|
@@ -126,37 +135,33 @@ module RBACApiClient
|
|
126
135
|
# @param [Hash] attributes Model attributes in the form of hash
|
127
136
|
# @return [Object] Returns the model itself
|
128
137
|
def self.build_from_hash(attributes)
|
129
|
-
new.build_from_hash(attributes)
|
130
|
-
end
|
131
|
-
|
132
|
-
# Builds the object from hash
|
133
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
-
# @return [Object] Returns the model itself
|
135
|
-
def build_from_hash(attributes)
|
136
138
|
return nil unless attributes.is_a?(Hash)
|
137
|
-
|
138
|
-
|
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
|
139
145
|
# check to ensure the input is an array given that the attribute
|
140
146
|
# is documented as an array but the input is not
|
141
|
-
if attributes[
|
142
|
-
|
147
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
148
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
143
149
|
end
|
144
|
-
elsif !attributes[
|
145
|
-
|
146
|
-
end
|
150
|
+
elsif !attributes[attribute_map[key]].nil?
|
151
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
152
|
+
end
|
147
153
|
end
|
148
|
-
|
149
|
-
self
|
154
|
+
new(transformed_hash)
|
150
155
|
end
|
151
156
|
|
152
157
|
# Deserializes the data based on type
|
153
158
|
# @param string type Data type
|
154
159
|
# @param string value Value to be deserialized
|
155
160
|
# @return [Object] Deserialized data
|
156
|
-
def _deserialize(type, value)
|
161
|
+
def self._deserialize(type, value)
|
157
162
|
case type.to_sym
|
158
|
-
when :
|
159
|
-
|
163
|
+
when :Time
|
164
|
+
Time.parse(value)
|
160
165
|
when :Date
|
161
166
|
Date.parse(value)
|
162
167
|
when :String
|
@@ -186,7 +191,9 @@ module RBACApiClient
|
|
186
191
|
end
|
187
192
|
end
|
188
193
|
else # model
|
189
|
-
|
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)
|
190
197
|
end
|
191
198
|
end
|
192
199
|
|
@@ -212,7 +219,7 @@ module RBACApiClient
|
|
212
219
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
213
220
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
214
221
|
end
|
215
|
-
|
222
|
+
|
216
223
|
hash[param] = _to_hash(value)
|
217
224
|
end
|
218
225
|
hash
|
@@ -235,5 +242,7 @@ module RBACApiClient
|
|
235
242
|
value
|
236
243
|
end
|
237
244
|
end
|
245
|
+
|
238
246
|
end
|
247
|
+
|
239
248
|
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 Principal
|
@@ -24,6 +25,10 @@ module RBACApiClient
|
|
24
25
|
|
25
26
|
attr_accessor :is_active
|
26
27
|
|
28
|
+
attr_accessor :is_org_admin
|
29
|
+
|
30
|
+
attr_accessor :external_source_id
|
31
|
+
|
27
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
28
33
|
def self.attribute_map
|
29
34
|
{
|
@@ -31,10 +36,17 @@ module RBACApiClient
|
|
31
36
|
:'email' => :'email',
|
32
37
|
:'first_name' => :'first_name',
|
33
38
|
:'last_name' => :'last_name',
|
34
|
-
:'is_active' => :'is_active'
|
39
|
+
:'is_active' => :'is_active',
|
40
|
+
:'is_org_admin' => :'is_org_admin',
|
41
|
+
:'external_source_id' => :'external_source_id'
|
35
42
|
}
|
36
43
|
end
|
37
44
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
46
|
+
def self.acceptable_attributes
|
47
|
+
attribute_map.values
|
48
|
+
end
|
49
|
+
|
38
50
|
# Attribute type mapping.
|
39
51
|
def self.openapi_types
|
40
52
|
{
|
@@ -42,7 +54,9 @@ module RBACApiClient
|
|
42
54
|
:'email' => :'String',
|
43
55
|
:'first_name' => :'String',
|
44
56
|
:'last_name' => :'String',
|
45
|
-
:'is_active' => :'Boolean'
|
57
|
+
:'is_active' => :'Boolean',
|
58
|
+
:'is_org_admin' => :'Boolean',
|
59
|
+
:'external_source_id' => :'PrincipalExternalSourceId'
|
46
60
|
}
|
47
61
|
end
|
48
62
|
|
@@ -69,10 +83,14 @@ module RBACApiClient
|
|
69
83
|
|
70
84
|
if attributes.key?(:'username')
|
71
85
|
self.username = attributes[:'username']
|
86
|
+
else
|
87
|
+
self.username = nil
|
72
88
|
end
|
73
89
|
|
74
90
|
if attributes.key?(:'email')
|
75
91
|
self.email = attributes[:'email']
|
92
|
+
else
|
93
|
+
self.email = nil
|
76
94
|
end
|
77
95
|
|
78
96
|
if attributes.key?(:'first_name')
|
@@ -86,11 +104,20 @@ module RBACApiClient
|
|
86
104
|
if attributes.key?(:'is_active')
|
87
105
|
self.is_active = attributes[:'is_active']
|
88
106
|
end
|
107
|
+
|
108
|
+
if attributes.key?(:'is_org_admin')
|
109
|
+
self.is_org_admin = attributes[:'is_org_admin']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'external_source_id')
|
113
|
+
self.external_source_id = attributes[:'external_source_id']
|
114
|
+
end
|
89
115
|
end
|
90
116
|
|
91
117
|
# Show invalid properties with the reasons. Usually used together with valid?
|
92
118
|
# @return Array for valid properties with the reasons
|
93
119
|
def list_invalid_properties
|
120
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
94
121
|
invalid_properties = Array.new
|
95
122
|
if @username.nil?
|
96
123
|
invalid_properties.push('invalid value for "username", username cannot be nil.')
|
@@ -106,6 +133,7 @@ module RBACApiClient
|
|
106
133
|
# Check to see if the all the properties in the model are valid
|
107
134
|
# @return true if the model is valid
|
108
135
|
def valid?
|
136
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
109
137
|
return false if @username.nil?
|
110
138
|
return false if @email.nil?
|
111
139
|
true
|
@@ -120,7 +148,9 @@ module RBACApiClient
|
|
120
148
|
email == o.email &&
|
121
149
|
first_name == o.first_name &&
|
122
150
|
last_name == o.last_name &&
|
123
|
-
is_active == o.is_active
|
151
|
+
is_active == o.is_active &&
|
152
|
+
is_org_admin == o.is_org_admin &&
|
153
|
+
external_source_id == o.external_source_id
|
124
154
|
end
|
125
155
|
|
126
156
|
# @see the `==` method
|
@@ -132,44 +162,40 @@ module RBACApiClient
|
|
132
162
|
# Calculates hash code according to all attributes.
|
133
163
|
# @return [Integer] Hash code
|
134
164
|
def hash
|
135
|
-
[username, email, first_name, last_name, is_active].hash
|
165
|
+
[username, email, first_name, last_name, is_active, is_org_admin, external_source_id].hash
|
136
166
|
end
|
137
167
|
|
138
168
|
# Builds the object from hash
|
139
169
|
# @param [Hash] attributes Model attributes in the form of hash
|
140
170
|
# @return [Object] Returns the model itself
|
141
171
|
def self.build_from_hash(attributes)
|
142
|
-
new.build_from_hash(attributes)
|
143
|
-
end
|
144
|
-
|
145
|
-
# Builds the object from hash
|
146
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
-
# @return [Object] Returns the model itself
|
148
|
-
def build_from_hash(attributes)
|
149
172
|
return nil unless attributes.is_a?(Hash)
|
150
|
-
|
151
|
-
|
173
|
+
attributes = attributes.transform_keys(&:to_sym)
|
174
|
+
transformed_hash = {}
|
175
|
+
openapi_types.each_pair do |key, type|
|
176
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
177
|
+
transformed_hash["#{key}"] = nil
|
178
|
+
elsif type =~ /\AArray<(.*)>/i
|
152
179
|
# check to ensure the input is an array given that the attribute
|
153
180
|
# is documented as an array but the input is not
|
154
|
-
if attributes[
|
155
|
-
|
181
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
182
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
156
183
|
end
|
157
|
-
elsif !attributes[
|
158
|
-
|
159
|
-
end
|
184
|
+
elsif !attributes[attribute_map[key]].nil?
|
185
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
186
|
+
end
|
160
187
|
end
|
161
|
-
|
162
|
-
self
|
188
|
+
new(transformed_hash)
|
163
189
|
end
|
164
190
|
|
165
191
|
# Deserializes the data based on type
|
166
192
|
# @param string type Data type
|
167
193
|
# @param string value Value to be deserialized
|
168
194
|
# @return [Object] Deserialized data
|
169
|
-
def _deserialize(type, value)
|
195
|
+
def self._deserialize(type, value)
|
170
196
|
case type.to_sym
|
171
|
-
when :
|
172
|
-
|
197
|
+
when :Time
|
198
|
+
Time.parse(value)
|
173
199
|
when :Date
|
174
200
|
Date.parse(value)
|
175
201
|
when :String
|
@@ -199,7 +225,9 @@ module RBACApiClient
|
|
199
225
|
end
|
200
226
|
end
|
201
227
|
else # model
|
202
|
-
|
228
|
+
# models (e.g. Pet) or oneOf
|
229
|
+
klass = RBACApiClient.const_get(type)
|
230
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
203
231
|
end
|
204
232
|
end
|
205
233
|
|
@@ -225,7 +253,7 @@ module RBACApiClient
|
|
225
253
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
226
254
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
227
255
|
end
|
228
|
-
|
256
|
+
|
229
257
|
hash[param] = _to_hash(value)
|
230
258
|
end
|
231
259
|
hash
|
@@ -248,5 +276,7 @@ module RBACApiClient
|
|
248
276
|
value
|
249
277
|
end
|
250
278
|
end
|
279
|
+
|
251
280
|
end
|
281
|
+
|
252
282
|
end
|
@@ -0,0 +1,105 @@
|
|
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
|
+
module PrincipalExternalSourceId
|
18
|
+
class << self
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
20
|
+
def openapi_one_of
|
21
|
+
[
|
22
|
+
:'Integer',
|
23
|
+
:'String'
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
# Builds the object
|
28
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
29
|
+
# @return [Object] Returns the model or the data itself
|
30
|
+
def build(data)
|
31
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
32
|
+
# Note:
|
33
|
+
# - We do not attempt to check whether exactly one item matches.
|
34
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
35
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
36
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
37
|
+
# - TODO: logging when debugging is set.
|
38
|
+
openapi_one_of.each do |klass|
|
39
|
+
begin
|
40
|
+
next if klass == :AnyType # "nullable: true"
|
41
|
+
typed_data = find_and_cast_into_type(klass, data)
|
42
|
+
return typed_data if typed_data
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
53
|
+
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
55
|
+
def find_and_cast_into_type(klass, data)
|
56
|
+
return if data.nil?
|
57
|
+
|
58
|
+
case klass.to_s
|
59
|
+
when 'Boolean'
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
61
|
+
when 'Float'
|
62
|
+
return data if data.instance_of?(Float)
|
63
|
+
when 'Integer'
|
64
|
+
return data if data.instance_of?(Integer)
|
65
|
+
when 'Time'
|
66
|
+
return Time.parse(data)
|
67
|
+
when 'Date'
|
68
|
+
return Date.parse(data)
|
69
|
+
when 'String'
|
70
|
+
return data if data.instance_of?(String)
|
71
|
+
when 'Object' # "type: object"
|
72
|
+
return data if data.instance_of?(Hash)
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
74
|
+
if data.instance_of?(Array)
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
77
|
+
end
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
82
|
+
end
|
83
|
+
else # model
|
84
|
+
const = RBACApiClient.const_get(klass)
|
85
|
+
if const
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
87
|
+
model = const.build(data)
|
88
|
+
return model if model
|
89
|
+
else
|
90
|
+
# raise if data contains keys that are not known to the model
|
91
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
92
|
+
model = const.build_from_hash(data)
|
93
|
+
return model if model
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
raise # if no match by now, raise
|
99
|
+
rescue
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
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 PrincipalIn
|
@@ -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
|
{
|
@@ -53,12 +59,15 @@ module RBACApiClient
|
|
53
59
|
|
54
60
|
if attributes.key?(:'username')
|
55
61
|
self.username = attributes[:'username']
|
62
|
+
else
|
63
|
+
self.username = nil
|
56
64
|
end
|
57
65
|
end
|
58
66
|
|
59
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
60
68
|
# @return Array for valid properties with the reasons
|
61
69
|
def list_invalid_properties
|
70
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
62
71
|
invalid_properties = Array.new
|
63
72
|
if @username.nil?
|
64
73
|
invalid_properties.push('invalid value for "username", username cannot be nil.')
|
@@ -70,6 +79,7 @@ module RBACApiClient
|
|
70
79
|
# Check to see if the all the properties in the model are valid
|
71
80
|
# @return true if the model is valid
|
72
81
|
def valid?
|
82
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
73
83
|
return false if @username.nil?
|
74
84
|
true
|
75
85
|
end
|
@@ -98,37 +108,33 @@ module RBACApiClient
|
|
98
108
|
# @param [Hash] attributes Model attributes in the form of hash
|
99
109
|
# @return [Object] Returns the model itself
|
100
110
|
def self.build_from_hash(attributes)
|
101
|
-
new.build_from_hash(attributes)
|
102
|
-
end
|
103
|
-
|
104
|
-
# Builds the object from hash
|
105
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
-
# @return [Object] Returns the model itself
|
107
|
-
def build_from_hash(attributes)
|
108
111
|
return nil unless attributes.is_a?(Hash)
|
109
|
-
|
110
|
-
|
112
|
+
attributes = attributes.transform_keys(&:to_sym)
|
113
|
+
transformed_hash = {}
|
114
|
+
openapi_types.each_pair do |key, type|
|
115
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash["#{key}"] = nil
|
117
|
+
elsif type =~ /\AArray<(.*)>/i
|
111
118
|
# check to ensure the input is an array given that the attribute
|
112
119
|
# is documented as an array but the input is not
|
113
|
-
if attributes[
|
114
|
-
|
120
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
121
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
115
122
|
end
|
116
|
-
elsif !attributes[
|
117
|
-
|
118
|
-
end
|
123
|
+
elsif !attributes[attribute_map[key]].nil?
|
124
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
125
|
+
end
|
119
126
|
end
|
120
|
-
|
121
|
-
self
|
127
|
+
new(transformed_hash)
|
122
128
|
end
|
123
129
|
|
124
130
|
# Deserializes the data based on type
|
125
131
|
# @param string type Data type
|
126
132
|
# @param string value Value to be deserialized
|
127
133
|
# @return [Object] Deserialized data
|
128
|
-
def _deserialize(type, value)
|
134
|
+
def self._deserialize(type, value)
|
129
135
|
case type.to_sym
|
130
|
-
when :
|
131
|
-
|
136
|
+
when :Time
|
137
|
+
Time.parse(value)
|
132
138
|
when :Date
|
133
139
|
Date.parse(value)
|
134
140
|
when :String
|
@@ -158,7 +164,9 @@ module RBACApiClient
|
|
158
164
|
end
|
159
165
|
end
|
160
166
|
else # model
|
161
|
-
|
167
|
+
# models (e.g. Pet) or oneOf
|
168
|
+
klass = RBACApiClient.const_get(type)
|
169
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
162
170
|
end
|
163
171
|
end
|
164
172
|
|
@@ -184,7 +192,7 @@ module RBACApiClient
|
|
184
192
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
185
193
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
186
194
|
end
|
187
|
-
|
195
|
+
|
188
196
|
hash[param] = _to_hash(value)
|
189
197
|
end
|
190
198
|
hash
|
@@ -207,5 +215,7 @@ module RBACApiClient
|
|
207
215
|
value
|
208
216
|
end
|
209
217
|
end
|
218
|
+
|
210
219
|
end
|
220
|
+
|
211
221
|
end
|