rbac-api-client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +175 -0
- data/Rakefile +10 -0
- data/client-meta.json +8 -0
- data/docs/Access.md +19 -0
- data/docs/AccessApi.md +68 -0
- data/docs/AccessPagination.md +21 -0
- data/docs/AccessPaginationAllOf.md +17 -0
- data/docs/AdditionalGroup.md +19 -0
- data/docs/Error.md +17 -0
- data/docs/Error403.md +17 -0
- data/docs/Group.md +19 -0
- data/docs/GroupApi.md +623 -0
- data/docs/GroupOut.md +33 -0
- data/docs/GroupPagination.md +21 -0
- data/docs/GroupPaginationAllOf.md +17 -0
- data/docs/GroupPrincipalIn.md +17 -0
- data/docs/GroupRoleIn.md +17 -0
- data/docs/GroupRolesPagination.md +21 -0
- data/docs/GroupWithPrincipals.md +27 -0
- data/docs/GroupWithPrincipalsAllOf.md +17 -0
- data/docs/GroupWithPrincipalsAndRoles.md +29 -0
- data/docs/GroupWithPrincipalsAndRolesAllOf.md +19 -0
- data/docs/InlineResponse200.md +17 -0
- data/docs/ListPagination.md +19 -0
- data/docs/PaginationLinks.md +23 -0
- data/docs/PaginationMeta.md +17 -0
- data/docs/Policy.md +19 -0
- data/docs/PolicyApi.md +283 -0
- data/docs/PolicyExtended.md +29 -0
- data/docs/PolicyExtendedAllOf.md +19 -0
- data/docs/PolicyIn.md +23 -0
- data/docs/PolicyInAllOf.md +19 -0
- data/docs/PolicyPagination.md +21 -0
- data/docs/PolicyPaginationAllOf.md +17 -0
- data/docs/Principal.md +25 -0
- data/docs/PrincipalApi.md +68 -0
- data/docs/PrincipalIn.md +17 -0
- data/docs/PrincipalOut.md +27 -0
- data/docs/PrincipalPagination.md +21 -0
- data/docs/PrincipalPaginationAllOf.md +17 -0
- data/docs/ResourceDefinition.md +17 -0
- data/docs/ResourceDefinitionFilter.md +21 -0
- data/docs/Role.md +19 -0
- data/docs/RoleApi.md +340 -0
- data/docs/RoleIn.md +21 -0
- data/docs/RoleInAllOf.md +17 -0
- data/docs/RoleOut.md +35 -0
- data/docs/RoleOutDynamic.md +39 -0
- data/docs/RoleOutDynamicAllOf.md +29 -0
- data/docs/RolePagination.md +21 -0
- data/docs/RolePaginationDynamic.md +21 -0
- data/docs/RolePaginationDynamicAllOf.md +17 -0
- data/docs/RoleWithAccess.md +37 -0
- data/docs/Status.md +27 -0
- data/docs/StatusApi.md +56 -0
- data/docs/Timestamped.md +19 -0
- data/docs/UUID.md +17 -0
- data/generate.sh +7 -0
- data/git_push.sh +58 -0
- data/lib/rbac-api-client.rb +93 -0
- data/lib/rbac-api-client/api/access_api.rb +104 -0
- data/lib/rbac-api-client/api/group_api.rb +800 -0
- data/lib/rbac-api-client/api/policy_api.rb +363 -0
- data/lib/rbac-api-client/api/principal_api.rb +104 -0
- data/lib/rbac-api-client/api/role_api.rb +445 -0
- data/lib/rbac-api-client/api/status_api.rb +76 -0
- data/lib/rbac-api-client/api_client.rb +386 -0
- data/lib/rbac-api-client/api_error.rb +57 -0
- data/lib/rbac-api-client/configuration.rb +248 -0
- data/lib/rbac-api-client/models/access.rb +227 -0
- data/lib/rbac-api-client/models/access_pagination.rb +239 -0
- data/lib/rbac-api-client/models/access_pagination_all_of.rb +213 -0
- data/lib/rbac-api-client/models/additional_group.rb +215 -0
- data/lib/rbac-api-client/models/error.rb +213 -0
- data/lib/rbac-api-client/models/error403.rb +213 -0
- data/lib/rbac-api-client/models/group.rb +220 -0
- data/lib/rbac-api-client/models/group_out.rb +341 -0
- data/lib/rbac-api-client/models/group_pagination.rb +239 -0
- data/lib/rbac-api-client/models/group_pagination_all_of.rb +213 -0
- data/lib/rbac-api-client/models/group_principal_in.rb +213 -0
- data/lib/rbac-api-client/models/group_role_in.rb +213 -0
- data/lib/rbac-api-client/models/group_roles_pagination.rb +239 -0
- data/lib/rbac-api-client/models/group_with_principals.rb +288 -0
- data/lib/rbac-api-client/models/group_with_principals_all_of.rb +213 -0
- data/lib/rbac-api-client/models/group_with_principals_and_roles.rb +304 -0
- data/lib/rbac-api-client/models/group_with_principals_and_roles_all_of.rb +229 -0
- data/lib/rbac-api-client/models/inline_response200.rb +213 -0
- data/lib/rbac-api-client/models/list_pagination.rb +215 -0
- data/lib/rbac-api-client/models/pagination_links.rb +233 -0
- data/lib/rbac-api-client/models/pagination_meta.rb +206 -0
- data/lib/rbac-api-client/models/policy.rb +220 -0
- data/lib/rbac-api-client/models/policy_extended.rb +302 -0
- data/lib/rbac-api-client/models/policy_extended_all_of.rb +227 -0
- data/lib/rbac-api-client/models/policy_in.rb +258 -0
- data/lib/rbac-api-client/models/policy_in_all_of.rb +227 -0
- data/lib/rbac-api-client/models/policy_pagination.rb +239 -0
- data/lib/rbac-api-client/models/policy_pagination_all_of.rb +213 -0
- data/lib/rbac-api-client/models/principal.rb +252 -0
- data/lib/rbac-api-client/models/principal_in.rb +211 -0
- data/lib/rbac-api-client/models/principal_out.rb +274 -0
- data/lib/rbac-api-client/models/principal_pagination.rb +239 -0
- data/lib/rbac-api-client/models/principal_pagination_all_of.rb +213 -0
- data/lib/rbac-api-client/models/resource_definition.rb +211 -0
- data/lib/rbac-api-client/models/resource_definition_filter.rb +273 -0
- data/lib/rbac-api-client/models/role.rb +220 -0
- data/lib/rbac-api-client/models/role_in.rb +244 -0
- data/lib/rbac-api-client/models/role_in_all_of.rb +213 -0
- data/lib/rbac-api-client/models/role_out.rb +352 -0
- data/lib/rbac-api-client/models/role_out_dynamic.rb +421 -0
- data/lib/rbac-api-client/models/role_out_dynamic_all_of.rb +346 -0
- data/lib/rbac-api-client/models/role_pagination.rb +239 -0
- data/lib/rbac-api-client/models/role_pagination_dynamic.rb +239 -0
- data/lib/rbac-api-client/models/role_pagination_dynamic_all_of.rb +213 -0
- data/lib/rbac-api-client/models/role_with_access.rb +367 -0
- data/lib/rbac-api-client/models/status.rb +256 -0
- data/lib/rbac-api-client/models/timestamped.rb +225 -0
- data/lib/rbac-api-client/models/uuid.rb +211 -0
- data/lib/rbac-api-client/version.rb +15 -0
- data/openapi.json +2613 -0
- data/rbac-api-client.gemspec +39 -0
- data/spec/api/access_api_spec.rb +49 -0
- data/spec/api/group_api_spec.rb +176 -0
- data/spec/api/policy_api_spec.rb +97 -0
- data/spec/api/principal_api_spec.rb +49 -0
- data/spec/api/role_api_spec.rb +110 -0
- data/spec/api/status_api_spec.rb +45 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/access_pagination_all_of_spec.rb +41 -0
- data/spec/models/access_pagination_spec.rb +53 -0
- data/spec/models/access_spec.rb +47 -0
- data/spec/models/additional_group_spec.rb +47 -0
- data/spec/models/error403_spec.rb +41 -0
- data/spec/models/error_spec.rb +41 -0
- data/spec/models/group_out_spec.rb +89 -0
- data/spec/models/group_pagination_all_of_spec.rb +41 -0
- data/spec/models/group_pagination_spec.rb +53 -0
- data/spec/models/group_principal_in_spec.rb +41 -0
- data/spec/models/group_role_in_spec.rb +41 -0
- data/spec/models/group_roles_pagination_spec.rb +53 -0
- data/spec/models/group_spec.rb +47 -0
- data/spec/models/group_with_principals_all_of_spec.rb +41 -0
- data/spec/models/group_with_principals_and_roles_all_of_spec.rb +47 -0
- data/spec/models/group_with_principals_and_roles_spec.rb +77 -0
- data/spec/models/group_with_principals_spec.rb +71 -0
- data/spec/models/inline_response200_spec.rb +41 -0
- data/spec/models/list_pagination_spec.rb +47 -0
- data/spec/models/pagination_links_spec.rb +59 -0
- data/spec/models/pagination_meta_spec.rb +41 -0
- data/spec/models/policy_extended_all_of_spec.rb +47 -0
- data/spec/models/policy_extended_spec.rb +77 -0
- data/spec/models/policy_in_all_of_spec.rb +47 -0
- data/spec/models/policy_in_spec.rb +59 -0
- data/spec/models/policy_pagination_all_of_spec.rb +41 -0
- data/spec/models/policy_pagination_spec.rb +53 -0
- data/spec/models/policy_spec.rb +47 -0
- data/spec/models/principal_in_spec.rb +41 -0
- data/spec/models/principal_out_spec.rb +71 -0
- data/spec/models/principal_pagination_all_of_spec.rb +41 -0
- data/spec/models/principal_pagination_spec.rb +53 -0
- data/spec/models/principal_spec.rb +65 -0
- data/spec/models/resource_definition_filter_spec.rb +57 -0
- data/spec/models/resource_definition_spec.rb +41 -0
- data/spec/models/role_in_all_of_spec.rb +41 -0
- data/spec/models/role_in_spec.rb +53 -0
- data/spec/models/role_out_dynamic_all_of_spec.rb +77 -0
- data/spec/models/role_out_dynamic_spec.rb +107 -0
- data/spec/models/role_out_spec.rb +95 -0
- data/spec/models/role_pagination_dynamic_all_of_spec.rb +41 -0
- data/spec/models/role_pagination_dynamic_spec.rb +53 -0
- data/spec/models/role_pagination_spec.rb +53 -0
- data/spec/models/role_spec.rb +47 -0
- data/spec/models/role_with_access_spec.rb +101 -0
- data/spec/models/status_spec.rb +71 -0
- data/spec/models/timestamped_spec.rb +47 -0
- data/spec/models/uuid_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +338 -0
|
@@ -0,0 +1,445 @@
|
|
|
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: 4.2.2
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module RBACApiClient
|
|
16
|
+
class RoleApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a roles for a tenant
|
|
23
|
+
# @param role_in [RoleIn] Role to create
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [RoleWithAccess]
|
|
26
|
+
def create_roles(role_in, opts = {})
|
|
27
|
+
data, _status_code, _headers = create_roles_with_http_info(role_in, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Create a roles for a tenant
|
|
32
|
+
# @param role_in [RoleIn] Role to create
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(RoleWithAccess, Integer, Hash)>] RoleWithAccess data, response status code and response headers
|
|
35
|
+
def create_roles_with_http_info(role_in, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: RoleApi.create_roles ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'role_in' is set
|
|
40
|
+
if @api_client.config.client_side_validation && role_in.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'role_in' when calling RoleApi.create_roles"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/roles/'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
53
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:body] || @api_client.object_to_http_body(role_in)
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:return_type] || 'RoleWithAccess'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:header_params => header_params,
|
|
70
|
+
:query_params => query_params,
|
|
71
|
+
:form_params => form_params,
|
|
72
|
+
:body => post_body,
|
|
73
|
+
:auth_names => auth_names,
|
|
74
|
+
:return_type => return_type
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
78
|
+
if @api_client.config.debugging
|
|
79
|
+
@api_client.config.logger.debug "API called: RoleApi#create_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
80
|
+
end
|
|
81
|
+
return data, status_code, headers
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Delete a role in the tenant
|
|
85
|
+
# @param uuid [String] ID of role to delete
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [nil]
|
|
88
|
+
def delete_role(uuid, opts = {})
|
|
89
|
+
delete_role_with_http_info(uuid, opts)
|
|
90
|
+
nil
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Delete a role in the tenant
|
|
94
|
+
# @param uuid [String] ID of role to delete
|
|
95
|
+
# @param [Hash] opts the optional parameters
|
|
96
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
97
|
+
def delete_role_with_http_info(uuid, opts = {})
|
|
98
|
+
if @api_client.config.debugging
|
|
99
|
+
@api_client.config.logger.debug 'Calling API: RoleApi.delete_role ...'
|
|
100
|
+
end
|
|
101
|
+
# verify the required parameter 'uuid' is set
|
|
102
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
103
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling RoleApi.delete_role"
|
|
104
|
+
end
|
|
105
|
+
# resource path
|
|
106
|
+
local_var_path = '/roles/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
107
|
+
|
|
108
|
+
# query parameters
|
|
109
|
+
query_params = opts[:query_params] || {}
|
|
110
|
+
|
|
111
|
+
# header parameters
|
|
112
|
+
header_params = opts[:header_params] || {}
|
|
113
|
+
# HTTP header 'Accept' (if needed)
|
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
115
|
+
|
|
116
|
+
# form parameters
|
|
117
|
+
form_params = opts[:form_params] || {}
|
|
118
|
+
|
|
119
|
+
# http body (model)
|
|
120
|
+
post_body = opts[:body]
|
|
121
|
+
|
|
122
|
+
# return_type
|
|
123
|
+
return_type = opts[:return_type]
|
|
124
|
+
|
|
125
|
+
# auth_names
|
|
126
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
127
|
+
|
|
128
|
+
new_options = opts.merge(
|
|
129
|
+
:header_params => header_params,
|
|
130
|
+
:query_params => query_params,
|
|
131
|
+
:form_params => form_params,
|
|
132
|
+
:body => post_body,
|
|
133
|
+
:auth_names => auth_names,
|
|
134
|
+
:return_type => return_type
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
138
|
+
if @api_client.config.debugging
|
|
139
|
+
@api_client.config.logger.debug "API called: RoleApi#delete_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
140
|
+
end
|
|
141
|
+
return data, status_code, headers
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Get a role in the tenant
|
|
145
|
+
# @param uuid [String] ID of role to get
|
|
146
|
+
# @param [Hash] opts the optional parameters
|
|
147
|
+
# @return [RoleWithAccess]
|
|
148
|
+
def get_role(uuid, opts = {})
|
|
149
|
+
data, _status_code, _headers = get_role_with_http_info(uuid, opts)
|
|
150
|
+
data
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Get a role in the tenant
|
|
154
|
+
# @param uuid [String] ID of role to get
|
|
155
|
+
# @param [Hash] opts the optional parameters
|
|
156
|
+
# @return [Array<(RoleWithAccess, Integer, Hash)>] RoleWithAccess data, response status code and response headers
|
|
157
|
+
def get_role_with_http_info(uuid, opts = {})
|
|
158
|
+
if @api_client.config.debugging
|
|
159
|
+
@api_client.config.logger.debug 'Calling API: RoleApi.get_role ...'
|
|
160
|
+
end
|
|
161
|
+
# verify the required parameter 'uuid' is set
|
|
162
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
163
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling RoleApi.get_role"
|
|
164
|
+
end
|
|
165
|
+
# resource path
|
|
166
|
+
local_var_path = '/roles/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
167
|
+
|
|
168
|
+
# query parameters
|
|
169
|
+
query_params = opts[:query_params] || {}
|
|
170
|
+
|
|
171
|
+
# header parameters
|
|
172
|
+
header_params = opts[:header_params] || {}
|
|
173
|
+
# HTTP header 'Accept' (if needed)
|
|
174
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
175
|
+
|
|
176
|
+
# form parameters
|
|
177
|
+
form_params = opts[:form_params] || {}
|
|
178
|
+
|
|
179
|
+
# http body (model)
|
|
180
|
+
post_body = opts[:body]
|
|
181
|
+
|
|
182
|
+
# return_type
|
|
183
|
+
return_type = opts[:return_type] || 'RoleWithAccess'
|
|
184
|
+
|
|
185
|
+
# auth_names
|
|
186
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
187
|
+
|
|
188
|
+
new_options = opts.merge(
|
|
189
|
+
:header_params => header_params,
|
|
190
|
+
:query_params => query_params,
|
|
191
|
+
:form_params => form_params,
|
|
192
|
+
:body => post_body,
|
|
193
|
+
:auth_names => auth_names,
|
|
194
|
+
:return_type => return_type
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
198
|
+
if @api_client.config.debugging
|
|
199
|
+
@api_client.config.logger.debug "API called: RoleApi#get_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
200
|
+
end
|
|
201
|
+
return data, status_code, headers
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Get access for a role in the tenant
|
|
205
|
+
# @param uuid [String] ID of the role
|
|
206
|
+
# @param [Hash] opts the optional parameters
|
|
207
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned. (default to 10)
|
|
208
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data. (default to 0)
|
|
209
|
+
# @return [AccessPagination]
|
|
210
|
+
def get_role_access(uuid, opts = {})
|
|
211
|
+
data, _status_code, _headers = get_role_access_with_http_info(uuid, opts)
|
|
212
|
+
data
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Get access for a role in the tenant
|
|
216
|
+
# @param uuid [String] ID of the role
|
|
217
|
+
# @param [Hash] opts the optional parameters
|
|
218
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned.
|
|
219
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data.
|
|
220
|
+
# @return [Array<(AccessPagination, Integer, Hash)>] AccessPagination data, response status code and response headers
|
|
221
|
+
def get_role_access_with_http_info(uuid, opts = {})
|
|
222
|
+
if @api_client.config.debugging
|
|
223
|
+
@api_client.config.logger.debug 'Calling API: RoleApi.get_role_access ...'
|
|
224
|
+
end
|
|
225
|
+
# verify the required parameter 'uuid' is set
|
|
226
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
227
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling RoleApi.get_role_access"
|
|
228
|
+
end
|
|
229
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
230
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RoleApi.get_role_access, must be smaller than or equal to 1000.'
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
234
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RoleApi.get_role_access, must be greater than or equal to 1.'
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
238
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling RoleApi.get_role_access, must be greater than or equal to 0.'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# resource path
|
|
242
|
+
local_var_path = '/roles/{uuid}/access/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
243
|
+
|
|
244
|
+
# query parameters
|
|
245
|
+
query_params = opts[:query_params] || {}
|
|
246
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
247
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
248
|
+
|
|
249
|
+
# header parameters
|
|
250
|
+
header_params = opts[:header_params] || {}
|
|
251
|
+
# HTTP header 'Accept' (if needed)
|
|
252
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
253
|
+
|
|
254
|
+
# form parameters
|
|
255
|
+
form_params = opts[:form_params] || {}
|
|
256
|
+
|
|
257
|
+
# http body (model)
|
|
258
|
+
post_body = opts[:body]
|
|
259
|
+
|
|
260
|
+
# return_type
|
|
261
|
+
return_type = opts[:return_type] || 'AccessPagination'
|
|
262
|
+
|
|
263
|
+
# auth_names
|
|
264
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
265
|
+
|
|
266
|
+
new_options = opts.merge(
|
|
267
|
+
:header_params => header_params,
|
|
268
|
+
:query_params => query_params,
|
|
269
|
+
:form_params => form_params,
|
|
270
|
+
:body => post_body,
|
|
271
|
+
:auth_names => auth_names,
|
|
272
|
+
:return_type => return_type
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
276
|
+
if @api_client.config.debugging
|
|
277
|
+
@api_client.config.logger.debug "API called: RoleApi#get_role_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
278
|
+
end
|
|
279
|
+
return data, status_code, headers
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# List the roles for a tenant
|
|
283
|
+
# @param [Hash] opts the optional parameters
|
|
284
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned. (default to 10)
|
|
285
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data. (default to 0)
|
|
286
|
+
# @option opts [String] :name Parameter for filtering resource by name using string contains search.
|
|
287
|
+
# @option opts [String] :scope Parameter for filtering resource by scope. (default to 'account')
|
|
288
|
+
# @option opts [String] :order_by Parameter for ordering resource by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name
|
|
289
|
+
# @option opts [Array<String>] :add_fields Parameter for add list of fields to display for roles.
|
|
290
|
+
# @option opts [String] :username Unique username of the principal to obtain roles for (only available for admins, and if supplied, takes precedence over the identity header).
|
|
291
|
+
# @return [RolePaginationDynamic]
|
|
292
|
+
def list_roles(opts = {})
|
|
293
|
+
data, _status_code, _headers = list_roles_with_http_info(opts)
|
|
294
|
+
data
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# List the roles for a tenant
|
|
298
|
+
# @param [Hash] opts the optional parameters
|
|
299
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned.
|
|
300
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data.
|
|
301
|
+
# @option opts [String] :name Parameter for filtering resource by name using string contains search.
|
|
302
|
+
# @option opts [String] :scope Parameter for filtering resource by scope.
|
|
303
|
+
# @option opts [String] :order_by Parameter for ordering resource by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name
|
|
304
|
+
# @option opts [Array<String>] :add_fields Parameter for add list of fields to display for roles.
|
|
305
|
+
# @option opts [String] :username Unique username of the principal to obtain roles for (only available for admins, and if supplied, takes precedence over the identity header).
|
|
306
|
+
# @return [Array<(RolePaginationDynamic, Integer, Hash)>] RolePaginationDynamic data, response status code and response headers
|
|
307
|
+
def list_roles_with_http_info(opts = {})
|
|
308
|
+
if @api_client.config.debugging
|
|
309
|
+
@api_client.config.logger.debug 'Calling API: RoleApi.list_roles ...'
|
|
310
|
+
end
|
|
311
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
312
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RoleApi.list_roles, must be smaller than or equal to 1000.'
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
316
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RoleApi.list_roles, must be greater than or equal to 1.'
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
320
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling RoleApi.list_roles, must be greater than or equal to 0.'
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
allowable_values = ["account", "principal"]
|
|
324
|
+
if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope'])
|
|
325
|
+
fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}"
|
|
326
|
+
end
|
|
327
|
+
allowable_values = ["groups_in", "groups_in_count"]
|
|
328
|
+
if @api_client.config.client_side_validation && opts[:'add_fields'] && !opts[:'add_fields'].all? { |item| allowable_values.include?(item) }
|
|
329
|
+
fail ArgumentError, "invalid value for \"add_fields\", must include one of #{allowable_values}"
|
|
330
|
+
end
|
|
331
|
+
# resource path
|
|
332
|
+
local_var_path = '/roles/'
|
|
333
|
+
|
|
334
|
+
# query parameters
|
|
335
|
+
query_params = opts[:query_params] || {}
|
|
336
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
337
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
338
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
|
339
|
+
query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
|
340
|
+
query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
|
|
341
|
+
query_params[:'add_fields'] = @api_client.build_collection_param(opts[:'add_fields'], :csv) if !opts[:'add_fields'].nil?
|
|
342
|
+
query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil?
|
|
343
|
+
|
|
344
|
+
# header parameters
|
|
345
|
+
header_params = opts[:header_params] || {}
|
|
346
|
+
# HTTP header 'Accept' (if needed)
|
|
347
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
348
|
+
|
|
349
|
+
# form parameters
|
|
350
|
+
form_params = opts[:form_params] || {}
|
|
351
|
+
|
|
352
|
+
# http body (model)
|
|
353
|
+
post_body = opts[:body]
|
|
354
|
+
|
|
355
|
+
# return_type
|
|
356
|
+
return_type = opts[:return_type] || 'RolePaginationDynamic'
|
|
357
|
+
|
|
358
|
+
# auth_names
|
|
359
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
360
|
+
|
|
361
|
+
new_options = opts.merge(
|
|
362
|
+
:header_params => header_params,
|
|
363
|
+
:query_params => query_params,
|
|
364
|
+
:form_params => form_params,
|
|
365
|
+
:body => post_body,
|
|
366
|
+
:auth_names => auth_names,
|
|
367
|
+
:return_type => return_type
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
371
|
+
if @api_client.config.debugging
|
|
372
|
+
@api_client.config.logger.debug "API called: RoleApi#list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
373
|
+
end
|
|
374
|
+
return data, status_code, headers
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# Update a Role in the tenant
|
|
378
|
+
# @param uuid [String] ID of role to update
|
|
379
|
+
# @param role_with_access [RoleWithAccess] Update to a Role
|
|
380
|
+
# @param [Hash] opts the optional parameters
|
|
381
|
+
# @return [nil]
|
|
382
|
+
def update_role(uuid, role_with_access, opts = {})
|
|
383
|
+
update_role_with_http_info(uuid, role_with_access, opts)
|
|
384
|
+
nil
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# Update a Role in the tenant
|
|
388
|
+
# @param uuid [String] ID of role to update
|
|
389
|
+
# @param role_with_access [RoleWithAccess] Update to a Role
|
|
390
|
+
# @param [Hash] opts the optional parameters
|
|
391
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
392
|
+
def update_role_with_http_info(uuid, role_with_access, opts = {})
|
|
393
|
+
if @api_client.config.debugging
|
|
394
|
+
@api_client.config.logger.debug 'Calling API: RoleApi.update_role ...'
|
|
395
|
+
end
|
|
396
|
+
# verify the required parameter 'uuid' is set
|
|
397
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
398
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling RoleApi.update_role"
|
|
399
|
+
end
|
|
400
|
+
# verify the required parameter 'role_with_access' is set
|
|
401
|
+
if @api_client.config.client_side_validation && role_with_access.nil?
|
|
402
|
+
fail ArgumentError, "Missing the required parameter 'role_with_access' when calling RoleApi.update_role"
|
|
403
|
+
end
|
|
404
|
+
# resource path
|
|
405
|
+
local_var_path = '/roles/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
406
|
+
|
|
407
|
+
# query parameters
|
|
408
|
+
query_params = opts[:query_params] || {}
|
|
409
|
+
|
|
410
|
+
# header parameters
|
|
411
|
+
header_params = opts[:header_params] || {}
|
|
412
|
+
# HTTP header 'Accept' (if needed)
|
|
413
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
414
|
+
# HTTP header 'Content-Type'
|
|
415
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
416
|
+
|
|
417
|
+
# form parameters
|
|
418
|
+
form_params = opts[:form_params] || {}
|
|
419
|
+
|
|
420
|
+
# http body (model)
|
|
421
|
+
post_body = opts[:body] || @api_client.object_to_http_body(role_with_access)
|
|
422
|
+
|
|
423
|
+
# return_type
|
|
424
|
+
return_type = opts[:return_type]
|
|
425
|
+
|
|
426
|
+
# auth_names
|
|
427
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
428
|
+
|
|
429
|
+
new_options = opts.merge(
|
|
430
|
+
:header_params => header_params,
|
|
431
|
+
:query_params => query_params,
|
|
432
|
+
:form_params => form_params,
|
|
433
|
+
:body => post_body,
|
|
434
|
+
:auth_names => auth_names,
|
|
435
|
+
:return_type => return_type
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
439
|
+
if @api_client.config.debugging
|
|
440
|
+
@api_client.config.logger.debug "API called: RoleApi#update_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
441
|
+
end
|
|
442
|
+
return data, status_code, headers
|
|
443
|
+
end
|
|
444
|
+
end
|
|
445
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
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: 4.2.2
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module RBACApiClient
|
|
16
|
+
class StatusApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Obtain server status
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [Status]
|
|
25
|
+
def get_status(opts = {})
|
|
26
|
+
data, _status_code, _headers = get_status_with_http_info(opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Obtain server status
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [Array<(Status, Integer, Hash)>] Status data, response status code and response headers
|
|
33
|
+
def get_status_with_http_info(opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: StatusApi.get_status ...'
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/status/'
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
|
|
43
|
+
# header parameters
|
|
44
|
+
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:return_type] || 'Status'
|
|
56
|
+
|
|
57
|
+
# auth_names
|
|
58
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:header_params => header_params,
|
|
62
|
+
:query_params => query_params,
|
|
63
|
+
:form_params => form_params,
|
|
64
|
+
:body => post_body,
|
|
65
|
+
:auth_names => auth_names,
|
|
66
|
+
:return_type => return_type
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
70
|
+
if @api_client.config.debugging
|
|
71
|
+
@api_client.config.logger.debug "API called: StatusApi#get_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
72
|
+
end
|
|
73
|
+
return data, status_code, headers
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|