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,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 AccessApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get the permitted access for a principal in the tenant (defaults to principal from the identity header)
|
|
23
|
+
# @param application [String] The application name to obtain access for the principal
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :username Unique username of the principal to obtain access for (only available for admins, and if supplied, takes precedence over the identity header).
|
|
26
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned. (default to 10)
|
|
27
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data. (default to 0)
|
|
28
|
+
# @return [AccessPagination]
|
|
29
|
+
def get_principal_access(application, opts = {})
|
|
30
|
+
data, _status_code, _headers = get_principal_access_with_http_info(application, opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Get the permitted access for a principal in the tenant (defaults to principal from the identity header)
|
|
35
|
+
# @param application [String] The application name to obtain access for the principal
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [String] :username Unique username of the principal to obtain access for (only available for admins, and if supplied, takes precedence over the identity header).
|
|
38
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned.
|
|
39
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data.
|
|
40
|
+
# @return [Array<(AccessPagination, Integer, Hash)>] AccessPagination data, response status code and response headers
|
|
41
|
+
def get_principal_access_with_http_info(application, opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: AccessApi.get_principal_access ...'
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'application' is set
|
|
46
|
+
if @api_client.config.client_side_validation && application.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'application' when calling AccessApi.get_principal_access"
|
|
48
|
+
end
|
|
49
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
50
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AccessApi.get_principal_access, must be smaller than or equal to 1000.'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
54
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AccessApi.get_principal_access, must be greater than or equal to 1.'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
58
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling AccessApi.get_principal_access, must be greater than or equal to 0.'
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# resource path
|
|
62
|
+
local_var_path = '/access/'
|
|
63
|
+
|
|
64
|
+
# query parameters
|
|
65
|
+
query_params = opts[:query_params] || {}
|
|
66
|
+
query_params[:'application'] = application
|
|
67
|
+
query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil?
|
|
68
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
69
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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] || 'AccessPagination'
|
|
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: AccessApi#get_principal_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
100
|
+
end
|
|
101
|
+
return data, status_code, headers
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,800 @@
|
|
|
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 GroupApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Add a principal to a group in the tenant
|
|
23
|
+
# @param uuid [String] ID of group to update
|
|
24
|
+
# @param group_principal_in [GroupPrincipalIn] Principal to add to a group
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GroupWithPrincipalsAndRoles]
|
|
27
|
+
def add_principal_to_group(uuid, group_principal_in, opts = {})
|
|
28
|
+
data, _status_code, _headers = add_principal_to_group_with_http_info(uuid, group_principal_in, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Add a principal to a group in the tenant
|
|
33
|
+
# @param uuid [String] ID of group to update
|
|
34
|
+
# @param group_principal_in [GroupPrincipalIn] Principal to add to a group
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>] GroupWithPrincipalsAndRoles data, response status code and response headers
|
|
37
|
+
def add_principal_to_group_with_http_info(uuid, group_principal_in, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.add_principal_to_group ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'uuid' is set
|
|
42
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.add_principal_to_group"
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'group_principal_in' is set
|
|
46
|
+
if @api_client.config.client_side_validation && group_principal_in.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'group_principal_in' when calling GroupApi.add_principal_to_group"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = opts[:query_params] || {}
|
|
54
|
+
|
|
55
|
+
# header parameters
|
|
56
|
+
header_params = opts[:header_params] || {}
|
|
57
|
+
# HTTP header 'Accept' (if needed)
|
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
59
|
+
# HTTP header 'Content-Type'
|
|
60
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
61
|
+
|
|
62
|
+
# form parameters
|
|
63
|
+
form_params = opts[:form_params] || {}
|
|
64
|
+
|
|
65
|
+
# http body (model)
|
|
66
|
+
post_body = opts[:body] || @api_client.object_to_http_body(group_principal_in)
|
|
67
|
+
|
|
68
|
+
# return_type
|
|
69
|
+
return_type = opts[:return_type] || 'GroupWithPrincipalsAndRoles'
|
|
70
|
+
|
|
71
|
+
# auth_names
|
|
72
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
73
|
+
|
|
74
|
+
new_options = opts.merge(
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: GroupApi#add_principal_to_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Add a role to a group in the tenant
|
|
91
|
+
# @param uuid [String] ID of group to update
|
|
92
|
+
# @param group_role_in [GroupRoleIn] Role to add to a group
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [InlineResponse200]
|
|
95
|
+
def add_role_to_group(uuid, group_role_in, opts = {})
|
|
96
|
+
data, _status_code, _headers = add_role_to_group_with_http_info(uuid, group_role_in, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Add a role to a group in the tenant
|
|
101
|
+
# @param uuid [String] ID of group to update
|
|
102
|
+
# @param group_role_in [GroupRoleIn] Role to add to a group
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
|
|
105
|
+
def add_role_to_group_with_http_info(uuid, group_role_in, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.add_role_to_group ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'uuid' is set
|
|
110
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.add_role_to_group"
|
|
112
|
+
end
|
|
113
|
+
# verify the required parameter 'group_role_in' is set
|
|
114
|
+
if @api_client.config.client_side_validation && group_role_in.nil?
|
|
115
|
+
fail ArgumentError, "Missing the required parameter 'group_role_in' when calling GroupApi.add_role_to_group"
|
|
116
|
+
end
|
|
117
|
+
# resource path
|
|
118
|
+
local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
119
|
+
|
|
120
|
+
# query parameters
|
|
121
|
+
query_params = opts[:query_params] || {}
|
|
122
|
+
|
|
123
|
+
# header parameters
|
|
124
|
+
header_params = opts[:header_params] || {}
|
|
125
|
+
# HTTP header 'Accept' (if needed)
|
|
126
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
127
|
+
# HTTP header 'Content-Type'
|
|
128
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
129
|
+
|
|
130
|
+
# form parameters
|
|
131
|
+
form_params = opts[:form_params] || {}
|
|
132
|
+
|
|
133
|
+
# http body (model)
|
|
134
|
+
post_body = opts[:body] || @api_client.object_to_http_body(group_role_in)
|
|
135
|
+
|
|
136
|
+
# return_type
|
|
137
|
+
return_type = opts[:return_type] || 'InlineResponse200'
|
|
138
|
+
|
|
139
|
+
# auth_names
|
|
140
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
141
|
+
|
|
142
|
+
new_options = opts.merge(
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: GroupApi#add_role_to_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Create a group in a tenant
|
|
159
|
+
# @param group [Group] Group to create in tenant
|
|
160
|
+
# @param [Hash] opts the optional parameters
|
|
161
|
+
# @return [GroupOut]
|
|
162
|
+
def create_group(group, opts = {})
|
|
163
|
+
data, _status_code, _headers = create_group_with_http_info(group, opts)
|
|
164
|
+
data
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Create a group in a tenant
|
|
168
|
+
# @param group [Group] Group to create in tenant
|
|
169
|
+
# @param [Hash] opts the optional parameters
|
|
170
|
+
# @return [Array<(GroupOut, Integer, Hash)>] GroupOut data, response status code and response headers
|
|
171
|
+
def create_group_with_http_info(group, opts = {})
|
|
172
|
+
if @api_client.config.debugging
|
|
173
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.create_group ...'
|
|
174
|
+
end
|
|
175
|
+
# verify the required parameter 'group' is set
|
|
176
|
+
if @api_client.config.client_side_validation && group.nil?
|
|
177
|
+
fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.create_group"
|
|
178
|
+
end
|
|
179
|
+
# resource path
|
|
180
|
+
local_var_path = '/groups/'
|
|
181
|
+
|
|
182
|
+
# query parameters
|
|
183
|
+
query_params = opts[:query_params] || {}
|
|
184
|
+
|
|
185
|
+
# header parameters
|
|
186
|
+
header_params = opts[:header_params] || {}
|
|
187
|
+
# HTTP header 'Accept' (if needed)
|
|
188
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
189
|
+
# HTTP header 'Content-Type'
|
|
190
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
191
|
+
|
|
192
|
+
# form parameters
|
|
193
|
+
form_params = opts[:form_params] || {}
|
|
194
|
+
|
|
195
|
+
# http body (model)
|
|
196
|
+
post_body = opts[:body] || @api_client.object_to_http_body(group)
|
|
197
|
+
|
|
198
|
+
# return_type
|
|
199
|
+
return_type = opts[:return_type] || 'GroupOut'
|
|
200
|
+
|
|
201
|
+
# auth_names
|
|
202
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
203
|
+
|
|
204
|
+
new_options = opts.merge(
|
|
205
|
+
:header_params => header_params,
|
|
206
|
+
:query_params => query_params,
|
|
207
|
+
:form_params => form_params,
|
|
208
|
+
:body => post_body,
|
|
209
|
+
:auth_names => auth_names,
|
|
210
|
+
:return_type => return_type
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
214
|
+
if @api_client.config.debugging
|
|
215
|
+
@api_client.config.logger.debug "API called: GroupApi#create_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
216
|
+
end
|
|
217
|
+
return data, status_code, headers
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Delete a group in the tenant
|
|
221
|
+
# @param uuid [String] ID of group to delete
|
|
222
|
+
# @param [Hash] opts the optional parameters
|
|
223
|
+
# @return [nil]
|
|
224
|
+
def delete_group(uuid, opts = {})
|
|
225
|
+
delete_group_with_http_info(uuid, opts)
|
|
226
|
+
nil
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Delete a group in the tenant
|
|
230
|
+
# @param uuid [String] ID of group to delete
|
|
231
|
+
# @param [Hash] opts the optional parameters
|
|
232
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
233
|
+
def delete_group_with_http_info(uuid, opts = {})
|
|
234
|
+
if @api_client.config.debugging
|
|
235
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.delete_group ...'
|
|
236
|
+
end
|
|
237
|
+
# verify the required parameter 'uuid' is set
|
|
238
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
239
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_group"
|
|
240
|
+
end
|
|
241
|
+
# resource path
|
|
242
|
+
local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
243
|
+
|
|
244
|
+
# query parameters
|
|
245
|
+
query_params = opts[:query_params] || {}
|
|
246
|
+
|
|
247
|
+
# header parameters
|
|
248
|
+
header_params = opts[:header_params] || {}
|
|
249
|
+
# HTTP header 'Accept' (if needed)
|
|
250
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
|
251
|
+
|
|
252
|
+
# form parameters
|
|
253
|
+
form_params = opts[:form_params] || {}
|
|
254
|
+
|
|
255
|
+
# http body (model)
|
|
256
|
+
post_body = opts[:body]
|
|
257
|
+
|
|
258
|
+
# return_type
|
|
259
|
+
return_type = opts[:return_type]
|
|
260
|
+
|
|
261
|
+
# auth_names
|
|
262
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
263
|
+
|
|
264
|
+
new_options = opts.merge(
|
|
265
|
+
:header_params => header_params,
|
|
266
|
+
:query_params => query_params,
|
|
267
|
+
:form_params => form_params,
|
|
268
|
+
:body => post_body,
|
|
269
|
+
:auth_names => auth_names,
|
|
270
|
+
:return_type => return_type
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
274
|
+
if @api_client.config.debugging
|
|
275
|
+
@api_client.config.logger.debug "API called: GroupApi#delete_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
276
|
+
end
|
|
277
|
+
return data, status_code, headers
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Remove a principal from a group in the tenant
|
|
281
|
+
# @param uuid [String] ID of group to update
|
|
282
|
+
# @param usernames [String] A comma separated list of usernames for principals to remove from the group
|
|
283
|
+
# @param [Hash] opts the optional parameters
|
|
284
|
+
# @return [nil]
|
|
285
|
+
def delete_principal_from_group(uuid, usernames, opts = {})
|
|
286
|
+
delete_principal_from_group_with_http_info(uuid, usernames, opts)
|
|
287
|
+
nil
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Remove a principal from a group in the tenant
|
|
291
|
+
# @param uuid [String] ID of group to update
|
|
292
|
+
# @param usernames [String] A comma separated list of usernames for principals to remove from the group
|
|
293
|
+
# @param [Hash] opts the optional parameters
|
|
294
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
295
|
+
def delete_principal_from_group_with_http_info(uuid, usernames, opts = {})
|
|
296
|
+
if @api_client.config.debugging
|
|
297
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.delete_principal_from_group ...'
|
|
298
|
+
end
|
|
299
|
+
# verify the required parameter 'uuid' is set
|
|
300
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
301
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_principal_from_group"
|
|
302
|
+
end
|
|
303
|
+
# verify the required parameter 'usernames' is set
|
|
304
|
+
if @api_client.config.client_side_validation && usernames.nil?
|
|
305
|
+
fail ArgumentError, "Missing the required parameter 'usernames' when calling GroupApi.delete_principal_from_group"
|
|
306
|
+
end
|
|
307
|
+
# resource path
|
|
308
|
+
local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
309
|
+
|
|
310
|
+
# query parameters
|
|
311
|
+
query_params = opts[:query_params] || {}
|
|
312
|
+
query_params[:'usernames'] = usernames
|
|
313
|
+
|
|
314
|
+
# header parameters
|
|
315
|
+
header_params = opts[:header_params] || {}
|
|
316
|
+
# HTTP header 'Accept' (if needed)
|
|
317
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
318
|
+
|
|
319
|
+
# form parameters
|
|
320
|
+
form_params = opts[:form_params] || {}
|
|
321
|
+
|
|
322
|
+
# http body (model)
|
|
323
|
+
post_body = opts[:body]
|
|
324
|
+
|
|
325
|
+
# return_type
|
|
326
|
+
return_type = opts[:return_type]
|
|
327
|
+
|
|
328
|
+
# auth_names
|
|
329
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
330
|
+
|
|
331
|
+
new_options = opts.merge(
|
|
332
|
+
:header_params => header_params,
|
|
333
|
+
:query_params => query_params,
|
|
334
|
+
:form_params => form_params,
|
|
335
|
+
:body => post_body,
|
|
336
|
+
:auth_names => auth_names,
|
|
337
|
+
:return_type => return_type
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
341
|
+
if @api_client.config.debugging
|
|
342
|
+
@api_client.config.logger.debug "API called: GroupApi#delete_principal_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
343
|
+
end
|
|
344
|
+
return data, status_code, headers
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
# Remove a role from a group in the tenant
|
|
348
|
+
# @param uuid [String] ID of group to update
|
|
349
|
+
# @param roles [String] A comma separated list of role UUIDs for roles to remove from the group
|
|
350
|
+
# @param [Hash] opts the optional parameters
|
|
351
|
+
# @return [nil]
|
|
352
|
+
def delete_role_from_group(uuid, roles, opts = {})
|
|
353
|
+
delete_role_from_group_with_http_info(uuid, roles, opts)
|
|
354
|
+
nil
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# Remove a role from a group in the tenant
|
|
358
|
+
# @param uuid [String] ID of group to update
|
|
359
|
+
# @param roles [String] A comma separated list of role UUIDs for roles to remove from the group
|
|
360
|
+
# @param [Hash] opts the optional parameters
|
|
361
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
362
|
+
def delete_role_from_group_with_http_info(uuid, roles, opts = {})
|
|
363
|
+
if @api_client.config.debugging
|
|
364
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.delete_role_from_group ...'
|
|
365
|
+
end
|
|
366
|
+
# verify the required parameter 'uuid' is set
|
|
367
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
368
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_role_from_group"
|
|
369
|
+
end
|
|
370
|
+
# verify the required parameter 'roles' is set
|
|
371
|
+
if @api_client.config.client_side_validation && roles.nil?
|
|
372
|
+
fail ArgumentError, "Missing the required parameter 'roles' when calling GroupApi.delete_role_from_group"
|
|
373
|
+
end
|
|
374
|
+
# resource path
|
|
375
|
+
local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
376
|
+
|
|
377
|
+
# query parameters
|
|
378
|
+
query_params = opts[:query_params] || {}
|
|
379
|
+
query_params[:'roles'] = roles
|
|
380
|
+
|
|
381
|
+
# header parameters
|
|
382
|
+
header_params = opts[:header_params] || {}
|
|
383
|
+
# HTTP header 'Accept' (if needed)
|
|
384
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
385
|
+
|
|
386
|
+
# form parameters
|
|
387
|
+
form_params = opts[:form_params] || {}
|
|
388
|
+
|
|
389
|
+
# http body (model)
|
|
390
|
+
post_body = opts[:body]
|
|
391
|
+
|
|
392
|
+
# return_type
|
|
393
|
+
return_type = opts[:return_type]
|
|
394
|
+
|
|
395
|
+
# auth_names
|
|
396
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
397
|
+
|
|
398
|
+
new_options = opts.merge(
|
|
399
|
+
:header_params => header_params,
|
|
400
|
+
:query_params => query_params,
|
|
401
|
+
:form_params => form_params,
|
|
402
|
+
:body => post_body,
|
|
403
|
+
:auth_names => auth_names,
|
|
404
|
+
:return_type => return_type
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
408
|
+
if @api_client.config.debugging
|
|
409
|
+
@api_client.config.logger.debug "API called: GroupApi#delete_role_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
410
|
+
end
|
|
411
|
+
return data, status_code, headers
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
# Get a group in the tenant
|
|
415
|
+
# @param uuid [String] ID of group to get
|
|
416
|
+
# @param [Hash] opts the optional parameters
|
|
417
|
+
# @return [GroupWithPrincipalsAndRoles]
|
|
418
|
+
def get_group(uuid, opts = {})
|
|
419
|
+
data, _status_code, _headers = get_group_with_http_info(uuid, opts)
|
|
420
|
+
data
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
# Get a group in the tenant
|
|
424
|
+
# @param uuid [String] ID of group to get
|
|
425
|
+
# @param [Hash] opts the optional parameters
|
|
426
|
+
# @return [Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>] GroupWithPrincipalsAndRoles data, response status code and response headers
|
|
427
|
+
def get_group_with_http_info(uuid, opts = {})
|
|
428
|
+
if @api_client.config.debugging
|
|
429
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.get_group ...'
|
|
430
|
+
end
|
|
431
|
+
# verify the required parameter 'uuid' is set
|
|
432
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
433
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.get_group"
|
|
434
|
+
end
|
|
435
|
+
# resource path
|
|
436
|
+
local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
437
|
+
|
|
438
|
+
# query parameters
|
|
439
|
+
query_params = opts[:query_params] || {}
|
|
440
|
+
|
|
441
|
+
# header parameters
|
|
442
|
+
header_params = opts[:header_params] || {}
|
|
443
|
+
# HTTP header 'Accept' (if needed)
|
|
444
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
445
|
+
|
|
446
|
+
# form parameters
|
|
447
|
+
form_params = opts[:form_params] || {}
|
|
448
|
+
|
|
449
|
+
# http body (model)
|
|
450
|
+
post_body = opts[:body]
|
|
451
|
+
|
|
452
|
+
# return_type
|
|
453
|
+
return_type = opts[:return_type] || 'GroupWithPrincipalsAndRoles'
|
|
454
|
+
|
|
455
|
+
# auth_names
|
|
456
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
457
|
+
|
|
458
|
+
new_options = opts.merge(
|
|
459
|
+
:header_params => header_params,
|
|
460
|
+
:query_params => query_params,
|
|
461
|
+
:form_params => form_params,
|
|
462
|
+
:body => post_body,
|
|
463
|
+
:auth_names => auth_names,
|
|
464
|
+
:return_type => return_type
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
468
|
+
if @api_client.config.debugging
|
|
469
|
+
@api_client.config.logger.debug "API called: GroupApi#get_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
470
|
+
end
|
|
471
|
+
return data, status_code, headers
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
# Get a list of principals from a group in the tenant
|
|
475
|
+
# @param uuid [String] ID of group from which to get principals
|
|
476
|
+
# @param [Hash] opts the optional parameters
|
|
477
|
+
# @option opts [String] :principal_username Parameter for filtering group principals by principal `username` using string contains search.
|
|
478
|
+
# @return [PrincipalPagination]
|
|
479
|
+
def get_principals_from_group(uuid, opts = {})
|
|
480
|
+
data, _status_code, _headers = get_principals_from_group_with_http_info(uuid, opts)
|
|
481
|
+
data
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
# Get a list of principals from a group in the tenant
|
|
485
|
+
# @param uuid [String] ID of group from which to get principals
|
|
486
|
+
# @param [Hash] opts the optional parameters
|
|
487
|
+
# @option opts [String] :principal_username Parameter for filtering group principals by principal `username` using string contains search.
|
|
488
|
+
# @return [Array<(PrincipalPagination, Integer, Hash)>] PrincipalPagination data, response status code and response headers
|
|
489
|
+
def get_principals_from_group_with_http_info(uuid, opts = {})
|
|
490
|
+
if @api_client.config.debugging
|
|
491
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.get_principals_from_group ...'
|
|
492
|
+
end
|
|
493
|
+
# verify the required parameter 'uuid' is set
|
|
494
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
495
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.get_principals_from_group"
|
|
496
|
+
end
|
|
497
|
+
# resource path
|
|
498
|
+
local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
499
|
+
|
|
500
|
+
# query parameters
|
|
501
|
+
query_params = opts[:query_params] || {}
|
|
502
|
+
query_params[:'principal_username'] = opts[:'principal_username'] if !opts[:'principal_username'].nil?
|
|
503
|
+
|
|
504
|
+
# header parameters
|
|
505
|
+
header_params = opts[:header_params] || {}
|
|
506
|
+
# HTTP header 'Accept' (if needed)
|
|
507
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
508
|
+
|
|
509
|
+
# form parameters
|
|
510
|
+
form_params = opts[:form_params] || {}
|
|
511
|
+
|
|
512
|
+
# http body (model)
|
|
513
|
+
post_body = opts[:body]
|
|
514
|
+
|
|
515
|
+
# return_type
|
|
516
|
+
return_type = opts[:return_type] || 'PrincipalPagination'
|
|
517
|
+
|
|
518
|
+
# auth_names
|
|
519
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
520
|
+
|
|
521
|
+
new_options = opts.merge(
|
|
522
|
+
:header_params => header_params,
|
|
523
|
+
:query_params => query_params,
|
|
524
|
+
:form_params => form_params,
|
|
525
|
+
:body => post_body,
|
|
526
|
+
:auth_names => auth_names,
|
|
527
|
+
:return_type => return_type
|
|
528
|
+
)
|
|
529
|
+
|
|
530
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
531
|
+
if @api_client.config.debugging
|
|
532
|
+
@api_client.config.logger.debug "API called: GroupApi#get_principals_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
533
|
+
end
|
|
534
|
+
return data, status_code, headers
|
|
535
|
+
end
|
|
536
|
+
|
|
537
|
+
# List the groups for a tenant
|
|
538
|
+
# @param [Hash] opts the optional parameters
|
|
539
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned. (default to 10)
|
|
540
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data. (default to 0)
|
|
541
|
+
# @option opts [String] :name Parameter for filtering resource by name using string contains search.
|
|
542
|
+
# @option opts [String] :scope Parameter for filtering resource by scope. (default to 'account')
|
|
543
|
+
# @option opts [String] :username A username for a principal to filter for groups
|
|
544
|
+
# @option opts [Array<String>] :uuid A list of UUIDs to filter listed groups.
|
|
545
|
+
# @option opts [Array<String>] :role_names List of role name to filter for groups. It is exact match but case-insensitive
|
|
546
|
+
# @option opts [String] :role_discriminator Discriminator that works with role_names to indicate matching all/any of the role names
|
|
547
|
+
# @option opts [String] :order_by Parameter for ordering resource by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name
|
|
548
|
+
# @return [GroupPagination]
|
|
549
|
+
def list_groups(opts = {})
|
|
550
|
+
data, _status_code, _headers = list_groups_with_http_info(opts)
|
|
551
|
+
data
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
# List the groups for a tenant
|
|
555
|
+
# @param [Hash] opts the optional parameters
|
|
556
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned.
|
|
557
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data.
|
|
558
|
+
# @option opts [String] :name Parameter for filtering resource by name using string contains search.
|
|
559
|
+
# @option opts [String] :scope Parameter for filtering resource by scope.
|
|
560
|
+
# @option opts [String] :username A username for a principal to filter for groups
|
|
561
|
+
# @option opts [Array<String>] :uuid A list of UUIDs to filter listed groups.
|
|
562
|
+
# @option opts [Array<String>] :role_names List of role name to filter for groups. It is exact match but case-insensitive
|
|
563
|
+
# @option opts [String] :role_discriminator Discriminator that works with role_names to indicate matching all/any of the role names
|
|
564
|
+
# @option opts [String] :order_by Parameter for ordering resource by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name
|
|
565
|
+
# @return [Array<(GroupPagination, Integer, Hash)>] GroupPagination data, response status code and response headers
|
|
566
|
+
def list_groups_with_http_info(opts = {})
|
|
567
|
+
if @api_client.config.debugging
|
|
568
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.list_groups ...'
|
|
569
|
+
end
|
|
570
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
571
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_groups, must be smaller than or equal to 1000.'
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
575
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_groups, must be greater than or equal to 1.'
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
579
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling GroupApi.list_groups, must be greater than or equal to 0.'
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
allowable_values = ["account", "principal"]
|
|
583
|
+
if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope'])
|
|
584
|
+
fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}"
|
|
585
|
+
end
|
|
586
|
+
allowable_values = ["all", "any"]
|
|
587
|
+
if @api_client.config.client_side_validation && opts[:'role_discriminator'] && !allowable_values.include?(opts[:'role_discriminator'])
|
|
588
|
+
fail ArgumentError, "invalid value for \"role_discriminator\", must be one of #{allowable_values}"
|
|
589
|
+
end
|
|
590
|
+
# resource path
|
|
591
|
+
local_var_path = '/groups/'
|
|
592
|
+
|
|
593
|
+
# query parameters
|
|
594
|
+
query_params = opts[:query_params] || {}
|
|
595
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
596
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
597
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
|
598
|
+
query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
|
599
|
+
query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil?
|
|
600
|
+
query_params[:'uuid'] = @api_client.build_collection_param(opts[:'uuid'], :csv) if !opts[:'uuid'].nil?
|
|
601
|
+
query_params[:'role_names'] = @api_client.build_collection_param(opts[:'role_names'], :csv) if !opts[:'role_names'].nil?
|
|
602
|
+
query_params[:'role_discriminator'] = opts[:'role_discriminator'] if !opts[:'role_discriminator'].nil?
|
|
603
|
+
query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
|
|
604
|
+
|
|
605
|
+
# header parameters
|
|
606
|
+
header_params = opts[:header_params] || {}
|
|
607
|
+
# HTTP header 'Accept' (if needed)
|
|
608
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
609
|
+
|
|
610
|
+
# form parameters
|
|
611
|
+
form_params = opts[:form_params] || {}
|
|
612
|
+
|
|
613
|
+
# http body (model)
|
|
614
|
+
post_body = opts[:body]
|
|
615
|
+
|
|
616
|
+
# return_type
|
|
617
|
+
return_type = opts[:return_type] || 'GroupPagination'
|
|
618
|
+
|
|
619
|
+
# auth_names
|
|
620
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
621
|
+
|
|
622
|
+
new_options = opts.merge(
|
|
623
|
+
:header_params => header_params,
|
|
624
|
+
:query_params => query_params,
|
|
625
|
+
:form_params => form_params,
|
|
626
|
+
:body => post_body,
|
|
627
|
+
:auth_names => auth_names,
|
|
628
|
+
:return_type => return_type
|
|
629
|
+
)
|
|
630
|
+
|
|
631
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
632
|
+
if @api_client.config.debugging
|
|
633
|
+
@api_client.config.logger.debug "API called: GroupApi#list_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
634
|
+
end
|
|
635
|
+
return data, status_code, headers
|
|
636
|
+
end
|
|
637
|
+
|
|
638
|
+
# List the roles for a group in the tenant
|
|
639
|
+
# @param uuid [String] ID of group
|
|
640
|
+
# @param [Hash] opts the optional parameters
|
|
641
|
+
# @option opts [Boolean] :exclude If this is set to true, the result would be roles excluding the ones in the group (default to false)
|
|
642
|
+
# @option opts [String] :role_name Parameter for filtering group roles by role `name` using string contains search.
|
|
643
|
+
# @option opts [String] :role_description Parameter for filtering group roles by role `description` using string contains search.
|
|
644
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned. (default to 10)
|
|
645
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data. (default to 0)
|
|
646
|
+
# @option opts [String] :order_by Parameter for ordering resource by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name
|
|
647
|
+
# @return [GroupRolesPagination]
|
|
648
|
+
def list_roles_for_group(uuid, opts = {})
|
|
649
|
+
data, _status_code, _headers = list_roles_for_group_with_http_info(uuid, opts)
|
|
650
|
+
data
|
|
651
|
+
end
|
|
652
|
+
|
|
653
|
+
# List the roles for a group in the tenant
|
|
654
|
+
# @param uuid [String] ID of group
|
|
655
|
+
# @param [Hash] opts the optional parameters
|
|
656
|
+
# @option opts [Boolean] :exclude If this is set to true, the result would be roles excluding the ones in the group
|
|
657
|
+
# @option opts [String] :role_name Parameter for filtering group roles by role `name` using string contains search.
|
|
658
|
+
# @option opts [String] :role_description Parameter for filtering group roles by role `description` using string contains search.
|
|
659
|
+
# @option opts [Integer] :limit Parameter for selecting the amount of data returned.
|
|
660
|
+
# @option opts [Integer] :offset Parameter for selecting the offset of data.
|
|
661
|
+
# @option opts [String] :order_by Parameter for ordering resource by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name
|
|
662
|
+
# @return [Array<(GroupRolesPagination, Integer, Hash)>] GroupRolesPagination data, response status code and response headers
|
|
663
|
+
def list_roles_for_group_with_http_info(uuid, opts = {})
|
|
664
|
+
if @api_client.config.debugging
|
|
665
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.list_roles_for_group ...'
|
|
666
|
+
end
|
|
667
|
+
# verify the required parameter 'uuid' is set
|
|
668
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
669
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.list_roles_for_group"
|
|
670
|
+
end
|
|
671
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
672
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_roles_for_group, must be smaller than or equal to 1000.'
|
|
673
|
+
end
|
|
674
|
+
|
|
675
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
676
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_roles_for_group, must be greater than or equal to 1.'
|
|
677
|
+
end
|
|
678
|
+
|
|
679
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
680
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling GroupApi.list_roles_for_group, must be greater than or equal to 0.'
|
|
681
|
+
end
|
|
682
|
+
|
|
683
|
+
allowable_values = ["name", "modified", "policyCount"]
|
|
684
|
+
if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by'])
|
|
685
|
+
fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}"
|
|
686
|
+
end
|
|
687
|
+
# resource path
|
|
688
|
+
local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
689
|
+
|
|
690
|
+
# query parameters
|
|
691
|
+
query_params = opts[:query_params] || {}
|
|
692
|
+
query_params[:'exclude'] = opts[:'exclude'] if !opts[:'exclude'].nil?
|
|
693
|
+
query_params[:'role_name'] = opts[:'role_name'] if !opts[:'role_name'].nil?
|
|
694
|
+
query_params[:'role_description'] = opts[:'role_description'] if !opts[:'role_description'].nil?
|
|
695
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
696
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
697
|
+
query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
|
|
698
|
+
|
|
699
|
+
# header parameters
|
|
700
|
+
header_params = opts[:header_params] || {}
|
|
701
|
+
# HTTP header 'Accept' (if needed)
|
|
702
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
703
|
+
|
|
704
|
+
# form parameters
|
|
705
|
+
form_params = opts[:form_params] || {}
|
|
706
|
+
|
|
707
|
+
# http body (model)
|
|
708
|
+
post_body = opts[:body]
|
|
709
|
+
|
|
710
|
+
# return_type
|
|
711
|
+
return_type = opts[:return_type] || 'GroupRolesPagination'
|
|
712
|
+
|
|
713
|
+
# auth_names
|
|
714
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
715
|
+
|
|
716
|
+
new_options = opts.merge(
|
|
717
|
+
:header_params => header_params,
|
|
718
|
+
:query_params => query_params,
|
|
719
|
+
:form_params => form_params,
|
|
720
|
+
:body => post_body,
|
|
721
|
+
:auth_names => auth_names,
|
|
722
|
+
:return_type => return_type
|
|
723
|
+
)
|
|
724
|
+
|
|
725
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
726
|
+
if @api_client.config.debugging
|
|
727
|
+
@api_client.config.logger.debug "API called: GroupApi#list_roles_for_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
728
|
+
end
|
|
729
|
+
return data, status_code, headers
|
|
730
|
+
end
|
|
731
|
+
|
|
732
|
+
# Udate a group in the tenant
|
|
733
|
+
# @param uuid [String] ID of group to update
|
|
734
|
+
# @param group [Group] Group to update in tenant
|
|
735
|
+
# @param [Hash] opts the optional parameters
|
|
736
|
+
# @return [GroupOut]
|
|
737
|
+
def update_group(uuid, group, opts = {})
|
|
738
|
+
data, _status_code, _headers = update_group_with_http_info(uuid, group, opts)
|
|
739
|
+
data
|
|
740
|
+
end
|
|
741
|
+
|
|
742
|
+
# Udate a group in the tenant
|
|
743
|
+
# @param uuid [String] ID of group to update
|
|
744
|
+
# @param group [Group] Group to update in tenant
|
|
745
|
+
# @param [Hash] opts the optional parameters
|
|
746
|
+
# @return [Array<(GroupOut, Integer, Hash)>] GroupOut data, response status code and response headers
|
|
747
|
+
def update_group_with_http_info(uuid, group, opts = {})
|
|
748
|
+
if @api_client.config.debugging
|
|
749
|
+
@api_client.config.logger.debug 'Calling API: GroupApi.update_group ...'
|
|
750
|
+
end
|
|
751
|
+
# verify the required parameter 'uuid' is set
|
|
752
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
|
753
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.update_group"
|
|
754
|
+
end
|
|
755
|
+
# verify the required parameter 'group' is set
|
|
756
|
+
if @api_client.config.client_side_validation && group.nil?
|
|
757
|
+
fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.update_group"
|
|
758
|
+
end
|
|
759
|
+
# resource path
|
|
760
|
+
local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
|
761
|
+
|
|
762
|
+
# query parameters
|
|
763
|
+
query_params = opts[:query_params] || {}
|
|
764
|
+
|
|
765
|
+
# header parameters
|
|
766
|
+
header_params = opts[:header_params] || {}
|
|
767
|
+
# HTTP header 'Accept' (if needed)
|
|
768
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
|
769
|
+
# HTTP header 'Content-Type'
|
|
770
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
771
|
+
|
|
772
|
+
# form parameters
|
|
773
|
+
form_params = opts[:form_params] || {}
|
|
774
|
+
|
|
775
|
+
# http body (model)
|
|
776
|
+
post_body = opts[:body] || @api_client.object_to_http_body(group)
|
|
777
|
+
|
|
778
|
+
# return_type
|
|
779
|
+
return_type = opts[:return_type] || 'GroupOut'
|
|
780
|
+
|
|
781
|
+
# auth_names
|
|
782
|
+
auth_names = opts[:auth_names] || ['basic_auth']
|
|
783
|
+
|
|
784
|
+
new_options = opts.merge(
|
|
785
|
+
:header_params => header_params,
|
|
786
|
+
:query_params => query_params,
|
|
787
|
+
:form_params => form_params,
|
|
788
|
+
:body => post_body,
|
|
789
|
+
:auth_names => auth_names,
|
|
790
|
+
:return_type => return_type
|
|
791
|
+
)
|
|
792
|
+
|
|
793
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
794
|
+
if @api_client.config.debugging
|
|
795
|
+
@api_client.config.logger.debug "API called: GroupApi#update_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
796
|
+
end
|
|
797
|
+
return data, status_code, headers
|
|
798
|
+
end
|
|
799
|
+
end
|
|
800
|
+
end
|