azure_mgmt_graph 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +5 -13
  2. data/azure_mgmt_graph.gemspec +4 -5
  3. data/lib/azure_mgmt_graph.rb +3 -54
  4. data/lib/generated/azure_mgmt_graph.rb +58 -0
  5. data/lib/{azure_mgmt_graph/application_operations.rb → generated/azure_mgmt_graph/applications.rb} +37 -33
  6. data/lib/{azure_mgmt_graph → generated/azure_mgmt_graph}/graph_rbac_management_client.rb +18 -18
  7. data/lib/{azure_mgmt_graph/group_operations.rb → generated/azure_mgmt_graph/groups.rb} +214 -62
  8. data/lib/generated/azure_mgmt_graph/models/aadobject.rb +142 -0
  9. data/lib/generated/azure_mgmt_graph/models/adgroup.rb +84 -0
  10. data/lib/generated/azure_mgmt_graph/models/application.rb +146 -0
  11. data/lib/generated/azure_mgmt_graph/models/application_create_parameters.rb +137 -0
  12. data/lib/generated/azure_mgmt_graph/models/application_list_result.rb +52 -0
  13. data/lib/generated/azure_mgmt_graph/models/application_update_parameters.rb +126 -0
  14. data/lib/generated/azure_mgmt_graph/models/check_group_membership_parameters.rb +55 -0
  15. data/lib/generated/azure_mgmt_graph/models/check_group_membership_result.rb +46 -0
  16. data/lib/generated/azure_mgmt_graph/models/get_objects_result.rb +93 -0
  17. data/lib/generated/azure_mgmt_graph/models/group_add_member_parameters.rb +48 -0
  18. data/lib/generated/azure_mgmt_graph/models/group_create_parameters.rb +82 -0
  19. data/lib/generated/azure_mgmt_graph/models/group_get_member_groups_parameters.rb +46 -0
  20. data/lib/generated/azure_mgmt_graph/models/group_get_member_groups_result.rb +51 -0
  21. data/lib/generated/azure_mgmt_graph/models/group_list_result.rb +93 -0
  22. data/lib/generated/azure_mgmt_graph/models/key_credential.rb +94 -0
  23. data/lib/generated/azure_mgmt_graph/models/password_credential.rb +74 -0
  24. data/lib/generated/azure_mgmt_graph/models/password_profile.rb +54 -0
  25. data/lib/generated/azure_mgmt_graph/models/service_principal.rb +91 -0
  26. data/lib/generated/azure_mgmt_graph/models/service_principal_create_parameters.rb +54 -0
  27. data/lib/generated/azure_mgmt_graph/models/service_principal_list_result.rb +94 -0
  28. data/lib/generated/azure_mgmt_graph/models/user.rb +104 -0
  29. data/lib/generated/azure_mgmt_graph/models/user_create_parameters.rb +100 -0
  30. data/lib/generated/azure_mgmt_graph/models/user_get_member_groups_parameters.rb +46 -0
  31. data/lib/generated/azure_mgmt_graph/models/user_get_member_groups_result.rb +51 -0
  32. data/lib/generated/azure_mgmt_graph/models/user_list_result.rb +93 -0
  33. data/lib/generated/azure_mgmt_graph/models/user_update_parameters.rb +76 -0
  34. data/lib/{azure_mgmt_graph → generated/azure_mgmt_graph}/module_definition.rb +0 -0
  35. data/lib/generated/azure_mgmt_graph/objects.rb +112 -0
  36. data/lib/{azure_mgmt_graph/service_principal_operations.rb → generated/azure_mgmt_graph/service_principals.rb} +50 -27
  37. data/lib/{azure_mgmt_graph/user_operations.rb → generated/azure_mgmt_graph/users.rb} +243 -115
  38. data/lib/{azure_mgmt_graph → generated/azure_mgmt_graph}/version.rb +1 -1
  39. metadata +56 -74
  40. data/lib/azure_mgmt_graph/models/aadobject.rb +0 -138
  41. data/lib/azure_mgmt_graph/models/adgroup.rb +0 -92
  42. data/lib/azure_mgmt_graph/models/application.rb +0 -122
  43. data/lib/azure_mgmt_graph/models/application_create_parameters.rb +0 -160
  44. data/lib/azure_mgmt_graph/models/application_filter.rb +0 -74
  45. data/lib/azure_mgmt_graph/models/application_list_result.rb +0 -76
  46. data/lib/azure_mgmt_graph/models/get_objects_parameters.rb +0 -77
  47. data/lib/azure_mgmt_graph/models/get_objects_result.rb +0 -85
  48. data/lib/azure_mgmt_graph/models/group_add_member_parameters.rb +0 -56
  49. data/lib/azure_mgmt_graph/models/group_create_parameters.rb +0 -86
  50. data/lib/azure_mgmt_graph/models/group_get_member_groups_parameters.rb +0 -58
  51. data/lib/azure_mgmt_graph/models/group_get_member_groups_result.rb +0 -56
  52. data/lib/azure_mgmt_graph/models/group_list_result.rb +0 -85
  53. data/lib/azure_mgmt_graph/models/key_credential.rb +0 -105
  54. data/lib/azure_mgmt_graph/models/password_credential.rb +0 -87
  55. data/lib/azure_mgmt_graph/models/service_principal.rb +0 -92
  56. data/lib/azure_mgmt_graph/models/service_principal_create_parameters.rb +0 -66
  57. data/lib/azure_mgmt_graph/models/service_principal_list_result.rb +0 -86
  58. data/lib/azure_mgmt_graph/models/user.rb +0 -101
  59. data/lib/azure_mgmt_graph/models/user_create_parameters.rb +0 -103
  60. data/lib/azure_mgmt_graph/models/user_create_parameters_password_profile.rb +0 -65
  61. data/lib/azure_mgmt_graph/models/user_get_member_groups_parameters.rb +0 -58
  62. data/lib/azure_mgmt_graph/models/user_get_member_groups_result.rb +0 -56
  63. data/lib/azure_mgmt_graph/models/user_list_result.rb +0 -85
  64. data/lib/azure_mgmt_graph/object_operations.rb +0 -302
@@ -1,65 +0,0 @@
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
- module Azure::ARM::Graph
7
- module Models
8
- #
9
- # Model object.
10
- #
11
- class UserCreateParametersPasswordProfile
12
-
13
- include MsRestAzure
14
-
15
- # @return [String] Password
16
- attr_accessor :password
17
-
18
- # @return [Boolean] Force change password on next login
19
- attr_accessor :force_change_password_next_login
20
-
21
- #
22
- # Validate the object. Throws ValidationError if validation fails.
23
- #
24
- def validate
25
- fail MsRest::ValidationError, 'property password is nil' if @password.nil?
26
- end
27
-
28
- #
29
- # Serializes given Model object into Ruby Hash.
30
- # @param object Model object to serialize.
31
- # @return [Hash] Serialized object in form of Ruby Hash.
32
- #
33
- def self.serialize_object(object)
34
- object.validate
35
- output_object = {}
36
-
37
- serialized_property = object.password
38
- output_object['password'] = serialized_property unless serialized_property.nil?
39
-
40
- serialized_property = object.force_change_password_next_login
41
- output_object['forceChangePasswordNextLogin'] = serialized_property unless serialized_property.nil?
42
-
43
- output_object
44
- end
45
-
46
- #
47
- # Deserializes given Ruby Hash into Model object.
48
- # @param object [Hash] Ruby Hash object to deserialize.
49
- # @return [UserCreateParametersPasswordProfile] Deserialized object.
50
- #
51
- def self.deserialize_object(object)
52
- return if object.nil?
53
- output_object = UserCreateParametersPasswordProfile.new
54
-
55
- deserialized_property = object['password']
56
- output_object.password = deserialized_property
57
-
58
- deserialized_property = object['forceChangePasswordNextLogin']
59
- output_object.force_change_password_next_login = deserialized_property
60
-
61
- output_object
62
- end
63
- end
64
- end
65
- end
@@ -1,58 +0,0 @@
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
- module Azure::ARM::Graph
7
- module Models
8
- #
9
- # Request parameters for GetMemberGroups API call
10
- #
11
- class UserGetMemberGroupsParameters
12
-
13
- include MsRestAzure
14
-
15
- # @return [Boolean] If true only membership in security enabled groups
16
- # should be checked. Otherwise membership in all groups should be
17
- # checked
18
- attr_accessor :security_enabled_only
19
-
20
- #
21
- # Validate the object. Throws ValidationError if validation fails.
22
- #
23
- def validate
24
- fail MsRest::ValidationError, 'property security_enabled_only is nil' if @security_enabled_only.nil?
25
- end
26
-
27
- #
28
- # Serializes given Model object into Ruby Hash.
29
- # @param object Model object to serialize.
30
- # @return [Hash] Serialized object in form of Ruby Hash.
31
- #
32
- def self.serialize_object(object)
33
- object.validate
34
- output_object = {}
35
-
36
- serialized_property = object.security_enabled_only
37
- output_object['securityEnabledOnly'] = serialized_property unless serialized_property.nil?
38
-
39
- output_object
40
- end
41
-
42
- #
43
- # Deserializes given Ruby Hash into Model object.
44
- # @param object [Hash] Ruby Hash object to deserialize.
45
- # @return [UserGetMemberGroupsParameters] Deserialized object.
46
- #
47
- def self.deserialize_object(object)
48
- return if object.nil?
49
- output_object = UserGetMemberGroupsParameters.new
50
-
51
- deserialized_property = object['securityEnabledOnly']
52
- output_object.security_enabled_only = deserialized_property
53
-
54
- output_object
55
- end
56
- end
57
- end
58
- end
@@ -1,56 +0,0 @@
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
- module Azure::ARM::Graph
7
- module Models
8
- #
9
- # Server response for GetMemberGroups API call
10
- #
11
- class UserGetMemberGroupsResult
12
-
13
- include MsRestAzure
14
-
15
- # @return [Array<String>] Group Ids of which the user is a member
16
- attr_accessor :value
17
-
18
- #
19
- # Validate the object. Throws ValidationError if validation fails.
20
- #
21
- def validate
22
- @value.each{ |e| e.validate if e.respond_to?(:validate) } unless @value.nil?
23
- end
24
-
25
- #
26
- # Serializes given Model object into Ruby Hash.
27
- # @param object Model object to serialize.
28
- # @return [Hash] Serialized object in form of Ruby Hash.
29
- #
30
- def self.serialize_object(object)
31
- object.validate
32
- output_object = {}
33
-
34
- serialized_property = object.value
35
- output_object['value'] = serialized_property unless serialized_property.nil?
36
-
37
- output_object
38
- end
39
-
40
- #
41
- # Deserializes given Ruby Hash into Model object.
42
- # @param object [Hash] Ruby Hash object to deserialize.
43
- # @return [UserGetMemberGroupsResult] Deserialized object.
44
- #
45
- def self.deserialize_object(object)
46
- return if object.nil?
47
- output_object = UserGetMemberGroupsResult.new
48
-
49
- deserialized_property = object['value']
50
- output_object.value = deserialized_property
51
-
52
- output_object
53
- end
54
- end
55
- end
56
- end
@@ -1,85 +0,0 @@
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
- module Azure::ARM::Graph
7
- module Models
8
- #
9
- # Server response for Get tenant users API call
10
- #
11
- class UserListResult
12
-
13
- include MsRestAzure
14
-
15
- # @return [Array<User>] Gets or sets the list of users.
16
- attr_accessor :value
17
-
18
- # @return [String] Gets or sets the URL to get the next set of results.
19
- attr_accessor :odatanext_link
20
-
21
- #
22
- # Validate the object. Throws ValidationError if validation fails.
23
- #
24
- def validate
25
- @value.each{ |e| e.validate if e.respond_to?(:validate) } unless @value.nil?
26
- end
27
-
28
- #
29
- # Serializes given Model object into Ruby Hash.
30
- # @param object Model object to serialize.
31
- # @return [Hash] Serialized object in form of Ruby Hash.
32
- #
33
- def self.serialize_object(object)
34
- object.validate
35
- output_object = {}
36
-
37
- serialized_property = object.value
38
- unless serialized_property.nil?
39
- serializedArray = []
40
- serialized_property.each do |element|
41
- unless element.nil?
42
- element = User.serialize_object(element)
43
- end
44
- serializedArray.push(element)
45
- end
46
- serialized_property = serializedArray
47
- end
48
- output_object['value'] = serialized_property unless serialized_property.nil?
49
-
50
- serialized_property = object.odatanext_link
51
- output_object['odata.nextLink'] = serialized_property unless serialized_property.nil?
52
-
53
- output_object
54
- end
55
-
56
- #
57
- # Deserializes given Ruby Hash into Model object.
58
- # @param object [Hash] Ruby Hash object to deserialize.
59
- # @return [UserListResult] Deserialized object.
60
- #
61
- def self.deserialize_object(object)
62
- return if object.nil?
63
- output_object = UserListResult.new
64
-
65
- deserialized_property = object['value']
66
- unless deserialized_property.nil?
67
- deserialized_array = []
68
- deserialized_property.each do |element1|
69
- unless element1.nil?
70
- element1 = User.deserialize_object(element1)
71
- end
72
- deserialized_array.push(element1)
73
- end
74
- deserialized_property = deserialized_array
75
- end
76
- output_object.value = deserialized_property
77
-
78
- deserialized_property = object['odata.nextLink']
79
- output_object.odatanext_link = deserialized_property
80
-
81
- output_object
82
- end
83
- end
84
- end
85
- end
@@ -1,302 +0,0 @@
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
- module Azure::ARM::Graph
7
- #
8
- # ObjectOperations
9
- #
10
- class ObjectOperations
11
- include Azure::ARM::Graph::Models
12
- include MsRestAzure
13
-
14
- #
15
- # Creates and initializes a new instance of the ObjectOperations class.
16
- # @param client service class for accessing basic functionality.
17
- #
18
- def initialize(client)
19
- @client = client
20
- end
21
-
22
- # @return reference to the GraphRbacManagementClient
23
- attr_reader :client
24
-
25
- #
26
- # Gets the details for current logged in user
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 [AADObject] operation results.
32
- #
33
- def get_current_user(custom_headers = nil)
34
- response = get_current_user_async(custom_headers).value!
35
- response.body unless response.nil?
36
- end
37
-
38
- #
39
- # Gets the details for current logged in user
40
- #
41
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
- # will be added to the HTTP request.
43
- #
44
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
45
- #
46
- def get_current_user_with_http_info(custom_headers = nil)
47
- get_current_user_async(custom_headers).value!
48
- end
49
-
50
- #
51
- # Gets the details for current logged in user
52
- #
53
- # @param [Hash{String => String}] A hash of custom headers that will be added
54
- # to the HTTP request.
55
- #
56
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
57
- #
58
- def get_current_user_async(custom_headers = nil)
59
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
60
- fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
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 = '/{tenantID}/me'
67
- options = {
68
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
69
- path_params: {'tenantID' => @client.tenant_id},
70
- query_params: {'api-version' => @client.api_version},
71
- headers: request_headers.merge(custom_headers || {})
72
- }
73
-
74
- request_url = @base_url || @client.base_url
75
-
76
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
77
- promise = request.run_promise do |req|
78
- @client.credentials.sign_request(req) unless @client.credentials.nil?
79
- end
80
-
81
- promise = promise.then do |http_response|
82
- status_code = http_response.status
83
- response_content = http_response.body
84
- unless status_code == 200
85
- error_model = JSON.load(response_content)
86
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
87
- end
88
-
89
- # Create Result
90
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
91
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
92
- # Deserialize Response
93
- if status_code == 200
94
- begin
95
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
96
- unless parsed_response.nil?
97
- parsed_response = AADObject.deserialize_object(parsed_response)
98
- end
99
- result.body = parsed_response
100
- rescue Exception => e
101
- fail MsRest::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 AD group membership by provided AD object Ids
113
- #
114
- # @param parameters [GetObjectsParameters] Objects filtering parameters.
115
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
- # will be added to the HTTP request.
117
- #
118
- # @return [GetObjectsResult] operation results.
119
- #
120
- def get_objects_by_object_ids(parameters, custom_headers = nil)
121
- response = get_objects_by_object_ids_async(parameters, custom_headers).value!
122
- response.body unless response.nil?
123
- end
124
-
125
- #
126
- # Gets AD group membership by provided AD object Ids
127
- #
128
- # @param parameters [GetObjectsParameters] Objects filtering parameters.
129
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
- # will be added to the HTTP request.
131
- #
132
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
133
- #
134
- def get_objects_by_object_ids_with_http_info(parameters, custom_headers = nil)
135
- get_objects_by_object_ids_async(parameters, custom_headers).value!
136
- end
137
-
138
- #
139
- # Gets AD group membership by provided AD object Ids
140
- #
141
- # @param parameters [GetObjectsParameters] Objects filtering parameters.
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_objects_by_object_ids_async(parameters, custom_headers = nil)
148
- fail ArgumentError, 'parameters is nil' if parameters.nil?
149
- parameters.validate unless parameters.nil?
150
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
151
- fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
152
- request_headers = {}
153
-
154
- # Set Headers
155
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
156
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
157
-
158
- # Serialize Request
159
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
160
- unless parameters.nil?
161
- parameters = GetObjectsParameters.serialize_object(parameters)
162
- end
163
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
164
- path_template = '/{tenantID}/getObjectsByObjectIds'
165
- options = {
166
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
167
- path_params: {'tenantID' => @client.tenant_id},
168
- query_params: {'api-version' => @client.api_version},
169
- body: request_content,
170
- headers: request_headers.merge(custom_headers || {})
171
- }
172
-
173
- request_url = @base_url || @client.base_url
174
-
175
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
176
- promise = request.run_promise do |req|
177
- @client.credentials.sign_request(req) unless @client.credentials.nil?
178
- end
179
-
180
- promise = promise.then do |http_response|
181
- status_code = http_response.status
182
- response_content = http_response.body
183
- unless status_code == 200
184
- error_model = JSON.load(response_content)
185
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
186
- end
187
-
188
- # Create Result
189
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
190
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
191
- # Deserialize Response
192
- if status_code == 200
193
- begin
194
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
195
- unless parsed_response.nil?
196
- parsed_response = GetObjectsResult.deserialize_object(parsed_response)
197
- end
198
- result.body = parsed_response
199
- rescue Exception => e
200
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
201
- end
202
- end
203
-
204
- result
205
- end
206
-
207
- promise.execute
208
- end
209
-
210
- #
211
- # Gets AD group membership by provided AD object Ids
212
- #
213
- # @param next_link [String] Next link for list operation.
214
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
215
- # will be added to the HTTP request.
216
- #
217
- # @return [GetObjectsResult] operation results.
218
- #
219
- def get_objects_by_object_ids_next(next_link, custom_headers = nil)
220
- response = get_objects_by_object_ids_next_async(next_link, custom_headers).value!
221
- response.body unless response.nil?
222
- end
223
-
224
- #
225
- # Gets AD group membership by provided AD object Ids
226
- #
227
- # @param next_link [String] Next link for list operation.
228
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
- # will be added to the HTTP request.
230
- #
231
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
232
- #
233
- def get_objects_by_object_ids_next_with_http_info(next_link, custom_headers = nil)
234
- get_objects_by_object_ids_next_async(next_link, custom_headers).value!
235
- end
236
-
237
- #
238
- # Gets AD group membership by provided AD object Ids
239
- #
240
- # @param next_link [String] Next link for list operation.
241
- # @param [Hash{String => String}] A hash of custom headers that will be added
242
- # to the HTTP request.
243
- #
244
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
245
- #
246
- def get_objects_by_object_ids_next_async(next_link, custom_headers = nil)
247
- fail ArgumentError, 'next_link is nil' if next_link.nil?
248
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
249
- fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
250
- request_headers = {}
251
-
252
- # Set Headers
253
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
254
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
255
- path_template = '/{tenantID}/{nextLink}'
256
- options = {
257
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
258
- path_params: {'tenantID' => @client.tenant_id},
259
- skip_encoding_path_params: {'nextLink' => next_link},
260
- query_params: {'api-version' => @client.api_version},
261
- headers: request_headers.merge(custom_headers || {})
262
- }
263
-
264
- request_url = @base_url || @client.base_url
265
-
266
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
267
- promise = request.run_promise do |req|
268
- @client.credentials.sign_request(req) unless @client.credentials.nil?
269
- end
270
-
271
- promise = promise.then do |http_response|
272
- status_code = http_response.status
273
- response_content = http_response.body
274
- unless status_code == 200
275
- error_model = JSON.load(response_content)
276
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
277
- end
278
-
279
- # Create Result
280
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
281
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
282
- # Deserialize Response
283
- if status_code == 200
284
- begin
285
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
286
- unless parsed_response.nil?
287
- parsed_response = GetObjectsResult.deserialize_object(parsed_response)
288
- end
289
- result.body = parsed_response
290
- rescue Exception => e
291
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
292
- end
293
- end
294
-
295
- result
296
- end
297
-
298
- promise.execute
299
- end
300
-
301
- end
302
- end