azure_graph_rbac2 0.18.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.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/1.6/generated/azure_graph_rbac2/applications.rb +1131 -0
  4. data/lib/1.6/generated/azure_graph_rbac2/domains.rb +200 -0
  5. data/lib/1.6/generated/azure_graph_rbac2/graph_rbac_client.rb +151 -0
  6. data/lib/1.6/generated/azure_graph_rbac2/groups.rb +1079 -0
  7. data/lib/1.6/generated/azure_graph_rbac2/models/aadobject.rb +297 -0
  8. data/lib/1.6/generated/azure_graph_rbac2/models/adgroup.rb +116 -0
  9. data/lib/1.6/generated/azure_graph_rbac2/models/application.rb +196 -0
  10. data/lib/1.6/generated/azure_graph_rbac2/models/application_add_owner_parameters.rb +69 -0
  11. data/lib/1.6/generated/azure_graph_rbac2/models/application_create_parameters.rb +202 -0
  12. data/lib/1.6/generated/azure_graph_rbac2/models/application_list_result.rb +98 -0
  13. data/lib/1.6/generated/azure_graph_rbac2/models/application_update_parameters.rb +201 -0
  14. data/lib/1.6/generated/azure_graph_rbac2/models/check_group_membership_parameters.rb +77 -0
  15. data/lib/1.6/generated/azure_graph_rbac2/models/check_group_membership_result.rb +67 -0
  16. data/lib/1.6/generated/azure_graph_rbac2/models/directory_object.rb +92 -0
  17. data/lib/1.6/generated/azure_graph_rbac2/models/directory_object_list_result.rb +57 -0
  18. data/lib/1.6/generated/azure_graph_rbac2/models/domain.rb +101 -0
  19. data/lib/1.6/generated/azure_graph_rbac2/models/domain_list_result.rb +55 -0
  20. data/lib/1.6/generated/azure_graph_rbac2/models/get_objects_parameters.rb +104 -0
  21. data/lib/1.6/generated/azure_graph_rbac2/models/get_objects_result.rb +98 -0
  22. data/lib/1.6/generated/azure_graph_rbac2/models/graph_error.rb +57 -0
  23. data/lib/1.6/generated/azure_graph_rbac2/models/group_add_member_parameters.rb +69 -0
  24. data/lib/1.6/generated/azure_graph_rbac2/models/group_create_parameters.rb +106 -0
  25. data/lib/1.6/generated/azure_graph_rbac2/models/group_get_member_groups_parameters.rb +67 -0
  26. data/lib/1.6/generated/azure_graph_rbac2/models/group_get_member_groups_result.rb +55 -0
  27. data/lib/1.6/generated/azure_graph_rbac2/models/group_list_result.rb +98 -0
  28. data/lib/1.6/generated/azure_graph_rbac2/models/key_credential.rb +132 -0
  29. data/lib/1.6/generated/azure_graph_rbac2/models/key_credential_list_result.rb +55 -0
  30. data/lib/1.6/generated/azure_graph_rbac2/models/key_credentials_update_parameters.rb +55 -0
  31. data/lib/1.6/generated/azure_graph_rbac2/models/password_credential.rb +98 -0
  32. data/lib/1.6/generated/azure_graph_rbac2/models/password_credential_list_result.rb +56 -0
  33. data/lib/1.6/generated/azure_graph_rbac2/models/password_credentials_update_parameters.rb +56 -0
  34. data/lib/1.6/generated/azure_graph_rbac2/models/password_profile.rb +76 -0
  35. data/lib/1.6/generated/azure_graph_rbac2/models/required_resource_access.rb +94 -0
  36. data/lib/1.6/generated/azure_graph_rbac2/models/resource_access.rb +80 -0
  37. data/lib/1.6/generated/azure_graph_rbac2/models/service_principal.rb +124 -0
  38. data/lib/1.6/generated/azure_graph_rbac2/models/service_principal_create_parameters.rb +117 -0
  39. data/lib/1.6/generated/azure_graph_rbac2/models/service_principal_list_result.rb +98 -0
  40. data/lib/1.6/generated/azure_graph_rbac2/models/sign_in_name.rb +79 -0
  41. data/lib/1.6/generated/azure_graph_rbac2/models/user.rb +221 -0
  42. data/lib/1.6/generated/azure_graph_rbac2/models/user_base.rb +118 -0
  43. data/lib/1.6/generated/azure_graph_rbac2/models/user_create_parameters.rb +158 -0
  44. data/lib/1.6/generated/azure_graph_rbac2/models/user_get_member_groups_parameters.rb +67 -0
  45. data/lib/1.6/generated/azure_graph_rbac2/models/user_get_member_groups_result.rb +55 -0
  46. data/lib/1.6/generated/azure_graph_rbac2/models/user_list_result.rb +98 -0
  47. data/lib/1.6/generated/azure_graph_rbac2/models/user_type.rb +16 -0
  48. data/lib/1.6/generated/azure_graph_rbac2/models/user_update_parameters.rb +147 -0
  49. data/lib/1.6/generated/azure_graph_rbac2/module_definition.rb +8 -0
  50. data/lib/1.6/generated/azure_graph_rbac2/objects.rb +314 -0
  51. data/lib/1.6/generated/azure_graph_rbac2/service_principals.rb +949 -0
  52. data/lib/1.6/generated/azure_graph_rbac2/users.rb +686 -0
  53. data/lib/1.6/generated/azure_graph_rbac2.rb +75 -0
  54. data/lib/azure_graph_rbac2.rb +6 -0
  55. data/lib/module_definition.rb +6 -0
  56. data/lib/profiles/latest/graphrbac_latest_profile_client.rb +38 -0
  57. data/lib/profiles/latest/graphrbac_module_definition.rb +8 -0
  58. data/lib/profiles/latest/modules/graphrbac_profile_module.rb +237 -0
  59. data/lib/version.rb +7 -0
  60. metadata +190 -0
@@ -0,0 +1,200 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::GraphRbac2::V1_6
7
+ #
8
+ # The Graph RBAC Management Client
9
+ #
10
+ class Domains
11
+ include MsRestAzure2
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Domains class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [GraphRbacClient] reference to the GraphRbacClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets a list of domains for the current tenant.
26
+ #
27
+ # @param filter [String] The filter to apply to the operation.
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [DomainListResult] operation results.
32
+ #
33
+ def list(filter:nil, custom_headers:nil)
34
+ response = list_async(filter:filter, custom_headers:custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Gets a list of domains for the current tenant.
40
+ #
41
+ # @param filter [String] The filter to apply to the operation.
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_with_http_info(filter:nil, custom_headers:nil)
48
+ list_async(filter:filter, custom_headers:custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Gets a list of domains for the current tenant.
53
+ #
54
+ # @param filter [String] The filter to apply to the operation.
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_async(filter:nil, custom_headers:nil)
61
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
62
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
63
+
64
+
65
+ request_headers = {}
66
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
67
+
68
+ # Set Headers
69
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
70
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
71
+ path_template = '{tenantID}/domains'
72
+
73
+ request_url = @base_url || @client.base_url
74
+
75
+ options = {
76
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
77
+ path_params: {'tenantID' => @client.tenant_id},
78
+ query_params: {'$filter' => filter,'api-version' => @client.api_version},
79
+ headers: request_headers.merge(custom_headers || {}),
80
+ base_url: request_url
81
+ }
82
+ promise = @client.make_request_async(:get, path_template, options)
83
+
84
+ promise = promise.then do |result|
85
+ http_response = result.response
86
+ status_code = http_response.status
87
+ response_content = http_response.body
88
+ unless status_code == 200
89
+ error_model = JSON.load(response_content)
90
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
91
+ end
92
+
93
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
94
+ # Deserialize Response
95
+ if status_code == 200
96
+ begin
97
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
98
+ result_mapper = Azure::GraphRbac2::V1_6::Models::DomainListResult.mapper()
99
+ result.body = @client.deserialize(result_mapper, parsed_response)
100
+ rescue Exception => e
101
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
102
+ end
103
+ end
104
+
105
+ result
106
+ end
107
+
108
+ promise.execute
109
+ end
110
+
111
+ #
112
+ # Gets a specific domain in the current tenant.
113
+ #
114
+ # @param domain_name [String] name of the domain.
115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
+ # will be added to the HTTP request.
117
+ #
118
+ # @return [Domain] operation results.
119
+ #
120
+ def get(domain_name, custom_headers:nil)
121
+ response = get_async(domain_name, custom_headers:custom_headers).value!
122
+ response.body unless response.nil?
123
+ end
124
+
125
+ #
126
+ # Gets a specific domain in the current tenant.
127
+ #
128
+ # @param domain_name [String] name of the domain.
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
133
+ #
134
+ def get_with_http_info(domain_name, custom_headers:nil)
135
+ get_async(domain_name, custom_headers:custom_headers).value!
136
+ end
137
+
138
+ #
139
+ # Gets a specific domain in the current tenant.
140
+ #
141
+ # @param domain_name [String] name of the domain.
142
+ # @param [Hash{String => String}] A hash of custom headers that will be added
143
+ # to the HTTP request.
144
+ #
145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
146
+ #
147
+ def get_async(domain_name, custom_headers:nil)
148
+ fail ArgumentError, 'domain_name is nil' if domain_name.nil?
149
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
150
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
151
+
152
+
153
+ request_headers = {}
154
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
155
+
156
+ # Set Headers
157
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
158
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
159
+ path_template = '{tenantID}/domains/{domainName}'
160
+
161
+ request_url = @base_url || @client.base_url
162
+
163
+ options = {
164
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
165
+ path_params: {'domainName' => domain_name,'tenantID' => @client.tenant_id},
166
+ query_params: {'api-version' => @client.api_version},
167
+ headers: request_headers.merge(custom_headers || {}),
168
+ base_url: request_url
169
+ }
170
+ promise = @client.make_request_async(:get, path_template, options)
171
+
172
+ promise = promise.then do |result|
173
+ http_response = result.response
174
+ status_code = http_response.status
175
+ response_content = http_response.body
176
+ unless status_code == 200
177
+ error_model = JSON.load(response_content)
178
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
179
+ end
180
+
181
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
182
+ # Deserialize Response
183
+ if status_code == 200
184
+ begin
185
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
186
+ result_mapper = Azure::GraphRbac2::V1_6::Models::Domain.mapper()
187
+ result.body = @client.deserialize(result_mapper, parsed_response)
188
+ rescue Exception => e
189
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
190
+ end
191
+ end
192
+
193
+ result
194
+ end
195
+
196
+ promise.execute
197
+ end
198
+
199
+ end
200
+ end
@@ -0,0 +1,151 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::GraphRbac2::V1_6
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class GraphRbacClient < MsRestAzure2::AzureServiceClient
11
+ include MsRestAzure2
12
+ include MsRestAzure2::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Client API version.
21
+ attr_reader :api_version
22
+
23
+ # @return [String] The tenant ID.
24
+ attr_accessor :tenant_id
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [Objects] objects
39
+ attr_reader :objects
40
+
41
+ # @return [Applications] applications
42
+ attr_reader :applications
43
+
44
+ # @return [Groups] groups
45
+ attr_reader :groups
46
+
47
+ # @return [ServicePrincipals] service_principals
48
+ attr_reader :service_principals
49
+
50
+ # @return [Users] users
51
+ attr_reader :users
52
+
53
+ # @return [Domains] domains
54
+ attr_reader :domains
55
+
56
+ #
57
+ # Creates initializes a new instance of the GraphRbacClient class.
58
+ # @param credentials [MsRest2::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
59
+ # @param base_url [String] the base URI of the service.
60
+ # @param options [Array] filters to be applied to the HTTP requests.
61
+ #
62
+ def initialize(credentials = nil, base_url = nil, options = nil)
63
+ super(credentials, options)
64
+ @base_url = base_url || 'https://graph.windows.net'
65
+
66
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest2::ServiceClientCredentials) unless credentials.nil?
67
+ @credentials = credentials
68
+
69
+ @objects = Objects.new(self)
70
+ @applications = Applications.new(self)
71
+ @groups = Groups.new(self)
72
+ @service_principals = ServicePrincipals.new(self)
73
+ @users = Users.new(self)
74
+ @domains = Domains.new(self)
75
+ @api_version = '1.6'
76
+ @accept_language = 'en-US'
77
+ @long_running_operation_retry_timeout = 30
78
+ @generate_client_request_id = true
79
+ add_telemetry
80
+ end
81
+
82
+ #
83
+ # Makes a request and returns the body of the response.
84
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
85
+ # @param path [String] the path, relative to {base_url}.
86
+ # @param options [Hash{String=>String}] specifying any request options like :body.
87
+ # @return [Hash{String=>String}] containing the body of the response.
88
+ # Example:
89
+ #
90
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
91
+ # path = "/path"
92
+ # options = {
93
+ # body: request_content,
94
+ # query_params: {'api-version' => '2016-02-01'}
95
+ # }
96
+ # result = @client.make_request(:put, path, options)
97
+ #
98
+ def make_request(method, path, options = {})
99
+ result = make_request_with_http_info(method, path, options)
100
+ result.body unless result.nil?
101
+ end
102
+
103
+ #
104
+ # Makes a request and returns the operation response.
105
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
106
+ # @param path [String] the path, relative to {base_url}.
107
+ # @param options [Hash{String=>String}] specifying any request options like :body.
108
+ # @return [MsRestAzure2::AzureOperationResponse] Operation response containing the request, response and status.
109
+ #
110
+ def make_request_with_http_info(method, path, options = {})
111
+ result = make_request_async(method, path, options).value!
112
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
113
+ result
114
+ end
115
+
116
+ #
117
+ # Makes a request asynchronously.
118
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
119
+ # @param path [String] the path, relative to {base_url}.
120
+ # @param options [Hash{String=>String}] specifying any request options like :body.
121
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
122
+ #
123
+ def make_request_async(method, path, options = {})
124
+ fail ArgumentError, 'method is nil' if method.nil?
125
+ fail ArgumentError, 'path is nil' if path.nil?
126
+
127
+ request_url = options[:base_url] || @base_url
128
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
129
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
130
+ end
131
+
132
+ request_headers = @request_headers
133
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
134
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
135
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
136
+
137
+ super(request_url, method, path, options)
138
+ end
139
+
140
+
141
+ private
142
+ #
143
+ # Adds telemetry information.
144
+ #
145
+ def add_telemetry
146
+ sdk_information = 'azure_graph_rbac2'
147
+ sdk_information = "#{sdk_information}/0.17.2"
148
+ add_user_agent_information(sdk_information)
149
+ end
150
+ end
151
+ end