azure_mgmt_cdn 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_cdn/cdn_management_client.rb +42 -426
  3. data/lib/generated/azure_mgmt_cdn/custom_domains.rb +2 -2
  4. data/lib/generated/azure_mgmt_cdn/edge_nodes.rb +14 -7
  5. data/lib/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +3 -0
  6. data/lib/generated/azure_mgmt_cdn/models/custom_domain.rb +22 -2
  7. data/lib/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +1 -0
  8. data/lib/generated/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb +24 -0
  9. data/lib/generated/azure_mgmt_cdn/models/deep_created_origin.rb +3 -2
  10. data/lib/generated/azure_mgmt_cdn/models/edge_node.rb +2 -1
  11. data/lib/generated/azure_mgmt_cdn/models/edgenode_result.rb +1 -0
  12. data/lib/generated/azure_mgmt_cdn/models/endpoint.rb +27 -8
  13. data/lib/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +2 -1
  14. data/lib/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +28 -9
  15. data/lib/generated/azure_mgmt_cdn/models/error_response.rb +2 -0
  16. data/lib/generated/azure_mgmt_cdn/models/geo_filter.rb +1 -1
  17. data/lib/generated/azure_mgmt_cdn/models/operation.rb +1 -0
  18. data/lib/generated/azure_mgmt_cdn/models/operation_display.rb +3 -0
  19. data/lib/generated/azure_mgmt_cdn/models/{operation_list_result.rb → operations_list_result.rb} +6 -5
  20. data/lib/generated/azure_mgmt_cdn/models/optimization_type.rb +19 -0
  21. data/lib/generated/azure_mgmt_cdn/models/origin_list_result.rb +1 -0
  22. data/lib/generated/azure_mgmt_cdn/models/profile.rb +2 -4
  23. data/lib/generated/azure_mgmt_cdn/models/profile_list_result.rb +1 -0
  24. data/lib/generated/azure_mgmt_cdn/models/resource_usage.rb +7 -3
  25. data/lib/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +1 -0
  26. data/lib/generated/azure_mgmt_cdn/models/sso_uri.rb +3 -1
  27. data/lib/generated/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb +54 -0
  28. data/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +4 -2
  29. data/lib/generated/azure_mgmt_cdn/models/validate_probe_input.rb +45 -0
  30. data/lib/generated/azure_mgmt_cdn/models/validate_probe_output.rb +70 -0
  31. data/lib/generated/azure_mgmt_cdn/operations.rb +215 -0
  32. data/lib/generated/azure_mgmt_cdn/profiles.rb +100 -0
  33. data/lib/generated/azure_mgmt_cdn/resource_usage_operations.rb +224 -0
  34. data/lib/generated/azure_mgmt_cdn/version.rb +1 -1
  35. data/lib/generated/azure_mgmt_cdn.rb +22 -15
  36. metadata +12 -5
@@ -0,0 +1,70 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CDN
7
+ module Models
8
+ #
9
+ # Output of the validate probe API.
10
+ #
11
+ class ValidateProbeOutput
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Boolean] Indicates whether the probe URL is accepted or not.
17
+ attr_accessor :is_valid
18
+
19
+ # @return [String] Specifies the error code when the probe url is not
20
+ # accepted.
21
+ attr_accessor :error_code
22
+
23
+ # @return [String] The detailed error message describing why the probe
24
+ # URL is not accepted.
25
+ attr_accessor :message
26
+
27
+
28
+ #
29
+ # Mapper for ValidateProbeOutput class as Ruby Hash.
30
+ # This will be used for serialization/deserialization.
31
+ #
32
+ def self.mapper()
33
+ {
34
+ required: false,
35
+ serialized_name: 'ValidateProbeOutput',
36
+ type: {
37
+ name: 'Composite',
38
+ class_name: 'ValidateProbeOutput',
39
+ model_properties: {
40
+ is_valid: {
41
+ required: false,
42
+ read_only: true,
43
+ serialized_name: 'isValid',
44
+ type: {
45
+ name: 'Boolean'
46
+ }
47
+ },
48
+ error_code: {
49
+ required: false,
50
+ read_only: true,
51
+ serialized_name: 'errorCode',
52
+ type: {
53
+ name: 'String'
54
+ }
55
+ },
56
+ message: {
57
+ required: false,
58
+ read_only: true,
59
+ serialized_name: 'message',
60
+ type: {
61
+ name: 'String'
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,215 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CDN
7
+ #
8
+ # Use these APIs to manage Azure CDN resources through the Azure Resource
9
+ # Manager. You must make sure that requests made to these resources are
10
+ # secure.
11
+ #
12
+ class Operations
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the Operations class.
17
+ # @param client service class for accessing basic functionality.
18
+ #
19
+ def initialize(client)
20
+ @client = client
21
+ end
22
+
23
+ # @return [CdnManagementClient] reference to the CdnManagementClient
24
+ attr_reader :client
25
+
26
+ #
27
+ # Lists all of the available CDN REST API operations.
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<Operation>] operation results.
33
+ #
34
+ def list(custom_headers = nil)
35
+ first_page = list_as_lazy(custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Lists all of the available CDN REST API operations.
41
+ #
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_with_http_info(custom_headers = nil)
48
+ list_async(custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Lists all of the available CDN REST API operations.
53
+ #
54
+ # @param [Hash{String => String}] A hash of custom headers that will be added
55
+ # to the HTTP request.
56
+ #
57
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
58
+ #
59
+ def list_async(custom_headers = nil)
60
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
61
+
62
+
63
+ request_headers = {}
64
+
65
+ # Set Headers
66
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
+ path_template = 'providers/Microsoft.Cdn/operations'
69
+
70
+ request_url = @base_url || @client.base_url
71
+
72
+ options = {
73
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
74
+ query_params: {'api-version' => @client.api_version},
75
+ headers: request_headers.merge(custom_headers || {}),
76
+ base_url: request_url
77
+ }
78
+ promise = @client.make_request_async(:get, path_template, options)
79
+
80
+ promise = promise.then do |result|
81
+ http_response = result.response
82
+ status_code = http_response.status
83
+ response_content = http_response.body
84
+ unless status_code == 200
85
+ error_model = JSON.load(response_content)
86
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
87
+ end
88
+
89
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
90
+ # Deserialize Response
91
+ if status_code == 200
92
+ begin
93
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
94
+ result_mapper = Azure::ARM::CDN::Models::OperationsListResult.mapper()
95
+ result.body = @client.deserialize(result_mapper, parsed_response)
96
+ rescue Exception => e
97
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
98
+ end
99
+ end
100
+
101
+ result
102
+ end
103
+
104
+ promise.execute
105
+ end
106
+
107
+ #
108
+ # Lists all of the available CDN REST API operations.
109
+ #
110
+ # @param next_page_link [String] The NextLink from the previous successful call
111
+ # to List operation.
112
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
113
+ # will be added to the HTTP request.
114
+ #
115
+ # @return [OperationsListResult] operation results.
116
+ #
117
+ def list_next(next_page_link, custom_headers = nil)
118
+ response = list_next_async(next_page_link, custom_headers).value!
119
+ response.body unless response.nil?
120
+ end
121
+
122
+ #
123
+ # Lists all of the available CDN REST API operations.
124
+ #
125
+ # @param next_page_link [String] The NextLink from the previous successful call
126
+ # to List operation.
127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
128
+ # will be added to the HTTP request.
129
+ #
130
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
131
+ #
132
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
133
+ list_next_async(next_page_link, custom_headers).value!
134
+ end
135
+
136
+ #
137
+ # Lists all of the available CDN REST API operations.
138
+ #
139
+ # @param next_page_link [String] The NextLink from the previous successful call
140
+ # to List operation.
141
+ # @param [Hash{String => String}] A hash of custom headers that will be added
142
+ # to the HTTP request.
143
+ #
144
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
145
+ #
146
+ def list_next_async(next_page_link, custom_headers = nil)
147
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
148
+
149
+
150
+ request_headers = {}
151
+
152
+ # Set Headers
153
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
154
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
155
+ path_template = '{nextLink}'
156
+
157
+ request_url = @base_url || @client.base_url
158
+
159
+ options = {
160
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
161
+ skip_encoding_path_params: {'nextLink' => next_page_link},
162
+ headers: request_headers.merge(custom_headers || {}),
163
+ base_url: request_url
164
+ }
165
+ promise = @client.make_request_async(:get, path_template, options)
166
+
167
+ promise = promise.then do |result|
168
+ http_response = result.response
169
+ status_code = http_response.status
170
+ response_content = http_response.body
171
+ unless status_code == 200
172
+ error_model = JSON.load(response_content)
173
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
174
+ end
175
+
176
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
177
+ # Deserialize Response
178
+ if status_code == 200
179
+ begin
180
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
181
+ result_mapper = Azure::ARM::CDN::Models::OperationsListResult.mapper()
182
+ result.body = @client.deserialize(result_mapper, parsed_response)
183
+ rescue Exception => e
184
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
185
+ end
186
+ end
187
+
188
+ result
189
+ end
190
+
191
+ promise.execute
192
+ end
193
+
194
+ #
195
+ # Lists all of the available CDN REST API operations.
196
+ #
197
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
198
+ # will be added to the HTTP request.
199
+ #
200
+ # @return [OperationsListResult] which provide lazy access to pages of the
201
+ # response.
202
+ #
203
+ def list_as_lazy(custom_headers = nil)
204
+ response = list_async(custom_headers).value!
205
+ unless response.nil?
206
+ page = response.body
207
+ page.next_method = Proc.new do |next_page_link|
208
+ list_next_async(next_page_link, custom_headers)
209
+ end
210
+ page
211
+ end
212
+ end
213
+
214
+ end
215
+ end
@@ -549,6 +549,106 @@ module Azure::ARM::CDN
549
549
  promise.execute
550
550
  end
551
551
 
552
+ #
553
+ # Gets the supported optimization types for the current profile. A user can
554
+ # create an endpoint with an optimization type from the listed values.
555
+ #
556
+ # @param resource_group_name [String] Name of the Resource group within the
557
+ # Azure subscription.
558
+ # @param profile_name [String] Name of the CDN profile which is unique within
559
+ # the resource group.
560
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
561
+ # will be added to the HTTP request.
562
+ #
563
+ # @return [SupportedOptimizationTypesListResult] operation results.
564
+ #
565
+ def list_supported_optimization_types(resource_group_name, profile_name, custom_headers = nil)
566
+ response = list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers).value!
567
+ response.body unless response.nil?
568
+ end
569
+
570
+ #
571
+ # Gets the supported optimization types for the current profile. A user can
572
+ # create an endpoint with an optimization type from the listed values.
573
+ #
574
+ # @param resource_group_name [String] Name of the Resource group within the
575
+ # Azure subscription.
576
+ # @param profile_name [String] Name of the CDN profile which is unique within
577
+ # the resource group.
578
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
579
+ # will be added to the HTTP request.
580
+ #
581
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
582
+ #
583
+ def list_supported_optimization_types_with_http_info(resource_group_name, profile_name, custom_headers = nil)
584
+ list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers).value!
585
+ end
586
+
587
+ #
588
+ # Gets the supported optimization types for the current profile. A user can
589
+ # create an endpoint with an optimization type from the listed values.
590
+ #
591
+ # @param resource_group_name [String] Name of the Resource group within the
592
+ # Azure subscription.
593
+ # @param profile_name [String] Name of the CDN profile which is unique within
594
+ # the resource group.
595
+ # @param [Hash{String => String}] A hash of custom headers that will be added
596
+ # to the HTTP request.
597
+ #
598
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
599
+ #
600
+ def list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers = nil)
601
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
602
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
603
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
604
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
605
+
606
+
607
+ request_headers = {}
608
+
609
+ # Set Headers
610
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
611
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
612
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getSupportedOptimizationTypes'
613
+
614
+ request_url = @base_url || @client.base_url
615
+
616
+ options = {
617
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
618
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
619
+ query_params: {'api-version' => @client.api_version},
620
+ headers: request_headers.merge(custom_headers || {}),
621
+ base_url: request_url
622
+ }
623
+ promise = @client.make_request_async(:post, path_template, options)
624
+
625
+ promise = promise.then do |result|
626
+ http_response = result.response
627
+ status_code = http_response.status
628
+ response_content = http_response.body
629
+ unless status_code == 200
630
+ error_model = JSON.load(response_content)
631
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
632
+ end
633
+
634
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
635
+ # Deserialize Response
636
+ if status_code == 200
637
+ begin
638
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
639
+ result_mapper = Azure::ARM::CDN::Models::SupportedOptimizationTypesListResult.mapper()
640
+ result.body = @client.deserialize(result_mapper, parsed_response)
641
+ rescue Exception => e
642
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
643
+ end
644
+ end
645
+
646
+ result
647
+ end
648
+
649
+ promise.execute
650
+ end
651
+
552
652
  #
553
653
  # Checks the quota and actual usage of endpoints under the given CDN profile.
554
654
  #
@@ -0,0 +1,224 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CDN
7
+ #
8
+ # Use these APIs to manage Azure CDN resources through the Azure Resource
9
+ # Manager. You must make sure that requests made to these resources are
10
+ # secure.
11
+ #
12
+ class ResourceUsageOperations
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the ResourceUsageOperations class.
17
+ # @param client service class for accessing basic functionality.
18
+ #
19
+ def initialize(client)
20
+ @client = client
21
+ end
22
+
23
+ # @return [CdnManagementClient] reference to the CdnManagementClient
24
+ attr_reader :client
25
+
26
+ #
27
+ # Check the quota and actual usage of the CDN profiles under the given
28
+ # subscription.
29
+ #
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<ResourceUsage>] operation results.
34
+ #
35
+ def list(custom_headers = nil)
36
+ first_page = list_as_lazy(custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Check the quota and actual usage of the CDN profiles under the given
42
+ # subscription.
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(custom_headers = nil)
50
+ list_async(custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Check the quota and actual usage of the CDN profiles under the given
55
+ # subscription.
56
+ #
57
+ # @param [Hash{String => String}] A hash of custom headers that will be added
58
+ # to the HTTP request.
59
+ #
60
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
61
+ #
62
+ def list_async(custom_headers = nil)
63
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+
66
+
67
+ request_headers = {}
68
+
69
+ # Set Headers
70
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
71
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
72
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage'
73
+
74
+ request_url = @base_url || @client.base_url
75
+
76
+ options = {
77
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
78
+ path_params: {'subscriptionId' => @client.subscription_id},
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:post, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ # Deserialize Response
96
+ if status_code == 200
97
+ begin
98
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
99
+ result_mapper = Azure::ARM::CDN::Models::ResourceUsageListResult.mapper()
100
+ result.body = @client.deserialize(result_mapper, parsed_response)
101
+ rescue Exception => e
102
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
103
+ end
104
+ end
105
+
106
+ result
107
+ end
108
+
109
+ promise.execute
110
+ end
111
+
112
+ #
113
+ # Check the quota and actual usage of the CDN profiles under the given
114
+ # subscription.
115
+ #
116
+ # @param next_page_link [String] The NextLink from the previous successful call
117
+ # to List operation.
118
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
119
+ # will be added to the HTTP request.
120
+ #
121
+ # @return [ResourceUsageListResult] operation results.
122
+ #
123
+ def list_next(next_page_link, custom_headers = nil)
124
+ response = list_next_async(next_page_link, custom_headers).value!
125
+ response.body unless response.nil?
126
+ end
127
+
128
+ #
129
+ # Check the quota and actual usage of the CDN profiles under the given
130
+ # subscription.
131
+ #
132
+ # @param next_page_link [String] The NextLink from the previous successful call
133
+ # to List operation.
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
138
+ #
139
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
140
+ list_next_async(next_page_link, custom_headers).value!
141
+ end
142
+
143
+ #
144
+ # Check the quota and actual usage of the CDN profiles under the given
145
+ # subscription.
146
+ #
147
+ # @param next_page_link [String] The NextLink from the previous successful call
148
+ # to List operation.
149
+ # @param [Hash{String => String}] A hash of custom headers that will be added
150
+ # to the HTTP request.
151
+ #
152
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
153
+ #
154
+ def list_next_async(next_page_link, custom_headers = nil)
155
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
156
+
157
+
158
+ request_headers = {}
159
+
160
+ # Set Headers
161
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
162
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
163
+ path_template = '{nextLink}'
164
+
165
+ request_url = @base_url || @client.base_url
166
+
167
+ options = {
168
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
169
+ skip_encoding_path_params: {'nextLink' => next_page_link},
170
+ headers: request_headers.merge(custom_headers || {}),
171
+ base_url: request_url
172
+ }
173
+ promise = @client.make_request_async(:post, path_template, options)
174
+
175
+ promise = promise.then do |result|
176
+ http_response = result.response
177
+ status_code = http_response.status
178
+ response_content = http_response.body
179
+ unless status_code == 200
180
+ error_model = JSON.load(response_content)
181
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
182
+ end
183
+
184
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
185
+ # Deserialize Response
186
+ if status_code == 200
187
+ begin
188
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
189
+ result_mapper = Azure::ARM::CDN::Models::ResourceUsageListResult.mapper()
190
+ result.body = @client.deserialize(result_mapper, parsed_response)
191
+ rescue Exception => e
192
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
193
+ end
194
+ end
195
+
196
+ result
197
+ end
198
+
199
+ promise.execute
200
+ end
201
+
202
+ #
203
+ # Check the quota and actual usage of the CDN profiles under the given
204
+ # subscription.
205
+ #
206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
207
+ # will be added to the HTTP request.
208
+ #
209
+ # @return [ResourceUsageListResult] which provide lazy access to pages of the
210
+ # response.
211
+ #
212
+ def list_as_lazy(custom_headers = nil)
213
+ response = list_async(custom_headers).value!
214
+ unless response.nil?
215
+ page = response.body
216
+ page.next_method = Proc.new do |next_page_link|
217
+ list_next_async(next_page_link, custom_headers)
218
+ end
219
+ page
220
+ end
221
+ end
222
+
223
+ end
224
+ end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::CDN
7
- VERSION = '0.11.0'
7
+ VERSION = '0.12.0'
8
8
  end