azure_mgmt_graph 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/azure_mgmt_graph.gemspec +4 -5
- data/lib/azure_mgmt_graph.rb +3 -54
- data/lib/generated/azure_mgmt_graph.rb +58 -0
- data/lib/{azure_mgmt_graph/application_operations.rb → generated/azure_mgmt_graph/applications.rb} +37 -33
- data/lib/{azure_mgmt_graph → generated/azure_mgmt_graph}/graph_rbac_management_client.rb +18 -18
- data/lib/{azure_mgmt_graph/group_operations.rb → generated/azure_mgmt_graph/groups.rb} +214 -62
- data/lib/generated/azure_mgmt_graph/models/aadobject.rb +142 -0
- data/lib/generated/azure_mgmt_graph/models/adgroup.rb +84 -0
- data/lib/generated/azure_mgmt_graph/models/application.rb +146 -0
- data/lib/generated/azure_mgmt_graph/models/application_create_parameters.rb +137 -0
- data/lib/generated/azure_mgmt_graph/models/application_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_graph/models/application_update_parameters.rb +126 -0
- data/lib/generated/azure_mgmt_graph/models/check_group_membership_parameters.rb +55 -0
- data/lib/generated/azure_mgmt_graph/models/check_group_membership_result.rb +46 -0
- data/lib/generated/azure_mgmt_graph/models/get_objects_result.rb +93 -0
- data/lib/generated/azure_mgmt_graph/models/group_add_member_parameters.rb +48 -0
- data/lib/generated/azure_mgmt_graph/models/group_create_parameters.rb +82 -0
- data/lib/generated/azure_mgmt_graph/models/group_get_member_groups_parameters.rb +46 -0
- data/lib/generated/azure_mgmt_graph/models/group_get_member_groups_result.rb +51 -0
- data/lib/generated/azure_mgmt_graph/models/group_list_result.rb +93 -0
- data/lib/generated/azure_mgmt_graph/models/key_credential.rb +94 -0
- data/lib/generated/azure_mgmt_graph/models/password_credential.rb +74 -0
- data/lib/generated/azure_mgmt_graph/models/password_profile.rb +54 -0
- data/lib/generated/azure_mgmt_graph/models/service_principal.rb +91 -0
- data/lib/generated/azure_mgmt_graph/models/service_principal_create_parameters.rb +54 -0
- data/lib/generated/azure_mgmt_graph/models/service_principal_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_graph/models/user.rb +104 -0
- data/lib/generated/azure_mgmt_graph/models/user_create_parameters.rb +100 -0
- data/lib/generated/azure_mgmt_graph/models/user_get_member_groups_parameters.rb +46 -0
- data/lib/generated/azure_mgmt_graph/models/user_get_member_groups_result.rb +51 -0
- data/lib/generated/azure_mgmt_graph/models/user_list_result.rb +93 -0
- data/lib/generated/azure_mgmt_graph/models/user_update_parameters.rb +76 -0
- data/lib/{azure_mgmt_graph → generated/azure_mgmt_graph}/module_definition.rb +0 -0
- data/lib/generated/azure_mgmt_graph/objects.rb +112 -0
- data/lib/{azure_mgmt_graph/service_principal_operations.rb → generated/azure_mgmt_graph/service_principals.rb} +50 -27
- data/lib/{azure_mgmt_graph/user_operations.rb → generated/azure_mgmt_graph/users.rb} +243 -115
- data/lib/{azure_mgmt_graph → generated/azure_mgmt_graph}/version.rb +1 -1
- metadata +56 -74
- data/lib/azure_mgmt_graph/models/aadobject.rb +0 -138
- data/lib/azure_mgmt_graph/models/adgroup.rb +0 -92
- data/lib/azure_mgmt_graph/models/application.rb +0 -122
- data/lib/azure_mgmt_graph/models/application_create_parameters.rb +0 -160
- data/lib/azure_mgmt_graph/models/application_filter.rb +0 -74
- data/lib/azure_mgmt_graph/models/application_list_result.rb +0 -76
- data/lib/azure_mgmt_graph/models/get_objects_parameters.rb +0 -77
- data/lib/azure_mgmt_graph/models/get_objects_result.rb +0 -85
- data/lib/azure_mgmt_graph/models/group_add_member_parameters.rb +0 -56
- data/lib/azure_mgmt_graph/models/group_create_parameters.rb +0 -86
- data/lib/azure_mgmt_graph/models/group_get_member_groups_parameters.rb +0 -58
- data/lib/azure_mgmt_graph/models/group_get_member_groups_result.rb +0 -56
- data/lib/azure_mgmt_graph/models/group_list_result.rb +0 -85
- data/lib/azure_mgmt_graph/models/key_credential.rb +0 -105
- data/lib/azure_mgmt_graph/models/password_credential.rb +0 -87
- data/lib/azure_mgmt_graph/models/service_principal.rb +0 -92
- data/lib/azure_mgmt_graph/models/service_principal_create_parameters.rb +0 -66
- data/lib/azure_mgmt_graph/models/service_principal_list_result.rb +0 -86
- data/lib/azure_mgmt_graph/models/user.rb +0 -101
- data/lib/azure_mgmt_graph/models/user_create_parameters.rb +0 -103
- data/lib/azure_mgmt_graph/models/user_create_parameters_password_profile.rb +0 -65
- data/lib/azure_mgmt_graph/models/user_get_member_groups_parameters.rb +0 -58
- data/lib/azure_mgmt_graph/models/user_get_member_groups_result.rb +0 -56
- data/lib/azure_mgmt_graph/models/user_list_result.rb +0 -85
- data/lib/azure_mgmt_graph/object_operations.rb +0 -302
checksums.yaml
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
5
|
-
data.tar.gz: !binary |-
|
|
6
|
-
MzdkYWYzOTFjYjRmMzdlOGVhOTc5ZGVjNTA3ZGQzOGJhNDg5MGZlYQ==
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 38461a1a9bfb8a21486b615869ad8193876d0a72
|
|
4
|
+
data.tar.gz: c6456ad99067ade973176bb505b1e3c7737cc2de
|
|
7
5
|
SHA512:
|
|
8
|
-
metadata.gz:
|
|
9
|
-
|
|
10
|
-
MDFjZDEyMmQzNTNlMjdiNmI5ZjVhZWY3MWRmNTA3OTdjZmRiZDE2Njc3MThm
|
|
11
|
-
OWNkMDU3ZDRlZjJmNDE3ZmQ3YjBjMGIxZjEzYjhkMDRkOWJmZGI=
|
|
12
|
-
data.tar.gz: !binary |-
|
|
13
|
-
NmQ1NmJlMDYxMmM1NzRjNzY3NzBmY2Y2NGY0ZWMyMjFhYmMwZTEwNGFhZTUz
|
|
14
|
-
NzhhYzBmMzNiYzgyN2ZmMGZlM2UyYmYwYzllOTBhYzhhODZkOTYyMjA1ODM3
|
|
15
|
-
MTdiNDM3MWE5ZDc5N2ExNjYwOWFiN2IxMDAyMjk4MTM1ODE4YTQ=
|
|
6
|
+
metadata.gz: 438c0c8ed4ab24db5fbba0e458e5b7faaeaf3456a126779ee27f70213a55d64bc6afcbf7dad9a0986db338ecfa9cbde117e1e154eb593ce3d72003d1a54938a7
|
|
7
|
+
data.tar.gz: 27430640d52acd6102d6677ffb61aa12af17cdc7b9e01f6e0a9708e8e54fd5056c31305ddf0efc382632c5881da7c5ed833a349ec46a0337450a242228a5c6d7
|
data/azure_mgmt_graph.gemspec
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
lib = File.expand_path('../lib', __FILE__)
|
|
6
6
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
7
7
|
|
|
8
|
-
require 'azure_mgmt_graph/module_definition'
|
|
9
|
-
require 'azure_mgmt_graph/version'
|
|
8
|
+
require 'generated/azure_mgmt_graph/module_definition'
|
|
9
|
+
require 'generated/azure_mgmt_graph/version'
|
|
10
10
|
|
|
11
11
|
Gem::Specification.new do |spec|
|
|
12
12
|
spec.name = 'azure_mgmt_graph'
|
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
|
15
15
|
spec.email = 'azrubyteam@microsoft.com'
|
|
16
16
|
spec.description = 'Microsoft Azure Active Directory Graph Management Client Library for Ruby'
|
|
17
17
|
spec.summary = 'Official Ruby client library to consume Microsoft Azure Active Directory Graph Management services.'
|
|
18
|
-
spec.homepage = '
|
|
18
|
+
spec.homepage = 'https://aka.ms/azure-sdk-for-ruby'
|
|
19
19
|
spec.license = 'MIT'
|
|
20
20
|
|
|
21
21
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
@@ -29,7 +29,6 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
spec.add_development_dependency 'rake', '~> 10'
|
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3'
|
|
31
31
|
spec.add_development_dependency 'dotenv', '~> 2'
|
|
32
|
-
spec.add_development_dependency 'azure_mgmt_resources', '~> 0.3'
|
|
33
32
|
|
|
34
|
-
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.
|
|
33
|
+
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.3.0'
|
|
35
34
|
end
|
data/lib/azure_mgmt_graph.rb
CHANGED
|
@@ -1,56 +1,5 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
# regenerated.
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
4
|
|
|
6
|
-
require '
|
|
7
|
-
require 'cgi'
|
|
8
|
-
require 'date'
|
|
9
|
-
require 'json'
|
|
10
|
-
require 'base64'
|
|
11
|
-
require 'erb'
|
|
12
|
-
require 'securerandom'
|
|
13
|
-
require 'time'
|
|
14
|
-
require 'timeliness'
|
|
15
|
-
require 'faraday'
|
|
16
|
-
require 'faraday-cookie_jar'
|
|
17
|
-
require 'concurrent'
|
|
18
|
-
require 'ms_rest'
|
|
19
|
-
require 'azure_mgmt_graph/module_definition'
|
|
20
|
-
require 'ms_rest_azure'
|
|
21
|
-
|
|
22
|
-
module Azure::ARM::Graph
|
|
23
|
-
autoload :ApplicationOperations, 'azure_mgmt_graph/application_operations.rb'
|
|
24
|
-
autoload :ObjectOperations, 'azure_mgmt_graph/object_operations.rb'
|
|
25
|
-
autoload :GroupOperations, 'azure_mgmt_graph/group_operations.rb'
|
|
26
|
-
autoload :ServicePrincipalOperations, 'azure_mgmt_graph/service_principal_operations.rb'
|
|
27
|
-
autoload :UserOperations, 'azure_mgmt_graph/user_operations.rb'
|
|
28
|
-
autoload :GraphRbacManagementClient, 'azure_mgmt_graph/graph_rbac_management_client.rb'
|
|
29
|
-
|
|
30
|
-
module Models
|
|
31
|
-
autoload :KeyCredential, 'azure_mgmt_graph/models/key_credential.rb'
|
|
32
|
-
autoload :PasswordCredential, 'azure_mgmt_graph/models/password_credential.rb'
|
|
33
|
-
autoload :ApplicationCreateParameters, 'azure_mgmt_graph/models/application_create_parameters.rb'
|
|
34
|
-
autoload :ApplicationFilter, 'azure_mgmt_graph/models/application_filter.rb'
|
|
35
|
-
autoload :Application, 'azure_mgmt_graph/models/application.rb'
|
|
36
|
-
autoload :ApplicationListResult, 'azure_mgmt_graph/models/application_list_result.rb'
|
|
37
|
-
autoload :GetObjectsParameters, 'azure_mgmt_graph/models/get_objects_parameters.rb'
|
|
38
|
-
autoload :AADObject, 'azure_mgmt_graph/models/aadobject.rb'
|
|
39
|
-
autoload :GetObjectsResult, 'azure_mgmt_graph/models/get_objects_result.rb'
|
|
40
|
-
autoload :GroupAddMemberParameters, 'azure_mgmt_graph/models/group_add_member_parameters.rb'
|
|
41
|
-
autoload :GroupCreateParameters, 'azure_mgmt_graph/models/group_create_parameters.rb'
|
|
42
|
-
autoload :ADGroup, 'azure_mgmt_graph/models/adgroup.rb'
|
|
43
|
-
autoload :GroupListResult, 'azure_mgmt_graph/models/group_list_result.rb'
|
|
44
|
-
autoload :GroupGetMemberGroupsParameters, 'azure_mgmt_graph/models/group_get_member_groups_parameters.rb'
|
|
45
|
-
autoload :GroupGetMemberGroupsResult, 'azure_mgmt_graph/models/group_get_member_groups_result.rb'
|
|
46
|
-
autoload :ServicePrincipalCreateParameters, 'azure_mgmt_graph/models/service_principal_create_parameters.rb'
|
|
47
|
-
autoload :ServicePrincipal, 'azure_mgmt_graph/models/service_principal.rb'
|
|
48
|
-
autoload :ServicePrincipalListResult, 'azure_mgmt_graph/models/service_principal_list_result.rb'
|
|
49
|
-
autoload :UserCreateParametersPasswordProfile, 'azure_mgmt_graph/models/user_create_parameters_password_profile.rb'
|
|
50
|
-
autoload :UserCreateParameters, 'azure_mgmt_graph/models/user_create_parameters.rb'
|
|
51
|
-
autoload :User, 'azure_mgmt_graph/models/user.rb'
|
|
52
|
-
autoload :UserGetMemberGroupsParameters, 'azure_mgmt_graph/models/user_get_member_groups_parameters.rb'
|
|
53
|
-
autoload :UserGetMemberGroupsResult, 'azure_mgmt_graph/models/user_get_member_groups_result.rb'
|
|
54
|
-
autoload :UserListResult, 'azure_mgmt_graph/models/user_list_result.rb'
|
|
55
|
-
end
|
|
56
|
-
end
|
|
5
|
+
require 'generated/azure_mgmt_graph'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
|
4
|
+
# regenerated.
|
|
5
|
+
|
|
6
|
+
require 'uri'
|
|
7
|
+
require 'cgi'
|
|
8
|
+
require 'date'
|
|
9
|
+
require 'json'
|
|
10
|
+
require 'base64'
|
|
11
|
+
require 'erb'
|
|
12
|
+
require 'securerandom'
|
|
13
|
+
require 'time'
|
|
14
|
+
require 'timeliness'
|
|
15
|
+
require 'faraday'
|
|
16
|
+
require 'faraday-cookie_jar'
|
|
17
|
+
require 'concurrent'
|
|
18
|
+
require 'ms_rest'
|
|
19
|
+
require 'generated/azure_mgmt_graph/module_definition'
|
|
20
|
+
require 'ms_rest_azure'
|
|
21
|
+
|
|
22
|
+
module Azure::ARM::Graph
|
|
23
|
+
autoload :Objects, 'generated/azure_mgmt_graph/objects.rb'
|
|
24
|
+
autoload :Applications, 'generated/azure_mgmt_graph/applications.rb'
|
|
25
|
+
autoload :Groups, 'generated/azure_mgmt_graph/groups.rb'
|
|
26
|
+
autoload :ServicePrincipals, 'generated/azure_mgmt_graph/service_principals.rb'
|
|
27
|
+
autoload :Users, 'generated/azure_mgmt_graph/users.rb'
|
|
28
|
+
autoload :GraphRbacManagementClient, 'generated/azure_mgmt_graph/graph_rbac_management_client.rb'
|
|
29
|
+
|
|
30
|
+
module Models
|
|
31
|
+
autoload :KeyCredential, 'generated/azure_mgmt_graph/models/key_credential.rb'
|
|
32
|
+
autoload :PasswordCredential, 'generated/azure_mgmt_graph/models/password_credential.rb'
|
|
33
|
+
autoload :ApplicationCreateParameters, 'generated/azure_mgmt_graph/models/application_create_parameters.rb'
|
|
34
|
+
autoload :ApplicationUpdateParameters, 'generated/azure_mgmt_graph/models/application_update_parameters.rb'
|
|
35
|
+
autoload :Application, 'generated/azure_mgmt_graph/models/application.rb'
|
|
36
|
+
autoload :ApplicationListResult, 'generated/azure_mgmt_graph/models/application_list_result.rb'
|
|
37
|
+
autoload :AADObject, 'generated/azure_mgmt_graph/models/aadobject.rb'
|
|
38
|
+
autoload :GetObjectsResult, 'generated/azure_mgmt_graph/models/get_objects_result.rb'
|
|
39
|
+
autoload :GroupAddMemberParameters, 'generated/azure_mgmt_graph/models/group_add_member_parameters.rb'
|
|
40
|
+
autoload :GroupCreateParameters, 'generated/azure_mgmt_graph/models/group_create_parameters.rb'
|
|
41
|
+
autoload :ADGroup, 'generated/azure_mgmt_graph/models/adgroup.rb'
|
|
42
|
+
autoload :GroupListResult, 'generated/azure_mgmt_graph/models/group_list_result.rb'
|
|
43
|
+
autoload :GroupGetMemberGroupsParameters, 'generated/azure_mgmt_graph/models/group_get_member_groups_parameters.rb'
|
|
44
|
+
autoload :GroupGetMemberGroupsResult, 'generated/azure_mgmt_graph/models/group_get_member_groups_result.rb'
|
|
45
|
+
autoload :CheckGroupMembershipParameters, 'generated/azure_mgmt_graph/models/check_group_membership_parameters.rb'
|
|
46
|
+
autoload :CheckGroupMembershipResult, 'generated/azure_mgmt_graph/models/check_group_membership_result.rb'
|
|
47
|
+
autoload :ServicePrincipalCreateParameters, 'generated/azure_mgmt_graph/models/service_principal_create_parameters.rb'
|
|
48
|
+
autoload :ServicePrincipal, 'generated/azure_mgmt_graph/models/service_principal.rb'
|
|
49
|
+
autoload :ServicePrincipalListResult, 'generated/azure_mgmt_graph/models/service_principal_list_result.rb'
|
|
50
|
+
autoload :PasswordProfile, 'generated/azure_mgmt_graph/models/password_profile.rb'
|
|
51
|
+
autoload :UserCreateParameters, 'generated/azure_mgmt_graph/models/user_create_parameters.rb'
|
|
52
|
+
autoload :UserUpdateParameters, 'generated/azure_mgmt_graph/models/user_update_parameters.rb'
|
|
53
|
+
autoload :User, 'generated/azure_mgmt_graph/models/user.rb'
|
|
54
|
+
autoload :UserGetMemberGroupsParameters, 'generated/azure_mgmt_graph/models/user_get_member_groups_parameters.rb'
|
|
55
|
+
autoload :UserGetMemberGroupsResult, 'generated/azure_mgmt_graph/models/user_get_member_groups_result.rb'
|
|
56
|
+
autoload :UserListResult, 'generated/azure_mgmt_graph/models/user_list_result.rb'
|
|
57
|
+
end
|
|
58
|
+
end
|
data/lib/{azure_mgmt_graph/application_operations.rb → generated/azure_mgmt_graph/applications.rb}
RENAMED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
module Azure::ARM::Graph
|
|
7
7
|
#
|
|
8
|
-
#
|
|
8
|
+
# The Graph RBAC Management Client
|
|
9
9
|
#
|
|
10
|
-
class
|
|
10
|
+
class Applications
|
|
11
11
|
include Azure::ARM::Graph::Models
|
|
12
12
|
include MsRestAzure
|
|
13
13
|
|
|
14
14
|
#
|
|
15
|
-
# Creates and initializes a new instance of the
|
|
15
|
+
# Creates and initializes a new instance of the Applications class.
|
|
16
16
|
# @param client service class for accessing basic functionality.
|
|
17
17
|
#
|
|
18
18
|
def initialize(client)
|
|
@@ -66,21 +66,23 @@ module Azure::ARM::Graph
|
|
|
66
66
|
#
|
|
67
67
|
def create_async(parameters, custom_headers = nil)
|
|
68
68
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
69
|
-
parameters.validate unless parameters.nil?
|
|
70
69
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
71
70
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
71
|
+
|
|
72
|
+
|
|
72
73
|
request_headers = {}
|
|
73
74
|
|
|
74
75
|
# Set Headers
|
|
75
76
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
76
77
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
77
78
|
|
|
78
|
-
# Serialize Request
|
|
79
79
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
request_content =
|
|
80
|
+
|
|
81
|
+
# Serialize Request
|
|
82
|
+
request_mapper = ApplicationCreateParameters.mapper()
|
|
83
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
|
84
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
85
|
+
|
|
84
86
|
path_template = '/{tenantID}/applications'
|
|
85
87
|
options = {
|
|
86
88
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
@@ -112,10 +114,8 @@ module Azure::ARM::Graph
|
|
|
112
114
|
if status_code == 201
|
|
113
115
|
begin
|
|
114
116
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
end
|
|
118
|
-
result.body = parsed_response
|
|
117
|
+
result_mapper = Application.mapper()
|
|
118
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
119
119
|
rescue Exception => e
|
|
120
120
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
121
121
|
end
|
|
@@ -169,6 +169,8 @@ module Azure::ARM::Graph
|
|
|
169
169
|
def list_async(filter = nil, custom_headers = nil)
|
|
170
170
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
171
171
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
172
|
+
|
|
173
|
+
|
|
172
174
|
request_headers = {}
|
|
173
175
|
|
|
174
176
|
# Set Headers
|
|
@@ -204,10 +206,8 @@ module Azure::ARM::Graph
|
|
|
204
206
|
if status_code == 200
|
|
205
207
|
begin
|
|
206
208
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
end
|
|
210
|
-
result.body = parsed_response
|
|
209
|
+
result_mapper = ApplicationListResult.mapper()
|
|
210
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
211
211
|
rescue Exception => e
|
|
212
212
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
213
213
|
end
|
|
@@ -261,6 +261,8 @@ module Azure::ARM::Graph
|
|
|
261
261
|
fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
|
|
262
262
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
263
263
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
264
|
+
|
|
265
|
+
|
|
264
266
|
request_headers = {}
|
|
265
267
|
|
|
266
268
|
# Set Headers
|
|
@@ -343,6 +345,8 @@ module Azure::ARM::Graph
|
|
|
343
345
|
fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
|
|
344
346
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
345
347
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
348
|
+
|
|
349
|
+
|
|
346
350
|
request_headers = {}
|
|
347
351
|
|
|
348
352
|
# Set Headers
|
|
@@ -379,10 +383,8 @@ module Azure::ARM::Graph
|
|
|
379
383
|
if status_code == 200
|
|
380
384
|
begin
|
|
381
385
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
end
|
|
385
|
-
result.body = parsed_response
|
|
386
|
+
result_mapper = Application.mapper()
|
|
387
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
386
388
|
rescue Exception => e
|
|
387
389
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
388
390
|
end
|
|
@@ -399,8 +401,8 @@ module Azure::ARM::Graph
|
|
|
399
401
|
# http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx
|
|
400
402
|
#
|
|
401
403
|
# @param application_object_id [String] Application object id
|
|
402
|
-
# @param parameters [
|
|
403
|
-
# application.
|
|
404
|
+
# @param parameters [ApplicationUpdateParameters] Parameters to update an
|
|
405
|
+
# existing application.
|
|
404
406
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
405
407
|
# will be added to the HTTP request.
|
|
406
408
|
#
|
|
@@ -415,8 +417,8 @@ module Azure::ARM::Graph
|
|
|
415
417
|
# http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx
|
|
416
418
|
#
|
|
417
419
|
# @param application_object_id [String] Application object id
|
|
418
|
-
# @param parameters [
|
|
419
|
-
# application.
|
|
420
|
+
# @param parameters [ApplicationUpdateParameters] Parameters to update an
|
|
421
|
+
# existing application.
|
|
420
422
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
421
423
|
# will be added to the HTTP request.
|
|
422
424
|
#
|
|
@@ -431,8 +433,8 @@ module Azure::ARM::Graph
|
|
|
431
433
|
# http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx
|
|
432
434
|
#
|
|
433
435
|
# @param application_object_id [String] Application object id
|
|
434
|
-
# @param parameters [
|
|
435
|
-
# application.
|
|
436
|
+
# @param parameters [ApplicationUpdateParameters] Parameters to update an
|
|
437
|
+
# existing application.
|
|
436
438
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
437
439
|
# to the HTTP request.
|
|
438
440
|
#
|
|
@@ -441,21 +443,23 @@ module Azure::ARM::Graph
|
|
|
441
443
|
def patch_async(application_object_id, parameters, custom_headers = nil)
|
|
442
444
|
fail ArgumentError, 'application_object_id is nil' if application_object_id.nil?
|
|
443
445
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
444
|
-
parameters.validate unless parameters.nil?
|
|
445
446
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
446
447
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
448
|
+
|
|
449
|
+
|
|
447
450
|
request_headers = {}
|
|
448
451
|
|
|
449
452
|
# Set Headers
|
|
450
453
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
451
454
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
452
455
|
|
|
453
|
-
# Serialize Request
|
|
454
456
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
request_content =
|
|
457
|
+
|
|
458
|
+
# Serialize Request
|
|
459
|
+
request_mapper = ApplicationUpdateParameters.mapper()
|
|
460
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
|
461
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
462
|
+
|
|
459
463
|
path_template = '/{tenantID}/applications/{applicationObjectId}'
|
|
460
464
|
options = {
|
|
461
465
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
@@ -8,13 +8,13 @@ module Azure::ARM::Graph
|
|
|
8
8
|
# A service client - single point of access to the REST API.
|
|
9
9
|
#
|
|
10
10
|
class GraphRbacManagementClient < MsRestAzure::AzureServiceClient
|
|
11
|
-
include
|
|
11
|
+
include MsRest::Serialization
|
|
12
12
|
include MsRestAzure
|
|
13
13
|
|
|
14
14
|
# @return [String] the base URI of the service.
|
|
15
15
|
attr_accessor :base_url
|
|
16
16
|
|
|
17
|
-
# @return
|
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
|
18
18
|
attr_reader :credentials
|
|
19
19
|
|
|
20
20
|
# @return [String] Client Api Version.
|
|
@@ -38,20 +38,20 @@ module Azure::ARM::Graph
|
|
|
38
38
|
# subscription.
|
|
39
39
|
attr_accessor :credentials
|
|
40
40
|
|
|
41
|
-
# @return
|
|
42
|
-
attr_reader :
|
|
41
|
+
# @return [Objects] objects
|
|
42
|
+
attr_reader :objects
|
|
43
43
|
|
|
44
|
-
# @return
|
|
45
|
-
attr_reader :
|
|
44
|
+
# @return [Applications] applications
|
|
45
|
+
attr_reader :applications
|
|
46
46
|
|
|
47
|
-
# @return
|
|
48
|
-
attr_reader :
|
|
47
|
+
# @return [Groups] groups
|
|
48
|
+
attr_reader :groups
|
|
49
49
|
|
|
50
|
-
# @return
|
|
51
|
-
attr_reader :
|
|
50
|
+
# @return [ServicePrincipals] service_principals
|
|
51
|
+
attr_reader :service_principals
|
|
52
52
|
|
|
53
|
-
# @return
|
|
54
|
-
attr_reader :
|
|
53
|
+
# @return [Users] users
|
|
54
|
+
attr_reader :users
|
|
55
55
|
|
|
56
56
|
#
|
|
57
57
|
# Creates initializes a new instance of the GraphRbacManagementClient class.
|
|
@@ -67,12 +67,12 @@ module Azure::ARM::Graph
|
|
|
67
67
|
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials)
|
|
68
68
|
@credentials = credentials
|
|
69
69
|
|
|
70
|
-
@
|
|
71
|
-
@
|
|
72
|
-
@
|
|
73
|
-
@
|
|
74
|
-
@
|
|
75
|
-
@api_version = '1.6
|
|
70
|
+
@objects = Objects.new(self)
|
|
71
|
+
@applications = Applications.new(self)
|
|
72
|
+
@groups = Groups.new(self)
|
|
73
|
+
@service_principals = ServicePrincipals.new(self)
|
|
74
|
+
@users = Users.new(self)
|
|
75
|
+
@api_version = '1.6'
|
|
76
76
|
@accept_language = 'en-US'
|
|
77
77
|
@long_running_operation_retry_timeout = 30
|
|
78
78
|
@generate_client_request_id = true
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
module Azure::ARM::Graph
|
|
7
7
|
#
|
|
8
|
-
#
|
|
8
|
+
# The Graph RBAC Management Client
|
|
9
9
|
#
|
|
10
|
-
class
|
|
10
|
+
class Groups
|
|
11
11
|
include Azure::ARM::Graph::Models
|
|
12
12
|
include MsRestAzure
|
|
13
13
|
|
|
14
14
|
#
|
|
15
|
-
# Creates and initializes a new instance of the
|
|
15
|
+
# Creates and initializes a new instance of the Groups class.
|
|
16
16
|
# @param client service class for accessing basic functionality.
|
|
17
17
|
#
|
|
18
18
|
def initialize(client)
|
|
@@ -22,9 +22,114 @@ module Azure::ARM::Graph
|
|
|
22
22
|
# @return reference to the GraphRbacManagementClient
|
|
23
23
|
attr_reader :client
|
|
24
24
|
|
|
25
|
+
#
|
|
26
|
+
# Checks whether the specified user, group, contact, or service principal is a
|
|
27
|
+
# direct or a transitive member of the specified group.
|
|
28
|
+
#
|
|
29
|
+
# @param parameters [CheckGroupMembershipParameters] Check group membership
|
|
30
|
+
# parameters.
|
|
31
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
32
|
+
# will be added to the HTTP request.
|
|
33
|
+
#
|
|
34
|
+
# @return [CheckGroupMembershipResult] operation results.
|
|
35
|
+
#
|
|
36
|
+
def is_member_of(parameters, custom_headers = nil)
|
|
37
|
+
response = is_member_of_async(parameters, custom_headers).value!
|
|
38
|
+
response.body unless response.nil?
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
#
|
|
42
|
+
# Checks whether the specified user, group, contact, or service principal is a
|
|
43
|
+
# direct or a transitive member of the specified group.
|
|
44
|
+
#
|
|
45
|
+
# @param parameters [CheckGroupMembershipParameters] Check group membership
|
|
46
|
+
# parameters.
|
|
47
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
48
|
+
# will be added to the HTTP request.
|
|
49
|
+
#
|
|
50
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
51
|
+
#
|
|
52
|
+
def is_member_of_with_http_info(parameters, custom_headers = nil)
|
|
53
|
+
is_member_of_async(parameters, custom_headers).value!
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
#
|
|
57
|
+
# Checks whether the specified user, group, contact, or service principal is a
|
|
58
|
+
# direct or a transitive member of the specified group.
|
|
59
|
+
#
|
|
60
|
+
# @param parameters [CheckGroupMembershipParameters] Check group membership
|
|
61
|
+
# parameters.
|
|
62
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
63
|
+
# to the HTTP request.
|
|
64
|
+
#
|
|
65
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
66
|
+
#
|
|
67
|
+
def is_member_of_async(parameters, custom_headers = nil)
|
|
68
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
69
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
70
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
request_headers = {}
|
|
74
|
+
|
|
75
|
+
# Set Headers
|
|
76
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
77
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
78
|
+
|
|
79
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
80
|
+
|
|
81
|
+
# Serialize Request
|
|
82
|
+
request_mapper = CheckGroupMembershipParameters.mapper()
|
|
83
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
|
84
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
85
|
+
|
|
86
|
+
path_template = '/{tenantID}/isMemberOf'
|
|
87
|
+
options = {
|
|
88
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
89
|
+
path_params: {'tenantID' => @client.tenant_id},
|
|
90
|
+
query_params: {'api-version' => @client.api_version},
|
|
91
|
+
body: request_content,
|
|
92
|
+
headers: request_headers.merge(custom_headers || {})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
request_url = @base_url || @client.base_url
|
|
96
|
+
|
|
97
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
|
|
98
|
+
promise = request.run_promise do |req|
|
|
99
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
promise = promise.then do |http_response|
|
|
103
|
+
status_code = http_response.status
|
|
104
|
+
response_content = http_response.body
|
|
105
|
+
unless status_code == 200
|
|
106
|
+
error_model = JSON.load(response_content)
|
|
107
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Create Result
|
|
111
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
112
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
113
|
+
# Deserialize Response
|
|
114
|
+
if status_code == 200
|
|
115
|
+
begin
|
|
116
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
117
|
+
result_mapper = CheckGroupMembershipResult.mapper()
|
|
118
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
119
|
+
rescue Exception => e
|
|
120
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
result
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
promise.execute
|
|
128
|
+
end
|
|
129
|
+
|
|
25
130
|
#
|
|
26
131
|
# Remove a memeber from a group. Reference:
|
|
27
|
-
#
|
|
132
|
+
# https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/groups-operations#DeleteGroupMember
|
|
28
133
|
#
|
|
29
134
|
# @param group_object_id [String] Group object id
|
|
30
135
|
# @param member_object_id [String] Member Object id
|
|
@@ -39,7 +144,7 @@ module Azure::ARM::Graph
|
|
|
39
144
|
|
|
40
145
|
#
|
|
41
146
|
# Remove a memeber from a group. Reference:
|
|
42
|
-
#
|
|
147
|
+
# https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/groups-operations#DeleteGroupMember
|
|
43
148
|
#
|
|
44
149
|
# @param group_object_id [String] Group object id
|
|
45
150
|
# @param member_object_id [String] Member Object id
|
|
@@ -54,7 +159,7 @@ module Azure::ARM::Graph
|
|
|
54
159
|
|
|
55
160
|
#
|
|
56
161
|
# Remove a memeber from a group. Reference:
|
|
57
|
-
#
|
|
162
|
+
# https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/groups-operations#DeleteGroupMember
|
|
58
163
|
#
|
|
59
164
|
# @param group_object_id [String] Group object id
|
|
60
165
|
# @param member_object_id [String] Member Object id
|
|
@@ -68,6 +173,8 @@ module Azure::ARM::Graph
|
|
|
68
173
|
fail ArgumentError, 'member_object_id is nil' if member_object_id.nil?
|
|
69
174
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
70
175
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
176
|
+
|
|
177
|
+
|
|
71
178
|
request_headers = {}
|
|
72
179
|
|
|
73
180
|
# Set Headers
|
|
@@ -109,11 +216,11 @@ module Azure::ARM::Graph
|
|
|
109
216
|
|
|
110
217
|
#
|
|
111
218
|
# Add a memeber to a group. Reference:
|
|
112
|
-
#
|
|
219
|
+
# https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/groups-operations#AddGroupMembers
|
|
113
220
|
#
|
|
114
221
|
# @param group_object_id [String] Group object id
|
|
115
222
|
# @param parameters [GroupAddMemberParameters] Member Object Url as
|
|
116
|
-
# https://graph.windows.net/
|
|
223
|
+
# https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd
|
|
117
224
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
118
225
|
# will be added to the HTTP request.
|
|
119
226
|
#
|
|
@@ -125,11 +232,11 @@ module Azure::ARM::Graph
|
|
|
125
232
|
|
|
126
233
|
#
|
|
127
234
|
# Add a memeber to a group. Reference:
|
|
128
|
-
#
|
|
235
|
+
# https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/groups-operations#AddGroupMembers
|
|
129
236
|
#
|
|
130
237
|
# @param group_object_id [String] Group object id
|
|
131
238
|
# @param parameters [GroupAddMemberParameters] Member Object Url as
|
|
132
|
-
# https://graph.windows.net/
|
|
239
|
+
# https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd
|
|
133
240
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
134
241
|
# will be added to the HTTP request.
|
|
135
242
|
#
|
|
@@ -141,11 +248,11 @@ module Azure::ARM::Graph
|
|
|
141
248
|
|
|
142
249
|
#
|
|
143
250
|
# Add a memeber to a group. Reference:
|
|
144
|
-
#
|
|
251
|
+
# https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/groups-operations#AddGroupMembers
|
|
145
252
|
#
|
|
146
253
|
# @param group_object_id [String] Group object id
|
|
147
254
|
# @param parameters [GroupAddMemberParameters] Member Object Url as
|
|
148
|
-
# https://graph.windows.net/
|
|
255
|
+
# https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd
|
|
149
256
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
150
257
|
# to the HTTP request.
|
|
151
258
|
#
|
|
@@ -154,21 +261,23 @@ module Azure::ARM::Graph
|
|
|
154
261
|
def add_member_async(group_object_id, parameters, custom_headers = nil)
|
|
155
262
|
fail ArgumentError, 'group_object_id is nil' if group_object_id.nil?
|
|
156
263
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
157
|
-
parameters.validate unless parameters.nil?
|
|
158
264
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
159
265
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
266
|
+
|
|
267
|
+
|
|
160
268
|
request_headers = {}
|
|
161
269
|
|
|
162
270
|
# Set Headers
|
|
163
271
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
164
272
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
165
273
|
|
|
166
|
-
# Serialize Request
|
|
167
274
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
request_content =
|
|
275
|
+
|
|
276
|
+
# Serialize Request
|
|
277
|
+
request_mapper = GroupAddMemberParameters.mapper()
|
|
278
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
|
279
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
280
|
+
|
|
172
281
|
path_template = '/{tenantID}/groups/{groupObjectId}/$links/members'
|
|
173
282
|
options = {
|
|
174
283
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
@@ -246,6 +355,8 @@ module Azure::ARM::Graph
|
|
|
246
355
|
fail ArgumentError, 'group_object_id is nil' if group_object_id.nil?
|
|
247
356
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
248
357
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
358
|
+
|
|
359
|
+
|
|
249
360
|
request_headers = {}
|
|
250
361
|
|
|
251
362
|
# Set Headers
|
|
@@ -326,21 +437,23 @@ module Azure::ARM::Graph
|
|
|
326
437
|
#
|
|
327
438
|
def create_async(parameters, custom_headers = nil)
|
|
328
439
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
329
|
-
parameters.validate unless parameters.nil?
|
|
330
440
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
331
441
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
442
|
+
|
|
443
|
+
|
|
332
444
|
request_headers = {}
|
|
333
445
|
|
|
334
446
|
# Set Headers
|
|
335
447
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
336
448
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
337
449
|
|
|
338
|
-
# Serialize Request
|
|
339
450
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
request_content =
|
|
451
|
+
|
|
452
|
+
# Serialize Request
|
|
453
|
+
request_mapper = GroupCreateParameters.mapper()
|
|
454
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
|
455
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
456
|
+
|
|
344
457
|
path_template = '/{tenantID}/groups'
|
|
345
458
|
options = {
|
|
346
459
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
@@ -372,10 +485,8 @@ module Azure::ARM::Graph
|
|
|
372
485
|
if status_code == 201
|
|
373
486
|
begin
|
|
374
487
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
end
|
|
378
|
-
result.body = parsed_response
|
|
488
|
+
result_mapper = ADGroup.mapper()
|
|
489
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
379
490
|
rescue Exception => e
|
|
380
491
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
381
492
|
end
|
|
@@ -387,6 +498,26 @@ module Azure::ARM::Graph
|
|
|
387
498
|
promise.execute
|
|
388
499
|
end
|
|
389
500
|
|
|
501
|
+
#
|
|
502
|
+
# Gets list of groups for the current tenant.
|
|
503
|
+
#
|
|
504
|
+
# @param filter [String] The filter to apply on the operation.
|
|
505
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
506
|
+
# will be added to the HTTP request.
|
|
507
|
+
#
|
|
508
|
+
# @return [GroupListResult] which provide lazy access to pages of the response.
|
|
509
|
+
#
|
|
510
|
+
def list_as_lazy(filter = nil, custom_headers = nil)
|
|
511
|
+
response = list_async(filter, custom_headers).value!
|
|
512
|
+
unless response.nil?
|
|
513
|
+
page = response.body
|
|
514
|
+
page.next_method = Proc.new do |next_link|
|
|
515
|
+
list_next_async(next_link, custom_headers)
|
|
516
|
+
end
|
|
517
|
+
page
|
|
518
|
+
end
|
|
519
|
+
end
|
|
520
|
+
|
|
390
521
|
#
|
|
391
522
|
# Gets list of groups for the current tenant.
|
|
392
523
|
#
|
|
@@ -397,8 +528,8 @@ module Azure::ARM::Graph
|
|
|
397
528
|
# @return [GroupListResult] operation results.
|
|
398
529
|
#
|
|
399
530
|
def list(filter = nil, custom_headers = nil)
|
|
400
|
-
|
|
401
|
-
|
|
531
|
+
first_page = list_as_lazy(filter, custom_headers)
|
|
532
|
+
first_page.get_all_items
|
|
402
533
|
end
|
|
403
534
|
|
|
404
535
|
#
|
|
@@ -426,6 +557,8 @@ module Azure::ARM::Graph
|
|
|
426
557
|
def list_async(filter = nil, custom_headers = nil)
|
|
427
558
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
428
559
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
560
|
+
|
|
561
|
+
|
|
429
562
|
request_headers = {}
|
|
430
563
|
|
|
431
564
|
# Set Headers
|
|
@@ -461,10 +594,8 @@ module Azure::ARM::Graph
|
|
|
461
594
|
if status_code == 200
|
|
462
595
|
begin
|
|
463
596
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
end
|
|
467
|
-
result.body = parsed_response
|
|
597
|
+
result_mapper = GroupListResult.mapper()
|
|
598
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
468
599
|
rescue Exception => e
|
|
469
600
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
470
601
|
end
|
|
@@ -476,6 +607,27 @@ module Azure::ARM::Graph
|
|
|
476
607
|
promise.execute
|
|
477
608
|
end
|
|
478
609
|
|
|
610
|
+
#
|
|
611
|
+
# Gets the members of a group.
|
|
612
|
+
#
|
|
613
|
+
# @param object_id [String] Group object Id who's members should be retrieved.
|
|
614
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
615
|
+
# will be added to the HTTP request.
|
|
616
|
+
#
|
|
617
|
+
# @return [GetObjectsResult] which provide lazy access to pages of the
|
|
618
|
+
# response.
|
|
619
|
+
#
|
|
620
|
+
def get_group_members_as_lazy(object_id, custom_headers = nil)
|
|
621
|
+
response = get_group_members_async(object_id, custom_headers).value!
|
|
622
|
+
unless response.nil?
|
|
623
|
+
page = response.body
|
|
624
|
+
page.next_method = Proc.new do |next_link|
|
|
625
|
+
get_group_members_next_async(next_link, custom_headers)
|
|
626
|
+
end
|
|
627
|
+
page
|
|
628
|
+
end
|
|
629
|
+
end
|
|
630
|
+
|
|
479
631
|
#
|
|
480
632
|
# Gets the members of a group.
|
|
481
633
|
#
|
|
@@ -486,8 +638,8 @@ module Azure::ARM::Graph
|
|
|
486
638
|
# @return [GetObjectsResult] operation results.
|
|
487
639
|
#
|
|
488
640
|
def get_group_members(object_id, custom_headers = nil)
|
|
489
|
-
|
|
490
|
-
|
|
641
|
+
first_page = get_group_members_as_lazy(object_id, custom_headers)
|
|
642
|
+
first_page.get_all_items
|
|
491
643
|
end
|
|
492
644
|
|
|
493
645
|
#
|
|
@@ -516,6 +668,8 @@ module Azure::ARM::Graph
|
|
|
516
668
|
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
|
517
669
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
518
670
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
671
|
+
|
|
672
|
+
|
|
519
673
|
request_headers = {}
|
|
520
674
|
|
|
521
675
|
# Set Headers
|
|
@@ -552,10 +706,8 @@ module Azure::ARM::Graph
|
|
|
552
706
|
if status_code == 200
|
|
553
707
|
begin
|
|
554
708
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
end
|
|
558
|
-
result.body = parsed_response
|
|
709
|
+
result_mapper = GetObjectsResult.mapper()
|
|
710
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
559
711
|
rescue Exception => e
|
|
560
712
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
561
713
|
end
|
|
@@ -607,6 +759,8 @@ module Azure::ARM::Graph
|
|
|
607
759
|
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
|
608
760
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
609
761
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
762
|
+
|
|
763
|
+
|
|
610
764
|
request_headers = {}
|
|
611
765
|
|
|
612
766
|
# Set Headers
|
|
@@ -643,10 +797,8 @@ module Azure::ARM::Graph
|
|
|
643
797
|
if status_code == 200
|
|
644
798
|
begin
|
|
645
799
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
end
|
|
649
|
-
result.body = parsed_response
|
|
800
|
+
result_mapper = ADGroup.mapper()
|
|
801
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
650
802
|
rescue Exception => e
|
|
651
803
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
652
804
|
end
|
|
@@ -706,21 +858,23 @@ module Azure::ARM::Graph
|
|
|
706
858
|
def get_member_groups_async(object_id, parameters, custom_headers = nil)
|
|
707
859
|
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
|
708
860
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
709
|
-
parameters.validate unless parameters.nil?
|
|
710
861
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
711
862
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
863
|
+
|
|
864
|
+
|
|
712
865
|
request_headers = {}
|
|
713
866
|
|
|
714
867
|
# Set Headers
|
|
715
868
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
716
869
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
717
870
|
|
|
718
|
-
# Serialize Request
|
|
719
871
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
request_content =
|
|
872
|
+
|
|
873
|
+
# Serialize Request
|
|
874
|
+
request_mapper = GroupGetMemberGroupsParameters.mapper()
|
|
875
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
|
876
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
877
|
+
|
|
724
878
|
path_template = '/{tenantID}/groups/{objectId}/getMemberGroups'
|
|
725
879
|
options = {
|
|
726
880
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
@@ -753,10 +907,8 @@ module Azure::ARM::Graph
|
|
|
753
907
|
if status_code == 200
|
|
754
908
|
begin
|
|
755
909
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
end
|
|
759
|
-
result.body = parsed_response
|
|
910
|
+
result_mapper = GroupGetMemberGroupsResult.mapper()
|
|
911
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
760
912
|
rescue Exception => e
|
|
761
913
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
762
914
|
end
|
|
@@ -808,6 +960,8 @@ module Azure::ARM::Graph
|
|
|
808
960
|
fail ArgumentError, 'next_link is nil' if next_link.nil?
|
|
809
961
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
810
962
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
963
|
+
|
|
964
|
+
|
|
811
965
|
request_headers = {}
|
|
812
966
|
|
|
813
967
|
# Set Headers
|
|
@@ -844,10 +998,8 @@ module Azure::ARM::Graph
|
|
|
844
998
|
if status_code == 200
|
|
845
999
|
begin
|
|
846
1000
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
end
|
|
850
|
-
result.body = parsed_response
|
|
1001
|
+
result_mapper = GroupListResult.mapper()
|
|
1002
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
851
1003
|
rescue Exception => e
|
|
852
1004
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
853
1005
|
end
|
|
@@ -899,6 +1051,8 @@ module Azure::ARM::Graph
|
|
|
899
1051
|
fail ArgumentError, 'next_link is nil' if next_link.nil?
|
|
900
1052
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
901
1053
|
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
|
1054
|
+
|
|
1055
|
+
|
|
902
1056
|
request_headers = {}
|
|
903
1057
|
|
|
904
1058
|
# Set Headers
|
|
@@ -935,10 +1089,8 @@ module Azure::ARM::Graph
|
|
|
935
1089
|
if status_code == 200
|
|
936
1090
|
begin
|
|
937
1091
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
end
|
|
941
|
-
result.body = parsed_response
|
|
1092
|
+
result_mapper = GetObjectsResult.mapper()
|
|
1093
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
942
1094
|
rescue Exception => e
|
|
943
1095
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
944
1096
|
end
|