azure_mgmt_cdn 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +13 -5
  2. data/azure_mgmt_cdn.gemspec +1 -1
  3. data/lib/azure_mgmt_cdn.rb +2 -3
  4. data/lib/azure_mgmt_cdn/cdn_management_client.rb +5 -5
  5. data/lib/azure_mgmt_cdn/custom_domains.rb +293 -72
  6. data/lib/azure_mgmt_cdn/endpoints.rb +573 -142
  7. data/lib/azure_mgmt_cdn/models/check_name_availability_input.rb +3 -3
  8. data/lib/azure_mgmt_cdn/models/check_name_availability_output.rb +6 -6
  9. data/lib/azure_mgmt_cdn/models/custom_domain.rb +3 -3
  10. data/lib/azure_mgmt_cdn/models/custom_domain_list_result.rb +1 -1
  11. data/lib/azure_mgmt_cdn/models/custom_domain_parameters.rb +2 -2
  12. data/lib/azure_mgmt_cdn/models/custom_domain_properties.rb +3 -2
  13. data/lib/azure_mgmt_cdn/models/custom_domain_properties_parameters.rb +3 -2
  14. data/lib/azure_mgmt_cdn/models/custom_domain_resource_state.rb +1 -1
  15. data/lib/azure_mgmt_cdn/models/deep_created_origin.rb +2 -2
  16. data/lib/azure_mgmt_cdn/models/deep_created_origin_properties.rb +6 -5
  17. data/lib/azure_mgmt_cdn/models/endpoint.rb +3 -3
  18. data/lib/azure_mgmt_cdn/models/endpoint_create_parameters.rb +2 -2
  19. data/lib/azure_mgmt_cdn/models/endpoint_list_result.rb +2 -2
  20. data/lib/azure_mgmt_cdn/models/endpoint_properties.rb +12 -12
  21. data/lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb +15 -14
  22. data/lib/azure_mgmt_cdn/models/endpoint_properties_update_parameters.rb +16 -15
  23. data/lib/azure_mgmt_cdn/models/endpoint_resource_state.rb +1 -1
  24. data/lib/azure_mgmt_cdn/models/endpoint_update_parameters.rb +2 -2
  25. data/lib/azure_mgmt_cdn/models/error_response.rb +2 -2
  26. data/lib/azure_mgmt_cdn/models/load_parameters.rb +3 -3
  27. data/lib/azure_mgmt_cdn/models/operation.rb +1 -1
  28. data/lib/azure_mgmt_cdn/models/operation_display.rb +3 -3
  29. data/lib/azure_mgmt_cdn/models/operation_list_result.rb +3 -3
  30. data/lib/azure_mgmt_cdn/models/origin.rb +4 -4
  31. data/lib/azure_mgmt_cdn/models/origin_list_result.rb +1 -1
  32. data/lib/azure_mgmt_cdn/models/origin_parameters.rb +2 -2
  33. data/lib/azure_mgmt_cdn/models/origin_properties.rb +7 -6
  34. data/lib/azure_mgmt_cdn/models/origin_properties_parameters.rb +7 -6
  35. data/lib/azure_mgmt_cdn/models/origin_resource_state.rb +1 -1
  36. data/lib/azure_mgmt_cdn/models/profile.rb +17 -1
  37. data/lib/azure_mgmt_cdn/models/profile_create_parameters.rb +18 -17
  38. data/lib/azure_mgmt_cdn/models/profile_list_result.rb +2 -2
  39. data/lib/azure_mgmt_cdn/models/profile_properties.rb +1 -17
  40. data/lib/azure_mgmt_cdn/models/profile_resource_state.rb +1 -1
  41. data/lib/azure_mgmt_cdn/models/profile_update_parameters.rb +2 -2
  42. data/lib/azure_mgmt_cdn/models/provisioning_state.rb +1 -1
  43. data/lib/azure_mgmt_cdn/models/purge_parameters.rb +3 -3
  44. data/lib/azure_mgmt_cdn/models/query_string_caching_behavior.rb +1 -1
  45. data/lib/azure_mgmt_cdn/models/resource_type.rb +1 -1
  46. data/lib/azure_mgmt_cdn/models/sku.rb +5 -4
  47. data/lib/azure_mgmt_cdn/models/sku_name.rb +5 -3
  48. data/lib/azure_mgmt_cdn/models/sso_uri.rb +3 -3
  49. data/lib/azure_mgmt_cdn/models/tracked_resource.rb +1 -1
  50. data/lib/azure_mgmt_cdn/models/validate_custom_domain_input.rb +4 -3
  51. data/lib/azure_mgmt_cdn/models/validate_custom_domain_output.rb +6 -5
  52. data/lib/azure_mgmt_cdn/module_definition.rb +1 -1
  53. data/lib/azure_mgmt_cdn/name_availability.rb +47 -12
  54. data/lib/azure_mgmt_cdn/operations.rb +34 -7
  55. data/lib/azure_mgmt_cdn/origins.rb +296 -79
  56. data/lib/azure_mgmt_cdn/profiles.rb +358 -84
  57. data/lib/azure_mgmt_cdn/version.rb +2 -2
  58. metadata +25 -21
  59. data/lib/azure_mgmt_cdn/models/profile_properties_create_parameters.rb +0 -63
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -27,19 +27,51 @@ module Azure::ARM::CDN
27
27
  attr_reader :client
28
28
 
29
29
  #
30
- # Lists existing CDN endpoints within a profile
30
+ # Lists existing CDN endpoints within a profile.
31
31
  #
32
32
  # @param profile_name [String] Name of the CDN profile within the resource
33
- # group
33
+ # group.
34
34
  # @param resource_group_name [String] Name of the resource group within the
35
- # Azure subscription
36
- # @param [Hash{String => String}] The hash of custom headers need to be
37
- # applied to HTTP request.
35
+ # Azure subscription.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
38
  #
39
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
40
- # response.
39
+ # @return [EndpointListResult] operation results.
41
40
  #
42
41
  def list_by_profile(profile_name, resource_group_name, custom_headers = nil)
42
+ response = list_by_profile_async(profile_name, resource_group_name, custom_headers).value!
43
+ response.body unless response.nil?
44
+ end
45
+
46
+ #
47
+ # Lists existing CDN endpoints within a profile.
48
+ #
49
+ # @param profile_name [String] Name of the CDN profile within the resource
50
+ # group.
51
+ # @param resource_group_name [String] Name of the resource group within the
52
+ # Azure subscription.
53
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
+ # will be added to the HTTP request.
55
+ #
56
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
57
+ #
58
+ def list_by_profile_with_http_info(profile_name, resource_group_name, custom_headers = nil)
59
+ list_by_profile_async(profile_name, resource_group_name, custom_headers).value!
60
+ end
61
+
62
+ #
63
+ # Lists existing CDN endpoints within a profile.
64
+ #
65
+ # @param profile_name [String] Name of the CDN profile within the resource
66
+ # group.
67
+ # @param resource_group_name [String] Name of the resource group within the
68
+ # Azure subscription.
69
+ # @param [Hash{String => String}] A hash of custom headers that will be added
70
+ # to the HTTP request.
71
+ #
72
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
73
+ #
74
+ def list_by_profile_async(profile_name, resource_group_name, custom_headers = nil)
43
75
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
44
76
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
45
77
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
@@ -56,7 +88,10 @@ module Azure::ARM::CDN
56
88
  query_params: {'api-version' => @client.api_version},
57
89
  headers: request_headers.merge(custom_headers || {})
58
90
  }
59
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
91
+
92
+ request_url = @base_url || @client.base_url
93
+
94
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
60
95
  promise = request.run_promise do |req|
61
96
  @client.credentials.sign_request(req) unless @client.credentials.nil?
62
97
  end
@@ -92,20 +127,54 @@ module Azure::ARM::CDN
92
127
  end
93
128
 
94
129
  #
95
- # Gets an existing CDN endpoint with the specified parameters
130
+ # Gets an existing CDN endpoint with the specified parameters.
96
131
  #
97
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
132
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
98
133
  # @param profile_name [String] Name of the CDN profile within the resource
99
- # group
134
+ # group.
100
135
  # @param resource_group_name [String] Name of the resource group within the
101
- # Azure subscription
102
- # @param [Hash{String => String}] The hash of custom headers need to be
103
- # applied to HTTP request.
136
+ # Azure subscription.
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
104
139
  #
105
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
106
- # response.
140
+ # @return [Endpoint] operation results.
107
141
  #
108
142
  def get(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
143
+ response = get_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
144
+ response.body unless response.nil?
145
+ end
146
+
147
+ #
148
+ # Gets an existing CDN endpoint with the specified parameters.
149
+ #
150
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
151
+ # @param profile_name [String] Name of the CDN profile within the resource
152
+ # group.
153
+ # @param resource_group_name [String] Name of the resource group within the
154
+ # Azure subscription.
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
159
+ #
160
+ def get_with_http_info(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
161
+ get_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
162
+ end
163
+
164
+ #
165
+ # Gets an existing CDN endpoint with the specified parameters.
166
+ #
167
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
168
+ # @param profile_name [String] Name of the CDN profile within the resource
169
+ # group.
170
+ # @param resource_group_name [String] Name of the resource group within the
171
+ # Azure subscription.
172
+ # @param [Hash{String => String}] A hash of custom headers that will be added
173
+ # to the HTTP request.
174
+ #
175
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
176
+ #
177
+ def get_async(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
109
178
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
110
179
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
111
180
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -123,7 +192,10 @@ module Azure::ARM::CDN
123
192
  query_params: {'api-version' => @client.api_version},
124
193
  headers: request_headers.merge(custom_headers || {})
125
194
  }
126
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
195
+
196
+ request_url = @base_url || @client.base_url
197
+
198
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
127
199
  promise = request.run_promise do |req|
128
200
  @client.credentials.sign_request(req) unless @client.credentials.nil?
129
201
  end
@@ -159,17 +231,17 @@ module Azure::ARM::CDN
159
231
  end
160
232
 
161
233
  #
162
- # Creates a new CDN endpoint with the specified parameters
234
+ # Creates a new CDN endpoint with the specified parameters.
163
235
  #
164
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
236
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
165
237
  # @param endpoint_properties [EndpointCreateParameters] Endpoint properties
166
238
  # @param profile_name [String] Name of the CDN profile within the resource
167
- # group
239
+ # group.
168
240
  # @param resource_group_name [String] Name of the resource group within the
169
- # Azure subscription
170
- # @param @client.subscription_id [String] Azure Subscription ID
241
+ # Azure subscription.
242
+ # @param @client.subscription_id [String] Azure Subscription ID.
171
243
  # @param @client.api_version [String] Version of the API to be used with the
172
- # client request, current version is 2015-06-01
244
+ # client request. Current version is 2016-04-02
173
245
  # @param @client.accept_language [String] Gets or sets the preferred language
174
246
  # for the response.
175
247
  #
@@ -178,7 +250,7 @@ module Azure::ARM::CDN
178
250
  #
179
251
  def create(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers = nil)
180
252
  # Send request
181
- promise = begin_create(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers)
253
+ promise = begin_create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers)
182
254
 
183
255
  promise = promise.then do |response|
184
256
  # Defining deserialization method.
@@ -189,28 +261,64 @@ module Azure::ARM::CDN
189
261
  end
190
262
 
191
263
  # Waiting for response.
192
- @client.get_put_operation_result(response, deserialize_method)
264
+ @client.get_long_running_operation_result(response, deserialize_method)
193
265
  end
194
266
 
195
267
  promise
196
268
  end
197
269
 
198
270
  #
199
- # Creates a new CDN endpoint with the specified parameters
271
+ # Creates a new CDN endpoint with the specified parameters.
200
272
  #
201
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
273
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
202
274
  # @param endpoint_properties [EndpointCreateParameters] Endpoint properties
203
275
  # @param profile_name [String] Name of the CDN profile within the resource
204
- # group
276
+ # group.
205
277
  # @param resource_group_name [String] Name of the resource group within the
206
- # Azure subscription
207
- # @param [Hash{String => String}] The hash of custom headers need to be
208
- # applied to HTTP request.
278
+ # Azure subscription.
279
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
280
+ # will be added to the HTTP request.
209
281
  #
210
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
211
- # response.
282
+ # @return [Endpoint] operation results.
212
283
  #
213
284
  def begin_create(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers = nil)
285
+ response = begin_create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers).value!
286
+ response.body unless response.nil?
287
+ end
288
+
289
+ #
290
+ # Creates a new CDN endpoint with the specified parameters.
291
+ #
292
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
293
+ # @param endpoint_properties [EndpointCreateParameters] Endpoint properties
294
+ # @param profile_name [String] Name of the CDN profile within the resource
295
+ # group.
296
+ # @param resource_group_name [String] Name of the resource group within the
297
+ # Azure subscription.
298
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
299
+ # will be added to the HTTP request.
300
+ #
301
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
302
+ #
303
+ def begin_create_with_http_info(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers = nil)
304
+ begin_create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers).value!
305
+ end
306
+
307
+ #
308
+ # Creates a new CDN endpoint with the specified parameters.
309
+ #
310
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
311
+ # @param endpoint_properties [EndpointCreateParameters] Endpoint properties
312
+ # @param profile_name [String] Name of the CDN profile within the resource
313
+ # group.
314
+ # @param resource_group_name [String] Name of the resource group within the
315
+ # Azure subscription.
316
+ # @param [Hash{String => String}] A hash of custom headers that will be added
317
+ # to the HTTP request.
318
+ #
319
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
320
+ #
321
+ def begin_create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers = nil)
214
322
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
215
323
  fail ArgumentError, 'endpoint_properties is nil' if endpoint_properties.nil?
216
324
  endpoint_properties.validate unless endpoint_properties.nil?
@@ -229,7 +337,7 @@ module Azure::ARM::CDN
229
337
  unless endpoint_properties.nil?
230
338
  endpoint_properties = EndpointCreateParameters.serialize_object(endpoint_properties)
231
339
  end
232
- request_content = JSON.generate(endpoint_properties, quirks_mode: true)
340
+ request_content = endpoint_properties != nil ? JSON.generate(endpoint_properties, quirks_mode: true) : nil
233
341
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}'
234
342
  options = {
235
343
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -238,7 +346,10 @@ module Azure::ARM::CDN
238
346
  body: request_content,
239
347
  headers: request_headers.merge(custom_headers || {})
240
348
  }
241
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
349
+
350
+ request_url = @base_url || @client.base_url
351
+
352
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
242
353
  promise = request.run_promise do |req|
243
354
  @client.credentials.sign_request(req) unless @client.credentials.nil?
244
355
  end
@@ -246,7 +357,7 @@ module Azure::ARM::CDN
246
357
  promise = promise.then do |http_response|
247
358
  status_code = http_response.status
248
359
  response_content = http_response.body
249
- unless status_code == 201 || status_code == 202
360
+ unless status_code == 200 || status_code == 201 || status_code == 202
250
361
  error_model = JSON.load(response_content)
251
362
  fail MsRest::HttpOperationError.new(request, http_response, error_model)
252
363
  end
@@ -255,6 +366,18 @@ module Azure::ARM::CDN
255
366
  result = MsRestAzure::AzureOperationResponse.new(request, http_response)
256
367
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
257
368
  # Deserialize Response
369
+ if status_code == 200
370
+ begin
371
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
372
+ unless parsed_response.nil?
373
+ parsed_response = Endpoint.deserialize_object(parsed_response)
374
+ end
375
+ result.body = parsed_response
376
+ rescue Exception => e
377
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
378
+ end
379
+ end
380
+ # Deserialize Response
258
381
  if status_code == 201
259
382
  begin
260
383
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
@@ -291,15 +414,15 @@ module Azure::ARM::CDN
291
414
  # origins, use the Update Origin operation. To update custom domains, use the
292
415
  # Update Custom Domain operation.
293
416
  #
294
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
417
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
295
418
  # @param endpoint_properties [EndpointUpdateParameters] Endpoint properties
296
419
  # @param profile_name [String] Name of the CDN profile within the resource
297
- # group
420
+ # group.
298
421
  # @param resource_group_name [String] Name of the resource group within the
299
- # Azure subscription
300
- # @param @client.subscription_id [String] Azure Subscription ID
422
+ # Azure subscription.
423
+ # @param @client.subscription_id [String] Azure Subscription ID.
301
424
  # @param @client.api_version [String] Version of the API to be used with the
302
- # client request, current version is 2015-06-01
425
+ # client request. Current version is 2016-04-02
303
426
  # @param @client.accept_language [String] Gets or sets the preferred language
304
427
  # for the response.
305
428
  #
@@ -308,7 +431,7 @@ module Azure::ARM::CDN
308
431
  #
309
432
  def update(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers = nil)
310
433
  # Send request
311
- promise = begin_update(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers)
434
+ promise = begin_update_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers)
312
435
 
313
436
  promise = promise.then do |response|
314
437
  # Defining deserialization method.
@@ -319,7 +442,7 @@ module Azure::ARM::CDN
319
442
  end
320
443
 
321
444
  # Waiting for response.
322
- @client.get_put_operation_result(response, deserialize_method)
445
+ @client.get_long_running_operation_result(response, deserialize_method)
323
446
  end
324
447
 
325
448
  promise
@@ -331,19 +454,61 @@ module Azure::ARM::CDN
331
454
  # origins, use the Update Origin operation. To update custom domains, use the
332
455
  # Update Custom Domain operation.
333
456
  #
334
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
457
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
335
458
  # @param endpoint_properties [EndpointUpdateParameters] Endpoint properties
336
459
  # @param profile_name [String] Name of the CDN profile within the resource
337
- # group
460
+ # group.
338
461
  # @param resource_group_name [String] Name of the resource group within the
339
- # Azure subscription
340
- # @param [Hash{String => String}] The hash of custom headers need to be
341
- # applied to HTTP request.
462
+ # Azure subscription.
463
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
464
+ # will be added to the HTTP request.
342
465
  #
343
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
344
- # response.
466
+ # @return [Endpoint] operation results.
345
467
  #
346
468
  def begin_update(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers = nil)
469
+ response = begin_update_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers).value!
470
+ response.body unless response.nil?
471
+ end
472
+
473
+ #
474
+ # Updates an existing CDN endpoint with the specified parameters. Only tags
475
+ # and OriginHostHeader can be updated after creating an endpoint. To update
476
+ # origins, use the Update Origin operation. To update custom domains, use the
477
+ # Update Custom Domain operation.
478
+ #
479
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
480
+ # @param endpoint_properties [EndpointUpdateParameters] Endpoint properties
481
+ # @param profile_name [String] Name of the CDN profile within the resource
482
+ # group.
483
+ # @param resource_group_name [String] Name of the resource group within the
484
+ # Azure subscription.
485
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
486
+ # will be added to the HTTP request.
487
+ #
488
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
489
+ #
490
+ def begin_update_with_http_info(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers = nil)
491
+ begin_update_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers).value!
492
+ end
493
+
494
+ #
495
+ # Updates an existing CDN endpoint with the specified parameters. Only tags
496
+ # and OriginHostHeader can be updated after creating an endpoint. To update
497
+ # origins, use the Update Origin operation. To update custom domains, use the
498
+ # Update Custom Domain operation.
499
+ #
500
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
501
+ # @param endpoint_properties [EndpointUpdateParameters] Endpoint properties
502
+ # @param profile_name [String] Name of the CDN profile within the resource
503
+ # group.
504
+ # @param resource_group_name [String] Name of the resource group within the
505
+ # Azure subscription.
506
+ # @param [Hash{String => String}] A hash of custom headers that will be added
507
+ # to the HTTP request.
508
+ #
509
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
510
+ #
511
+ def begin_update_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers = nil)
347
512
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
348
513
  fail ArgumentError, 'endpoint_properties is nil' if endpoint_properties.nil?
349
514
  endpoint_properties.validate unless endpoint_properties.nil?
@@ -362,7 +527,7 @@ module Azure::ARM::CDN
362
527
  unless endpoint_properties.nil?
363
528
  endpoint_properties = EndpointUpdateParameters.serialize_object(endpoint_properties)
364
529
  end
365
- request_content = JSON.generate(endpoint_properties, quirks_mode: true)
530
+ request_content = endpoint_properties != nil ? JSON.generate(endpoint_properties, quirks_mode: true) : nil
366
531
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}'
367
532
  options = {
368
533
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -371,7 +536,10 @@ module Azure::ARM::CDN
371
536
  body: request_content,
372
537
  headers: request_headers.merge(custom_headers || {})
373
538
  }
374
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :patch, options)
539
+
540
+ request_url = @base_url || @client.base_url
541
+
542
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
375
543
  promise = request.run_promise do |req|
376
544
  @client.credentials.sign_request(req) unless @client.credentials.nil?
377
545
  end
@@ -419,19 +587,19 @@ module Azure::ARM::CDN
419
587
  end
420
588
 
421
589
  #
422
- # deletes an existing CDN endpoint with the specified parameters
590
+ # Deletes an existing CDN endpoint with the specified parameters.
423
591
  #
424
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
592
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
425
593
  # @param profile_name [String] Name of the CDN profile within the resource
426
- # group
594
+ # group.
427
595
  # @param resource_group_name [String] Name of the resource group within the
428
- # Azure subscription
596
+ # Azure subscription.
429
597
  # @return [Concurrent::Promise] promise which provides async access to http
430
598
  # response.
431
599
  #
432
600
  def delete_if_exists(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
433
601
  # Send request
434
- promise = begin_delete_if_exists(endpoint_name, profile_name, resource_group_name, custom_headers)
602
+ promise = begin_delete_if_exists_async(endpoint_name, profile_name, resource_group_name, custom_headers)
435
603
 
436
604
  promise = promise.then do |response|
437
605
  # Defining deserialization method.
@@ -439,27 +607,60 @@ module Azure::ARM::CDN
439
607
  end
440
608
 
441
609
  # Waiting for response.
442
- @client.get_post_or_delete_operation_result(response, deserialize_method)
610
+ @client.get_long_running_operation_result(response, deserialize_method)
443
611
  end
444
612
 
445
613
  promise
446
614
  end
447
615
 
448
616
  #
449
- # deletes an existing CDN endpoint with the specified parameters
617
+ # Deletes an existing CDN endpoint with the specified parameters.
450
618
  #
451
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
619
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
452
620
  # @param profile_name [String] Name of the CDN profile within the resource
453
- # group
621
+ # group.
454
622
  # @param resource_group_name [String] Name of the resource group within the
455
- # Azure subscription
456
- # @param [Hash{String => String}] The hash of custom headers need to be
457
- # applied to HTTP request.
623
+ # Azure subscription.
624
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
625
+ # will be added to the HTTP request.
458
626
  #
459
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
460
- # response.
461
627
  #
462
628
  def begin_delete_if_exists(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
629
+ response = begin_delete_if_exists_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
630
+ nil
631
+ end
632
+
633
+ #
634
+ # Deletes an existing CDN endpoint with the specified parameters.
635
+ #
636
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
637
+ # @param profile_name [String] Name of the CDN profile within the resource
638
+ # group.
639
+ # @param resource_group_name [String] Name of the resource group within the
640
+ # Azure subscription.
641
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
642
+ # will be added to the HTTP request.
643
+ #
644
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
645
+ #
646
+ def begin_delete_if_exists_with_http_info(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
647
+ begin_delete_if_exists_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
648
+ end
649
+
650
+ #
651
+ # Deletes an existing CDN endpoint with the specified parameters.
652
+ #
653
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
654
+ # @param profile_name [String] Name of the CDN profile within the resource
655
+ # group.
656
+ # @param resource_group_name [String] Name of the resource group within the
657
+ # Azure subscription.
658
+ # @param [Hash{String => String}] A hash of custom headers that will be added
659
+ # to the HTTP request.
660
+ #
661
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
662
+ #
663
+ def begin_delete_if_exists_async(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
463
664
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
464
665
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
465
666
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -477,7 +678,10 @@ module Azure::ARM::CDN
477
678
  query_params: {'api-version' => @client.api_version},
478
679
  headers: request_headers.merge(custom_headers || {})
479
680
  }
480
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
681
+
682
+ request_url = @base_url || @client.base_url
683
+
684
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
481
685
  promise = request.run_promise do |req|
482
686
  @client.credentials.sign_request(req) unless @client.credentials.nil?
483
687
  end
@@ -501,47 +705,84 @@ module Azure::ARM::CDN
501
705
  end
502
706
 
503
707
  #
504
- # Starts an existing stopped CDN endpoint
708
+ # Starts an existing stopped CDN endpoint.
505
709
  #
506
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
710
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
507
711
  # @param profile_name [String] Name of the CDN profile within the resource
508
- # group
712
+ # group.
509
713
  # @param resource_group_name [String] Name of the resource group within the
510
- # Azure subscription
714
+ # Azure subscription.
511
715
  # @return [Concurrent::Promise] promise which provides async access to http
512
716
  # response.
513
717
  #
514
718
  def start(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
515
719
  # Send request
516
- promise = begin_start(endpoint_name, profile_name, resource_group_name, custom_headers)
720
+ promise = begin_start_async(endpoint_name, profile_name, resource_group_name, custom_headers)
517
721
 
518
722
  promise = promise.then do |response|
519
723
  # Defining deserialization method.
520
724
  deserialize_method = lambda do |parsed_response|
725
+ unless parsed_response.nil?
726
+ parsed_response = Endpoint.deserialize_object(parsed_response)
727
+ end
521
728
  end
522
729
 
523
730
  # Waiting for response.
524
- @client.get_post_or_delete_operation_result(response, deserialize_method)
731
+ @client.get_long_running_operation_result(response, deserialize_method)
525
732
  end
526
733
 
527
734
  promise
528
735
  end
529
736
 
530
737
  #
531
- # Starts an existing stopped CDN endpoint
738
+ # Starts an existing stopped CDN endpoint.
532
739
  #
533
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
740
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
534
741
  # @param profile_name [String] Name of the CDN profile within the resource
535
- # group
742
+ # group.
536
743
  # @param resource_group_name [String] Name of the resource group within the
537
- # Azure subscription
538
- # @param [Hash{String => String}] The hash of custom headers need to be
539
- # applied to HTTP request.
744
+ # Azure subscription.
745
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
746
+ # will be added to the HTTP request.
540
747
  #
541
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
542
- # response.
748
+ # @return [Endpoint] operation results.
543
749
  #
544
750
  def begin_start(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
751
+ response = begin_start_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
752
+ response.body unless response.nil?
753
+ end
754
+
755
+ #
756
+ # Starts an existing stopped CDN endpoint.
757
+ #
758
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
759
+ # @param profile_name [String] Name of the CDN profile within the resource
760
+ # group.
761
+ # @param resource_group_name [String] Name of the resource group within the
762
+ # Azure subscription.
763
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
764
+ # will be added to the HTTP request.
765
+ #
766
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
767
+ #
768
+ def begin_start_with_http_info(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
769
+ begin_start_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
770
+ end
771
+
772
+ #
773
+ # Starts an existing stopped CDN endpoint.
774
+ #
775
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
776
+ # @param profile_name [String] Name of the CDN profile within the resource
777
+ # group.
778
+ # @param resource_group_name [String] Name of the resource group within the
779
+ # Azure subscription.
780
+ # @param [Hash{String => String}] A hash of custom headers that will be added
781
+ # to the HTTP request.
782
+ #
783
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
784
+ #
785
+ def begin_start_async(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
545
786
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
546
787
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
547
788
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -559,7 +800,10 @@ module Azure::ARM::CDN
559
800
  query_params: {'api-version' => @client.api_version},
560
801
  headers: request_headers.merge(custom_headers || {})
561
802
  }
562
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
803
+
804
+ request_url = @base_url || @client.base_url
805
+
806
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
563
807
  promise = request.run_promise do |req|
564
808
  @client.credentials.sign_request(req) unless @client.credentials.nil?
565
809
  end
@@ -575,6 +819,18 @@ module Azure::ARM::CDN
575
819
  # Create Result
576
820
  result = MsRestAzure::AzureOperationResponse.new(request, http_response)
577
821
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
822
+ # Deserialize Response
823
+ if status_code == 202
824
+ begin
825
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
826
+ unless parsed_response.nil?
827
+ parsed_response = Endpoint.deserialize_object(parsed_response)
828
+ end
829
+ result.body = parsed_response
830
+ rescue Exception => e
831
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
832
+ end
833
+ end
578
834
 
579
835
  result
580
836
  end
@@ -583,47 +839,84 @@ module Azure::ARM::CDN
583
839
  end
584
840
 
585
841
  #
586
- # Stops an existing running CDN endpoint
842
+ # Stops an existing running CDN endpoint.
587
843
  #
588
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
844
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
589
845
  # @param profile_name [String] Name of the CDN profile within the resource
590
- # group
846
+ # group.
591
847
  # @param resource_group_name [String] Name of the resource group within the
592
- # Azure subscription
848
+ # Azure subscription.
593
849
  # @return [Concurrent::Promise] promise which provides async access to http
594
850
  # response.
595
851
  #
596
852
  def stop(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
597
853
  # Send request
598
- promise = begin_stop(endpoint_name, profile_name, resource_group_name, custom_headers)
854
+ promise = begin_stop_async(endpoint_name, profile_name, resource_group_name, custom_headers)
599
855
 
600
856
  promise = promise.then do |response|
601
857
  # Defining deserialization method.
602
858
  deserialize_method = lambda do |parsed_response|
859
+ unless parsed_response.nil?
860
+ parsed_response = Endpoint.deserialize_object(parsed_response)
861
+ end
603
862
  end
604
863
 
605
864
  # Waiting for response.
606
- @client.get_post_or_delete_operation_result(response, deserialize_method)
865
+ @client.get_long_running_operation_result(response, deserialize_method)
607
866
  end
608
867
 
609
868
  promise
610
869
  end
611
870
 
612
871
  #
613
- # Stops an existing running CDN endpoint
872
+ # Stops an existing running CDN endpoint.
614
873
  #
615
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
874
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
616
875
  # @param profile_name [String] Name of the CDN profile within the resource
617
- # group
876
+ # group.
618
877
  # @param resource_group_name [String] Name of the resource group within the
619
- # Azure subscription
620
- # @param [Hash{String => String}] The hash of custom headers need to be
621
- # applied to HTTP request.
878
+ # Azure subscription.
879
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
880
+ # will be added to the HTTP request.
622
881
  #
623
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
624
- # response.
882
+ # @return [Endpoint] operation results.
625
883
  #
626
884
  def begin_stop(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
885
+ response = begin_stop_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
886
+ response.body unless response.nil?
887
+ end
888
+
889
+ #
890
+ # Stops an existing running CDN endpoint.
891
+ #
892
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
893
+ # @param profile_name [String] Name of the CDN profile within the resource
894
+ # group.
895
+ # @param resource_group_name [String] Name of the resource group within the
896
+ # Azure subscription.
897
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
898
+ # will be added to the HTTP request.
899
+ #
900
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
901
+ #
902
+ def begin_stop_with_http_info(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
903
+ begin_stop_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
904
+ end
905
+
906
+ #
907
+ # Stops an existing running CDN endpoint.
908
+ #
909
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
910
+ # @param profile_name [String] Name of the CDN profile within the resource
911
+ # group.
912
+ # @param resource_group_name [String] Name of the resource group within the
913
+ # Azure subscription.
914
+ # @param [Hash{String => String}] A hash of custom headers that will be added
915
+ # to the HTTP request.
916
+ #
917
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
918
+ #
919
+ def begin_stop_async(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
627
920
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
628
921
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
629
922
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -641,7 +934,10 @@ module Azure::ARM::CDN
641
934
  query_params: {'api-version' => @client.api_version},
642
935
  headers: request_headers.merge(custom_headers || {})
643
936
  }
644
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
937
+
938
+ request_url = @base_url || @client.base_url
939
+
940
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
645
941
  promise = request.run_promise do |req|
646
942
  @client.credentials.sign_request(req) unless @client.credentials.nil?
647
943
  end
@@ -657,6 +953,18 @@ module Azure::ARM::CDN
657
953
  # Create Result
658
954
  result = MsRestAzure::AzureOperationResponse.new(request, http_response)
659
955
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
956
+ # Deserialize Response
957
+ if status_code == 202
958
+ begin
959
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
960
+ unless parsed_response.nil?
961
+ parsed_response = Endpoint.deserialize_object(parsed_response)
962
+ end
963
+ result.body = parsed_response
964
+ rescue Exception => e
965
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
966
+ end
967
+ end
660
968
 
661
969
  result
662
970
  end
@@ -665,21 +973,21 @@ module Azure::ARM::CDN
665
973
  end
666
974
 
667
975
  #
668
- # Forcibly purges CDN endpoint content
976
+ # Forcibly purges CDN endpoint content.
669
977
  #
670
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
978
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
671
979
  # @param content_file_paths [PurgeParameters] The path to the content to be
672
980
  # purged. Path can describe a file or directory.
673
981
  # @param profile_name [String] Name of the CDN profile within the resource
674
- # group
982
+ # group.
675
983
  # @param resource_group_name [String] Name of the resource group within the
676
- # Azure subscription
984
+ # Azure subscription.
677
985
  # @return [Concurrent::Promise] promise which provides async access to http
678
986
  # response.
679
987
  #
680
988
  def purge_content(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers = nil)
681
989
  # Send request
682
- promise = begin_purge_content(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers)
990
+ promise = begin_purge_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers)
683
991
 
684
992
  promise = promise.then do |response|
685
993
  # Defining deserialization method.
@@ -687,29 +995,66 @@ module Azure::ARM::CDN
687
995
  end
688
996
 
689
997
  # Waiting for response.
690
- @client.get_post_or_delete_operation_result(response, deserialize_method)
998
+ @client.get_long_running_operation_result(response, deserialize_method)
691
999
  end
692
1000
 
693
1001
  promise
694
1002
  end
695
1003
 
696
1004
  #
697
- # Forcibly purges CDN endpoint content
1005
+ # Forcibly purges CDN endpoint content.
698
1006
  #
699
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
1007
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
700
1008
  # @param content_file_paths [PurgeParameters] The path to the content to be
701
1009
  # purged. Path can describe a file or directory.
702
1010
  # @param profile_name [String] Name of the CDN profile within the resource
703
- # group
1011
+ # group.
704
1012
  # @param resource_group_name [String] Name of the resource group within the
705
- # Azure subscription
706
- # @param [Hash{String => String}] The hash of custom headers need to be
707
- # applied to HTTP request.
1013
+ # Azure subscription.
1014
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1015
+ # will be added to the HTTP request.
708
1016
  #
709
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
710
- # response.
711
1017
  #
712
1018
  def begin_purge_content(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers = nil)
1019
+ response = begin_purge_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers).value!
1020
+ nil
1021
+ end
1022
+
1023
+ #
1024
+ # Forcibly purges CDN endpoint content.
1025
+ #
1026
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
1027
+ # @param content_file_paths [PurgeParameters] The path to the content to be
1028
+ # purged. Path can describe a file or directory.
1029
+ # @param profile_name [String] Name of the CDN profile within the resource
1030
+ # group.
1031
+ # @param resource_group_name [String] Name of the resource group within the
1032
+ # Azure subscription.
1033
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1034
+ # will be added to the HTTP request.
1035
+ #
1036
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1037
+ #
1038
+ def begin_purge_content_with_http_info(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers = nil)
1039
+ begin_purge_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers).value!
1040
+ end
1041
+
1042
+ #
1043
+ # Forcibly purges CDN endpoint content.
1044
+ #
1045
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
1046
+ # @param content_file_paths [PurgeParameters] The path to the content to be
1047
+ # purged. Path can describe a file or directory.
1048
+ # @param profile_name [String] Name of the CDN profile within the resource
1049
+ # group.
1050
+ # @param resource_group_name [String] Name of the resource group within the
1051
+ # Azure subscription.
1052
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1053
+ # to the HTTP request.
1054
+ #
1055
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1056
+ #
1057
+ def begin_purge_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers = nil)
713
1058
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
714
1059
  fail ArgumentError, 'content_file_paths is nil' if content_file_paths.nil?
715
1060
  content_file_paths.validate unless content_file_paths.nil?
@@ -728,7 +1073,7 @@ module Azure::ARM::CDN
728
1073
  unless content_file_paths.nil?
729
1074
  content_file_paths = PurgeParameters.serialize_object(content_file_paths)
730
1075
  end
731
- request_content = JSON.generate(content_file_paths, quirks_mode: true)
1076
+ request_content = content_file_paths != nil ? JSON.generate(content_file_paths, quirks_mode: true) : nil
732
1077
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge'
733
1078
  options = {
734
1079
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -737,7 +1082,10 @@ module Azure::ARM::CDN
737
1082
  body: request_content,
738
1083
  headers: request_headers.merge(custom_headers || {})
739
1084
  }
740
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
1085
+
1086
+ request_url = @base_url || @client.base_url
1087
+
1088
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
741
1089
  promise = request.run_promise do |req|
742
1090
  @client.credentials.sign_request(req) unless @client.credentials.nil?
743
1091
  end
@@ -761,21 +1109,21 @@ module Azure::ARM::CDN
761
1109
  end
762
1110
 
763
1111
  #
764
- # Forcibly pre-loads CDN endpoint content
1112
+ # Forcibly pre-loads CDN endpoint content.
765
1113
  #
766
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
1114
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
767
1115
  # @param content_file_paths [LoadParameters] The path to the content to be
768
1116
  # loaded. Path should describe a file.
769
1117
  # @param profile_name [String] Name of the CDN profile within the resource
770
- # group
1118
+ # group.
771
1119
  # @param resource_group_name [String] Name of the resource group within the
772
- # Azure subscription
1120
+ # Azure subscription.
773
1121
  # @return [Concurrent::Promise] promise which provides async access to http
774
1122
  # response.
775
1123
  #
776
1124
  def load_content(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers = nil)
777
1125
  # Send request
778
- promise = begin_load_content(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers)
1126
+ promise = begin_load_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers)
779
1127
 
780
1128
  promise = promise.then do |response|
781
1129
  # Defining deserialization method.
@@ -783,29 +1131,66 @@ module Azure::ARM::CDN
783
1131
  end
784
1132
 
785
1133
  # Waiting for response.
786
- @client.get_post_or_delete_operation_result(response, deserialize_method)
1134
+ @client.get_long_running_operation_result(response, deserialize_method)
787
1135
  end
788
1136
 
789
1137
  promise
790
1138
  end
791
1139
 
792
1140
  #
793
- # Forcibly pre-loads CDN endpoint content
1141
+ # Forcibly pre-loads CDN endpoint content.
794
1142
  #
795
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
1143
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
796
1144
  # @param content_file_paths [LoadParameters] The path to the content to be
797
1145
  # loaded. Path should describe a file.
798
1146
  # @param profile_name [String] Name of the CDN profile within the resource
799
- # group
1147
+ # group.
800
1148
  # @param resource_group_name [String] Name of the resource group within the
801
- # Azure subscription
802
- # @param [Hash{String => String}] The hash of custom headers need to be
803
- # applied to HTTP request.
1149
+ # Azure subscription.
1150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1151
+ # will be added to the HTTP request.
804
1152
  #
805
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
806
- # response.
807
1153
  #
808
1154
  def begin_load_content(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers = nil)
1155
+ response = begin_load_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers).value!
1156
+ nil
1157
+ end
1158
+
1159
+ #
1160
+ # Forcibly pre-loads CDN endpoint content.
1161
+ #
1162
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
1163
+ # @param content_file_paths [LoadParameters] The path to the content to be
1164
+ # loaded. Path should describe a file.
1165
+ # @param profile_name [String] Name of the CDN profile within the resource
1166
+ # group.
1167
+ # @param resource_group_name [String] Name of the resource group within the
1168
+ # Azure subscription.
1169
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1170
+ # will be added to the HTTP request.
1171
+ #
1172
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1173
+ #
1174
+ def begin_load_content_with_http_info(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers = nil)
1175
+ begin_load_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers).value!
1176
+ end
1177
+
1178
+ #
1179
+ # Forcibly pre-loads CDN endpoint content.
1180
+ #
1181
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
1182
+ # @param content_file_paths [LoadParameters] The path to the content to be
1183
+ # loaded. Path should describe a file.
1184
+ # @param profile_name [String] Name of the CDN profile within the resource
1185
+ # group.
1186
+ # @param resource_group_name [String] Name of the resource group within the
1187
+ # Azure subscription.
1188
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1189
+ # to the HTTP request.
1190
+ #
1191
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1192
+ #
1193
+ def begin_load_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers = nil)
809
1194
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
810
1195
  fail ArgumentError, 'content_file_paths is nil' if content_file_paths.nil?
811
1196
  content_file_paths.validate unless content_file_paths.nil?
@@ -824,7 +1209,7 @@ module Azure::ARM::CDN
824
1209
  unless content_file_paths.nil?
825
1210
  content_file_paths = LoadParameters.serialize_object(content_file_paths)
826
1211
  end
827
- request_content = JSON.generate(content_file_paths, quirks_mode: true)
1212
+ request_content = content_file_paths != nil ? JSON.generate(content_file_paths, quirks_mode: true) : nil
828
1213
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load'
829
1214
  options = {
830
1215
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -833,7 +1218,10 @@ module Azure::ARM::CDN
833
1218
  body: request_content,
834
1219
  headers: request_headers.merge(custom_headers || {})
835
1220
  }
836
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
1221
+
1222
+ request_url = @base_url || @client.base_url
1223
+
1224
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
837
1225
  promise = request.run_promise do |req|
838
1226
  @client.credentials.sign_request(req) unless @client.credentials.nil?
839
1227
  end
@@ -857,23 +1245,63 @@ module Azure::ARM::CDN
857
1245
  end
858
1246
 
859
1247
  #
860
- # Validates a Custom Domain mapping to ensure it maps to the correct CNAME in
861
- # DNS
1248
+ # Validates a custom domain mapping to ensure it maps to the correct CNAME in
1249
+ # DNS.
862
1250
  #
863
- # @param endpoint_name [String] Name of the endpoint within the CDN profile
1251
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
864
1252
  # @param custom_domain_properties [ValidateCustomDomainInput] Custom domain to
865
- # validate
1253
+ # validate.
866
1254
  # @param profile_name [String] Name of the CDN profile within the resource
867
- # group
1255
+ # group.
868
1256
  # @param resource_group_name [String] Name of the resource group within the
869
- # Azure subscription
870
- # @param [Hash{String => String}] The hash of custom headers need to be
871
- # applied to HTTP request.
1257
+ # Azure subscription.
1258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1259
+ # will be added to the HTTP request.
872
1260
  #
873
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
874
- # response.
1261
+ # @return [ValidateCustomDomainOutput] operation results.
875
1262
  #
876
1263
  def validate_custom_domain(endpoint_name, custom_domain_properties, profile_name, resource_group_name, custom_headers = nil)
1264
+ response = validate_custom_domain_async(endpoint_name, custom_domain_properties, profile_name, resource_group_name, custom_headers).value!
1265
+ response.body unless response.nil?
1266
+ end
1267
+
1268
+ #
1269
+ # Validates a custom domain mapping to ensure it maps to the correct CNAME in
1270
+ # DNS.
1271
+ #
1272
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
1273
+ # @param custom_domain_properties [ValidateCustomDomainInput] Custom domain to
1274
+ # validate.
1275
+ # @param profile_name [String] Name of the CDN profile within the resource
1276
+ # group.
1277
+ # @param resource_group_name [String] Name of the resource group within the
1278
+ # Azure subscription.
1279
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1280
+ # will be added to the HTTP request.
1281
+ #
1282
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1283
+ #
1284
+ def validate_custom_domain_with_http_info(endpoint_name, custom_domain_properties, profile_name, resource_group_name, custom_headers = nil)
1285
+ validate_custom_domain_async(endpoint_name, custom_domain_properties, profile_name, resource_group_name, custom_headers).value!
1286
+ end
1287
+
1288
+ #
1289
+ # Validates a custom domain mapping to ensure it maps to the correct CNAME in
1290
+ # DNS.
1291
+ #
1292
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
1293
+ # @param custom_domain_properties [ValidateCustomDomainInput] Custom domain to
1294
+ # validate.
1295
+ # @param profile_name [String] Name of the CDN profile within the resource
1296
+ # group.
1297
+ # @param resource_group_name [String] Name of the resource group within the
1298
+ # Azure subscription.
1299
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1300
+ # to the HTTP request.
1301
+ #
1302
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1303
+ #
1304
+ def validate_custom_domain_async(endpoint_name, custom_domain_properties, profile_name, resource_group_name, custom_headers = nil)
877
1305
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
878
1306
  fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.nil?
879
1307
  custom_domain_properties.validate unless custom_domain_properties.nil?
@@ -892,7 +1320,7 @@ module Azure::ARM::CDN
892
1320
  unless custom_domain_properties.nil?
893
1321
  custom_domain_properties = ValidateCustomDomainInput.serialize_object(custom_domain_properties)
894
1322
  end
895
- request_content = JSON.generate(custom_domain_properties, quirks_mode: true)
1323
+ request_content = custom_domain_properties != nil ? JSON.generate(custom_domain_properties, quirks_mode: true) : nil
896
1324
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain'
897
1325
  options = {
898
1326
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -901,7 +1329,10 @@ module Azure::ARM::CDN
901
1329
  body: request_content,
902
1330
  headers: request_headers.merge(custom_headers || {})
903
1331
  }
904
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
1332
+
1333
+ request_url = @base_url || @client.base_url
1334
+
1335
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
905
1336
  promise = request.run_promise do |req|
906
1337
  @client.credentials.sign_request(req) unless @client.credentials.nil?
907
1338
  end