azure_mgmt_msi 0.15.2

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.
@@ -0,0 +1,100 @@
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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
7
+ module Models
8
+ #
9
+ # A list of operations supported by Microsoft.ManagedIdentity Resource
10
+ # Provider.
11
+ #
12
+ class OperationListResult
13
+
14
+ include MsRestAzure
15
+
16
+ include MsRest::JSONable
17
+ # @return [Array<Operation>] A list of operations supported by
18
+ # Microsoft.ManagedIdentity Resource Provider.
19
+ attr_accessor :value
20
+
21
+ # @return [String] The url to get the next page of results, if any.
22
+ attr_accessor :next_link
23
+
24
+ # return [Proc] with next page method call.
25
+ attr_accessor :next_method
26
+
27
+ #
28
+ # Gets the rest of the items for the request, enabling auto-pagination.
29
+ #
30
+ # @return [Array<Operation>] operation results.
31
+ #
32
+ def get_all_items
33
+ items = @value
34
+ page = self
35
+ while page.next_link != nil do
36
+ page = page.get_next_page
37
+ items.concat(page.value)
38
+ end
39
+ items
40
+ end
41
+
42
+ #
43
+ # Gets the next page of results.
44
+ #
45
+ # @return [OperationListResult] with next page content.
46
+ #
47
+ def get_next_page
48
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
49
+ unless response.nil?
50
+ @next_link = response.body.next_link
51
+ @value = response.body.value
52
+ self
53
+ end
54
+ end
55
+
56
+ #
57
+ # Mapper for OperationListResult class as Ruby Hash.
58
+ # This will be used for serialization/deserialization.
59
+ #
60
+ def self.mapper()
61
+ {
62
+ client_side_validation: true,
63
+ required: false,
64
+ serialized_name: 'OperationListResult',
65
+ type: {
66
+ name: 'Composite',
67
+ class_name: 'OperationListResult',
68
+ model_properties: {
69
+ value: {
70
+ client_side_validation: true,
71
+ required: false,
72
+ serialized_name: 'value',
73
+ type: {
74
+ name: 'Sequence',
75
+ element: {
76
+ client_side_validation: true,
77
+ required: false,
78
+ serialized_name: 'OperationElementType',
79
+ type: {
80
+ name: 'Composite',
81
+ class_name: 'Operation'
82
+ }
83
+ }
84
+ }
85
+ },
86
+ next_link: {
87
+ client_side_validation: true,
88
+ required: false,
89
+ serialized_name: 'nextLink',
90
+ type: {
91
+ name: 'String'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,15 @@
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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
7
+ module Models
8
+ #
9
+ # Defines values for UserAssignedIdentities
10
+ #
11
+ module UserAssignedIdentities
12
+ MicrosoftManagedIdentityuserAssignedIdentities = "Microsoft.ManagedIdentity/userAssignedIdentities"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,99 @@
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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
7
+ module Models
8
+ #
9
+ # Values returned by the List operation.
10
+ #
11
+ class UserAssignedIdentitiesListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<Identity>] The collection of userAssignedIdentities
17
+ # returned by the listing operation.
18
+ attr_accessor :value
19
+
20
+ # @return [String] The url to get the next page of results, if any.
21
+ attr_accessor :next_link
22
+
23
+ # return [Proc] with next page method call.
24
+ attr_accessor :next_method
25
+
26
+ #
27
+ # Gets the rest of the items for the request, enabling auto-pagination.
28
+ #
29
+ # @return [Array<Identity>] operation results.
30
+ #
31
+ def get_all_items
32
+ items = @value
33
+ page = self
34
+ while page.next_link != nil do
35
+ page = page.get_next_page
36
+ items.concat(page.value)
37
+ end
38
+ items
39
+ end
40
+
41
+ #
42
+ # Gets the next page of results.
43
+ #
44
+ # @return [UserAssignedIdentitiesListResult] with next page content.
45
+ #
46
+ def get_next_page
47
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
48
+ unless response.nil?
49
+ @next_link = response.body.next_link
50
+ @value = response.body.value
51
+ self
52
+ end
53
+ end
54
+
55
+ #
56
+ # Mapper for UserAssignedIdentitiesListResult class as Ruby Hash.
57
+ # This will be used for serialization/deserialization.
58
+ #
59
+ def self.mapper()
60
+ {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'UserAssignedIdentitiesListResult',
64
+ type: {
65
+ name: 'Composite',
66
+ class_name: 'UserAssignedIdentitiesListResult',
67
+ model_properties: {
68
+ value: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'value',
72
+ type: {
73
+ name: 'Sequence',
74
+ element: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ serialized_name: 'IdentityElementType',
78
+ type: {
79
+ name: 'Composite',
80
+ class_name: 'Identity'
81
+ }
82
+ }
83
+ }
84
+ },
85
+ next_link: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ serialized_name: 'nextLink',
89
+ type: {
90
+ name: 'String'
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::ManagedServiceIdentity end
8
+ module Azure::ManagedServiceIdentity::Mgmt end
9
+ module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview end
@@ -0,0 +1,213 @@
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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
7
+ #
8
+ # The Managed Service Identity Client.
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ManagedServiceIdentityClient] reference to the ManagedServiceIdentityClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists available operations for the Microsoft.ManagedIdentity provider
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<Operation>] operation results.
31
+ #
32
+ def list(custom_headers = nil)
33
+ first_page = list_as_lazy(custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Lists available operations for the Microsoft.ManagedIdentity provider
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers = nil)
46
+ list_async(custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists available operations for the Microsoft.ManagedIdentity provider
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers = nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+
63
+ # Set Headers
64
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
65
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
66
+ path_template = 'providers/Microsoft.ManagedIdentity/operations'
67
+
68
+ request_url = @base_url || @client.base_url
69
+
70
+ options = {
71
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
72
+ query_params: {'api-version' => @client.api_version},
73
+ headers: request_headers.merge(custom_headers || {}),
74
+ base_url: request_url
75
+ }
76
+ promise = @client.make_request_async(:get, path_template, options)
77
+
78
+ promise = promise.then do |result|
79
+ http_response = result.response
80
+ status_code = http_response.status
81
+ response_content = http_response.body
82
+ unless status_code == 200
83
+ error_model = JSON.load(response_content)
84
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
85
+ end
86
+
87
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
88
+ # Deserialize Response
89
+ if status_code == 200
90
+ begin
91
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
92
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationListResult.mapper()
93
+ result.body = @client.deserialize(result_mapper, parsed_response)
94
+ rescue Exception => e
95
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
96
+ end
97
+ end
98
+
99
+ result
100
+ end
101
+
102
+ promise.execute
103
+ end
104
+
105
+ #
106
+ # Lists available operations for the Microsoft.ManagedIdentity provider
107
+ #
108
+ # @param next_page_link [String] The NextLink from the previous successful call
109
+ # to List operation.
110
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
111
+ # will be added to the HTTP request.
112
+ #
113
+ # @return [OperationListResult] operation results.
114
+ #
115
+ def list_next(next_page_link, custom_headers = nil)
116
+ response = list_next_async(next_page_link, custom_headers).value!
117
+ response.body unless response.nil?
118
+ end
119
+
120
+ #
121
+ # Lists available operations for the Microsoft.ManagedIdentity provider
122
+ #
123
+ # @param next_page_link [String] The NextLink from the previous successful call
124
+ # to List operation.
125
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
126
+ # will be added to the HTTP request.
127
+ #
128
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
129
+ #
130
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
131
+ list_next_async(next_page_link, custom_headers).value!
132
+ end
133
+
134
+ #
135
+ # Lists available operations for the Microsoft.ManagedIdentity provider
136
+ #
137
+ # @param next_page_link [String] The NextLink from the previous successful call
138
+ # to List operation.
139
+ # @param [Hash{String => String}] A hash of custom headers that will be added
140
+ # to the HTTP request.
141
+ #
142
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
143
+ #
144
+ def list_next_async(next_page_link, custom_headers = nil)
145
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
146
+
147
+
148
+ request_headers = {}
149
+
150
+ # Set Headers
151
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
152
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
153
+ path_template = '{nextLink}'
154
+
155
+ request_url = @base_url || @client.base_url
156
+
157
+ options = {
158
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
159
+ skip_encoding_path_params: {'nextLink' => next_page_link},
160
+ headers: request_headers.merge(custom_headers || {}),
161
+ base_url: request_url
162
+ }
163
+ promise = @client.make_request_async(:get, path_template, options)
164
+
165
+ promise = promise.then do |result|
166
+ http_response = result.response
167
+ status_code = http_response.status
168
+ response_content = http_response.body
169
+ unless status_code == 200
170
+ error_model = JSON.load(response_content)
171
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
172
+ end
173
+
174
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
175
+ # Deserialize Response
176
+ if status_code == 200
177
+ begin
178
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
179
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationListResult.mapper()
180
+ result.body = @client.deserialize(result_mapper, parsed_response)
181
+ rescue Exception => e
182
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
183
+ end
184
+ end
185
+
186
+ result
187
+ end
188
+
189
+ promise.execute
190
+ end
191
+
192
+ #
193
+ # Lists available operations for the Microsoft.ManagedIdentity provider
194
+ #
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [OperationListResult] which provide lazy access to pages of the
199
+ # response.
200
+ #
201
+ def list_as_lazy(custom_headers = nil)
202
+ response = list_async(custom_headers).value!
203
+ unless response.nil?
204
+ page = response.body
205
+ page.next_method = Proc.new do |next_page_link|
206
+ list_next_async(next_page_link, custom_headers)
207
+ end
208
+ page
209
+ end
210
+ end
211
+
212
+ end
213
+ end
@@ -0,0 +1,832 @@
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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
7
+ #
8
+ # The Managed Service Identity Client.
9
+ #
10
+ class UserAssignedIdentities
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the UserAssignedIdentities class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ManagedServiceIdentityClient] reference to the ManagedServiceIdentityClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all the userAssignedIdentities available under the specified
26
+ # subscription.
27
+ #
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [Array<Identity>] operation results.
32
+ #
33
+ def list_by_subscription(custom_headers = nil)
34
+ first_page = list_by_subscription_as_lazy(custom_headers)
35
+ first_page.get_all_items
36
+ end
37
+
38
+ #
39
+ # Lists all the userAssignedIdentities available under the specified
40
+ # subscription.
41
+ #
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_by_subscription_with_http_info(custom_headers = nil)
48
+ list_by_subscription_async(custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Lists all the userAssignedIdentities available under the specified
53
+ # subscription.
54
+ #
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_by_subscription_async(custom_headers = nil)
61
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
62
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
63
+
64
+
65
+ request_headers = {}
66
+
67
+ # Set Headers
68
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
69
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
70
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ManagedIdentity/userAssignedIdentities'
71
+
72
+ request_url = @base_url || @client.base_url
73
+
74
+ options = {
75
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
76
+ path_params: {'subscriptionId' => @client.subscription_id},
77
+ query_params: {'api-version' => @client.api_version},
78
+ headers: request_headers.merge(custom_headers || {}),
79
+ base_url: request_url
80
+ }
81
+ promise = @client.make_request_async(:get, path_template, options)
82
+
83
+ promise = promise.then do |result|
84
+ http_response = result.response
85
+ status_code = http_response.status
86
+ response_content = http_response.body
87
+ unless status_code == 200
88
+ error_model = JSON.load(response_content)
89
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
90
+ end
91
+
92
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ #
111
+ # Lists all the userAssignedIdentities available under the specified
112
+ # ResourceGroup.
113
+ #
114
+ # @param resource_group_name [String] The name of the Resource Group to which
115
+ # the identity belongs.
116
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
117
+ # will be added to the HTTP request.
118
+ #
119
+ # @return [Array<Identity>] operation results.
120
+ #
121
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
122
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
123
+ first_page.get_all_items
124
+ end
125
+
126
+ #
127
+ # Lists all the userAssignedIdentities available under the specified
128
+ # ResourceGroup.
129
+ #
130
+ # @param resource_group_name [String] The name of the Resource Group to which
131
+ # the identity belongs.
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
136
+ #
137
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
138
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
139
+ end
140
+
141
+ #
142
+ # Lists all the userAssignedIdentities available under the specified
143
+ # ResourceGroup.
144
+ #
145
+ # @param resource_group_name [String] The name of the Resource Group to which
146
+ # the identity belongs.
147
+ # @param [Hash{String => String}] A hash of custom headers that will be added
148
+ # to the HTTP request.
149
+ #
150
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
151
+ #
152
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
153
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
154
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
155
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
156
+
157
+
158
+ request_headers = {}
159
+
160
+ # Set Headers
161
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
162
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
163
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities'
164
+
165
+ request_url = @base_url || @client.base_url
166
+
167
+ options = {
168
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
169
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
170
+ query_params: {'api-version' => @client.api_version},
171
+ headers: request_headers.merge(custom_headers || {}),
172
+ base_url: request_url
173
+ }
174
+ promise = @client.make_request_async(:get, path_template, options)
175
+
176
+ promise = promise.then do |result|
177
+ http_response = result.response
178
+ status_code = http_response.status
179
+ response_content = http_response.body
180
+ unless status_code == 200
181
+ error_model = JSON.load(response_content)
182
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
183
+ end
184
+
185
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
186
+ # Deserialize Response
187
+ if status_code == 200
188
+ begin
189
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
190
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult.mapper()
191
+ result.body = @client.deserialize(result_mapper, parsed_response)
192
+ rescue Exception => e
193
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
194
+ end
195
+ end
196
+
197
+ result
198
+ end
199
+
200
+ promise.execute
201
+ end
202
+
203
+ #
204
+ # Create or update an identity in the specified subscription and resource
205
+ # group.
206
+ #
207
+ # @param resource_group_name [String] The name of the Resource Group to which
208
+ # the identity belongs.
209
+ # @param resource_name [String] The name of the identity resource.
210
+ # @param parameters [Identity] Parameters to create or update the identity
211
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
212
+ # will be added to the HTTP request.
213
+ #
214
+ # @return [Identity] operation results.
215
+ #
216
+ def create_or_update(resource_group_name, resource_name, parameters, custom_headers = nil)
217
+ response = create_or_update_async(resource_group_name, resource_name, parameters, custom_headers).value!
218
+ response.body unless response.nil?
219
+ end
220
+
221
+ #
222
+ # Create or update an identity in the specified subscription and resource
223
+ # group.
224
+ #
225
+ # @param resource_group_name [String] The name of the Resource Group to which
226
+ # the identity belongs.
227
+ # @param resource_name [String] The name of the identity resource.
228
+ # @param parameters [Identity] Parameters to create or update the identity
229
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
230
+ # will be added to the HTTP request.
231
+ #
232
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
233
+ #
234
+ def create_or_update_with_http_info(resource_group_name, resource_name, parameters, custom_headers = nil)
235
+ create_or_update_async(resource_group_name, resource_name, parameters, custom_headers).value!
236
+ end
237
+
238
+ #
239
+ # Create or update an identity in the specified subscription and resource
240
+ # group.
241
+ #
242
+ # @param resource_group_name [String] The name of the Resource Group to which
243
+ # the identity belongs.
244
+ # @param resource_name [String] The name of the identity resource.
245
+ # @param parameters [Identity] Parameters to create or update the identity
246
+ # @param [Hash{String => String}] A hash of custom headers that will be added
247
+ # to the HTTP request.
248
+ #
249
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
250
+ #
251
+ def create_or_update_async(resource_group_name, resource_name, parameters, custom_headers = nil)
252
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
253
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
254
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
255
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
256
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
257
+
258
+
259
+ request_headers = {}
260
+
261
+ # Set Headers
262
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
263
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
264
+
265
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
266
+
267
+ # Serialize Request
268
+ request_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.mapper()
269
+ request_content = @client.serialize(request_mapper, parameters)
270
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
271
+
272
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}'
273
+
274
+ request_url = @base_url || @client.base_url
275
+
276
+ options = {
277
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
278
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
279
+ query_params: {'api-version' => @client.api_version},
280
+ body: request_content,
281
+ headers: request_headers.merge(custom_headers || {}),
282
+ base_url: request_url
283
+ }
284
+ promise = @client.make_request_async(:put, path_template, options)
285
+
286
+ promise = promise.then do |result|
287
+ http_response = result.response
288
+ status_code = http_response.status
289
+ response_content = http_response.body
290
+ unless status_code == 200 || status_code == 201
291
+ error_model = JSON.load(response_content)
292
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
293
+ end
294
+
295
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
296
+ # Deserialize Response
297
+ if status_code == 200
298
+ begin
299
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
300
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.mapper()
301
+ result.body = @client.deserialize(result_mapper, parsed_response)
302
+ rescue Exception => e
303
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
304
+ end
305
+ end
306
+ # Deserialize Response
307
+ if status_code == 201
308
+ begin
309
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
310
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.mapper()
311
+ result.body = @client.deserialize(result_mapper, parsed_response)
312
+ rescue Exception => e
313
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
314
+ end
315
+ end
316
+
317
+ result
318
+ end
319
+
320
+ promise.execute
321
+ end
322
+
323
+ #
324
+ # Update an identity in the specified subscription and resource group.
325
+ #
326
+ # @param resource_group_name [String] The name of the Resource Group to which
327
+ # the identity belongs.
328
+ # @param resource_name [String] The name of the identity resource.
329
+ # @param parameters [Identity] Parameters to update the identity
330
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
331
+ # will be added to the HTTP request.
332
+ #
333
+ # @return [Identity] operation results.
334
+ #
335
+ def update(resource_group_name, resource_name, parameters, custom_headers = nil)
336
+ response = update_async(resource_group_name, resource_name, parameters, custom_headers).value!
337
+ response.body unless response.nil?
338
+ end
339
+
340
+ #
341
+ # Update an identity in the specified subscription and resource group.
342
+ #
343
+ # @param resource_group_name [String] The name of the Resource Group to which
344
+ # the identity belongs.
345
+ # @param resource_name [String] The name of the identity resource.
346
+ # @param parameters [Identity] Parameters to update the identity
347
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
348
+ # will be added to the HTTP request.
349
+ #
350
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
351
+ #
352
+ def update_with_http_info(resource_group_name, resource_name, parameters, custom_headers = nil)
353
+ update_async(resource_group_name, resource_name, parameters, custom_headers).value!
354
+ end
355
+
356
+ #
357
+ # Update an identity in the specified subscription and resource group.
358
+ #
359
+ # @param resource_group_name [String] The name of the Resource Group to which
360
+ # the identity belongs.
361
+ # @param resource_name [String] The name of the identity resource.
362
+ # @param parameters [Identity] Parameters to update the identity
363
+ # @param [Hash{String => String}] A hash of custom headers that will be added
364
+ # to the HTTP request.
365
+ #
366
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
367
+ #
368
+ def update_async(resource_group_name, resource_name, parameters, custom_headers = nil)
369
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
370
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
371
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
372
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
373
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
374
+
375
+
376
+ request_headers = {}
377
+
378
+ # Set Headers
379
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
380
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
381
+
382
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
383
+
384
+ # Serialize Request
385
+ request_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.mapper()
386
+ request_content = @client.serialize(request_mapper, parameters)
387
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
388
+
389
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}'
390
+
391
+ request_url = @base_url || @client.base_url
392
+
393
+ options = {
394
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
395
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
396
+ query_params: {'api-version' => @client.api_version},
397
+ body: request_content,
398
+ headers: request_headers.merge(custom_headers || {}),
399
+ base_url: request_url
400
+ }
401
+ promise = @client.make_request_async(:patch, path_template, options)
402
+
403
+ promise = promise.then do |result|
404
+ http_response = result.response
405
+ status_code = http_response.status
406
+ response_content = http_response.body
407
+ unless status_code == 200
408
+ error_model = JSON.load(response_content)
409
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
410
+ end
411
+
412
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
413
+ # Deserialize Response
414
+ if status_code == 200
415
+ begin
416
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
417
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.mapper()
418
+ result.body = @client.deserialize(result_mapper, parsed_response)
419
+ rescue Exception => e
420
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
421
+ end
422
+ end
423
+
424
+ result
425
+ end
426
+
427
+ promise.execute
428
+ end
429
+
430
+ #
431
+ # Gets the identity.
432
+ #
433
+ # @param resource_group_name [String] The name of the Resource Group to which
434
+ # the identity belongs.
435
+ # @param resource_name [String] The name of the identity resource.
436
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
437
+ # will be added to the HTTP request.
438
+ #
439
+ # @return [Identity] operation results.
440
+ #
441
+ def get(resource_group_name, resource_name, custom_headers = nil)
442
+ response = get_async(resource_group_name, resource_name, custom_headers).value!
443
+ response.body unless response.nil?
444
+ end
445
+
446
+ #
447
+ # Gets the identity.
448
+ #
449
+ # @param resource_group_name [String] The name of the Resource Group to which
450
+ # the identity belongs.
451
+ # @param resource_name [String] The name of the identity resource.
452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
453
+ # will be added to the HTTP request.
454
+ #
455
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
456
+ #
457
+ def get_with_http_info(resource_group_name, resource_name, custom_headers = nil)
458
+ get_async(resource_group_name, resource_name, custom_headers).value!
459
+ end
460
+
461
+ #
462
+ # Gets the identity.
463
+ #
464
+ # @param resource_group_name [String] The name of the Resource Group to which
465
+ # the identity belongs.
466
+ # @param resource_name [String] The name of the identity resource.
467
+ # @param [Hash{String => String}] A hash of custom headers that will be added
468
+ # to the HTTP request.
469
+ #
470
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
471
+ #
472
+ def get_async(resource_group_name, resource_name, custom_headers = nil)
473
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
474
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
475
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
476
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
477
+
478
+
479
+ request_headers = {}
480
+
481
+ # Set Headers
482
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
483
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
484
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}'
485
+
486
+ request_url = @base_url || @client.base_url
487
+
488
+ options = {
489
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
490
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
491
+ query_params: {'api-version' => @client.api_version},
492
+ headers: request_headers.merge(custom_headers || {}),
493
+ base_url: request_url
494
+ }
495
+ promise = @client.make_request_async(:get, path_template, options)
496
+
497
+ promise = promise.then do |result|
498
+ http_response = result.response
499
+ status_code = http_response.status
500
+ response_content = http_response.body
501
+ unless status_code == 200
502
+ error_model = JSON.load(response_content)
503
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
504
+ end
505
+
506
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
507
+ # Deserialize Response
508
+ if status_code == 200
509
+ begin
510
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
511
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.mapper()
512
+ result.body = @client.deserialize(result_mapper, parsed_response)
513
+ rescue Exception => e
514
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
515
+ end
516
+ end
517
+
518
+ result
519
+ end
520
+
521
+ promise.execute
522
+ end
523
+
524
+ #
525
+ # Deletes the identity.
526
+ #
527
+ # @param resource_group_name [String] The name of the Resource Group to which
528
+ # the identity belongs.
529
+ # @param resource_name [String] The name of the identity resource.
530
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
531
+ # will be added to the HTTP request.
532
+ #
533
+ #
534
+ def delete(resource_group_name, resource_name, custom_headers = nil)
535
+ response = delete_async(resource_group_name, resource_name, custom_headers).value!
536
+ nil
537
+ end
538
+
539
+ #
540
+ # Deletes the identity.
541
+ #
542
+ # @param resource_group_name [String] The name of the Resource Group to which
543
+ # the identity belongs.
544
+ # @param resource_name [String] The name of the identity resource.
545
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
546
+ # will be added to the HTTP request.
547
+ #
548
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
549
+ #
550
+ def delete_with_http_info(resource_group_name, resource_name, custom_headers = nil)
551
+ delete_async(resource_group_name, resource_name, custom_headers).value!
552
+ end
553
+
554
+ #
555
+ # Deletes the identity.
556
+ #
557
+ # @param resource_group_name [String] The name of the Resource Group to which
558
+ # the identity belongs.
559
+ # @param resource_name [String] The name of the identity resource.
560
+ # @param [Hash{String => String}] A hash of custom headers that will be added
561
+ # to the HTTP request.
562
+ #
563
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
564
+ #
565
+ def delete_async(resource_group_name, resource_name, custom_headers = nil)
566
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
567
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
568
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
569
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
570
+
571
+
572
+ request_headers = {}
573
+
574
+ # Set Headers
575
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
576
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
577
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}'
578
+
579
+ request_url = @base_url || @client.base_url
580
+
581
+ options = {
582
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
583
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
584
+ query_params: {'api-version' => @client.api_version},
585
+ headers: request_headers.merge(custom_headers || {}),
586
+ base_url: request_url
587
+ }
588
+ promise = @client.make_request_async(:delete, path_template, options)
589
+
590
+ promise = promise.then do |result|
591
+ http_response = result.response
592
+ status_code = http_response.status
593
+ response_content = http_response.body
594
+ unless status_code == 200 || status_code == 204
595
+ error_model = JSON.load(response_content)
596
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
597
+ end
598
+
599
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
600
+
601
+ result
602
+ end
603
+
604
+ promise.execute
605
+ end
606
+
607
+ #
608
+ # Lists all the userAssignedIdentities available under the specified
609
+ # subscription.
610
+ #
611
+ # @param next_page_link [String] The NextLink from the previous successful call
612
+ # to List operation.
613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
614
+ # will be added to the HTTP request.
615
+ #
616
+ # @return [UserAssignedIdentitiesListResult] operation results.
617
+ #
618
+ def list_by_subscription_next(next_page_link, custom_headers = nil)
619
+ response = list_by_subscription_next_async(next_page_link, custom_headers).value!
620
+ response.body unless response.nil?
621
+ end
622
+
623
+ #
624
+ # Lists all the userAssignedIdentities available under the specified
625
+ # subscription.
626
+ #
627
+ # @param next_page_link [String] The NextLink from the previous successful call
628
+ # to List operation.
629
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
630
+ # will be added to the HTTP request.
631
+ #
632
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
633
+ #
634
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers = nil)
635
+ list_by_subscription_next_async(next_page_link, custom_headers).value!
636
+ end
637
+
638
+ #
639
+ # Lists all the userAssignedIdentities available under the specified
640
+ # subscription.
641
+ #
642
+ # @param next_page_link [String] The NextLink from the previous successful call
643
+ # to List operation.
644
+ # @param [Hash{String => String}] A hash of custom headers that will be added
645
+ # to the HTTP request.
646
+ #
647
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
648
+ #
649
+ def list_by_subscription_next_async(next_page_link, custom_headers = nil)
650
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
651
+
652
+
653
+ request_headers = {}
654
+
655
+ # Set Headers
656
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
657
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
658
+ path_template = '{nextLink}'
659
+
660
+ request_url = @base_url || @client.base_url
661
+
662
+ options = {
663
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
664
+ skip_encoding_path_params: {'nextLink' => next_page_link},
665
+ headers: request_headers.merge(custom_headers || {}),
666
+ base_url: request_url
667
+ }
668
+ promise = @client.make_request_async(:get, path_template, options)
669
+
670
+ promise = promise.then do |result|
671
+ http_response = result.response
672
+ status_code = http_response.status
673
+ response_content = http_response.body
674
+ unless status_code == 200
675
+ error_model = JSON.load(response_content)
676
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
677
+ end
678
+
679
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
680
+ # Deserialize Response
681
+ if status_code == 200
682
+ begin
683
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
684
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult.mapper()
685
+ result.body = @client.deserialize(result_mapper, parsed_response)
686
+ rescue Exception => e
687
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
688
+ end
689
+ end
690
+
691
+ result
692
+ end
693
+
694
+ promise.execute
695
+ end
696
+
697
+ #
698
+ # Lists all the userAssignedIdentities available under the specified
699
+ # ResourceGroup.
700
+ #
701
+ # @param next_page_link [String] The NextLink from the previous successful call
702
+ # to List operation.
703
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
704
+ # will be added to the HTTP request.
705
+ #
706
+ # @return [UserAssignedIdentitiesListResult] operation results.
707
+ #
708
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
709
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
710
+ response.body unless response.nil?
711
+ end
712
+
713
+ #
714
+ # Lists all the userAssignedIdentities available under the specified
715
+ # ResourceGroup.
716
+ #
717
+ # @param next_page_link [String] The NextLink from the previous successful call
718
+ # to List operation.
719
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
720
+ # will be added to the HTTP request.
721
+ #
722
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
723
+ #
724
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
725
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
726
+ end
727
+
728
+ #
729
+ # Lists all the userAssignedIdentities available under the specified
730
+ # ResourceGroup.
731
+ #
732
+ # @param next_page_link [String] The NextLink from the previous successful call
733
+ # to List operation.
734
+ # @param [Hash{String => String}] A hash of custom headers that will be added
735
+ # to the HTTP request.
736
+ #
737
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
738
+ #
739
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
740
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
741
+
742
+
743
+ request_headers = {}
744
+
745
+ # Set Headers
746
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
747
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
748
+ path_template = '{nextLink}'
749
+
750
+ request_url = @base_url || @client.base_url
751
+
752
+ options = {
753
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
754
+ skip_encoding_path_params: {'nextLink' => next_page_link},
755
+ headers: request_headers.merge(custom_headers || {}),
756
+ base_url: request_url
757
+ }
758
+ promise = @client.make_request_async(:get, path_template, options)
759
+
760
+ promise = promise.then do |result|
761
+ http_response = result.response
762
+ status_code = http_response.status
763
+ response_content = http_response.body
764
+ unless status_code == 200
765
+ error_model = JSON.load(response_content)
766
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
767
+ end
768
+
769
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
770
+ # Deserialize Response
771
+ if status_code == 200
772
+ begin
773
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
774
+ result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult.mapper()
775
+ result.body = @client.deserialize(result_mapper, parsed_response)
776
+ rescue Exception => e
777
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
778
+ end
779
+ end
780
+
781
+ result
782
+ end
783
+
784
+ promise.execute
785
+ end
786
+
787
+ #
788
+ # Lists all the userAssignedIdentities available under the specified
789
+ # subscription.
790
+ #
791
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
792
+ # will be added to the HTTP request.
793
+ #
794
+ # @return [UserAssignedIdentitiesListResult] which provide lazy access to pages
795
+ # of the response.
796
+ #
797
+ def list_by_subscription_as_lazy(custom_headers = nil)
798
+ response = list_by_subscription_async(custom_headers).value!
799
+ unless response.nil?
800
+ page = response.body
801
+ page.next_method = Proc.new do |next_page_link|
802
+ list_by_subscription_next_async(next_page_link, custom_headers)
803
+ end
804
+ page
805
+ end
806
+ end
807
+
808
+ #
809
+ # Lists all the userAssignedIdentities available under the specified
810
+ # ResourceGroup.
811
+ #
812
+ # @param resource_group_name [String] The name of the Resource Group to which
813
+ # the identity belongs.
814
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
815
+ # will be added to the HTTP request.
816
+ #
817
+ # @return [UserAssignedIdentitiesListResult] which provide lazy access to pages
818
+ # of the response.
819
+ #
820
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
821
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
822
+ unless response.nil?
823
+ page = response.body
824
+ page.next_method = Proc.new do |next_page_link|
825
+ list_by_resource_group_next_async(next_page_link, custom_headers)
826
+ end
827
+ page
828
+ end
829
+ end
830
+
831
+ end
832
+ end