Class: Azure::ARM::Graph::Users
- Inherits:
-
Object
- Object
- Azure::ARM::Graph::Users
- Includes:
- Models, MsRestAzure
- Defined in:
- lib/generated/azure_mgmt_graph/users.rb
Overview
The Graph RBAC Management Client
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Reference to the GraphRbacManagementClient.
Instance Method Summary collapse
-
#create(parameters, custom_headers = nil) ⇒ User
Create a new user.
-
#create_async(parameters, custom_headers = nil) ⇒ Concurrent::Promise
Create a new user.
-
#create_with_http_info(parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Create a new user.
-
#delete(upn_or_object_id, custom_headers = nil) ⇒ Object
Delete a user.
-
#delete_async(upn_or_object_id, custom_headers = nil) ⇒ Concurrent::Promise
Delete a user.
-
#delete_with_http_info(upn_or_object_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Delete a user.
-
#get(upn_or_object_id, custom_headers = nil) ⇒ User
Gets user information from the directory.
-
#get_async(upn_or_object_id, custom_headers = nil) ⇒ Concurrent::Promise
Gets user information from the directory.
-
#get_member_groups(object_id, parameters, custom_headers = nil) ⇒ UserGetMemberGroupsResult
Gets a collection that contains the Object IDs of the groups of which the user is a member.
-
#get_member_groups_async(object_id, parameters, custom_headers = nil) ⇒ Concurrent::Promise
Gets a collection that contains the Object IDs of the groups of which the user is a member.
-
#get_member_groups_with_http_info(object_id, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a collection that contains the Object IDs of the groups of which the user is a member.
-
#get_with_http_info(upn_or_object_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets user information from the directory.
-
#initialize(client) ⇒ Users
constructor
Creates and initializes a new instance of the Users class.
-
#list(filter = nil, custom_headers = nil) ⇒ UserListResult
Gets list of users for the current tenant.
-
#list_as_lazy(filter = nil, custom_headers = nil) ⇒ UserListResult
Gets list of users for the current tenant.
-
#list_async(filter = nil, custom_headers = nil) ⇒ Concurrent::Promise
Gets list of users for the current tenant.
-
#list_next(next_link, custom_headers = nil) ⇒ UserListResult
Gets list of users for the current tenant.
-
#list_next_async(next_link, custom_headers = nil) ⇒ Concurrent::Promise
Gets list of users for the current tenant.
-
#list_next_with_http_info(next_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets list of users for the current tenant.
-
#list_with_http_info(filter = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets list of users for the current tenant.
-
#update(upn_or_object_id, parameters, custom_headers = nil) ⇒ Object
Updates an exisitng user.
-
#update_async(upn_or_object_id, parameters, custom_headers = nil) ⇒ Concurrent::Promise
Updates an exisitng user.
-
#update_with_http_info(upn_or_object_id, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Updates an exisitng user.
Constructor Details
#initialize(client) ⇒ Users
Creates and initializes a new instance of the Users class.
18 19 20 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 18 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns reference to the GraphRbacManagementClient.
23 24 25 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 23 def client @client end |
Instance Method Details
#create(parameters, custom_headers = nil) ⇒ User
Create a new user. Reference: msdn.microsoft.com/library/azure/ad/graph/api/users-operations#CreateUser
will be added to the HTTP request.
35 36 37 38 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 35 def create(parameters, custom_headers = nil) response = create_async(parameters, custom_headers).value! response.body unless response.nil? end |
#create_async(parameters, custom_headers = nil) ⇒ Concurrent::Promise
Create a new user. Reference: msdn.microsoft.com/library/azure/ad/graph/api/users-operations#CreateUser
to the HTTP request.
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 64 def create_async(parameters, custom_headers = nil) fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = UserCreateParameters.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = '/{tenantID}/users' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'tenantID' => @client.tenant_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 201 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = User.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#create_with_http_info(parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Create a new user. Reference: msdn.microsoft.com/library/azure/ad/graph/api/users-operations#CreateUser
will be added to the HTTP request.
50 51 52 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 50 def create_with_http_info(parameters, custom_headers = nil) create_async(parameters, custom_headers).value! end |
#delete(upn_or_object_id, custom_headers = nil) ⇒ Object
Delete a user. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#DeleteUser
will be added to the HTTP request.
448 449 450 451 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 448 def delete(upn_or_object_id, custom_headers = nil) response = delete_async(upn_or_object_id, custom_headers).value! nil end |
#delete_async(upn_or_object_id, custom_headers = nil) ⇒ Concurrent::Promise
Delete a user. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#DeleteUser
to the HTTP request.
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 512 513 514 515 516 517 518 519 520 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 477 def delete_async(upn_or_object_id, custom_headers = nil) fail ArgumentError, 'upn_or_object_id is nil' if upn_or_object_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/{tenantID}/users/{upnOrObjectId}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'tenantID' => @client.tenant_id}, skip_encoding_path_params: {'upnOrObjectId' => upn_or_object_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 204 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result end promise.execute end |
#delete_with_http_info(upn_or_object_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Delete a user. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#DeleteUser
will be added to the HTTP request.
463 464 465 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 463 def delete_with_http_info(upn_or_object_id, custom_headers = nil) delete_async(upn_or_object_id, custom_headers).value! end |
#get(upn_or_object_id, custom_headers = nil) ⇒ User
Gets user information from the directory. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#GetAUser
get user information. will be added to the HTTP request.
251 252 253 254 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 251 def get(upn_or_object_id, custom_headers = nil) response = get_async(upn_or_object_id, custom_headers).value! response.body unless response.nil? end |
#get_async(upn_or_object_id, custom_headers = nil) ⇒ Concurrent::Promise
Gets user information from the directory. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#GetAUser
get user information. to the HTTP request.
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 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 282 def get_async(upn_or_object_id, custom_headers = nil) fail ArgumentError, 'upn_or_object_id is nil' if upn_or_object_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/{tenantID}/users/{upnOrObjectId}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'tenantID' => @client.tenant_id}, skip_encoding_path_params: {'upnOrObjectId' => upn_or_object_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = User.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_member_groups(object_id, parameters, custom_headers = nil) ⇒ UserGetMemberGroupsResult
Gets a collection that contains the Object IDs of the groups of which the user is a member.
will be added to the HTTP request.
533 534 535 536 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 533 def get_member_groups(object_id, parameters, custom_headers = nil) response = get_member_groups_async(object_id, parameters, custom_headers).value! response.body unless response.nil? end |
#get_member_groups_async(object_id, parameters, custom_headers = nil) ⇒ Concurrent::Promise
Gets a collection that contains the Object IDs of the groups of which the user is a member.
to the HTTP request.
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 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 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 564 def get_member_groups_async(object_id, parameters, custom_headers = nil) fail ArgumentError, 'object_id is nil' if object_id.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = UserGetMemberGroupsParameters.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = '/{tenantID}/users/{objectId}/getMemberGroups' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'tenantID' => @client.tenant_id}, skip_encoding_path_params: {'objectId' => object_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = UserGetMemberGroupsResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_member_groups_with_http_info(object_id, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a collection that contains the Object IDs of the groups of which the user is a member.
will be added to the HTTP request.
549 550 551 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 549 def get_member_groups_with_http_info(object_id, parameters, custom_headers = nil) get_member_groups_async(object_id, parameters, custom_headers).value! end |
#get_with_http_info(upn_or_object_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets user information from the directory. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#GetAUser
get user information. will be added to the HTTP request.
267 268 269 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 267 def get_with_http_info(upn_or_object_id, custom_headers = nil) get_async(upn_or_object_id, custom_headers).value! end |
#list(filter = nil, custom_headers = nil) ⇒ UserListResult
Gets list of users for the current tenant. Reference msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#GetUsers
will be added to the HTTP request.
158 159 160 161 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 158 def list(filter = nil, custom_headers = nil) first_page = list_as_lazy(filter, custom_headers) first_page.get_all_items end |
#list_as_lazy(filter = nil, custom_headers = nil) ⇒ UserListResult
Gets list of users for the current tenant. Reference msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#GetUsers
will be added to the HTTP request.
137 138 139 140 141 142 143 144 145 146 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 137 def list_as_lazy(filter = nil, custom_headers = nil) response = list_async(filter, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_link| list_next_async(next_link, custom_headers) end page end end |
#list_async(filter = nil, custom_headers = nil) ⇒ Concurrent::Promise
Gets list of users for the current tenant. Reference msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#GetUsers
to the HTTP request.
187 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 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 187 def list_async(filter = nil, custom_headers = nil) fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/{tenantID}/users' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'tenantID' => @client.tenant_id}, query_params: {'$filter' => filter,'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = UserListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_next(next_link, custom_headers = nil) ⇒ UserListResult
Gets list of users for the current tenant.
will be added to the HTTP request.
638 639 640 641 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 638 def list_next(next_link, custom_headers = nil) response = list_next_async(next_link, custom_headers).value! response.body unless response.nil? end |
#list_next_async(next_link, custom_headers = nil) ⇒ Concurrent::Promise
Gets list of users for the current tenant.
to the HTTP request.
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 665 def list_next_async(next_link, custom_headers = nil) fail ArgumentError, 'next_link is nil' if next_link.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/{tenantID}/{nextLink}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'tenantID' => @client.tenant_id}, skip_encoding_path_params: {'nextLink' => next_link}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = UserListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_next_with_http_info(next_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets list of users for the current tenant.
will be added to the HTTP request.
652 653 654 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 652 def list_next_with_http_info(next_link, custom_headers = nil) list_next_async(next_link, custom_headers).value! end |
#list_with_http_info(filter = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets list of users for the current tenant. Reference msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#GetUsers
will be added to the HTTP request.
173 174 175 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 173 def list_with_http_info(filter = nil, custom_headers = nil) list_async(filter, custom_headers).value! end |
#update(upn_or_object_id, parameters, custom_headers = nil) ⇒ Object
Updates an exisitng user. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#UpdateUser
get user information. user. will be added to the HTTP request.
349 350 351 352 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 349 def update(upn_or_object_id, parameters, custom_headers = nil) response = update_async(upn_or_object_id, parameters, custom_headers).value! nil end |
#update_async(upn_or_object_id, parameters, custom_headers = nil) ⇒ Concurrent::Promise
Updates an exisitng user. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#UpdateUser
get user information. user. to the HTTP request.
384 385 386 387 388 389 390 391 392 393 394 395 396 397 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 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 384 def update_async(upn_or_object_id, parameters, custom_headers = nil) fail ArgumentError, 'upn_or_object_id is nil' if upn_or_object_id.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = UserUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters, 'parameters') request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = '/{tenantID}/users/{upnOrObjectId}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'tenantID' => @client.tenant_id}, skip_encoding_path_params: {'upnOrObjectId' => upn_or_object_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 204 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result end promise.execute end |
#update_with_http_info(upn_or_object_id, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Updates an exisitng user. Reference: msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#UpdateUser
get user information. user. will be added to the HTTP request.
367 368 369 |
# File 'lib/generated/azure_mgmt_graph/users.rb', line 367 def update_with_http_info(upn_or_object_id, parameters, custom_headers = nil) update_async(upn_or_object_id, parameters, custom_headers).value! end |