rbac-api-client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,363 @@
|
|
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 PolicyApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create a policy in a tenant
|
23
|
+
# @param policy_in [PolicyIn] Policy to create
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [PolicyExtended]
|
26
|
+
def create_policies(policy_in, opts = {})
|
27
|
+
data, _status_code, _headers = create_policies_with_http_info(policy_in, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Create a policy in a tenant
|
32
|
+
# @param policy_in [PolicyIn] Policy to create
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(PolicyExtended, Integer, Hash)>] PolicyExtended data, response status code and response headers
|
35
|
+
def create_policies_with_http_info(policy_in, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: PolicyApi.create_policies ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'policy_in' is set
|
40
|
+
if @api_client.config.client_side_validation && policy_in.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'policy_in' when calling PolicyApi.create_policies"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/policies/'
|
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(policy_in)
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type] || 'PolicyExtended'
|
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: PolicyApi#create_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
|
84
|
+
# Delete a policy in the tenant
|
85
|
+
# @param uuid [String] ID of policy to delete
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [nil]
|
88
|
+
def delete_policy(uuid, opts = {})
|
89
|
+
delete_policy_with_http_info(uuid, opts)
|
90
|
+
nil
|
91
|
+
end
|
92
|
+
|
93
|
+
# Delete a policy in the tenant
|
94
|
+
# @param uuid [String] ID of policy 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_policy_with_http_info(uuid, opts = {})
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug 'Calling API: PolicyApi.delete_policy ...'
|
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 PolicyApi.delete_policy"
|
104
|
+
end
|
105
|
+
# resource path
|
106
|
+
local_var_path = '/policies/{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: PolicyApi#delete_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
140
|
+
end
|
141
|
+
return data, status_code, headers
|
142
|
+
end
|
143
|
+
|
144
|
+
# Get a policy in the tenant
|
145
|
+
# @param uuid [String] ID of policy to get
|
146
|
+
# @param [Hash] opts the optional parameters
|
147
|
+
# @return [PolicyExtended]
|
148
|
+
def get_policy(uuid, opts = {})
|
149
|
+
data, _status_code, _headers = get_policy_with_http_info(uuid, opts)
|
150
|
+
data
|
151
|
+
end
|
152
|
+
|
153
|
+
# Get a policy in the tenant
|
154
|
+
# @param uuid [String] ID of policy to get
|
155
|
+
# @param [Hash] opts the optional parameters
|
156
|
+
# @return [Array<(PolicyExtended, Integer, Hash)>] PolicyExtended data, response status code and response headers
|
157
|
+
def get_policy_with_http_info(uuid, opts = {})
|
158
|
+
if @api_client.config.debugging
|
159
|
+
@api_client.config.logger.debug 'Calling API: PolicyApi.get_policy ...'
|
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 PolicyApi.get_policy"
|
164
|
+
end
|
165
|
+
# resource path
|
166
|
+
local_var_path = '/policies/{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] || 'PolicyExtended'
|
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: PolicyApi#get_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
200
|
+
end
|
201
|
+
return data, status_code, headers
|
202
|
+
end
|
203
|
+
|
204
|
+
# List the policies in the tenant
|
205
|
+
# @param [Hash] opts the optional parameters
|
206
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned. (default to 10)
|
207
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data. (default to 0)
|
208
|
+
# @option opts [String] :name Parameter for filtering resource by name using string contains search.
|
209
|
+
# @option opts [String] :scope Parameter for filtering resource by scope. (default to 'account')
|
210
|
+
# @option opts [String] :group_name Parameter for filtering resource by group name using string contains search.
|
211
|
+
# @option opts [String] :group_uuid Parameter for filtering resource by group uuid using UUID exact match.
|
212
|
+
# @option opts [String] :order_by Parameter for ordering resource by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name
|
213
|
+
# @return [PolicyPagination]
|
214
|
+
def list_policies(opts = {})
|
215
|
+
data, _status_code, _headers = list_policies_with_http_info(opts)
|
216
|
+
data
|
217
|
+
end
|
218
|
+
|
219
|
+
# List the policies in the tenant
|
220
|
+
# @param [Hash] opts the optional parameters
|
221
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned.
|
222
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data.
|
223
|
+
# @option opts [String] :name Parameter for filtering resource by name using string contains search.
|
224
|
+
# @option opts [String] :scope Parameter for filtering resource by scope.
|
225
|
+
# @option opts [String] :group_name Parameter for filtering resource by group name using string contains search.
|
226
|
+
# @option opts [String] :group_uuid Parameter for filtering resource by group uuid using UUID exact match.
|
227
|
+
# @option opts [String] :order_by Parameter for ordering resource by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name
|
228
|
+
# @return [Array<(PolicyPagination, Integer, Hash)>] PolicyPagination data, response status code and response headers
|
229
|
+
def list_policies_with_http_info(opts = {})
|
230
|
+
if @api_client.config.debugging
|
231
|
+
@api_client.config.logger.debug 'Calling API: PolicyApi.list_policies ...'
|
232
|
+
end
|
233
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
234
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PolicyApi.list_policies, must be smaller than or equal to 1000.'
|
235
|
+
end
|
236
|
+
|
237
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
238
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PolicyApi.list_policies, must be greater than or equal to 1.'
|
239
|
+
end
|
240
|
+
|
241
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
242
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling PolicyApi.list_policies, must be greater than or equal to 0.'
|
243
|
+
end
|
244
|
+
|
245
|
+
allowable_values = ["account", "principal"]
|
246
|
+
if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope'])
|
247
|
+
fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}"
|
248
|
+
end
|
249
|
+
# resource path
|
250
|
+
local_var_path = '/policies/'
|
251
|
+
|
252
|
+
# query parameters
|
253
|
+
query_params = opts[:query_params] || {}
|
254
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
255
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
256
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
257
|
+
query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
258
|
+
query_params[:'group_name'] = opts[:'group_name'] if !opts[:'group_name'].nil?
|
259
|
+
query_params[:'group_uuid'] = opts[:'group_uuid'] if !opts[:'group_uuid'].nil?
|
260
|
+
query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
|
261
|
+
|
262
|
+
# header parameters
|
263
|
+
header_params = opts[:header_params] || {}
|
264
|
+
# HTTP header 'Accept' (if needed)
|
265
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
266
|
+
|
267
|
+
# form parameters
|
268
|
+
form_params = opts[:form_params] || {}
|
269
|
+
|
270
|
+
# http body (model)
|
271
|
+
post_body = opts[:body]
|
272
|
+
|
273
|
+
# return_type
|
274
|
+
return_type = opts[:return_type] || 'PolicyPagination'
|
275
|
+
|
276
|
+
# auth_names
|
277
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
278
|
+
|
279
|
+
new_options = opts.merge(
|
280
|
+
:header_params => header_params,
|
281
|
+
:query_params => query_params,
|
282
|
+
:form_params => form_params,
|
283
|
+
:body => post_body,
|
284
|
+
:auth_names => auth_names,
|
285
|
+
:return_type => return_type
|
286
|
+
)
|
287
|
+
|
288
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
289
|
+
if @api_client.config.debugging
|
290
|
+
@api_client.config.logger.debug "API called: PolicyApi#list_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
291
|
+
end
|
292
|
+
return data, status_code, headers
|
293
|
+
end
|
294
|
+
|
295
|
+
# Update a policy in the tenant
|
296
|
+
# @param uuid [String] ID of policy to update
|
297
|
+
# @param policy_in [PolicyIn] Policy to update
|
298
|
+
# @param [Hash] opts the optional parameters
|
299
|
+
# @return [PolicyExtended]
|
300
|
+
def update_policy(uuid, policy_in, opts = {})
|
301
|
+
data, _status_code, _headers = update_policy_with_http_info(uuid, policy_in, opts)
|
302
|
+
data
|
303
|
+
end
|
304
|
+
|
305
|
+
# Update a policy in the tenant
|
306
|
+
# @param uuid [String] ID of policy to update
|
307
|
+
# @param policy_in [PolicyIn] Policy to update
|
308
|
+
# @param [Hash] opts the optional parameters
|
309
|
+
# @return [Array<(PolicyExtended, Integer, Hash)>] PolicyExtended data, response status code and response headers
|
310
|
+
def update_policy_with_http_info(uuid, policy_in, opts = {})
|
311
|
+
if @api_client.config.debugging
|
312
|
+
@api_client.config.logger.debug 'Calling API: PolicyApi.update_policy ...'
|
313
|
+
end
|
314
|
+
# verify the required parameter 'uuid' is set
|
315
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
316
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling PolicyApi.update_policy"
|
317
|
+
end
|
318
|
+
# verify the required parameter 'policy_in' is set
|
319
|
+
if @api_client.config.client_side_validation && policy_in.nil?
|
320
|
+
fail ArgumentError, "Missing the required parameter 'policy_in' when calling PolicyApi.update_policy"
|
321
|
+
end
|
322
|
+
# resource path
|
323
|
+
local_var_path = '/policies/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
324
|
+
|
325
|
+
# query parameters
|
326
|
+
query_params = opts[:query_params] || {}
|
327
|
+
|
328
|
+
# header parameters
|
329
|
+
header_params = opts[:header_params] || {}
|
330
|
+
# HTTP header 'Accept' (if needed)
|
331
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
332
|
+
# HTTP header 'Content-Type'
|
333
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
334
|
+
|
335
|
+
# form parameters
|
336
|
+
form_params = opts[:form_params] || {}
|
337
|
+
|
338
|
+
# http body (model)
|
339
|
+
post_body = opts[:body] || @api_client.object_to_http_body(policy_in)
|
340
|
+
|
341
|
+
# return_type
|
342
|
+
return_type = opts[:return_type] || 'PolicyExtended'
|
343
|
+
|
344
|
+
# auth_names
|
345
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
346
|
+
|
347
|
+
new_options = opts.merge(
|
348
|
+
:header_params => header_params,
|
349
|
+
:query_params => query_params,
|
350
|
+
:form_params => form_params,
|
351
|
+
:body => post_body,
|
352
|
+
:auth_names => auth_names,
|
353
|
+
:return_type => return_type
|
354
|
+
)
|
355
|
+
|
356
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
357
|
+
if @api_client.config.debugging
|
358
|
+
@api_client.config.logger.debug "API called: PolicyApi#update_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
359
|
+
end
|
360
|
+
return data, status_code, headers
|
361
|
+
end
|
362
|
+
end
|
363
|
+
end
|
@@ -0,0 +1,104 @@
|
|
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 PrincipalApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List the principals for a tenant
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned. (default to 10)
|
25
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data. (default to 0)
|
26
|
+
# @option opts [String] :usernames Usernames of principals to get
|
27
|
+
# @option opts [String] :sort_order The sort order of the query, either ascending or descending
|
28
|
+
# @return [PrincipalPagination]
|
29
|
+
def list_principals(opts = {})
|
30
|
+
data, _status_code, _headers = list_principals_with_http_info(opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# List the principals for a tenant
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned.
|
37
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data.
|
38
|
+
# @option opts [String] :usernames Usernames of principals to get
|
39
|
+
# @option opts [String] :sort_order The sort order of the query, either ascending or descending
|
40
|
+
# @return [Array<(PrincipalPagination, Integer, Hash)>] PrincipalPagination data, response status code and response headers
|
41
|
+
def list_principals_with_http_info(opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: PrincipalApi.list_principals ...'
|
44
|
+
end
|
45
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
46
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PrincipalApi.list_principals, must be smaller than or equal to 1000.'
|
47
|
+
end
|
48
|
+
|
49
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
50
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PrincipalApi.list_principals, must be greater than or equal to 1.'
|
51
|
+
end
|
52
|
+
|
53
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
54
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling PrincipalApi.list_principals, must be greater than or equal to 0.'
|
55
|
+
end
|
56
|
+
|
57
|
+
allowable_values = ["asc", "desc"]
|
58
|
+
if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
|
59
|
+
fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
|
60
|
+
end
|
61
|
+
# resource path
|
62
|
+
local_var_path = '/principals/'
|
63
|
+
|
64
|
+
# query parameters
|
65
|
+
query_params = opts[:query_params] || {}
|
66
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
67
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
68
|
+
query_params[:'usernames'] = opts[:'usernames'] if !opts[:'usernames'].nil?
|
69
|
+
query_params[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
70
|
+
|
71
|
+
# header parameters
|
72
|
+
header_params = opts[:header_params] || {}
|
73
|
+
# HTTP header 'Accept' (if needed)
|
74
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
75
|
+
|
76
|
+
# form parameters
|
77
|
+
form_params = opts[:form_params] || {}
|
78
|
+
|
79
|
+
# http body (model)
|
80
|
+
post_body = opts[:body]
|
81
|
+
|
82
|
+
# return_type
|
83
|
+
return_type = opts[:return_type] || 'PrincipalPagination'
|
84
|
+
|
85
|
+
# auth_names
|
86
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
87
|
+
|
88
|
+
new_options = opts.merge(
|
89
|
+
:header_params => header_params,
|
90
|
+
:query_params => query_params,
|
91
|
+
:form_params => form_params,
|
92
|
+
:body => post_body,
|
93
|
+
:auth_names => auth_names,
|
94
|
+
:return_type => return_type
|
95
|
+
)
|
96
|
+
|
97
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug "API called: PrincipalApi#list_principals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
100
|
+
end
|
101
|
+
return data, status_code, headers
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|