haipa_compute 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/1.0/generated/haipa_compute/haipa_compute.rb +136 -136
  3. data/lib/1.0/generated/haipa_compute/machines.rb +578 -578
  4. data/lib/1.0/generated/haipa_compute/models/agent.rb +87 -87
  5. data/lib/1.0/generated/haipa_compute/models/agent_network.rb +93 -93
  6. data/lib/1.0/generated/haipa_compute/models/machine.rb +125 -125
  7. data/lib/1.0/generated/haipa_compute/models/machine_config.rb +102 -91
  8. data/lib/1.0/generated/haipa_compute/models/machine_network.rb +187 -187
  9. data/lib/1.0/generated/haipa_compute/models/machine_network_config.rb +67 -67
  10. data/lib/1.0/generated/haipa_compute/models/machine_subnet_config.rb +47 -47
  11. data/lib/1.0/generated/haipa_compute/models/network.rb +109 -109
  12. data/lib/1.0/generated/haipa_compute/models/odata_value_ienumerable_machine.rb +56 -56
  13. data/lib/1.0/generated/haipa_compute/models/odata_value_ienumerable_operation.rb +56 -56
  14. data/lib/1.0/generated/haipa_compute/models/odata_value_ienumerable_operation_log.rb +56 -56
  15. data/lib/1.0/generated/haipa_compute/models/operation.rb +123 -123
  16. data/lib/1.0/generated/haipa_compute/models/operation_log.rb +81 -81
  17. data/lib/1.0/generated/haipa_compute/models/subnet.rb +144 -144
  18. data/lib/1.0/generated/haipa_compute/models/virtual_machine.rb +90 -90
  19. data/lib/1.0/generated/haipa_compute/models/virtual_machine_config.rb +111 -111
  20. data/lib/1.0/generated/haipa_compute/models/virtual_machine_cpu_config.rb +47 -47
  21. data/lib/1.0/generated/haipa_compute/models/virtual_machine_disk_config.rb +80 -80
  22. data/lib/1.0/generated/haipa_compute/models/virtual_machine_memory_config.rb +69 -69
  23. data/lib/1.0/generated/haipa_compute/models/virtual_machine_network_adapter.rb +92 -92
  24. data/lib/1.0/generated/haipa_compute/models/virtual_machine_network_adapter_config.rb +69 -69
  25. data/lib/1.0/generated/haipa_compute/models/virtual_machine_provisioning_config.rb +58 -58
  26. data/lib/1.0/generated/haipa_compute/module_definition.rb +9 -9
  27. data/lib/1.0/generated/haipa_compute/networks.rb +415 -415
  28. data/lib/1.0/generated/haipa_compute/operations.rb +347 -347
  29. data/lib/1.0/generated/haipa_compute/subnets.rb +100 -100
  30. data/lib/1.0/generated/haipa_compute.rb +53 -53
  31. data/lib/api_configuration.rb +2 -1
  32. data/lib/version.rb +1 -1
  33. metadata +4 -4
@@ -1,415 +1,415 @@
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 Haipa::Client::Compute::V1_0
7
- #
8
- # Haipa management API
9
- #
10
- class Networks
11
- include Haipa::Client
12
-
13
- #
14
- # Creates and initializes a new instance of the Networks class.
15
- # @param client service class for accessing basic functionality.
16
- #
17
- def initialize(client)
18
- @client = client
19
- end
20
-
21
- # @return [HaipaCompute] reference to the HaipaCompute
22
- attr_reader :client
23
-
24
- #
25
- # @param select [String] Limits the properties returned in the result.
26
- # @param expand [String] Indicates the related entities to be represented
27
- # inline. The maximum depth is 2.
28
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
- # will be added to the HTTP request.
30
- #
31
- #
32
- def list(select:nil, expand:nil, custom_headers:nil)
33
- response = list_async(select:select, expand:expand, custom_headers:custom_headers).value!
34
- nil
35
- end
36
-
37
- #
38
- # @param select [String] Limits the properties returned in the result.
39
- # @param expand [String] Indicates the related entities to be represented
40
- # inline. The maximum depth is 2.
41
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
- # will be added to the HTTP request.
43
- #
44
- # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
45
- #
46
- def list_with_http_info(select:nil, expand:nil, custom_headers:nil)
47
- list_async(select:select, expand:expand, custom_headers:custom_headers).value!
48
- end
49
-
50
- #
51
- # @param select [String] Limits the properties returned in the result.
52
- # @param expand [String] Indicates the related entities to be represented
53
- # inline. The maximum depth is 2.
54
- # @param [Hash{String => String}] A hash of custom headers that will be added
55
- # to the HTTP request.
56
- #
57
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
58
- #
59
- def list_async(select:nil, expand:nil, custom_headers:nil)
60
-
61
-
62
- request_headers = {}
63
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
64
-
65
- # Set Headers
66
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
- path_template = 'odata/v1/Networks'
69
-
70
- request_url = @base_url || @client.base_url
71
-
72
- options = {
73
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
74
- query_params: {'$select' => select,'$expand' => expand},
75
- headers: request_headers.merge(custom_headers || {}),
76
- base_url: request_url
77
- }
78
- promise = @client.make_request_async(:get, path_template, options)
79
-
80
- promise = promise.then do |result|
81
- http_response = result.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 Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
87
- end
88
-
89
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
90
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
91
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
92
-
93
- result
94
- end
95
-
96
- promise.execute
97
- end
98
-
99
- #
100
- # @param network [Network]
101
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
102
- # will be added to the HTTP request.
103
- #
104
- #
105
- def create(network:nil, custom_headers:nil)
106
- response = create_async(network:network, custom_headers:custom_headers).value!
107
- nil
108
- end
109
-
110
- #
111
- # @param network [Network]
112
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
113
- # will be added to the HTTP request.
114
- #
115
- # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
116
- #
117
- def create_with_http_info(network:nil, custom_headers:nil)
118
- create_async(network:network, custom_headers:custom_headers).value!
119
- end
120
-
121
- #
122
- # @param network [Network]
123
- # @param [Hash{String => String}] A hash of custom headers that will be added
124
- # to the HTTP request.
125
- #
126
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
127
- #
128
- def create_async(network:nil, custom_headers:nil)
129
-
130
-
131
- request_headers = {}
132
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
133
-
134
- # Set Headers
135
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
136
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
137
-
138
- # Serialize Request
139
- request_mapper = Haipa::Client::Compute::V1_0::Models::Network.mapper()
140
- request_content = @client.serialize(request_mapper, network)
141
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
142
-
143
- path_template = 'odata/v1/Networks'
144
-
145
- request_url = @base_url || @client.base_url
146
-
147
- options = {
148
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
149
- body: request_content,
150
- headers: request_headers.merge(custom_headers || {}),
151
- base_url: request_url
152
- }
153
- promise = @client.make_request_async(:post, path_template, options)
154
-
155
- promise = promise.then do |result|
156
- http_response = result.response
157
- status_code = http_response.status
158
- response_content = http_response.body
159
- unless status_code == 200
160
- error_model = JSON.load(response_content)
161
- fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
162
- end
163
-
164
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
165
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
166
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
167
-
168
- result
169
- end
170
-
171
- promise.execute
172
- end
173
-
174
- #
175
- # @param key
176
- # @param select [String] Limits the properties returned in the result.
177
- # @param expand [String] Indicates the related entities to be represented
178
- # inline. The maximum depth is 2.
179
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
180
- # will be added to the HTTP request.
181
- #
182
- #
183
- def get(key, select:nil, expand:nil, custom_headers:nil)
184
- response = get_async(key, select:select, expand:expand, custom_headers:custom_headers).value!
185
- nil
186
- end
187
-
188
- #
189
- # @param key
190
- # @param select [String] Limits the properties returned in the result.
191
- # @param expand [String] Indicates the related entities to be represented
192
- # inline. The maximum depth is 2.
193
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
- # will be added to the HTTP request.
195
- #
196
- # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
197
- #
198
- def get_with_http_info(key, select:nil, expand:nil, custom_headers:nil)
199
- get_async(key, select:select, expand:expand, custom_headers:custom_headers).value!
200
- end
201
-
202
- #
203
- # @param key
204
- # @param select [String] Limits the properties returned in the result.
205
- # @param expand [String] Indicates the related entities to be represented
206
- # inline. The maximum depth is 2.
207
- # @param [Hash{String => String}] A hash of custom headers that will be added
208
- # to the HTTP request.
209
- #
210
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
211
- #
212
- def get_async(key, select:nil, expand:nil, custom_headers:nil)
213
- fail ArgumentError, 'key is nil' if key.nil?
214
-
215
-
216
- request_headers = {}
217
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
218
-
219
- # Set Headers
220
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
221
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
222
- path_template = 'odata/v1/Networks({key})'
223
-
224
- request_url = @base_url || @client.base_url
225
-
226
- options = {
227
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
228
- path_params: {'key' => key},
229
- query_params: {'$select' => select,'$expand' => expand},
230
- headers: request_headers.merge(custom_headers || {}),
231
- base_url: request_url
232
- }
233
- promise = @client.make_request_async(:get, path_template, options)
234
-
235
- promise = promise.then do |result|
236
- http_response = result.response
237
- status_code = http_response.status
238
- response_content = http_response.body
239
- unless status_code == 200
240
- error_model = JSON.load(response_content)
241
- fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
242
- end
243
-
244
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
245
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
246
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
247
-
248
- result
249
- end
250
-
251
- promise.execute
252
- end
253
-
254
- #
255
- # @param key
256
- # @param update [Network]
257
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
258
- # will be added to the HTTP request.
259
- #
260
- #
261
- def update(key, update:nil, custom_headers:nil)
262
- response = update_async(key, update:update, custom_headers:custom_headers).value!
263
- nil
264
- end
265
-
266
- #
267
- # @param key
268
- # @param update [Network]
269
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
270
- # will be added to the HTTP request.
271
- #
272
- # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
273
- #
274
- def update_with_http_info(key, update:nil, custom_headers:nil)
275
- update_async(key, update:update, custom_headers:custom_headers).value!
276
- end
277
-
278
- #
279
- # @param key
280
- # @param update [Network]
281
- # @param [Hash{String => String}] A hash of custom headers that will be added
282
- # to the HTTP request.
283
- #
284
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
285
- #
286
- def update_async(key, update:nil, custom_headers:nil)
287
- fail ArgumentError, 'key is nil' if key.nil?
288
-
289
-
290
- request_headers = {}
291
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
292
-
293
- # Set Headers
294
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
295
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
296
-
297
- # Serialize Request
298
- request_mapper = Haipa::Client::Compute::V1_0::Models::Network.mapper()
299
- request_content = @client.serialize(request_mapper, update)
300
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
301
-
302
- path_template = 'odata/v1/Networks({key})'
303
-
304
- request_url = @base_url || @client.base_url
305
-
306
- options = {
307
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
308
- path_params: {'key' => key},
309
- body: request_content,
310
- headers: request_headers.merge(custom_headers || {}),
311
- base_url: request_url
312
- }
313
- promise = @client.make_request_async(:put, path_template, options)
314
-
315
- promise = promise.then do |result|
316
- http_response = result.response
317
- status_code = http_response.status
318
- response_content = http_response.body
319
- unless status_code == 200
320
- error_model = JSON.load(response_content)
321
- fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
322
- end
323
-
324
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
325
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
326
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
327
-
328
- result
329
- end
330
-
331
- promise.execute
332
- end
333
-
334
- #
335
- # @param key
336
- # @param product [Network]
337
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
- # will be added to the HTTP request.
339
- #
340
- #
341
- def patch(key, product:nil, custom_headers:nil)
342
- response = patch_async(key, product:product, custom_headers:custom_headers).value!
343
- nil
344
- end
345
-
346
- #
347
- # @param key
348
- # @param product [Network]
349
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
350
- # will be added to the HTTP request.
351
- #
352
- # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
353
- #
354
- def patch_with_http_info(key, product:nil, custom_headers:nil)
355
- patch_async(key, product:product, custom_headers:custom_headers).value!
356
- end
357
-
358
- #
359
- # @param key
360
- # @param product [Network]
361
- # @param [Hash{String => String}] A hash of custom headers that will be added
362
- # to the HTTP request.
363
- #
364
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
365
- #
366
- def patch_async(key, product:nil, custom_headers:nil)
367
- fail ArgumentError, 'key is nil' if key.nil?
368
-
369
-
370
- request_headers = {}
371
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
372
-
373
- # Set Headers
374
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
375
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
376
-
377
- # Serialize Request
378
- request_mapper = Haipa::Client::Compute::V1_0::Models::Network.mapper()
379
- request_content = @client.serialize(request_mapper, product)
380
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
381
-
382
- path_template = 'odata/v1/Networks({key})'
383
-
384
- request_url = @base_url || @client.base_url
385
-
386
- options = {
387
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
388
- path_params: {'key' => key},
389
- body: request_content,
390
- headers: request_headers.merge(custom_headers || {}),
391
- base_url: request_url
392
- }
393
- promise = @client.make_request_async(:patch, path_template, options)
394
-
395
- promise = promise.then do |result|
396
- http_response = result.response
397
- status_code = http_response.status
398
- response_content = http_response.body
399
- unless status_code == 200
400
- error_model = JSON.load(response_content)
401
- fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
402
- end
403
-
404
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
405
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
406
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
407
-
408
- result
409
- end
410
-
411
- promise.execute
412
- end
413
-
414
- end
415
- end
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 Haipa::Client::Compute::V1_0
7
+ #
8
+ # Haipa management API
9
+ #
10
+ class Networks
11
+ include Haipa::Client
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Networks class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [HaipaCompute] reference to the HaipaCompute
22
+ attr_reader :client
23
+
24
+ #
25
+ # @param select [String] Limits the properties returned in the result.
26
+ # @param expand [String] Indicates the related entities to be represented
27
+ # inline. The maximum depth is 2.
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ #
32
+ def list(select:nil, expand:nil, custom_headers:nil)
33
+ response = list_async(select:select, expand:expand, custom_headers:custom_headers).value!
34
+ nil
35
+ end
36
+
37
+ #
38
+ # @param select [String] Limits the properties returned in the result.
39
+ # @param expand [String] Indicates the related entities to be represented
40
+ # inline. The maximum depth is 2.
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
45
+ #
46
+ def list_with_http_info(select:nil, expand:nil, custom_headers:nil)
47
+ list_async(select:select, expand:expand, custom_headers:custom_headers).value!
48
+ end
49
+
50
+ #
51
+ # @param select [String] Limits the properties returned in the result.
52
+ # @param expand [String] Indicates the related entities to be represented
53
+ # inline. The maximum depth is 2.
54
+ # @param [Hash{String => String}] A hash of custom headers that will be added
55
+ # to the HTTP request.
56
+ #
57
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
58
+ #
59
+ def list_async(select:nil, expand:nil, custom_headers:nil)
60
+
61
+
62
+ request_headers = {}
63
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
64
+
65
+ # Set Headers
66
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
+ path_template = 'odata/v1/Networks'
69
+
70
+ request_url = @base_url || @client.base_url
71
+
72
+ options = {
73
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
74
+ query_params: {'$select' => select,'$expand' => expand},
75
+ headers: request_headers.merge(custom_headers || {}),
76
+ base_url: request_url
77
+ }
78
+ promise = @client.make_request_async(:get, path_template, options)
79
+
80
+ promise = promise.then do |result|
81
+ http_response = result.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 Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
87
+ end
88
+
89
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
90
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
91
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
92
+
93
+ result
94
+ end
95
+
96
+ promise.execute
97
+ end
98
+
99
+ #
100
+ # @param network [Network]
101
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
102
+ # will be added to the HTTP request.
103
+ #
104
+ #
105
+ def create(network:nil, custom_headers:nil)
106
+ response = create_async(network:network, custom_headers:custom_headers).value!
107
+ nil
108
+ end
109
+
110
+ #
111
+ # @param network [Network]
112
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
113
+ # will be added to the HTTP request.
114
+ #
115
+ # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
116
+ #
117
+ def create_with_http_info(network:nil, custom_headers:nil)
118
+ create_async(network:network, custom_headers:custom_headers).value!
119
+ end
120
+
121
+ #
122
+ # @param network [Network]
123
+ # @param [Hash{String => String}] A hash of custom headers that will be added
124
+ # to the HTTP request.
125
+ #
126
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
127
+ #
128
+ def create_async(network:nil, custom_headers:nil)
129
+
130
+
131
+ request_headers = {}
132
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
133
+
134
+ # Set Headers
135
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
136
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
137
+
138
+ # Serialize Request
139
+ request_mapper = Haipa::Client::Compute::V1_0::Models::Network.mapper()
140
+ request_content = @client.serialize(request_mapper, network)
141
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
142
+
143
+ path_template = 'odata/v1/Networks'
144
+
145
+ request_url = @base_url || @client.base_url
146
+
147
+ options = {
148
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
149
+ body: request_content,
150
+ headers: request_headers.merge(custom_headers || {}),
151
+ base_url: request_url
152
+ }
153
+ promise = @client.make_request_async(:post, path_template, options)
154
+
155
+ promise = promise.then do |result|
156
+ http_response = result.response
157
+ status_code = http_response.status
158
+ response_content = http_response.body
159
+ unless status_code == 200
160
+ error_model = JSON.load(response_content)
161
+ fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
162
+ end
163
+
164
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
165
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
166
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
167
+
168
+ result
169
+ end
170
+
171
+ promise.execute
172
+ end
173
+
174
+ #
175
+ # @param key
176
+ # @param select [String] Limits the properties returned in the result.
177
+ # @param expand [String] Indicates the related entities to be represented
178
+ # inline. The maximum depth is 2.
179
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
180
+ # will be added to the HTTP request.
181
+ #
182
+ #
183
+ def get(key, select:nil, expand:nil, custom_headers:nil)
184
+ response = get_async(key, select:select, expand:expand, custom_headers:custom_headers).value!
185
+ nil
186
+ end
187
+
188
+ #
189
+ # @param key
190
+ # @param select [String] Limits the properties returned in the result.
191
+ # @param expand [String] Indicates the related entities to be represented
192
+ # inline. The maximum depth is 2.
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
197
+ #
198
+ def get_with_http_info(key, select:nil, expand:nil, custom_headers:nil)
199
+ get_async(key, select:select, expand:expand, custom_headers:custom_headers).value!
200
+ end
201
+
202
+ #
203
+ # @param key
204
+ # @param select [String] Limits the properties returned in the result.
205
+ # @param expand [String] Indicates the related entities to be represented
206
+ # inline. The maximum depth is 2.
207
+ # @param [Hash{String => String}] A hash of custom headers that will be added
208
+ # to the HTTP request.
209
+ #
210
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
211
+ #
212
+ def get_async(key, select:nil, expand:nil, custom_headers:nil)
213
+ fail ArgumentError, 'key is nil' if key.nil?
214
+
215
+
216
+ request_headers = {}
217
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
218
+
219
+ # Set Headers
220
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
221
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
222
+ path_template = 'odata/v1/Networks({key})'
223
+
224
+ request_url = @base_url || @client.base_url
225
+
226
+ options = {
227
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
228
+ path_params: {'key' => key},
229
+ query_params: {'$select' => select,'$expand' => expand},
230
+ headers: request_headers.merge(custom_headers || {}),
231
+ base_url: request_url
232
+ }
233
+ promise = @client.make_request_async(:get, path_template, options)
234
+
235
+ promise = promise.then do |result|
236
+ http_response = result.response
237
+ status_code = http_response.status
238
+ response_content = http_response.body
239
+ unless status_code == 200
240
+ error_model = JSON.load(response_content)
241
+ fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
242
+ end
243
+
244
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
245
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
246
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
247
+
248
+ result
249
+ end
250
+
251
+ promise.execute
252
+ end
253
+
254
+ #
255
+ # @param key
256
+ # @param update [Network]
257
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
258
+ # will be added to the HTTP request.
259
+ #
260
+ #
261
+ def update(key, update:nil, custom_headers:nil)
262
+ response = update_async(key, update:update, custom_headers:custom_headers).value!
263
+ nil
264
+ end
265
+
266
+ #
267
+ # @param key
268
+ # @param update [Network]
269
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
270
+ # will be added to the HTTP request.
271
+ #
272
+ # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
273
+ #
274
+ def update_with_http_info(key, update:nil, custom_headers:nil)
275
+ update_async(key, update:update, custom_headers:custom_headers).value!
276
+ end
277
+
278
+ #
279
+ # @param key
280
+ # @param update [Network]
281
+ # @param [Hash{String => String}] A hash of custom headers that will be added
282
+ # to the HTTP request.
283
+ #
284
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
285
+ #
286
+ def update_async(key, update:nil, custom_headers:nil)
287
+ fail ArgumentError, 'key is nil' if key.nil?
288
+
289
+
290
+ request_headers = {}
291
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
292
+
293
+ # Set Headers
294
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
295
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
296
+
297
+ # Serialize Request
298
+ request_mapper = Haipa::Client::Compute::V1_0::Models::Network.mapper()
299
+ request_content = @client.serialize(request_mapper, update)
300
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
301
+
302
+ path_template = 'odata/v1/Networks({key})'
303
+
304
+ request_url = @base_url || @client.base_url
305
+
306
+ options = {
307
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
308
+ path_params: {'key' => key},
309
+ body: request_content,
310
+ headers: request_headers.merge(custom_headers || {}),
311
+ base_url: request_url
312
+ }
313
+ promise = @client.make_request_async(:put, path_template, options)
314
+
315
+ promise = promise.then do |result|
316
+ http_response = result.response
317
+ status_code = http_response.status
318
+ response_content = http_response.body
319
+ unless status_code == 200
320
+ error_model = JSON.load(response_content)
321
+ fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
322
+ end
323
+
324
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
325
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
326
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
327
+
328
+ result
329
+ end
330
+
331
+ promise.execute
332
+ end
333
+
334
+ #
335
+ # @param key
336
+ # @param product [Network]
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ #
341
+ def patch(key, product:nil, custom_headers:nil)
342
+ response = patch_async(key, product:product, custom_headers:custom_headers).value!
343
+ nil
344
+ end
345
+
346
+ #
347
+ # @param key
348
+ # @param product [Network]
349
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
350
+ # will be added to the HTTP request.
351
+ #
352
+ # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
353
+ #
354
+ def patch_with_http_info(key, product:nil, custom_headers:nil)
355
+ patch_async(key, product:product, custom_headers:custom_headers).value!
356
+ end
357
+
358
+ #
359
+ # @param key
360
+ # @param product [Network]
361
+ # @param [Hash{String => String}] A hash of custom headers that will be added
362
+ # to the HTTP request.
363
+ #
364
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
365
+ #
366
+ def patch_async(key, product:nil, custom_headers:nil)
367
+ fail ArgumentError, 'key is nil' if key.nil?
368
+
369
+
370
+ request_headers = {}
371
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
372
+
373
+ # Set Headers
374
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
375
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
376
+
377
+ # Serialize Request
378
+ request_mapper = Haipa::Client::Compute::V1_0::Models::Network.mapper()
379
+ request_content = @client.serialize(request_mapper, product)
380
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
381
+
382
+ path_template = 'odata/v1/Networks({key})'
383
+
384
+ request_url = @base_url || @client.base_url
385
+
386
+ options = {
387
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
388
+ path_params: {'key' => key},
389
+ body: request_content,
390
+ headers: request_headers.merge(custom_headers || {}),
391
+ base_url: request_url
392
+ }
393
+ promise = @client.make_request_async(:patch, path_template, options)
394
+
395
+ promise = promise.then do |result|
396
+ http_response = result.response
397
+ status_code = http_response.status
398
+ response_content = http_response.body
399
+ unless status_code == 200
400
+ error_model = JSON.load(response_content)
401
+ fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
402
+ end
403
+
404
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
405
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
406
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
407
+
408
+ result
409
+ end
410
+
411
+ promise.execute
412
+ end
413
+
414
+ end
415
+ end