Class: Mudbase::RolesApi
- Inherits:
-
Object
- Object
- Mudbase::RolesApi
- Defined in:
- lib/mudbase/api/roles_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#assign_role(org_id, user_id, assign_role_request, opts = {}) ⇒ AssignRole200Response
Assign custom role to user(deprecated) Assign a custom role to a user in the organization. -
#assign_role_with_http_info(org_id, user_id, assign_role_request, opts = {}) ⇒ Array<(AssignRole200Response, Integer, Hash)>
Assign custom role to user(deprecated) Assign a custom role to a user in the organization. -
#check_permissions(org_id, user_id, opts = {}) ⇒ CheckPermissions200Response
Check user permissions(deprecated) Get all permissions for a user (system + custom role combined). -
#check_permissions_with_http_info(org_id, user_id, opts = {}) ⇒ Array<(CheckPermissions200Response, Integer, Hash)>
Check user permissions(deprecated) Get all permissions for a user (system + custom role combined). -
#create_role(org_id, create_role_request, opts = {}) ⇒ CreateRole201Response
Create custom role(deprecated) Create a new custom role with specific permissions for your organization. -
#create_role_with_http_info(org_id, create_role_request, opts = {}) ⇒ Array<(CreateRole201Response, Integer, Hash)>
Create custom role(deprecated) Create a new custom role with specific permissions for your organization. -
#delete_role(org_id, role_id, opts = {}) ⇒ DeleteRole200Response
Delete role(deprecated) Delete a custom role. -
#delete_role_with_http_info(org_id, role_id, opts = {}) ⇒ Array<(DeleteRole200Response, Integer, Hash)>
Delete role(deprecated) Delete a custom role. -
#get_role(org_id, role_id, opts = {}) ⇒ GetRole200Response
Get role details(deprecated) Get details of a specific custom role. -
#get_role_with_http_info(org_id, role_id, opts = {}) ⇒ Array<(GetRole200Response, Integer, Hash)>
Get role details(deprecated) Get details of a specific custom role. -
#get_users_by_role(org_id, role_slug, opts = {}) ⇒ GetUsersByRole200Response
Get users with specific role(deprecated). -
#get_users_by_role_with_http_info(org_id, role_slug, opts = {}) ⇒ Array<(GetUsersByRole200Response, Integer, Hash)>
Get users with specific role(deprecated). -
#initialize(api_client = ApiClient.default) ⇒ RolesApi
constructor
A new instance of RolesApi.
-
#list_roles(org_id, opts = {}) ⇒ ListRoles200Response
List all roles(deprecated) Get all custom roles for the organization. -
#list_roles_with_http_info(org_id, opts = {}) ⇒ Array<(ListRoles200Response, Integer, Hash)>
List all roles(deprecated) Get all custom roles for the organization. -
#remove_role(org_id, user_id, opts = {}) ⇒ AssignRole200Response
Remove custom role from user(deprecated) Remove a custom role from a user in the organization. -
#remove_role_with_http_info(org_id, user_id, opts = {}) ⇒ Array<(AssignRole200Response, Integer, Hash)>
Remove custom role from user(deprecated) Remove a custom role from a user in the organization. -
#update_role(org_id, role_id, update_role_request, opts = {}) ⇒ UpdateRole200Response
Update role(deprecated). -
#update_role_with_http_info(org_id, role_id, update_role_request, opts = {}) ⇒ Array<(UpdateRole200Response, Integer, Hash)>
Update role(deprecated).
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/mudbase/api/roles_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#assign_role(org_id, user_id, assign_role_request, opts = {}) ⇒ AssignRole200Response
Assign custom role to user (deprecated)
Assign a custom role to a user in the organization. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.
29 30 31 32 |
# File 'lib/mudbase/api/roles_api.rb', line 29 def assign_role(org_id, user_id, assign_role_request, opts = {}) data, _status_code, _headers = assign_role_with_http_info(org_id, user_id, assign_role_request, opts) data end |
#assign_role_with_http_info(org_id, user_id, assign_role_request, opts = {}) ⇒ Array<(AssignRole200Response, Integer, Hash)>
Assign custom role to user (deprecated)
Assign a custom role to a user in the organization. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/mudbase/api/roles_api.rb', line 41 def assign_role_with_http_info(org_id, user_id, assign_role_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.assign_role ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.assign_role" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling RolesApi.assign_role" end # verify the required parameter 'assign_role_request' is set if @api_client.config.client_side_validation && assign_role_request.nil? fail ArgumentError, "Missing the required parameter 'assign_role_request' when calling RolesApi.assign_role" end # resource path local_var_path = '/api/orgs/{orgId}/users/{userId}/role'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(assign_role_request) # return_type return_type = opts[:debug_return_type] || 'AssignRole200Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"RolesApi.assign_role", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#assign_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#check_permissions(org_id, user_id, opts = {}) ⇒ CheckPermissions200Response
Check user permissions (deprecated)
Get all permissions for a user (system + custom role combined)
108 109 110 111 |
# File 'lib/mudbase/api/roles_api.rb', line 108 def (org_id, user_id, opts = {}) data, _status_code, _headers = (org_id, user_id, opts) data end |
#check_permissions_with_http_info(org_id, user_id, opts = {}) ⇒ Array<(CheckPermissions200Response, Integer, Hash)>
Check user permissions (deprecated)
Get all permissions for a user (system + custom role combined)
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/mudbase/api/roles_api.rb', line 119 def (org_id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.check_permissions ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.check_permissions" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling RolesApi.check_permissions" end # resource path local_var_path = '/api/orgs/{orgId}/users/{userId}/permissions'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CheckPermissions200Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"RolesApi.check_permissions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#check_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_role(org_id, create_role_request, opts = {}) ⇒ CreateRole201Response
Create custom role (deprecated)
Create a new custom role with specific permissions for your organization. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.
177 178 179 180 |
# File 'lib/mudbase/api/roles_api.rb', line 177 def create_role(org_id, create_role_request, opts = {}) data, _status_code, _headers = create_role_with_http_info(org_id, create_role_request, opts) data end |
#create_role_with_http_info(org_id, create_role_request, opts = {}) ⇒ Array<(CreateRole201Response, Integer, Hash)>
Create custom role (deprecated)
Create a new custom role with specific permissions for your organization. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/mudbase/api/roles_api.rb', line 188 def create_role_with_http_info(org_id, create_role_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.create_role ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.create_role" end # verify the required parameter 'create_role_request' is set if @api_client.config.client_side_validation && create_role_request.nil? fail ArgumentError, "Missing the required parameter 'create_role_request' when calling RolesApi.create_role" end # resource path local_var_path = '/api/orgs/{orgId}/roles'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_role_request) # return_type return_type = opts[:debug_return_type] || 'CreateRole201Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"RolesApi.create_role", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#create_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_role(org_id, role_id, opts = {}) ⇒ DeleteRole200Response
Delete role (deprecated)
Delete a custom role. Cannot delete system roles or roles with active users. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.
251 252 253 254 |
# File 'lib/mudbase/api/roles_api.rb', line 251 def delete_role(org_id, role_id, opts = {}) data, _status_code, _headers = delete_role_with_http_info(org_id, role_id, opts) data end |
#delete_role_with_http_info(org_id, role_id, opts = {}) ⇒ Array<(DeleteRole200Response, Integer, Hash)>
Delete role (deprecated)
Delete a custom role. Cannot delete system roles or roles with active users. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/mudbase/api/roles_api.rb', line 262 def delete_role_with_http_info(org_id, role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.delete_role ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.delete_role" end # verify the required parameter 'role_id' is set if @api_client.config.client_side_validation && role_id.nil? fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.delete_role" end # resource path local_var_path = '/api/orgs/{orgId}/roles/{roleId}'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'roleId' + '}', CGI.escape(role_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteRole200Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"RolesApi.delete_role", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#delete_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_role(org_id, role_id, opts = {}) ⇒ GetRole200Response
Get role details (deprecated)
Get details of a specific custom role. Requires: OrgBearerAuth (organization-level authentication only).
320 321 322 323 |
# File 'lib/mudbase/api/roles_api.rb', line 320 def get_role(org_id, role_id, opts = {}) data, _status_code, _headers = get_role_with_http_info(org_id, role_id, opts) data end |
#get_role_with_http_info(org_id, role_id, opts = {}) ⇒ Array<(GetRole200Response, Integer, Hash)>
Get role details (deprecated)
Get details of a specific custom role. Requires: OrgBearerAuth (organization-level authentication only).
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/mudbase/api/roles_api.rb', line 331 def get_role_with_http_info(org_id, role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.get_role ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.get_role" end # verify the required parameter 'role_id' is set if @api_client.config.client_side_validation && role_id.nil? fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.get_role" end # resource path local_var_path = '/api/orgs/{orgId}/roles/{roleId}'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'roleId' + '}', CGI.escape(role_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetRole200Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth'] = opts.merge( :operation => :"RolesApi.get_role", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#get_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_users_by_role(org_id, role_slug, opts = {}) ⇒ GetUsersByRole200Response
Get users with specific role (deprecated)
388 389 390 391 |
# File 'lib/mudbase/api/roles_api.rb', line 388 def get_users_by_role(org_id, role_slug, opts = {}) data, _status_code, _headers = get_users_by_role_with_http_info(org_id, role_slug, opts) data end |
#get_users_by_role_with_http_info(org_id, role_slug, opts = {}) ⇒ Array<(GetUsersByRole200Response, Integer, Hash)>
Get users with specific role (deprecated)
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/mudbase/api/roles_api.rb', line 398 def get_users_by_role_with_http_info(org_id, role_slug, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.get_users_by_role ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.get_users_by_role" end # verify the required parameter 'role_slug' is set if @api_client.config.client_side_validation && role_slug.nil? fail ArgumentError, "Missing the required parameter 'role_slug' when calling RolesApi.get_users_by_role" end # resource path local_var_path = '/api/orgs/{orgId}/roles/{roleSlug}/users'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'roleSlug' + '}', CGI.escape(role_slug.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetUsersByRole200Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"RolesApi.get_users_by_role", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#get_users_by_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_roles(org_id, opts = {}) ⇒ ListRoles200Response
List all roles (deprecated)
Get all custom roles for the organization. Requires: OrgBearerAuth (organization-level authentication only).
455 456 457 458 |
# File 'lib/mudbase/api/roles_api.rb', line 455 def list_roles(org_id, opts = {}) data, _status_code, _headers = list_roles_with_http_info(org_id, opts) data end |
#list_roles_with_http_info(org_id, opts = {}) ⇒ Array<(ListRoles200Response, Integer, Hash)>
List all roles (deprecated)
Get all custom roles for the organization. Requires: OrgBearerAuth (organization-level authentication only).
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/mudbase/api/roles_api.rb', line 465 def list_roles_with_http_info(org_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.list_roles ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.list_roles" end # resource path local_var_path = '/api/orgs/{orgId}/roles'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListRoles200Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth'] = opts.merge( :operation => :"RolesApi.list_roles", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#remove_role(org_id, user_id, opts = {}) ⇒ AssignRole200Response
Remove custom role from user (deprecated)
Remove a custom role from a user in the organization. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.
519 520 521 522 |
# File 'lib/mudbase/api/roles_api.rb', line 519 def remove_role(org_id, user_id, opts = {}) data, _status_code, _headers = remove_role_with_http_info(org_id, user_id, opts) data end |
#remove_role_with_http_info(org_id, user_id, opts = {}) ⇒ Array<(AssignRole200Response, Integer, Hash)>
Remove custom role from user (deprecated)
Remove a custom role from a user in the organization. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 |
# File 'lib/mudbase/api/roles_api.rb', line 530 def remove_role_with_http_info(org_id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.remove_role ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.remove_role" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling RolesApi.remove_role" end # resource path local_var_path = '/api/orgs/{orgId}/users/{userId}/role'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AssignRole200Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"RolesApi.remove_role", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#remove_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_role(org_id, role_id, update_role_request, opts = {}) ⇒ UpdateRole200Response
Update role (deprecated)
588 589 590 591 |
# File 'lib/mudbase/api/roles_api.rb', line 588 def update_role(org_id, role_id, update_role_request, opts = {}) data, _status_code, _headers = update_role_with_http_info(org_id, role_id, update_role_request, opts) data end |
#update_role_with_http_info(org_id, role_id, update_role_request, opts = {}) ⇒ Array<(UpdateRole200Response, Integer, Hash)>
Update role (deprecated)
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'lib/mudbase/api/roles_api.rb', line 599 def update_role_with_http_info(org_id, role_id, update_role_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RolesApi.update_role ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling RolesApi.update_role" end # verify the required parameter 'role_id' is set if @api_client.config.client_side_validation && role_id.nil? fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.update_role" end # verify the required parameter 'update_role_request' is set if @api_client.config.client_side_validation && update_role_request.nil? fail ArgumentError, "Missing the required parameter 'update_role_request' when calling RolesApi.update_role" end # resource path local_var_path = '/api/orgs/{orgId}/roles/{roleId}'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'roleId' + '}', CGI.escape(role_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_role_request) # return_type return_type = opts[:debug_return_type] || 'UpdateRole200Response' # auth_names auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"RolesApi.update_role", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: RolesApi#update_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |