azure_mgmt_cdn 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_cdn.rb +16 -20
  3. data/lib/generated/azure_mgmt_cdn/cdn_management_client.rb +362 -11
  4. data/lib/generated/azure_mgmt_cdn/custom_domains.rb +240 -234
  5. data/lib/generated/azure_mgmt_cdn/endpoints.rb +735 -572
  6. data/lib/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +1 -1
  7. data/lib/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +4 -4
  8. data/lib/generated/azure_mgmt_cdn/models/custom_domain.rb +42 -10
  9. data/lib/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +45 -2
  10. data/lib/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +3 -2
  11. data/lib/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +1 -1
  12. data/lib/generated/azure_mgmt_cdn/models/deep_created_origin.rb +10 -2
  13. data/lib/generated/azure_mgmt_cdn/models/endpoint.rb +70 -42
  14. data/lib/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +45 -2
  15. data/lib/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +1 -1
  16. data/lib/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +44 -15
  17. data/lib/generated/azure_mgmt_cdn/models/error_response.rb +4 -3
  18. data/lib/generated/azure_mgmt_cdn/models/geo_filter.rb +75 -0
  19. data/lib/generated/azure_mgmt_cdn/models/geo_filter_actions.rb +16 -0
  20. data/lib/generated/azure_mgmt_cdn/models/load_parameters.rb +1 -1
  21. data/lib/generated/azure_mgmt_cdn/models/operation.rb +2 -2
  22. data/lib/generated/azure_mgmt_cdn/models/operation_display.rb +4 -4
  23. data/lib/generated/azure_mgmt_cdn/models/operation_list_result.rb +45 -2
  24. data/lib/generated/azure_mgmt_cdn/models/origin.rb +38 -11
  25. data/lib/generated/azure_mgmt_cdn/models/origin_list_result.rb +45 -2
  26. data/lib/generated/azure_mgmt_cdn/models/origin_resource_state.rb +1 -1
  27. data/lib/generated/azure_mgmt_cdn/models/{origin_parameters.rb → origin_update_parameters.rb} +14 -6
  28. data/lib/generated/azure_mgmt_cdn/models/profile.rb +13 -15
  29. data/lib/generated/azure_mgmt_cdn/models/profile_list_result.rb +45 -2
  30. data/lib/generated/azure_mgmt_cdn/models/profile_resource_state.rb +1 -1
  31. data/lib/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +1 -1
  32. data/lib/generated/azure_mgmt_cdn/models/purge_parameters.rb +1 -1
  33. data/lib/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +1 -1
  34. data/lib/generated/azure_mgmt_cdn/models/resource_type.rb +1 -1
  35. data/lib/generated/azure_mgmt_cdn/models/sku.rb +3 -4
  36. data/lib/generated/azure_mgmt_cdn/models/sku_name.rb +2 -1
  37. data/lib/generated/azure_mgmt_cdn/models/sso_uri.rb +1 -1
  38. data/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +1 -1
  39. data/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +1 -1
  40. data/lib/generated/azure_mgmt_cdn/module_definition.rb +1 -1
  41. data/lib/generated/azure_mgmt_cdn/origins.rb +154 -387
  42. data/lib/generated/azure_mgmt_cdn/profiles.rb +480 -257
  43. data/lib/generated/azure_mgmt_cdn/version.rb +2 -2
  44. metadata +7 -11
  45. data/lib/generated/azure_mgmt_cdn/models/endpoint_create_parameters.rb +0 -173
  46. data/lib/generated/azure_mgmt_cdn/models/profile_create_parameters.rb +0 -72
  47. data/lib/generated/azure_mgmt_cdn/models/provisioning_state.rb +0 -17
  48. data/lib/generated/azure_mgmt_cdn/models/tracked_resource.rb +0 -85
  49. data/lib/generated/azure_mgmt_cdn/name_availability.rb +0 -133
  50. data/lib/generated/azure_mgmt_cdn/operations.rb +0 -111
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -7,9 +7,7 @@ module Azure::ARM::CDN
7
7
  #
8
8
  # Use these APIs to manage Azure CDN resources through the Azure Resource
9
9
  # Manager. You must make sure that requests made to these resources are
10
- # secure. For more information, see <a
11
- # href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx">Authenticating
12
- # Azure Resource Manager requests.</a>
10
+ # secure.
13
11
  #
14
12
  class CustomDomains
15
13
  include Azure::ARM::CDN::Models
@@ -29,55 +27,58 @@ module Azure::ARM::CDN
29
27
  #
30
28
  # Lists the existing CDN custom domains within an endpoint.
31
29
  #
32
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
33
- # @param profile_name [String] Name of the CDN profile within the resource
34
- # group.
35
- # @param resource_group_name [String] Name of the resource group within the
30
+ # @param resource_group_name [String] Name of the Resource group within the
36
31
  # Azure subscription.
32
+ # @param profile_name [String] Name of the CDN profile which is unique within
33
+ # the resource group.
34
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
35
+ # unique globally.
37
36
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
37
  # will be added to the HTTP request.
39
38
  #
40
- # @return [CustomDomainListResult] operation results.
39
+ # @return [Array<CustomDomain>] operation results.
41
40
  #
42
- def list_by_endpoint(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
43
- response = list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
44
- response.body unless response.nil?
41
+ def list_by_endpoint(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
42
+ first_page = list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers)
43
+ first_page.get_all_items
45
44
  end
46
45
 
47
46
  #
48
47
  # Lists the existing CDN custom domains within an endpoint.
49
48
  #
50
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
51
- # @param profile_name [String] Name of the CDN profile within the resource
52
- # group.
53
- # @param resource_group_name [String] Name of the resource group within the
49
+ # @param resource_group_name [String] Name of the Resource group within the
54
50
  # Azure subscription.
51
+ # @param profile_name [String] Name of the CDN profile which is unique within
52
+ # the resource group.
53
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
54
+ # unique globally.
55
55
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
56
56
  # will be added to the HTTP request.
57
57
  #
58
58
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
59
59
  #
60
- def list_by_endpoint_with_http_info(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
61
- list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
60
+ def list_by_endpoint_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
61
+ list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers).value!
62
62
  end
63
63
 
64
64
  #
65
65
  # Lists the existing CDN custom domains within an endpoint.
66
66
  #
67
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
68
- # @param profile_name [String] Name of the CDN profile within the resource
69
- # group.
70
- # @param resource_group_name [String] Name of the resource group within the
67
+ # @param resource_group_name [String] Name of the Resource group within the
71
68
  # Azure subscription.
69
+ # @param profile_name [String] Name of the CDN profile which is unique within
70
+ # the resource group.
71
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
72
+ # unique globally.
72
73
  # @param [Hash{String => String}] A hash of custom headers that will be added
73
74
  # to the HTTP request.
74
75
  #
75
76
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
76
77
  #
77
- def list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
78
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
79
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
78
+ def list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
80
79
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
80
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
81
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
81
82
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
82
83
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
83
84
 
@@ -93,7 +94,7 @@ module Azure::ARM::CDN
93
94
 
94
95
  options = {
95
96
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
- path_params: {'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
97
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'subscriptionId' => @client.subscription_id},
97
98
  query_params: {'api-version' => @client.api_version},
98
99
  headers: request_headers.merge(custom_headers || {}),
99
100
  base_url: request_url
@@ -130,62 +131,65 @@ module Azure::ARM::CDN
130
131
  #
131
132
  # Gets an existing CDN custom domain within an endpoint.
132
133
  #
134
+ # @param resource_group_name [String] Name of the Resource group within the
135
+ # Azure subscription.
136
+ # @param profile_name [String] Name of the CDN profile which is unique within
137
+ # the resource group.
138
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
139
+ # unique globally.
133
140
  # @param custom_domain_name [String] Name of the custom domain within an
134
141
  # endpoint.
135
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
136
- # @param profile_name [String] Name of the CDN profile within the resource
137
- # group.
138
- # @param resource_group_name [String] Name of the resource group within the
139
- # Azure subscription.
140
142
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
143
  # will be added to the HTTP request.
142
144
  #
143
145
  # @return [CustomDomain] operation results.
144
146
  #
145
- def get(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
146
- response = get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
147
+ def get(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
148
+ response = get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
147
149
  response.body unless response.nil?
148
150
  end
149
151
 
150
152
  #
151
153
  # Gets an existing CDN custom domain within an endpoint.
152
154
  #
155
+ # @param resource_group_name [String] Name of the Resource group within the
156
+ # Azure subscription.
157
+ # @param profile_name [String] Name of the CDN profile which is unique within
158
+ # the resource group.
159
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
160
+ # unique globally.
153
161
  # @param custom_domain_name [String] Name of the custom domain within an
154
162
  # endpoint.
155
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
156
- # @param profile_name [String] Name of the CDN profile within the resource
157
- # group.
158
- # @param resource_group_name [String] Name of the resource group within the
159
- # Azure subscription.
160
163
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
161
164
  # will be added to the HTTP request.
162
165
  #
163
166
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
164
167
  #
165
- def get_with_http_info(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
166
- get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
168
+ def get_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
169
+ get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
167
170
  end
168
171
 
169
172
  #
170
173
  # Gets an existing CDN custom domain within an endpoint.
171
174
  #
175
+ # @param resource_group_name [String] Name of the Resource group within the
176
+ # Azure subscription.
177
+ # @param profile_name [String] Name of the CDN profile which is unique within
178
+ # the resource group.
179
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
180
+ # unique globally.
172
181
  # @param custom_domain_name [String] Name of the custom domain within an
173
182
  # endpoint.
174
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
175
- # @param profile_name [String] Name of the CDN profile within the resource
176
- # group.
177
- # @param resource_group_name [String] Name of the resource group within the
178
- # Azure subscription.
179
183
  # @param [Hash{String => String}] A hash of custom headers that will be added
180
184
  # to the HTTP request.
181
185
  #
182
186
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
183
187
  #
184
- def get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
185
- fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
186
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
187
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
188
+ def get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
188
189
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
190
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
191
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
192
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
189
193
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
190
194
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
191
195
 
@@ -201,7 +205,7 @@ module Azure::ARM::CDN
201
205
 
202
206
  options = {
203
207
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
204
- path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
208
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
205
209
  query_params: {'api-version' => @client.api_version},
206
210
  headers: request_headers.merge(custom_headers || {}),
207
211
  base_url: request_url
@@ -238,44 +242,100 @@ module Azure::ARM::CDN
238
242
  #
239
243
  # Creates a new CDN custom domain within an endpoint.
240
244
  #
245
+ # @param resource_group_name [String] Name of the Resource group within the
246
+ # Azure subscription.
247
+ # @param profile_name [String] Name of the CDN profile which is unique within
248
+ # the resource group.
249
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
250
+ # unique globally.
241
251
  # @param custom_domain_name [String] Name of the custom domain within an
242
252
  # endpoint.
243
253
  # @param custom_domain_properties [CustomDomainParameters] Custom domain
244
254
  # properties required for creation.
245
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
246
- # @param profile_name [String] Name of the CDN profile within the resource
247
- # group.
248
- # @param resource_group_name [String] Name of the resource group within the
249
- # Azure subscription.
250
255
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
256
  # will be added to the HTTP request.
252
257
  #
253
258
  # @return [CustomDomain] operation results.
254
259
  #
255
- def create(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
256
- response = create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
260
+ def create(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
261
+ response = create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
257
262
  response.body unless response.nil?
258
263
  end
259
264
 
260
265
  #
266
+ # @param resource_group_name [String] Name of the Resource group within the
267
+ # Azure subscription.
268
+ # @param profile_name [String] Name of the CDN profile which is unique within
269
+ # the resource group.
270
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
271
+ # unique globally.
261
272
  # @param custom_domain_name [String] Name of the custom domain within an
262
273
  # endpoint.
263
274
  # @param custom_domain_properties [CustomDomainParameters] Custom domain
264
275
  # properties required for creation.
265
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
266
- # @param profile_name [String] Name of the CDN profile within the resource
267
- # group.
268
- # @param resource_group_name [String] Name of the resource group within the
276
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
277
+ # will be added to the HTTP request.
278
+ #
279
+ # @return [Concurrent::Promise] promise which provides async access to http
280
+ # response.
281
+ #
282
+ def create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
283
+ # Send request
284
+ promise = begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers)
285
+
286
+ promise = promise.then do |response|
287
+ # Defining deserialization method.
288
+ deserialize_method = lambda do |parsed_response|
289
+ result_mapper = CustomDomain.mapper()
290
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
291
+ end
292
+
293
+ # Waiting for response.
294
+ @client.get_long_running_operation_result(response, deserialize_method)
295
+ end
296
+
297
+ promise
298
+ end
299
+
300
+ #
301
+ # Deletes an existing CDN custom domain within an endpoint.
302
+ #
303
+ # @param resource_group_name [String] Name of the Resource group within the
269
304
  # Azure subscription.
305
+ # @param profile_name [String] Name of the CDN profile which is unique within
306
+ # the resource group.
307
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
308
+ # unique globally.
309
+ # @param custom_domain_name [String] Name of the custom domain within an
310
+ # endpoint.
311
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
312
+ # will be added to the HTTP request.
313
+ #
314
+ # @return [CustomDomain] operation results.
315
+ #
316
+ def delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
317
+ response = delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
318
+ response.body unless response.nil?
319
+ end
320
+
321
+ #
322
+ # @param resource_group_name [String] Name of the Resource group within the
323
+ # Azure subscription.
324
+ # @param profile_name [String] Name of the CDN profile which is unique within
325
+ # the resource group.
326
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
327
+ # unique globally.
328
+ # @param custom_domain_name [String] Name of the custom domain within an
329
+ # endpoint.
270
330
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
331
  # will be added to the HTTP request.
272
332
  #
273
333
  # @return [Concurrent::Promise] promise which provides async access to http
274
334
  # response.
275
335
  #
276
- def create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
336
+ def delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
277
337
  # Send request
278
- promise = begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers)
338
+ promise = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers)
279
339
 
280
340
  promise = promise.then do |response|
281
341
  # Defining deserialization method.
@@ -294,69 +354,72 @@ module Azure::ARM::CDN
294
354
  #
295
355
  # Creates a new CDN custom domain within an endpoint.
296
356
  #
357
+ # @param resource_group_name [String] Name of the Resource group within the
358
+ # Azure subscription.
359
+ # @param profile_name [String] Name of the CDN profile which is unique within
360
+ # the resource group.
361
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
362
+ # unique globally.
297
363
  # @param custom_domain_name [String] Name of the custom domain within an
298
364
  # endpoint.
299
365
  # @param custom_domain_properties [CustomDomainParameters] Custom domain
300
366
  # properties required for creation.
301
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
302
- # @param profile_name [String] Name of the CDN profile within the resource
303
- # group.
304
- # @param resource_group_name [String] Name of the resource group within the
305
- # Azure subscription.
306
367
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
307
368
  # will be added to the HTTP request.
308
369
  #
309
370
  # @return [CustomDomain] operation results.
310
371
  #
311
- def begin_create(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
312
- response = begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
372
+ def begin_create(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
373
+ response = begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
313
374
  response.body unless response.nil?
314
375
  end
315
376
 
316
377
  #
317
378
  # Creates a new CDN custom domain within an endpoint.
318
379
  #
380
+ # @param resource_group_name [String] Name of the Resource group within the
381
+ # Azure subscription.
382
+ # @param profile_name [String] Name of the CDN profile which is unique within
383
+ # the resource group.
384
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
385
+ # unique globally.
319
386
  # @param custom_domain_name [String] Name of the custom domain within an
320
387
  # endpoint.
321
388
  # @param custom_domain_properties [CustomDomainParameters] Custom domain
322
389
  # properties required for creation.
323
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
324
- # @param profile_name [String] Name of the CDN profile within the resource
325
- # group.
326
- # @param resource_group_name [String] Name of the resource group within the
327
- # Azure subscription.
328
390
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
329
391
  # will be added to the HTTP request.
330
392
  #
331
393
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
332
394
  #
333
- def begin_create_with_http_info(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
334
- begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
395
+ def begin_create_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
396
+ begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
335
397
  end
336
398
 
337
399
  #
338
400
  # Creates a new CDN custom domain within an endpoint.
339
401
  #
402
+ # @param resource_group_name [String] Name of the Resource group within the
403
+ # Azure subscription.
404
+ # @param profile_name [String] Name of the CDN profile which is unique within
405
+ # the resource group.
406
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
407
+ # unique globally.
340
408
  # @param custom_domain_name [String] Name of the custom domain within an
341
409
  # endpoint.
342
410
  # @param custom_domain_properties [CustomDomainParameters] Custom domain
343
411
  # properties required for creation.
344
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
345
- # @param profile_name [String] Name of the CDN profile within the resource
346
- # group.
347
- # @param resource_group_name [String] Name of the resource group within the
348
- # Azure subscription.
349
412
  # @param [Hash{String => String}] A hash of custom headers that will be added
350
413
  # to the HTTP request.
351
414
  #
352
415
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
353
416
  #
354
- def begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
417
+ def begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
418
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
419
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
420
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
355
421
  fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
356
422
  fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.nil?
357
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
358
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
359
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
360
423
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
361
424
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
362
425
 
@@ -380,7 +443,7 @@ module Azure::ARM::CDN
380
443
 
381
444
  options = {
382
445
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
383
- path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
446
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
384
447
  query_params: {'api-version' => @client.api_version},
385
448
  body: request_content,
386
449
  headers: request_headers.merge(custom_headers || {}),
@@ -436,71 +499,67 @@ module Azure::ARM::CDN
436
499
  end
437
500
 
438
501
  #
439
- # Updates an existing CDN custom domain within an endpoint.
502
+ # Deletes an existing CDN custom domain within an endpoint.
440
503
  #
504
+ # @param resource_group_name [String] Name of the Resource group within the
505
+ # Azure subscription.
506
+ # @param profile_name [String] Name of the CDN profile which is unique within
507
+ # the resource group.
508
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
509
+ # unique globally.
441
510
  # @param custom_domain_name [String] Name of the custom domain within an
442
511
  # endpoint.
443
- # @param custom_domain_properties [CustomDomainParameters] Custom domain
444
- # properties to update.
445
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
446
- # @param profile_name [String] Name of the CDN profile within the resource
447
- # group.
448
- # @param resource_group_name [String] Name of the resource group within the
449
- # Azure subscription.
450
512
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
513
  # will be added to the HTTP request.
452
514
  #
453
- # @return [ErrorResponse] operation results.
515
+ # @return [CustomDomain] operation results.
454
516
  #
455
- def update(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
456
- response = update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
517
+ def begin_delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
518
+ response = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
457
519
  response.body unless response.nil?
458
520
  end
459
521
 
460
522
  #
461
- # Updates an existing CDN custom domain within an endpoint.
523
+ # Deletes an existing CDN custom domain within an endpoint.
462
524
  #
525
+ # @param resource_group_name [String] Name of the Resource group within the
526
+ # Azure subscription.
527
+ # @param profile_name [String] Name of the CDN profile which is unique within
528
+ # the resource group.
529
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
530
+ # unique globally.
463
531
  # @param custom_domain_name [String] Name of the custom domain within an
464
532
  # endpoint.
465
- # @param custom_domain_properties [CustomDomainParameters] Custom domain
466
- # properties to update.
467
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
468
- # @param profile_name [String] Name of the CDN profile within the resource
469
- # group.
470
- # @param resource_group_name [String] Name of the resource group within the
471
- # Azure subscription.
472
533
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
473
534
  # will be added to the HTTP request.
474
535
  #
475
536
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
476
537
  #
477
- def update_with_http_info(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
478
- update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
538
+ def begin_delete_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
539
+ begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
479
540
  end
480
541
 
481
542
  #
482
- # Updates an existing CDN custom domain within an endpoint.
543
+ # Deletes an existing CDN custom domain within an endpoint.
483
544
  #
545
+ # @param resource_group_name [String] Name of the Resource group within the
546
+ # Azure subscription.
547
+ # @param profile_name [String] Name of the CDN profile which is unique within
548
+ # the resource group.
549
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
550
+ # unique globally.
484
551
  # @param custom_domain_name [String] Name of the custom domain within an
485
552
  # endpoint.
486
- # @param custom_domain_properties [CustomDomainParameters] Custom domain
487
- # properties to update.
488
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
489
- # @param profile_name [String] Name of the CDN profile within the resource
490
- # group.
491
- # @param resource_group_name [String] Name of the resource group within the
492
- # Azure subscription.
493
553
  # @param [Hash{String => String}] A hash of custom headers that will be added
494
554
  # to the HTTP request.
495
555
  #
496
556
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
497
557
  #
498
- def update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
499
- fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
500
- fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.nil?
501
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
502
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
558
+ def begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
503
559
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
560
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
561
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
562
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
504
563
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
505
564
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
506
565
 
@@ -510,44 +569,38 @@ module Azure::ARM::CDN
510
569
  # Set Headers
511
570
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
512
571
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
513
-
514
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
515
-
516
- # Serialize Request
517
- request_mapper = CustomDomainParameters.mapper()
518
- request_content = @client.serialize(request_mapper, custom_domain_properties, 'custom_domain_properties')
519
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
520
-
521
572
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
522
573
 
523
574
  request_url = @base_url || @client.base_url
524
575
 
525
576
  options = {
526
577
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
527
- path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
578
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
528
579
  query_params: {'api-version' => @client.api_version},
529
- body: request_content,
530
580
  headers: request_headers.merge(custom_headers || {}),
531
581
  base_url: request_url
532
582
  }
533
- promise = @client.make_request_async(:patch, path_template, options)
583
+ promise = @client.make_request_async(:delete, path_template, options)
534
584
 
535
585
  promise = promise.then do |result|
536
586
  http_response = result.response
537
587
  status_code = http_response.status
538
588
  response_content = http_response.body
539
- unless status_code >= 200 && status_code < 300
589
+ unless status_code == 200 || status_code == 202 || status_code == 204
540
590
  error_model = JSON.load(response_content)
541
591
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
542
592
  end
543
593
 
544
594
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
545
- begin
546
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
547
- result_mapper = ErrorResponse.mapper()
548
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
549
- rescue Exception => e
550
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
595
+ # Deserialize Response
596
+ if status_code == 202
597
+ begin
598
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
599
+ result_mapper = CustomDomain.mapper()
600
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
601
+ rescue Exception => e
602
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
603
+ end
551
604
  end
552
605
 
553
606
  result
@@ -557,118 +610,46 @@ module Azure::ARM::CDN
557
610
  end
558
611
 
559
612
  #
560
- # Deletes an existing CDN custom domain within an endpoint.
561
- #
562
- # @param custom_domain_name [String] Name of the custom domain within an
563
- # endpoint.
564
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
565
- # @param profile_name [String] Name of the CDN profile within the resource
566
- # group.
567
- # @param resource_group_name [String] Name of the resource group within the
568
- # Azure subscription.
569
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
570
- # will be added to the HTTP request.
571
- #
572
- # @return [CustomDomain] operation results.
573
- #
574
- def delete_if_exists(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
575
- response = delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
576
- response.body unless response.nil?
577
- end
578
-
579
- #
580
- # @param custom_domain_name [String] Name of the custom domain within an
581
- # endpoint.
582
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
583
- # @param profile_name [String] Name of the CDN profile within the resource
584
- # group.
585
- # @param resource_group_name [String] Name of the resource group within the
586
- # Azure subscription.
587
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
588
- # will be added to the HTTP request.
589
- #
590
- # @return [Concurrent::Promise] promise which provides async access to http
591
- # response.
592
- #
593
- def delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
594
- # Send request
595
- promise = begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers)
596
-
597
- promise = promise.then do |response|
598
- # Defining deserialization method.
599
- deserialize_method = lambda do |parsed_response|
600
- result_mapper = CustomDomain.mapper()
601
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
602
- end
603
-
604
- # Waiting for response.
605
- @client.get_long_running_operation_result(response, deserialize_method)
606
- end
607
-
608
- promise
609
- end
610
-
611
- #
612
- # Deletes an existing CDN custom domain within an endpoint.
613
+ # Lists the existing CDN custom domains within an endpoint.
613
614
  #
614
- # @param custom_domain_name [String] Name of the custom domain within an
615
- # endpoint.
616
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
617
- # @param profile_name [String] Name of the CDN profile within the resource
618
- # group.
619
- # @param resource_group_name [String] Name of the resource group within the
620
- # Azure subscription.
615
+ # @param next_page_link [String] The NextLink from the previous successful call
616
+ # to List operation.
621
617
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
622
618
  # will be added to the HTTP request.
623
619
  #
624
- # @return [CustomDomain] operation results.
620
+ # @return [CustomDomainListResult] operation results.
625
621
  #
626
- def begin_delete_if_exists(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
627
- response = begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
622
+ def list_by_endpoint_next(next_page_link, custom_headers = nil)
623
+ response = list_by_endpoint_next_async(next_page_link, custom_headers).value!
628
624
  response.body unless response.nil?
629
625
  end
630
626
 
631
627
  #
632
- # Deletes an existing CDN custom domain within an endpoint.
628
+ # Lists the existing CDN custom domains within an endpoint.
633
629
  #
634
- # @param custom_domain_name [String] Name of the custom domain within an
635
- # endpoint.
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.
630
+ # @param next_page_link [String] The NextLink from the previous successful call
631
+ # to List operation.
641
632
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
642
633
  # will be added to the HTTP request.
643
634
  #
644
635
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
645
636
  #
646
- def begin_delete_if_exists_with_http_info(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
647
- begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
637
+ def list_by_endpoint_next_with_http_info(next_page_link, custom_headers = nil)
638
+ list_by_endpoint_next_async(next_page_link, custom_headers).value!
648
639
  end
649
640
 
650
641
  #
651
- # Deletes an existing CDN custom domain within an endpoint.
642
+ # Lists the existing CDN custom domains within an endpoint.
652
643
  #
653
- # @param custom_domain_name [String] Name of the custom domain within an
654
- # endpoint.
655
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
656
- # @param profile_name [String] Name of the CDN profile within the resource
657
- # group.
658
- # @param resource_group_name [String] Name of the resource group within the
659
- # Azure subscription.
644
+ # @param next_page_link [String] The NextLink from the previous successful call
645
+ # to List operation.
660
646
  # @param [Hash{String => String}] A hash of custom headers that will be added
661
647
  # to the HTTP request.
662
648
  #
663
649
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
664
650
  #
665
- def begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
666
- fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
667
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
668
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
669
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
670
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
671
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
651
+ def list_by_endpoint_next_async(next_page_link, custom_headers = nil)
652
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
672
653
 
673
654
 
674
655
  request_headers = {}
@@ -676,34 +657,33 @@ module Azure::ARM::CDN
676
657
  # Set Headers
677
658
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
678
659
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
679
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
660
+ path_template = '{nextLink}'
680
661
 
681
662
  request_url = @base_url || @client.base_url
682
663
 
683
664
  options = {
684
665
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
685
- path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
686
- query_params: {'api-version' => @client.api_version},
666
+ skip_encoding_path_params: {'nextLink' => next_page_link},
687
667
  headers: request_headers.merge(custom_headers || {}),
688
668
  base_url: request_url
689
669
  }
690
- promise = @client.make_request_async(:delete, path_template, options)
670
+ promise = @client.make_request_async(:get, path_template, options)
691
671
 
692
672
  promise = promise.then do |result|
693
673
  http_response = result.response
694
674
  status_code = http_response.status
695
675
  response_content = http_response.body
696
- unless status_code == 200 || status_code == 202 || status_code == 204
676
+ unless status_code == 200
697
677
  error_model = JSON.load(response_content)
698
678
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
699
679
  end
700
680
 
701
681
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
702
682
  # Deserialize Response
703
- if status_code == 202
683
+ if status_code == 200
704
684
  begin
705
685
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
706
- result_mapper = CustomDomain.mapper()
686
+ result_mapper = CustomDomainListResult.mapper()
707
687
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
708
688
  rescue Exception => e
709
689
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -716,5 +696,31 @@ module Azure::ARM::CDN
716
696
  promise.execute
717
697
  end
718
698
 
699
+ #
700
+ # Lists the existing CDN custom domains within an endpoint.
701
+ #
702
+ # @param resource_group_name [String] Name of the Resource group within the
703
+ # Azure subscription.
704
+ # @param profile_name [String] Name of the CDN profile which is unique within
705
+ # the resource group.
706
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
707
+ # unique globally.
708
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
709
+ # will be added to the HTTP request.
710
+ #
711
+ # @return [CustomDomainListResult] which provide lazy access to pages of the
712
+ # response.
713
+ #
714
+ def list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
715
+ response = list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers).value!
716
+ unless response.nil?
717
+ page = response.body
718
+ page.next_method = Proc.new do |next_page_link|
719
+ list_by_endpoint_next_async(next_page_link, custom_headers)
720
+ end
721
+ page
722
+ end
723
+ end
724
+
719
725
  end
720
726
  end