permit-sdk 0.0.1
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/lib/api/api.rb +25 -0
- data/lib/api/base.rb +26 -0
- data/lib/api/resources.rb +13 -0
- data/lib/api/tenants.rb +11 -0
- data/lib/api/users.rb +50 -0
- data/lib/api/utils.rb +9 -0
- data/lib/config.rb +23 -0
- data/lib/main.rb +49 -0
- data/lib/openapi_client/api/api_keys_api.rb +413 -0
- data/lib/openapi_client/api/audit_elements_data_api.rb +118 -0
- data/lib/openapi_client/api/audit_logs_api.rb +204 -0
- data/lib/openapi_client/api/authentication_api.rb +512 -0
- data/lib/openapi_client/api/condition_set_rules_api.rb +278 -0
- data/lib/openapi_client/api/condition_sets_api.rb +428 -0
- data/lib/openapi_client/api/decision_logs_api.rb +128 -0
- data/lib/openapi_client/api/decision_logs_ingress_api.rb +90 -0
- data/lib/openapi_client/api/default_api.rb +297 -0
- data/lib/openapi_client/api/elements_configs_api.rb +657 -0
- data/lib/openapi_client/api/environments_api.rb +462 -0
- data/lib/openapi_client/api/instructions_api.rb +91 -0
- data/lib/openapi_client/api/members_api.rb +354 -0
- data/lib/openapi_client/api/opal_data_api.rb +343 -0
- data/lib/openapi_client/api/organizations_api.rb +652 -0
- data/lib/openapi_client/api/policy_api.rb +138 -0
- data/lib/openapi_client/api/policy_decision_points_api.rb +382 -0
- data/lib/openapi_client/api/policy_git_repositories_api.rb +510 -0
- data/lib/openapi_client/api/projects_api.rb +365 -0
- data/lib/openapi_client/api/resource_actions_api.rb +455 -0
- data/lib/openapi_client/api/resource_attributes_api.rb +473 -0
- data/lib/openapi_client/api/resource_instances_api.rb +425 -0
- data/lib/openapi_client/api/resource_roles_api.rb +813 -0
- data/lib/openapi_client/api/resources_api.rb +514 -0
- data/lib/openapi_client/api/role_assignments_api.rb +278 -0
- data/lib/openapi_client/api/roles_api.rb +759 -0
- data/lib/openapi_client/api/tenants_api.rb +603 -0
- data/lib/openapi_client/api/user_attributes_api.rb +458 -0
- data/lib/openapi_client/api/users_api.rb +684 -0
- data/lib/openapi_client/api/users_elements_data_api.rb +638 -0
- data/lib/openapi_client/api_client.rb +392 -0
- data/lib/openapi_client/api_error.rb +57 -0
- data/lib/openapi_client/configuration.rb +280 -0
- data/lib/openapi_client/models/action_block_editable.rb +230 -0
- data/lib/openapi_client/models/action_block_read.rb +255 -0
- data/lib/openapi_client/models/action_object.rb +275 -0
- data/lib/openapi_client/models/actor.rb +57 -0
- data/lib/openapi_client/models/add_role_permissions.rb +227 -0
- data/lib/openapi_client/models/api_key_create.rb +269 -0
- data/lib/openapi_client/models/api_key_owner_type.rb +41 -0
- data/lib/openapi_client/models/api_key_read.rb +329 -0
- data/lib/openapi_client/models/api_key_scope_read.rb +245 -0
- data/lib/openapi_client/models/attribute_block_editable.rb +235 -0
- data/lib/openapi_client/models/attribute_block_read.rb +260 -0
- data/lib/openapi_client/models/attribute_type.rb +44 -0
- data/lib/openapi_client/models/attributes.rb +231 -0
- data/lib/openapi_client/models/audit_log.rb +415 -0
- data/lib/openapi_client/models/audit_log_objects.rb +282 -0
- data/lib/openapi_client/models/authn_me_api_key_read.rb +329 -0
- data/lib/openapi_client/models/authn_me_member_read.rb +352 -0
- data/lib/openapi_client/models/authn_me_read.rb +224 -0
- data/lib/openapi_client/models/authn_me_user_read.rb +440 -0
- data/lib/openapi_client/models/condition_set_create.rb +340 -0
- data/lib/openapi_client/models/condition_set_read.rb +409 -0
- data/lib/openapi_client/models/condition_set_rule_create.rb +279 -0
- data/lib/openapi_client/models/condition_set_rule_read.rb +360 -0
- data/lib/openapi_client/models/condition_set_rule_remove.rb +279 -0
- data/lib/openapi_client/models/condition_set_type.rb +40 -0
- data/lib/openapi_client/models/condition_set_update.rb +255 -0
- data/lib/openapi_client/models/data_source_config.rb +228 -0
- data/lib/openapi_client/models/data_source_entry.rb +272 -0
- data/lib/openapi_client/models/detailed_audit_log.rb +443 -0
- data/lib/openapi_client/models/dev_login.rb +225 -0
- data/lib/openapi_client/models/dummy_engine_model.rb +229 -0
- data/lib/openapi_client/models/elements_config_create.rb +319 -0
- data/lib/openapi_client/models/elements_config_read.rb +402 -0
- data/lib/openapi_client/models/elements_config_runtime_read.rb +238 -0
- data/lib/openapi_client/models/elements_config_update.rb +268 -0
- data/lib/openapi_client/models/elements_env_type_read.rb +242 -0
- data/lib/openapi_client/models/elements_env_type_update.rb +222 -0
- data/lib/openapi_client/models/elements_permission_level.rb +44 -0
- data/lib/openapi_client/models/elements_role_read.rb +378 -0
- data/lib/openapi_client/models/elements_type.rb +41 -0
- data/lib/openapi_client/models/elements_user_create.rb +295 -0
- data/lib/openapi_client/models/elements_user_role_create.rb +225 -0
- data/lib/openapi_client/models/elements_user_role_remove.rb +225 -0
- data/lib/openapi_client/models/embedded_login_request_output.rb +265 -0
- data/lib/openapi_client/models/engine.rb +39 -0
- data/lib/openapi_client/models/environment_create.rb +281 -0
- data/lib/openapi_client/models/environment_object.rb +295 -0
- data/lib/openapi_client/models/environment_read.rb +335 -0
- data/lib/openapi_client/models/environment_stats.rb +365 -0
- data/lib/openapi_client/models/environment_update.rb +240 -0
- data/lib/openapi_client/models/failed_invite.rb +238 -0
- data/lib/openapi_client/models/full_data.rb +258 -0
- data/lib/openapi_client/models/http_validation_error.rb +221 -0
- data/lib/openapi_client/models/identity_read.rb +300 -0
- data/lib/openapi_client/models/invite_attempt_result.rb +232 -0
- data/lib/openapi_client/models/invite_create.rb +240 -0
- data/lib/openapi_client/models/invite_read.rb +325 -0
- data/lib/openapi_client/models/invite_status.rb +42 -0
- data/lib/openapi_client/models/labels.rb +238 -0
- data/lib/openapi_client/models/language_instructions.rb +252 -0
- data/lib/openapi_client/models/location_inner.rb +230 -0
- data/lib/openapi_client/models/login_result.rb +259 -0
- data/lib/openapi_client/models/member_access_level.rb +41 -0
- data/lib/openapi_client/models/member_access_obj.rb +41 -0
- data/lib/openapi_client/models/multi_invite_result.rb +238 -0
- data/lib/openapi_client/models/onboarding_step.rb +46 -0
- data/lib/openapi_client/models/opa_decision_log.rb +288 -0
- data/lib/openapi_client/models/opa_engine_decision_log.rb +345 -0
- data/lib/openapi_client/models/opa_labels.rb +238 -0
- data/lib/openapi_client/models/opa_metrics.rb +273 -0
- data/lib/openapi_client/models/opal_client.rb +305 -0
- data/lib/openapi_client/models/org_member_read.rb +420 -0
- data/lib/openapi_client/models/org_member_update.rb +230 -0
- data/lib/openapi_client/models/organization_create.rb +292 -0
- data/lib/openapi_client/models/organization_object.rb +295 -0
- data/lib/openapi_client/models/organization_read.rb +295 -0
- data/lib/openapi_client/models/organization_read_with_api_key.rb +313 -0
- data/lib/openapi_client/models/organization_update.rb +247 -0
- data/lib/openapi_client/models/paginated_result_api_key_read.rb +285 -0
- data/lib/openapi_client/models/paginated_result_audit_log.rb +285 -0
- data/lib/openapi_client/models/paginated_result_elements_config_read.rb +285 -0
- data/lib/openapi_client/models/paginated_result_opa_decision_log.rb +285 -0
- data/lib/openapi_client/models/paginated_result_user_read.rb +285 -0
- data/lib/openapi_client/models/pdp.rb +259 -0
- data/lib/openapi_client/models/pdp_config_object.rb +258 -0
- data/lib/openapi_client/models/pdp_config_read.rb +292 -0
- data/lib/openapi_client/models/pdp_context.rb +291 -0
- data/lib/openapi_client/models/pdp_state.rb +224 -0
- data/lib/openapi_client/models/pdp_state_update.rb +238 -0
- data/lib/openapi_client/models/pdp_values.rb +252 -0
- data/lib/openapi_client/models/permission_level_role_read.rb +254 -0
- data/lib/openapi_client/models/policy_repo_create.rb +318 -0
- data/lib/openapi_client/models/policy_repo_read.rb +347 -0
- data/lib/openapi_client/models/policy_repo_status.rb +41 -0
- data/lib/openapi_client/models/programming_language.rb +43 -0
- data/lib/openapi_client/models/project_create.rb +318 -0
- data/lib/openapi_client/models/project_object.rb +295 -0
- data/lib/openapi_client/models/project_read.rb +357 -0
- data/lib/openapi_client/models/project_update.rb +250 -0
- data/lib/openapi_client/models/raw_data.rb +329 -0
- data/lib/openapi_client/models/relationship_tuple_object.rb +252 -0
- data/lib/openapi_client/models/remote_config.rb +256 -0
- data/lib/openapi_client/models/remove_role_permissions.rb +227 -0
- data/lib/openapi_client/models/resource_action_create.rb +271 -0
- data/lib/openapi_client/models/resource_action_read.rb +370 -0
- data/lib/openapi_client/models/resource_action_update.rb +230 -0
- data/lib/openapi_client/models/resource_attribute_create.rb +271 -0
- data/lib/openapi_client/models/resource_attribute_read.rb +370 -0
- data/lib/openapi_client/models/resource_attribute_update.rb +230 -0
- data/lib/openapi_client/models/resource_attributes.rb +238 -0
- data/lib/openapi_client/models/resource_create.rb +310 -0
- data/lib/openapi_client/models/resource_id.rb +230 -0
- data/lib/openapi_client/models/resource_instance_create.rb +281 -0
- data/lib/openapi_client/models/resource_instance_read.rb +375 -0
- data/lib/openapi_client/models/resource_instance_update.rb +220 -0
- data/lib/openapi_client/models/resource_read.rb +374 -0
- data/lib/openapi_client/models/resource_replace.rb +274 -0
- data/lib/openapi_client/models/resource_role_create.rb +295 -0
- data/lib/openapi_client/models/resource_role_read.rb +379 -0
- data/lib/openapi_client/models/resource_role_update.rb +254 -0
- data/lib/openapi_client/models/resource_type_object.rb +286 -0
- data/lib/openapi_client/models/resource_update.rb +264 -0
- data/lib/openapi_client/models/role_assignment_create.rb +255 -0
- data/lib/openapi_client/models/role_assignment_read.rb +375 -0
- data/lib/openapi_client/models/role_assignment_remove.rb +255 -0
- data/lib/openapi_client/models/role_block.rb +244 -0
- data/lib/openapi_client/models/role_create.rb +295 -0
- data/lib/openapi_client/models/role_data.rb +221 -0
- data/lib/openapi_client/models/role_read.rb +364 -0
- data/lib/openapi_client/models/role_update.rb +254 -0
- data/lib/openapi_client/models/settings.rb +231 -0
- data/lib/openapi_client/models/ssh_auth_data.rb +295 -0
- data/lib/openapi_client/models/statistics.rb +389 -0
- data/lib/openapi_client/models/tenant_create.rb +281 -0
- data/lib/openapi_client/models/tenant_object.rb +284 -0
- data/lib/openapi_client/models/tenant_read.rb +365 -0
- data/lib/openapi_client/models/tenant_update.rb +240 -0
- data/lib/openapi_client/models/user_create.rb +286 -0
- data/lib/openapi_client/models/user_data.rb +232 -0
- data/lib/openapi_client/models/user_login_request_input.rb +240 -0
- data/lib/openapi_client/models/user_object.rb +313 -0
- data/lib/openapi_client/models/user_read.rb +336 -0
- data/lib/openapi_client/models/user_role.rb +240 -0
- data/lib/openapi_client/models/user_role_create.rb +240 -0
- data/lib/openapi_client/models/user_role_remove.rb +240 -0
- data/lib/openapi_client/models/user_update.rb +250 -0
- data/lib/openapi_client/models/validation_error.rb +254 -0
- data/lib/openapi_client/models/webhook_create.rb +235 -0
- data/lib/openapi_client/models/webhook_read.rb +315 -0
- data/lib/openapi_client/models/webhook_update.rb +230 -0
- data/lib/openapi_client/version.rb +15 -0
- data/lib/openapi_client.rb +220 -0
- data/lib/permit.rb +58 -0
- metadata +251 -0
@@ -0,0 +1,759 @@
|
|
1
|
+
=begin
|
2
|
+
#Permit.io API
|
3
|
+
|
4
|
+
# Authorization as a service
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
class RolesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Add Parent Role
|
23
|
+
# This endpoint is part of the role hierarchy feature. Makes role with id `role_id` extend the role with id `parent_role_id`. In other words, `role_id` will automatically be assigned any permissions that are granted to `parent_role_id`. We can say the `role_id` **extends** `parent_role_id` or **inherits** from `parent_role_id`. If `role_id` is already an ancestor of `parent_role_id`, the request will fail with HTTP 400 to prevent a cycle in the role hierarchy.
|
24
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
25
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
26
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
27
|
+
# @param parent_role_id [String] Either the unique id of the parent role, or the URL-friendly key of the parent role (i.e: the \"slug\").
|
28
|
+
# @param [Hash] opts the optional parameters
|
29
|
+
# @return [RoleRead]
|
30
|
+
def add_parent_role(proj_id, env_id, role_id, parent_role_id, opts = {})
|
31
|
+
data, _status_code, _headers = add_parent_role_with_http_info(proj_id, env_id, role_id, parent_role_id, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Add Parent Role
|
36
|
+
# This endpoint is part of the role hierarchy feature. Makes role with id `role_id` extend the role with id `parent_role_id`. In other words, `role_id` will automatically be assigned any permissions that are granted to `parent_role_id`. We can say the `role_id` **extends** `parent_role_id` or **inherits** from `parent_role_id`. If `role_id` is already an ancestor of `parent_role_id`, the request will fail with HTTP 400 to prevent a cycle in the role hierarchy.
|
37
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
38
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
39
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
40
|
+
# @param parent_role_id [String] Either the unique id of the parent role, or the URL-friendly key of the parent role (i.e: the \"slug\").
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @return [Array<(RoleRead, Integer, Hash)>] RoleRead data, response status code and response headers
|
43
|
+
def add_parent_role_with_http_info(proj_id, env_id, role_id, parent_role_id, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.add_parent_role ...'
|
46
|
+
end
|
47
|
+
# verify the required parameter 'proj_id' is set
|
48
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.add_parent_role"
|
50
|
+
end
|
51
|
+
# verify the required parameter 'env_id' is set
|
52
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
53
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.add_parent_role"
|
54
|
+
end
|
55
|
+
# verify the required parameter 'role_id' is set
|
56
|
+
if @api_client.config.client_side_validation && role_id.nil?
|
57
|
+
fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.add_parent_role"
|
58
|
+
end
|
59
|
+
# verify the required parameter 'parent_role_id' is set
|
60
|
+
if @api_client.config.client_side_validation && parent_role_id.nil?
|
61
|
+
fail ArgumentError, "Missing the required parameter 'parent_role_id' when calling RolesApi.add_parent_role"
|
62
|
+
end
|
63
|
+
# resource path
|
64
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles/{role_id}/parents/{parent_role_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s)).sub('{' + 'parent_role_id' + '}', CGI.escape(parent_role_id.to_s))
|
65
|
+
|
66
|
+
# query parameters
|
67
|
+
query_params = opts[:query_params] || {}
|
68
|
+
|
69
|
+
# header parameters
|
70
|
+
header_params = opts[:header_params] || {}
|
71
|
+
# HTTP header 'Accept' (if needed)
|
72
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
73
|
+
|
74
|
+
# form parameters
|
75
|
+
form_params = opts[:form_params] || {}
|
76
|
+
|
77
|
+
# http body (model)
|
78
|
+
post_body = opts[:debug_body]
|
79
|
+
|
80
|
+
# return_type
|
81
|
+
return_type = opts[:debug_return_type] || 'RoleRead'
|
82
|
+
|
83
|
+
# auth_names
|
84
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
85
|
+
|
86
|
+
new_options = opts.merge(
|
87
|
+
:operation => :"RolesApi.add_parent_role",
|
88
|
+
:header_params => header_params,
|
89
|
+
:query_params => query_params,
|
90
|
+
:form_params => form_params,
|
91
|
+
:body => post_body,
|
92
|
+
:auth_names => auth_names,
|
93
|
+
:return_type => return_type
|
94
|
+
)
|
95
|
+
|
96
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
97
|
+
if @api_client.config.debugging
|
98
|
+
@api_client.config.logger.debug "API called: RolesApi#add_parent_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
99
|
+
end
|
100
|
+
return data, status_code, headers
|
101
|
+
end
|
102
|
+
|
103
|
+
# Assign Permissions To Role
|
104
|
+
# Assign permissions to role. If some of the permissions specified are already unassigned, will skip them.
|
105
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
106
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
107
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
108
|
+
# @param add_role_permissions [AddRolePermissions]
|
109
|
+
# @param [Hash] opts the optional parameters
|
110
|
+
# @return [RoleRead]
|
111
|
+
def assign_permissions_to_role(proj_id, env_id, role_id, add_role_permissions, opts = {})
|
112
|
+
data, _status_code, _headers = assign_permissions_to_role_with_http_info(proj_id, env_id, role_id, add_role_permissions, opts)
|
113
|
+
data
|
114
|
+
end
|
115
|
+
|
116
|
+
# Assign Permissions To Role
|
117
|
+
# Assign permissions to role. If some of the permissions specified are already unassigned, will skip them.
|
118
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
119
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
120
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
121
|
+
# @param add_role_permissions [AddRolePermissions]
|
122
|
+
# @param [Hash] opts the optional parameters
|
123
|
+
# @return [Array<(RoleRead, Integer, Hash)>] RoleRead data, response status code and response headers
|
124
|
+
def assign_permissions_to_role_with_http_info(proj_id, env_id, role_id, add_role_permissions, opts = {})
|
125
|
+
if @api_client.config.debugging
|
126
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.assign_permissions_to_role ...'
|
127
|
+
end
|
128
|
+
# verify the required parameter 'proj_id' is set
|
129
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
130
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.assign_permissions_to_role"
|
131
|
+
end
|
132
|
+
# verify the required parameter 'env_id' is set
|
133
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
134
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.assign_permissions_to_role"
|
135
|
+
end
|
136
|
+
# verify the required parameter 'role_id' is set
|
137
|
+
if @api_client.config.client_side_validation && role_id.nil?
|
138
|
+
fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.assign_permissions_to_role"
|
139
|
+
end
|
140
|
+
# verify the required parameter 'add_role_permissions' is set
|
141
|
+
if @api_client.config.client_side_validation && add_role_permissions.nil?
|
142
|
+
fail ArgumentError, "Missing the required parameter 'add_role_permissions' when calling RolesApi.assign_permissions_to_role"
|
143
|
+
end
|
144
|
+
# resource path
|
145
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles/{role_id}/permissions'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s))
|
146
|
+
|
147
|
+
# query parameters
|
148
|
+
query_params = opts[:query_params] || {}
|
149
|
+
|
150
|
+
# header parameters
|
151
|
+
header_params = opts[:header_params] || {}
|
152
|
+
# HTTP header 'Accept' (if needed)
|
153
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
154
|
+
# HTTP header 'Content-Type'
|
155
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
156
|
+
if !content_type.nil?
|
157
|
+
header_params['Content-Type'] = content_type
|
158
|
+
end
|
159
|
+
|
160
|
+
# form parameters
|
161
|
+
form_params = opts[:form_params] || {}
|
162
|
+
|
163
|
+
# http body (model)
|
164
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(add_role_permissions)
|
165
|
+
|
166
|
+
# return_type
|
167
|
+
return_type = opts[:debug_return_type] || 'RoleRead'
|
168
|
+
|
169
|
+
# auth_names
|
170
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
171
|
+
|
172
|
+
new_options = opts.merge(
|
173
|
+
:operation => :"RolesApi.assign_permissions_to_role",
|
174
|
+
:header_params => header_params,
|
175
|
+
:query_params => query_params,
|
176
|
+
:form_params => form_params,
|
177
|
+
:body => post_body,
|
178
|
+
:auth_names => auth_names,
|
179
|
+
:return_type => return_type
|
180
|
+
)
|
181
|
+
|
182
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
183
|
+
if @api_client.config.debugging
|
184
|
+
@api_client.config.logger.debug "API called: RolesApi#assign_permissions_to_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
185
|
+
end
|
186
|
+
return data, status_code, headers
|
187
|
+
end
|
188
|
+
|
189
|
+
# Create Role
|
190
|
+
# Creates a new tenant role.
|
191
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
192
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
193
|
+
# @param role_create [RoleCreate]
|
194
|
+
# @param [Hash] opts the optional parameters
|
195
|
+
# @return [RoleRead]
|
196
|
+
def create_role(proj_id, env_id, role_create, opts = {})
|
197
|
+
data, _status_code, _headers = create_role_with_http_info(proj_id, env_id, role_create, opts)
|
198
|
+
data
|
199
|
+
end
|
200
|
+
|
201
|
+
# Create Role
|
202
|
+
# Creates a new tenant role.
|
203
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
204
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
205
|
+
# @param role_create [RoleCreate]
|
206
|
+
# @param [Hash] opts the optional parameters
|
207
|
+
# @return [Array<(RoleRead, Integer, Hash)>] RoleRead data, response status code and response headers
|
208
|
+
def create_role_with_http_info(proj_id, env_id, role_create, opts = {})
|
209
|
+
if @api_client.config.debugging
|
210
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.create_role ...'
|
211
|
+
end
|
212
|
+
# verify the required parameter 'proj_id' is set
|
213
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
214
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.create_role"
|
215
|
+
end
|
216
|
+
# verify the required parameter 'env_id' is set
|
217
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
218
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.create_role"
|
219
|
+
end
|
220
|
+
# verify the required parameter 'role_create' is set
|
221
|
+
if @api_client.config.client_side_validation && role_create.nil?
|
222
|
+
fail ArgumentError, "Missing the required parameter 'role_create' when calling RolesApi.create_role"
|
223
|
+
end
|
224
|
+
# resource path
|
225
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))
|
226
|
+
|
227
|
+
# query parameters
|
228
|
+
query_params = opts[:query_params] || {}
|
229
|
+
|
230
|
+
# header parameters
|
231
|
+
header_params = opts[:header_params] || {}
|
232
|
+
# HTTP header 'Accept' (if needed)
|
233
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
234
|
+
# HTTP header 'Content-Type'
|
235
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
236
|
+
if !content_type.nil?
|
237
|
+
header_params['Content-Type'] = content_type
|
238
|
+
end
|
239
|
+
|
240
|
+
# form parameters
|
241
|
+
form_params = opts[:form_params] || {}
|
242
|
+
|
243
|
+
# http body (model)
|
244
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(role_create)
|
245
|
+
|
246
|
+
# return_type
|
247
|
+
return_type = opts[:debug_return_type] || 'RoleRead'
|
248
|
+
|
249
|
+
# auth_names
|
250
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
251
|
+
|
252
|
+
new_options = opts.merge(
|
253
|
+
:operation => :"RolesApi.create_role",
|
254
|
+
:header_params => header_params,
|
255
|
+
:query_params => query_params,
|
256
|
+
:form_params => form_params,
|
257
|
+
:body => post_body,
|
258
|
+
:auth_names => auth_names,
|
259
|
+
:return_type => return_type
|
260
|
+
)
|
261
|
+
|
262
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
263
|
+
if @api_client.config.debugging
|
264
|
+
@api_client.config.logger.debug "API called: RolesApi#create_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
265
|
+
end
|
266
|
+
return data, status_code, headers
|
267
|
+
end
|
268
|
+
|
269
|
+
# Delete Role
|
270
|
+
# Deletes a tenant role and all its related data. This includes any permissions granted to said role.
|
271
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
272
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
273
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
274
|
+
# @param [Hash] opts the optional parameters
|
275
|
+
# @return [nil]
|
276
|
+
def delete_role(proj_id, env_id, role_id, opts = {})
|
277
|
+
delete_role_with_http_info(proj_id, env_id, role_id, opts)
|
278
|
+
nil
|
279
|
+
end
|
280
|
+
|
281
|
+
# Delete Role
|
282
|
+
# Deletes a tenant role and all its related data. This includes any permissions granted to said role.
|
283
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
284
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
285
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
286
|
+
# @param [Hash] opts the optional parameters
|
287
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
288
|
+
def delete_role_with_http_info(proj_id, env_id, role_id, opts = {})
|
289
|
+
if @api_client.config.debugging
|
290
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.delete_role ...'
|
291
|
+
end
|
292
|
+
# verify the required parameter 'proj_id' is set
|
293
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
294
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.delete_role"
|
295
|
+
end
|
296
|
+
# verify the required parameter 'env_id' is set
|
297
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
298
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.delete_role"
|
299
|
+
end
|
300
|
+
# verify the required parameter 'role_id' is set
|
301
|
+
if @api_client.config.client_side_validation && role_id.nil?
|
302
|
+
fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.delete_role"
|
303
|
+
end
|
304
|
+
# resource path
|
305
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles/{role_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s))
|
306
|
+
|
307
|
+
# query parameters
|
308
|
+
query_params = opts[:query_params] || {}
|
309
|
+
|
310
|
+
# header parameters
|
311
|
+
header_params = opts[:header_params] || {}
|
312
|
+
# HTTP header 'Accept' (if needed)
|
313
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
314
|
+
|
315
|
+
# form parameters
|
316
|
+
form_params = opts[:form_params] || {}
|
317
|
+
|
318
|
+
# http body (model)
|
319
|
+
post_body = opts[:debug_body]
|
320
|
+
|
321
|
+
# return_type
|
322
|
+
return_type = opts[:debug_return_type]
|
323
|
+
|
324
|
+
# auth_names
|
325
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
326
|
+
|
327
|
+
new_options = opts.merge(
|
328
|
+
:operation => :"RolesApi.delete_role",
|
329
|
+
:header_params => header_params,
|
330
|
+
:query_params => query_params,
|
331
|
+
:form_params => form_params,
|
332
|
+
:body => post_body,
|
333
|
+
:auth_names => auth_names,
|
334
|
+
:return_type => return_type
|
335
|
+
)
|
336
|
+
|
337
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
338
|
+
if @api_client.config.debugging
|
339
|
+
@api_client.config.logger.debug "API called: RolesApi#delete_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
340
|
+
end
|
341
|
+
return data, status_code, headers
|
342
|
+
end
|
343
|
+
|
344
|
+
# Get Role
|
345
|
+
# Gets a single tenant role, if such role exists.
|
346
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
347
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
348
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
349
|
+
# @param [Hash] opts the optional parameters
|
350
|
+
# @return [RoleRead]
|
351
|
+
def get_role(proj_id, env_id, role_id, opts = {})
|
352
|
+
data, _status_code, _headers = get_role_with_http_info(proj_id, env_id, role_id, opts)
|
353
|
+
data
|
354
|
+
end
|
355
|
+
|
356
|
+
# Get Role
|
357
|
+
# Gets a single tenant role, if such role exists.
|
358
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
359
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
360
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
361
|
+
# @param [Hash] opts the optional parameters
|
362
|
+
# @return [Array<(RoleRead, Integer, Hash)>] RoleRead data, response status code and response headers
|
363
|
+
def get_role_with_http_info(proj_id, env_id, role_id, opts = {})
|
364
|
+
if @api_client.config.debugging
|
365
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.get_role ...'
|
366
|
+
end
|
367
|
+
# verify the required parameter 'proj_id' is set
|
368
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
369
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.get_role"
|
370
|
+
end
|
371
|
+
# verify the required parameter 'env_id' is set
|
372
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
373
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.get_role"
|
374
|
+
end
|
375
|
+
# verify the required parameter 'role_id' is set
|
376
|
+
if @api_client.config.client_side_validation && role_id.nil?
|
377
|
+
fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.get_role"
|
378
|
+
end
|
379
|
+
# resource path
|
380
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles/{role_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s))
|
381
|
+
|
382
|
+
# query parameters
|
383
|
+
query_params = opts[:query_params] || {}
|
384
|
+
|
385
|
+
# header parameters
|
386
|
+
header_params = opts[:header_params] || {}
|
387
|
+
# HTTP header 'Accept' (if needed)
|
388
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
389
|
+
|
390
|
+
# form parameters
|
391
|
+
form_params = opts[:form_params] || {}
|
392
|
+
|
393
|
+
# http body (model)
|
394
|
+
post_body = opts[:debug_body]
|
395
|
+
|
396
|
+
# return_type
|
397
|
+
return_type = opts[:debug_return_type] || 'RoleRead'
|
398
|
+
|
399
|
+
# auth_names
|
400
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
401
|
+
|
402
|
+
new_options = opts.merge(
|
403
|
+
:operation => :"RolesApi.get_role",
|
404
|
+
:header_params => header_params,
|
405
|
+
:query_params => query_params,
|
406
|
+
:form_params => form_params,
|
407
|
+
:body => post_body,
|
408
|
+
:auth_names => auth_names,
|
409
|
+
:return_type => return_type
|
410
|
+
)
|
411
|
+
|
412
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
413
|
+
if @api_client.config.debugging
|
414
|
+
@api_client.config.logger.debug "API called: RolesApi#get_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
415
|
+
end
|
416
|
+
return data, status_code, headers
|
417
|
+
end
|
418
|
+
|
419
|
+
# List Roles
|
420
|
+
# Lists all tenant roles.
|
421
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
422
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
423
|
+
# @param [Hash] opts the optional parameters
|
424
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
425
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
426
|
+
# @return [Array<RoleRead>]
|
427
|
+
def list_roles(proj_id, env_id, opts = {})
|
428
|
+
data, _status_code, _headers = list_roles_with_http_info(proj_id, env_id, opts)
|
429
|
+
data
|
430
|
+
end
|
431
|
+
|
432
|
+
# List Roles
|
433
|
+
# Lists all tenant roles.
|
434
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
435
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
436
|
+
# @param [Hash] opts the optional parameters
|
437
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
438
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
439
|
+
# @return [Array<(Array<RoleRead>, Integer, Hash)>] Array<RoleRead> data, response status code and response headers
|
440
|
+
def list_roles_with_http_info(proj_id, env_id, opts = {})
|
441
|
+
if @api_client.config.debugging
|
442
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.list_roles ...'
|
443
|
+
end
|
444
|
+
# verify the required parameter 'proj_id' is set
|
445
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
446
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.list_roles"
|
447
|
+
end
|
448
|
+
# verify the required parameter 'env_id' is set
|
449
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
450
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.list_roles"
|
451
|
+
end
|
452
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
453
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling RolesApi.list_roles, must be greater than or equal to 1.'
|
454
|
+
end
|
455
|
+
|
456
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
457
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling RolesApi.list_roles, must be smaller than or equal to 100.'
|
458
|
+
end
|
459
|
+
|
460
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
461
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling RolesApi.list_roles, must be greater than or equal to 1.'
|
462
|
+
end
|
463
|
+
|
464
|
+
# resource path
|
465
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))
|
466
|
+
|
467
|
+
# query parameters
|
468
|
+
query_params = opts[:query_params] || {}
|
469
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
470
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
471
|
+
|
472
|
+
# header parameters
|
473
|
+
header_params = opts[:header_params] || {}
|
474
|
+
# HTTP header 'Accept' (if needed)
|
475
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
476
|
+
|
477
|
+
# form parameters
|
478
|
+
form_params = opts[:form_params] || {}
|
479
|
+
|
480
|
+
# http body (model)
|
481
|
+
post_body = opts[:debug_body]
|
482
|
+
|
483
|
+
# return_type
|
484
|
+
return_type = opts[:debug_return_type] || 'Array<RoleRead>'
|
485
|
+
|
486
|
+
# auth_names
|
487
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
488
|
+
|
489
|
+
new_options = opts.merge(
|
490
|
+
:operation => :"RolesApi.list_roles",
|
491
|
+
:header_params => header_params,
|
492
|
+
:query_params => query_params,
|
493
|
+
:form_params => form_params,
|
494
|
+
:body => post_body,
|
495
|
+
:auth_names => auth_names,
|
496
|
+
:return_type => return_type
|
497
|
+
)
|
498
|
+
|
499
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
500
|
+
if @api_client.config.debugging
|
501
|
+
@api_client.config.logger.debug "API called: RolesApi#list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
502
|
+
end
|
503
|
+
return data, status_code, headers
|
504
|
+
end
|
505
|
+
|
506
|
+
# Remove Parent Role
|
507
|
+
# This endpoint is part of the role hierarchy feature. Removes `parent_role_id` from the list of parent roles of role with id `role_id`. In other words, `role_id` will no longer be automatically assigned permissions that are granted to `parent_role_id`. We can say the `role_id` **not longer extends** `parent_role_id` or **no longer inherits** from `parent_role_id`.
|
508
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
509
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
510
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
511
|
+
# @param parent_role_id [String] Either the unique id of the parent role, or the URL-friendly key of the parent role (i.e: the \"slug\").
|
512
|
+
# @param [Hash] opts the optional parameters
|
513
|
+
# @return [RoleRead]
|
514
|
+
def remove_parent_role(proj_id, env_id, role_id, parent_role_id, opts = {})
|
515
|
+
data, _status_code, _headers = remove_parent_role_with_http_info(proj_id, env_id, role_id, parent_role_id, opts)
|
516
|
+
data
|
517
|
+
end
|
518
|
+
|
519
|
+
# Remove Parent Role
|
520
|
+
# This endpoint is part of the role hierarchy feature. Removes `parent_role_id` from the list of parent roles of role with id `role_id`. In other words, `role_id` will no longer be automatically assigned permissions that are granted to `parent_role_id`. We can say the `role_id` **not longer extends** `parent_role_id` or **no longer inherits** from `parent_role_id`.
|
521
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
522
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
523
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
524
|
+
# @param parent_role_id [String] Either the unique id of the parent role, or the URL-friendly key of the parent role (i.e: the \"slug\").
|
525
|
+
# @param [Hash] opts the optional parameters
|
526
|
+
# @return [Array<(RoleRead, Integer, Hash)>] RoleRead data, response status code and response headers
|
527
|
+
def remove_parent_role_with_http_info(proj_id, env_id, role_id, parent_role_id, opts = {})
|
528
|
+
if @api_client.config.debugging
|
529
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.remove_parent_role ...'
|
530
|
+
end
|
531
|
+
# verify the required parameter 'proj_id' is set
|
532
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
533
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.remove_parent_role"
|
534
|
+
end
|
535
|
+
# verify the required parameter 'env_id' is set
|
536
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
537
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.remove_parent_role"
|
538
|
+
end
|
539
|
+
# verify the required parameter 'role_id' is set
|
540
|
+
if @api_client.config.client_side_validation && role_id.nil?
|
541
|
+
fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.remove_parent_role"
|
542
|
+
end
|
543
|
+
# verify the required parameter 'parent_role_id' is set
|
544
|
+
if @api_client.config.client_side_validation && parent_role_id.nil?
|
545
|
+
fail ArgumentError, "Missing the required parameter 'parent_role_id' when calling RolesApi.remove_parent_role"
|
546
|
+
end
|
547
|
+
# resource path
|
548
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles/{role_id}/parents/{parent_role_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s)).sub('{' + 'parent_role_id' + '}', CGI.escape(parent_role_id.to_s))
|
549
|
+
|
550
|
+
# query parameters
|
551
|
+
query_params = opts[:query_params] || {}
|
552
|
+
|
553
|
+
# header parameters
|
554
|
+
header_params = opts[:header_params] || {}
|
555
|
+
# HTTP header 'Accept' (if needed)
|
556
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
557
|
+
|
558
|
+
# form parameters
|
559
|
+
form_params = opts[:form_params] || {}
|
560
|
+
|
561
|
+
# http body (model)
|
562
|
+
post_body = opts[:debug_body]
|
563
|
+
|
564
|
+
# return_type
|
565
|
+
return_type = opts[:debug_return_type] || 'RoleRead'
|
566
|
+
|
567
|
+
# auth_names
|
568
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
569
|
+
|
570
|
+
new_options = opts.merge(
|
571
|
+
:operation => :"RolesApi.remove_parent_role",
|
572
|
+
:header_params => header_params,
|
573
|
+
:query_params => query_params,
|
574
|
+
:form_params => form_params,
|
575
|
+
:body => post_body,
|
576
|
+
:auth_names => auth_names,
|
577
|
+
:return_type => return_type
|
578
|
+
)
|
579
|
+
|
580
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
581
|
+
if @api_client.config.debugging
|
582
|
+
@api_client.config.logger.debug "API called: RolesApi#remove_parent_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
583
|
+
end
|
584
|
+
return data, status_code, headers
|
585
|
+
end
|
586
|
+
|
587
|
+
# Remove Permissions From Role
|
588
|
+
# Remove permissions from role. If some of the permissions specified are already unassigned, will skip them.
|
589
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
590
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
591
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
592
|
+
# @param remove_role_permissions [RemoveRolePermissions]
|
593
|
+
# @param [Hash] opts the optional parameters
|
594
|
+
# @return [RoleRead]
|
595
|
+
def remove_permissions_from_role(proj_id, env_id, role_id, remove_role_permissions, opts = {})
|
596
|
+
data, _status_code, _headers = remove_permissions_from_role_with_http_info(proj_id, env_id, role_id, remove_role_permissions, opts)
|
597
|
+
data
|
598
|
+
end
|
599
|
+
|
600
|
+
# Remove Permissions From Role
|
601
|
+
# Remove permissions from role. If some of the permissions specified are already unassigned, will skip them.
|
602
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
603
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
604
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
605
|
+
# @param remove_role_permissions [RemoveRolePermissions]
|
606
|
+
# @param [Hash] opts the optional parameters
|
607
|
+
# @return [Array<(RoleRead, Integer, Hash)>] RoleRead data, response status code and response headers
|
608
|
+
def remove_permissions_from_role_with_http_info(proj_id, env_id, role_id, remove_role_permissions, opts = {})
|
609
|
+
if @api_client.config.debugging
|
610
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.remove_permissions_from_role ...'
|
611
|
+
end
|
612
|
+
# verify the required parameter 'proj_id' is set
|
613
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
614
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.remove_permissions_from_role"
|
615
|
+
end
|
616
|
+
# verify the required parameter 'env_id' is set
|
617
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
618
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.remove_permissions_from_role"
|
619
|
+
end
|
620
|
+
# verify the required parameter 'role_id' is set
|
621
|
+
if @api_client.config.client_side_validation && role_id.nil?
|
622
|
+
fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.remove_permissions_from_role"
|
623
|
+
end
|
624
|
+
# verify the required parameter 'remove_role_permissions' is set
|
625
|
+
if @api_client.config.client_side_validation && remove_role_permissions.nil?
|
626
|
+
fail ArgumentError, "Missing the required parameter 'remove_role_permissions' when calling RolesApi.remove_permissions_from_role"
|
627
|
+
end
|
628
|
+
# resource path
|
629
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles/{role_id}/permissions'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s))
|
630
|
+
|
631
|
+
# query parameters
|
632
|
+
query_params = opts[:query_params] || {}
|
633
|
+
|
634
|
+
# header parameters
|
635
|
+
header_params = opts[:header_params] || {}
|
636
|
+
# HTTP header 'Accept' (if needed)
|
637
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
638
|
+
# HTTP header 'Content-Type'
|
639
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
640
|
+
if !content_type.nil?
|
641
|
+
header_params['Content-Type'] = content_type
|
642
|
+
end
|
643
|
+
|
644
|
+
# form parameters
|
645
|
+
form_params = opts[:form_params] || {}
|
646
|
+
|
647
|
+
# http body (model)
|
648
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(remove_role_permissions)
|
649
|
+
|
650
|
+
# return_type
|
651
|
+
return_type = opts[:debug_return_type] || 'RoleRead'
|
652
|
+
|
653
|
+
# auth_names
|
654
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
655
|
+
|
656
|
+
new_options = opts.merge(
|
657
|
+
:operation => :"RolesApi.remove_permissions_from_role",
|
658
|
+
:header_params => header_params,
|
659
|
+
:query_params => query_params,
|
660
|
+
:form_params => form_params,
|
661
|
+
:body => post_body,
|
662
|
+
:auth_names => auth_names,
|
663
|
+
:return_type => return_type
|
664
|
+
)
|
665
|
+
|
666
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
667
|
+
if @api_client.config.debugging
|
668
|
+
@api_client.config.logger.debug "API called: RolesApi#remove_permissions_from_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
669
|
+
end
|
670
|
+
return data, status_code, headers
|
671
|
+
end
|
672
|
+
|
673
|
+
# Update Role
|
674
|
+
# Partially updates a tenant role. Fields that will be provided will be completely overwritten.
|
675
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
676
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
677
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
678
|
+
# @param role_update [RoleUpdate]
|
679
|
+
# @param [Hash] opts the optional parameters
|
680
|
+
# @return [RoleRead]
|
681
|
+
def update_role(proj_id, env_id, role_id, role_update, opts = {})
|
682
|
+
data, _status_code, _headers = update_role_with_http_info(proj_id, env_id, role_id, role_update, opts)
|
683
|
+
data
|
684
|
+
end
|
685
|
+
|
686
|
+
# Update Role
|
687
|
+
# Partially updates a tenant role. Fields that will be provided will be completely overwritten.
|
688
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
689
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
690
|
+
# @param role_id [String] Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\").
|
691
|
+
# @param role_update [RoleUpdate]
|
692
|
+
# @param [Hash] opts the optional parameters
|
693
|
+
# @return [Array<(RoleRead, Integer, Hash)>] RoleRead data, response status code and response headers
|
694
|
+
def update_role_with_http_info(proj_id, env_id, role_id, role_update, opts = {})
|
695
|
+
if @api_client.config.debugging
|
696
|
+
@api_client.config.logger.debug 'Calling API: RolesApi.update_role ...'
|
697
|
+
end
|
698
|
+
# verify the required parameter 'proj_id' is set
|
699
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
700
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling RolesApi.update_role"
|
701
|
+
end
|
702
|
+
# verify the required parameter 'env_id' is set
|
703
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
704
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling RolesApi.update_role"
|
705
|
+
end
|
706
|
+
# verify the required parameter 'role_id' is set
|
707
|
+
if @api_client.config.client_side_validation && role_id.nil?
|
708
|
+
fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.update_role"
|
709
|
+
end
|
710
|
+
# verify the required parameter 'role_update' is set
|
711
|
+
if @api_client.config.client_side_validation && role_update.nil?
|
712
|
+
fail ArgumentError, "Missing the required parameter 'role_update' when calling RolesApi.update_role"
|
713
|
+
end
|
714
|
+
# resource path
|
715
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/roles/{role_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s))
|
716
|
+
|
717
|
+
# query parameters
|
718
|
+
query_params = opts[:query_params] || {}
|
719
|
+
|
720
|
+
# header parameters
|
721
|
+
header_params = opts[:header_params] || {}
|
722
|
+
# HTTP header 'Accept' (if needed)
|
723
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
724
|
+
# HTTP header 'Content-Type'
|
725
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
726
|
+
if !content_type.nil?
|
727
|
+
header_params['Content-Type'] = content_type
|
728
|
+
end
|
729
|
+
|
730
|
+
# form parameters
|
731
|
+
form_params = opts[:form_params] || {}
|
732
|
+
|
733
|
+
# http body (model)
|
734
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(role_update)
|
735
|
+
|
736
|
+
# return_type
|
737
|
+
return_type = opts[:debug_return_type] || 'RoleRead'
|
738
|
+
|
739
|
+
# auth_names
|
740
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
741
|
+
|
742
|
+
new_options = opts.merge(
|
743
|
+
:operation => :"RolesApi.update_role",
|
744
|
+
:header_params => header_params,
|
745
|
+
:query_params => query_params,
|
746
|
+
:form_params => form_params,
|
747
|
+
:body => post_body,
|
748
|
+
:auth_names => auth_names,
|
749
|
+
:return_type => return_type
|
750
|
+
)
|
751
|
+
|
752
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
753
|
+
if @api_client.config.debugging
|
754
|
+
@api_client.config.logger.debug "API called: RolesApi#update_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
755
|
+
end
|
756
|
+
return data, status_code, headers
|
757
|
+
end
|
758
|
+
end
|
759
|
+
end
|