diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn.rb index 1062d6c5f5..9ef76f847c 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn.rb @@ -24,36 +24,41 @@ module Azure::ARM::CDN autoload :Endpoints, 'generated/azure_mgmt_cdn/endpoints.rb' autoload :Origins, 'generated/azure_mgmt_cdn/origins.rb' autoload :CustomDomains, 'generated/azure_mgmt_cdn/custom_domains.rb' + autoload :ResourceUsageOperations, 'generated/azure_mgmt_cdn/resource_usage_operations.rb' + autoload :Operations, 'generated/azure_mgmt_cdn/operations.rb' autoload :EdgeNodes, 'generated/azure_mgmt_cdn/edge_nodes.rb' autoload :CdnManagementClient, 'generated/azure_mgmt_cdn/cdn_management_client.rb' module Models - autoload :CustomDomainParameters, 'generated/azure_mgmt_cdn/models/custom_domain_parameters.rb' autoload :CustomDomainListResult, 'generated/azure_mgmt_cdn/models/custom_domain_list_result.rb' - autoload :ProfileListResult, 'generated/azure_mgmt_cdn/models/profile_list_result.rb' autoload :Sku, 'generated/azure_mgmt_cdn/models/sku.rb' - autoload :SsoUri, 'generated/azure_mgmt_cdn/models/sso_uri.rb' - autoload :EdgenodeResult, 'generated/azure_mgmt_cdn/models/edgenode_result.rb' autoload :ValidateCustomDomainInput, 'generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb' - autoload :GeoFilter, 'generated/azure_mgmt_cdn/models/geo_filter.rb' + autoload :ProfileListResult, 'generated/azure_mgmt_cdn/models/profile_list_result.rb' autoload :ValidateCustomDomainOutput, 'generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb' - autoload :PurgeParameters, 'generated/azure_mgmt_cdn/models/purge_parameters.rb' + autoload :SsoUri, 'generated/azure_mgmt_cdn/models/sso_uri.rb' autoload :CheckNameAvailabilityInput, 'generated/azure_mgmt_cdn/models/check_name_availability_input.rb' - autoload :ErrorResponse, 'generated/azure_mgmt_cdn/models/error_response.rb' + autoload :DeepCreatedOrigin, 'generated/azure_mgmt_cdn/models/deep_created_origin.rb' autoload :CheckNameAvailabilityOutput, 'generated/azure_mgmt_cdn/models/check_name_availability_output.rb' - autoload :OriginListResult, 'generated/azure_mgmt_cdn/models/origin_list_result.rb' + autoload :EndpointListResult, 'generated/azure_mgmt_cdn/models/endpoint_list_result.rb' + autoload :ValidateProbeInput, 'generated/azure_mgmt_cdn/models/validate_probe_input.rb' + autoload :EndpointUpdateParameters, 'generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb' + autoload :ValidateProbeOutput, 'generated/azure_mgmt_cdn/models/validate_probe_output.rb' + autoload :LoadParameters, 'generated/azure_mgmt_cdn/models/load_parameters.rb' autoload :ResourceUsage, 'generated/azure_mgmt_cdn/models/resource_usage.rb' - autoload :DeepCreatedOrigin, 'generated/azure_mgmt_cdn/models/deep_created_origin.rb' + autoload :OriginUpdateParameters, 'generated/azure_mgmt_cdn/models/origin_update_parameters.rb' autoload :ResourceUsageListResult, 'generated/azure_mgmt_cdn/models/resource_usage_list_result.rb' - autoload :EndpointUpdateParameters, 'generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb' + autoload :OriginListResult, 'generated/azure_mgmt_cdn/models/origin_list_result.rb' + autoload :CustomDomainParameters, 'generated/azure_mgmt_cdn/models/custom_domain_parameters.rb' + autoload :ProfileUpdateParameters, 'generated/azure_mgmt_cdn/models/profile_update_parameters.rb' + autoload :ErrorResponse, 'generated/azure_mgmt_cdn/models/error_response.rb' autoload :OperationDisplay, 'generated/azure_mgmt_cdn/models/operation_display.rb' - autoload :OriginUpdateParameters, 'generated/azure_mgmt_cdn/models/origin_update_parameters.rb' + autoload :PurgeParameters, 'generated/azure_mgmt_cdn/models/purge_parameters.rb' autoload :Operation, 'generated/azure_mgmt_cdn/models/operation.rb' - autoload :EndpointListResult, 'generated/azure_mgmt_cdn/models/endpoint_list_result.rb' - autoload :OperationListResult, 'generated/azure_mgmt_cdn/models/operation_list_result.rb' - autoload :ProfileUpdateParameters, 'generated/azure_mgmt_cdn/models/profile_update_parameters.rb' + autoload :SupportedOptimizationTypesListResult, 'generated/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb' + autoload :OperationsListResult, 'generated/azure_mgmt_cdn/models/operations_list_result.rb' + autoload :EdgenodeResult, 'generated/azure_mgmt_cdn/models/edgenode_result.rb' autoload :CidrIpAddress, 'generated/azure_mgmt_cdn/models/cidr_ip_address.rb' - autoload :LoadParameters, 'generated/azure_mgmt_cdn/models/load_parameters.rb' + autoload :GeoFilter, 'generated/azure_mgmt_cdn/models/geo_filter.rb' autoload :IpAddressGroup, 'generated/azure_mgmt_cdn/models/ip_address_group.rb' autoload :Profile, 'generated/azure_mgmt_cdn/models/profile.rb' autoload :Endpoint, 'generated/azure_mgmt_cdn/models/endpoint.rb' @@ -62,12 +67,14 @@ module Models autoload :EdgeNode, 'generated/azure_mgmt_cdn/models/edge_node.rb' autoload :SkuName, 'generated/azure_mgmt_cdn/models/sku_name.rb' autoload :ProfileResourceState, 'generated/azure_mgmt_cdn/models/profile_resource_state.rb' + autoload :OptimizationType, 'generated/azure_mgmt_cdn/models/optimization_type.rb' autoload :EndpointResourceState, 'generated/azure_mgmt_cdn/models/endpoint_resource_state.rb' autoload :QueryStringCachingBehavior, 'generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb' autoload :GeoFilterActions, 'generated/azure_mgmt_cdn/models/geo_filter_actions.rb' autoload :OriginResourceState, 'generated/azure_mgmt_cdn/models/origin_resource_state.rb' autoload :CustomDomainResourceState, 'generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb' autoload :CustomHttpsProvisioningState, 'generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb' + autoload :CustomHttpsProvisioningSubstate, 'generated/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb' autoload :ResourceType, 'generated/azure_mgmt_cdn/models/resource_type.rb' end end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/cdn_management_client.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/cdn_management_client.rb index 2ed4cf9203..e68e5cf4f7 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/cdn_management_client.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/cdn_management_client.rb @@ -21,7 +21,7 @@ class CdnManagementClient < MsRestAzure::AzureServiceClient attr_accessor :subscription_id # @return [String] Version of the API to be used with the client request. - # Current version is 2016-10-02. + # Current version is 2017-04-02. attr_reader :api_version # @return [String] Gets or sets the preferred language for the response. @@ -47,6 +47,12 @@ class CdnManagementClient < MsRestAzure::AzureServiceClient # @return [CustomDomains] custom_domains attr_reader :custom_domains + # @return [ResourceUsageOperations] resource_usage_operations + attr_reader :resource_usage_operations + + # @return [Operations] operations + attr_reader :operations + # @return [EdgeNodes] edge_nodes attr_reader :edge_nodes @@ -67,8 +73,10 @@ def initialize(credentials = nil, base_url = nil, options = nil) @endpoints = Endpoints.new(self) @origins = Origins.new(self) @custom_domains = CustomDomains.new(self) + @resource_usage_operations = ResourceUsageOperations.new(self) + @operations = Operations.new(self) @edge_nodes = EdgeNodes.new(self) - @api_version = '2016-10-02' + @api_version = '2017-04-02' @accept_language = 'en-US' @long_running_operation_retry_timeout = 30 @generate_client_request_id = true @@ -231,42 +239,52 @@ def check_name_availability_async(check_name_availability_input, custom_headers end # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. + # Check if the probe path is a valid path and the file can be accessed. Probe + # path is the path to a file hosted on the origin server to help accelerate the + # delivery of dynamic content via the CDN endpoint. This path is relative to + # the origin path specified in the endpoint configuration. # + # @param validate_probe_input [ValidateProbeInput] Input to check. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [Array] operation results. + # @return [ValidateProbeOutput] operation results. # - def list_resource_usage(custom_headers = nil) - first_page = list_resource_usage_as_lazy(custom_headers) - first_page.get_all_items + def validate_probe(validate_probe_input, custom_headers = nil) + response = validate_probe_async(validate_probe_input, custom_headers).value! + response.body unless response.nil? end # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. + # Check if the probe path is a valid path and the file can be accessed. Probe + # path is the path to a file hosted on the origin server to help accelerate the + # delivery of dynamic content via the CDN endpoint. This path is relative to + # the origin path specified in the endpoint configuration. # + # @param validate_probe_input [ValidateProbeInput] Input to check. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def list_resource_usage_with_http_info(custom_headers = nil) - list_resource_usage_async(custom_headers).value! + def validate_probe_with_http_info(validate_probe_input, custom_headers = nil) + validate_probe_async(validate_probe_input, custom_headers).value! end # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. + # Check if the probe path is a valid path and the file can be accessed. Probe + # path is the path to a file hosted on the origin server to help accelerate the + # delivery of dynamic content via the CDN endpoint. This path is relative to + # the origin path specified in the endpoint configuration. # + # @param validate_probe_input [ValidateProbeInput] Input to check. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def list_resource_usage_async(custom_headers = nil) + def validate_probe_async(validate_probe_input, custom_headers = nil) + fail ArgumentError, 'validate_probe_input is nil' if validate_probe_input.nil? fail ArgumentError, 'subscription_id is nil' if subscription_id.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? @@ -276,350 +294,23 @@ def list_resource_usage_async(custom_headers = nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? - path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage' - - request_url = @base_url || self.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'subscriptionId' => subscription_id}, - query_params: {'api-version' => api_version}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = self.make_request_async(:post, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRest::HttpOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::ARM::CDN::Models::ResourceUsageListResult.mapper() - result.body = self.deserialize(result_mapper, parsed_response) - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Lists all of the available CDN REST API operations. - # - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [Array] operation results. - # - def list_operations(custom_headers = nil) - first_page = list_operations_as_lazy(custom_headers) - first_page.get_all_items - end - - # - # Lists all of the available CDN REST API operations. - # - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def list_operations_with_http_info(custom_headers = nil) - list_operations_async(custom_headers).value! - end - - # - # Lists all of the available CDN REST API operations. - # - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def list_operations_async(custom_headers = nil) - fail ArgumentError, 'api_version is nil' if api_version.nil? + request_headers['Content-Type'] = 'application/json; charset=utf-8' - request_headers = {} + # Serialize Request + request_mapper = Azure::ARM::CDN::Models::ValidateProbeInput.mapper() + request_content = self.serialize(request_mapper, validate_probe_input) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = accept_language unless accept_language.nil? - path_template = 'providers/Microsoft.Cdn/operations' + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateProbe' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => subscription_id}, query_params: {'api-version' => api_version}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = self.make_request_async(:get, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRest::HttpOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::ARM::CDN::Models::OperationListResult.mapper() - result.body = self.deserialize(result_mapper, parsed_response) - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. - # - # @param next_page_link [String] The NextLink from the previous successful call - # to List operation. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [ResourceUsageListResult] operation results. - # - def list_resource_usage_next(next_page_link, custom_headers = nil) - response = list_resource_usage_next_async(next_page_link, custom_headers).value! - response.body unless response.nil? - end - - # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. - # - # @param next_page_link [String] The NextLink from the previous successful call - # to List operation. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def list_resource_usage_next_with_http_info(next_page_link, custom_headers = nil) - list_resource_usage_next_async(next_page_link, custom_headers).value! - end - - # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. - # - # @param next_page_link [String] The NextLink from the previous successful call - # to List operation. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def list_resource_usage_next_async(next_page_link, custom_headers = nil) - fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = accept_language unless accept_language.nil? - path_template = '{nextLink}' - - request_url = @base_url || self.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - skip_encoding_path_params: {'nextLink' => next_page_link}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = self.make_request_async(:post, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRest::HttpOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::ARM::CDN::Models::ResourceUsageListResult.mapper() - result.body = self.deserialize(result_mapper, parsed_response) - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Lists all of the available CDN REST API operations. - # - # @param next_page_link [String] The NextLink from the previous successful call - # to List operation. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [OperationListResult] operation results. - # - def list_operations_next(next_page_link, custom_headers = nil) - response = list_operations_next_async(next_page_link, custom_headers).value! - response.body unless response.nil? - end - - # - # Lists all of the available CDN REST API operations. - # - # @param next_page_link [String] The NextLink from the previous successful call - # to List operation. - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def list_operations_next_with_http_info(next_page_link, custom_headers = nil) - list_operations_next_async(next_page_link, custom_headers).value! - end - - # - # Lists all of the available CDN REST API operations. - # - # @param next_page_link [String] The NextLink from the previous successful call - # to List operation. - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def list_operations_next_async(next_page_link, custom_headers = nil) - fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? - - - request_headers = {} - - # Set Headers - request_headers['x-ms-client-request-id'] = SecureRandom.uuid - request_headers['accept-language'] = accept_language unless accept_language.nil? - path_template = '{nextLink}' - - request_url = @base_url || self.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - skip_encoding_path_params: {'nextLink' => next_page_link}, - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = self.make_request_async(:get, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRest::HttpOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::ARM::CDN::Models::OperationListResult.mapper() - result.body = self.deserialize(result_mapper, parsed_response) - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. - # - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [ResourceUsageListResult] operation results. - # - def list_resource_usage_as_lazy(custom_headers = nil) - first_page = list_resource_usage_as_lazy_as_lazy(custom_headers) - first_page.get_all_items - end - - # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. - # - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def list_resource_usage_as_lazy_with_http_info(custom_headers = nil) - list_resource_usage_as_lazy_async(custom_headers).value! - end - - # - # Check the quota and actual usage of the CDN profiles under the given - # subscription. - # - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def list_resource_usage_as_lazy_async(custom_headers = nil) - - - request_headers = {} - path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage' - - request_url = @base_url || self.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } @@ -639,82 +330,7 @@ def list_resource_usage_as_lazy_async(custom_headers = nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::ARM::CDN::Models::ResourceUsageListResult.mapper() - result.body = self.deserialize(result_mapper, parsed_response) - rescue Exception => e - fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) - end - end - - result - end - - promise.execute - end - - # - # Lists all of the available CDN REST API operations. - # - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [OperationListResult] operation results. - # - def list_operations_as_lazy(custom_headers = nil) - first_page = list_operations_as_lazy_as_lazy(custom_headers) - first_page.get_all_items - end - - # - # Lists all of the available CDN REST API operations. - # - # @param custom_headers [Hash{String => String}] A hash of custom headers that - # will be added to the HTTP request. - # - # @return [MsRestAzure::AzureOperationResponse] HTTP response information. - # - def list_operations_as_lazy_with_http_info(custom_headers = nil) - list_operations_as_lazy_async(custom_headers).value! - end - - # - # Lists all of the available CDN REST API operations. - # - # @param [Hash{String => String}] A hash of custom headers that will be added - # to the HTTP request. - # - # @return [Concurrent::Promise] Promise object which holds the HTTP response. - # - def list_operations_as_lazy_async(custom_headers = nil) - - - request_headers = {} - path_template = 'providers/Microsoft.Cdn/operations' - - request_url = @base_url || self.base_url - - options = { - middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - headers: request_headers.merge(custom_headers || {}), - base_url: request_url - } - promise = self.make_request_async(:get, path_template, options) - - promise = promise.then do |result| - http_response = result.response - status_code = http_response.status - response_content = http_response.body - unless status_code == 200 - error_model = JSON.load(response_content) - fail MsRest::HttpOperationError.new(result.request, http_response, error_model) - end - - result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? - # Deserialize Response - if status_code == 200 - begin - parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::ARM::CDN::Models::OperationListResult.mapper() + result_mapper = Azure::ARM::CDN::Models::ValidateProbeOutput.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/custom_domains.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/custom_domains.rb index 7f7f5940e4..aeae72171a 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/custom_domains.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/custom_domains.rb @@ -438,7 +438,7 @@ def disable_custom_https_async(resource_group_name, profile_name, endpoint_name, http_response = result.response status_code = http_response.status response_content = http_response.body - unless status_code == 202 || status_code == 200 + unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end @@ -549,7 +549,7 @@ def enable_custom_https_async(resource_group_name, profile_name, endpoint_name, http_response = result.response status_code = http_response.status response_content = http_response.body - unless status_code == 202 || status_code == 200 + unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/edge_nodes.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/edge_nodes.rb index f59ba88954..7abdada707 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/edge_nodes.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/edge_nodes.rb @@ -24,7 +24,8 @@ def initialize(client) attr_reader :client # - # Lists all the edge nodes of a CDN service. + # Edgenodes are the global Point of Presence (POP) locations used to deliver + # CDN content to end users. # # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. @@ -37,7 +38,8 @@ def list(custom_headers = nil) end # - # Lists all the edge nodes of a CDN service. + # Edgenodes are the global Point of Presence (POP) locations used to deliver + # CDN content to end users. # # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. @@ -49,7 +51,8 @@ def list_with_http_info(custom_headers = nil) end # - # Lists all the edge nodes of a CDN service. + # Edgenodes are the global Point of Presence (POP) locations used to deliver + # CDN content to end users. # # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. @@ -105,7 +108,8 @@ def list_async(custom_headers = nil) end # - # Lists all the edge nodes of a CDN service. + # Edgenodes are the global Point of Presence (POP) locations used to deliver + # CDN content to end users. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. @@ -120,7 +124,8 @@ def list_next(next_page_link, custom_headers = nil) end # - # Lists all the edge nodes of a CDN service. + # Edgenodes are the global Point of Presence (POP) locations used to deliver + # CDN content to end users. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. @@ -134,7 +139,8 @@ def list_next_with_http_info(next_page_link, custom_headers = nil) end # - # Lists all the edge nodes of a CDN service. + # Edgenodes are the global Point of Presence (POP) locations used to deliver + # CDN content to end users. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. @@ -192,7 +198,8 @@ def list_next_async(next_page_link, custom_headers = nil) end # - # Lists all the edge nodes of a CDN service. + # Edgenodes are the global Point of Presence (POP) locations used to deliver + # CDN content to end users. # # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/check_name_availability_output.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/check_name_availability_output.rb index e0e38c267e..eca0bad022 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/check_name_availability_output.rb @@ -38,6 +38,7 @@ def self.mapper() model_properties: { name_available: { required: false, + read_only: true, serialized_name: 'nameAvailable', type: { name: 'Boolean' @@ -45,6 +46,7 @@ def self.mapper() }, reason: { required: false, + read_only: true, serialized_name: 'reason', type: { name: 'String' @@ -52,6 +54,7 @@ def self.mapper() }, message: { required: false, + read_only: true, serialized_name: 'message', type: { name: 'String' diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain.rb index 2029973cab..c85185a91f 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain.rb @@ -6,7 +6,8 @@ module Azure::ARM::CDN module Models # - # Customer provided domain for branding purposes, e.g. www.consoto.com. + # Friendly domain name mapping to the endpoint hostname that the customer + # provides for branding purposes, e.g. www.consoto.com. # class CustomDomain < MsRestAzure::Resource @@ -21,11 +22,22 @@ class CustomDomain < MsRestAzure::Resource # domain. Possible values include: 'Creating', 'Active', 'Deleting' attr_accessor :resource_state - # @return [CustomHttpsProvisioningState] Provisioning state of Custom + # @return [CustomHttpsProvisioningState] Provisioning status of Custom # Https of the custom domain. Possible values include: 'Enabling', # 'Enabled', 'Disabling', 'Disabled', 'Failed' attr_accessor :custom_https_provisioning_state + # @return [CustomHttpsProvisioningSubstate] Provisioning substate shows + # the progress of custom HTTPS enabling/disabling process step by step. + # Possible values include: 'SubmittingDomainControlValidationRequest', + # 'PendingDomainControlValidationREquestApproval', + # 'DomainControlValidationRequestApproved', + # 'DomainControlValidationRequestRejected', + # 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', + # 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + # 'CertificateDeleted' + attr_accessor :custom_https_provisioning_substate + # @return [String] Special validation or data may be required when # delivering CDN to some regions due to local compliance reasons. E.g. # ICP license number of a custom domain is required to deliver content in @@ -116,6 +128,14 @@ def self.mapper() name: 'String' } }, + custom_https_provisioning_substate: { + required: false, + read_only: true, + serialized_name: 'properties.customHttpsProvisioningSubstate', + type: { + name: 'String' + } + }, validation_data: { required: false, serialized_name: 'properties.validationData', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb index 5f4ec48cba..308c9e385f 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb @@ -68,6 +68,7 @@ def self.mapper() model_properties: { value: { required: false, + read_only: true, serialized_name: 'value', type: { name: 'Sequence', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb new file mode 100644 index 0000000000..7e4081170e --- /dev/null +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb @@ -0,0 +1,24 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::CDN + module Models + # + # Defines values for CustomHttpsProvisioningSubstate + # + module CustomHttpsProvisioningSubstate + SubmittingDomainControlValidationRequest = "SubmittingDomainControlValidationRequest" + PendingDomainControlValidationREquestApproval = "PendingDomainControlValidationREquestApproval" + DomainControlValidationRequestApproved = "DomainControlValidationRequestApproved" + DomainControlValidationRequestRejected = "DomainControlValidationRequestRejected" + DomainControlValidationRequestTimedOut = "DomainControlValidationRequestTimedOut" + IssuingCertificate = "IssuingCertificate" + DeployingCertificate = "DeployingCertificate" + CertificateDeployed = "CertificateDeployed" + DeletingCertificate = "DeletingCertificate" + CertificateDeleted = "CertificateDeleted" + end + end +end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/deep_created_origin.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/deep_created_origin.rb index 83bdd0682a..abc17d3260 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/deep_created_origin.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/deep_created_origin.rb @@ -6,7 +6,8 @@ module Azure::ARM::CDN module Models # - # Origin to be added when creating a CDN endpoint. + # The main origin of CDN content which is added when creating a CDN + # endpoint. # class DeepCreatedOrigin @@ -16,7 +17,7 @@ class DeepCreatedOrigin # @return [String] Origin name attr_accessor :name - # @return [String] The address of the origin. It can be a domain names, + # @return [String] The address of the origin. It can be a domain name, # IPv4 address, or IPv6 address. attr_accessor :host_name diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/edge_node.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/edge_node.rb index 9a9ee272f5..57921551c9 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/edge_node.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/edge_node.rb @@ -6,7 +6,8 @@ module Azure::ARM::CDN module Models # - # Edge node of CDN service. + # Edgenode is a global Point of Presence (POP) location used to deliver CDN + # content to end users. # class EdgeNode < MsRestAzure::Resource diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/edgenode_result.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/edgenode_result.rb index ee61ce1494..174b85323c 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/edgenode_result.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/edgenode_result.rb @@ -67,6 +67,7 @@ def self.mapper() model_properties: { value: { required: false, + read_only: true, serialized_name: 'value', type: { name: 'Sequence', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint.rb index a06c7bda0f..9526580bb2 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint.rb @@ -20,7 +20,8 @@ class Endpoint < MsRestAzure::Resource # to origin. The default value is the host name of the origin. attr_accessor :origin_host_header - # @return [String] The path used when CDN sends request to origin. + # @return [String] A directory path on the origin that CDN can use to + # retreive content from, e.g. contoso.cloudapp.net/originpath. attr_accessor :origin_path # @return [Array] List of content types on which compression @@ -44,17 +45,28 @@ class Endpoint < MsRestAzure::Resource # must be allowed. attr_accessor :is_https_allowed - # @return [QueryStringCachingBehavior] Defines the query string caching - # behavior. Possible values include: 'IgnoreQueryString', - # 'BypassCaching', 'UseQueryString', 'NotSet' + # @return [QueryStringCachingBehavior] Defines how CDN caches requests + # that include query strings. You can ignore any query strings when + # caching, bypass caching to prevent requests that contain query strings + # from being cached, or cache every request with a unique URL. Possible + # values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', + # 'NotSet' attr_accessor :query_string_caching_behavior - # @return [String] Customer can specify what scenario they want this CDN - # endpoint to optimize, e.g. Download, Media services. With this - # information we can apply scenario driven optimization. + # @return [OptimizationType] Specifies what scenario the customer wants + # this CDN endpoint to optimize for, e.g. Download, Media services. With + # this information, CDN can apply scenario driven optimization. Possible + # values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', + # 'VideoOnDemandMediaStreaming', 'LargeFileDownload', + # 'DynamicSiteAcceleration' attr_accessor :optimization_type - # @return [Array] List of rules defining user geo access + # @return [String] Path to a file hosted on the origin which helps + # accelerate delivery of the dynamic content and calculate the most + # optimal routes for the CDN. This is relative to the origin path. + attr_accessor :probe_path + + # @return [Array] List of rules defining the user's geo access # within a CDN endpoint. Each geo filter defines an acess rule to a # specified path or content, e.g. block APAC for path /pictures/ attr_accessor :geo_filters @@ -197,6 +209,13 @@ def self.mapper() name: 'String' } }, + probe_path: { + required: false, + serialized_name: 'properties.probePath', + type: { + name: 'String' + } + }, geo_filters: { required: false, serialized_name: 'properties.geoFilters', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint_list_result.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint_list_result.rb index f7b3d1d13d..594719489e 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint_list_result.rb @@ -18,7 +18,7 @@ class EndpointListResult attr_accessor :value # @return [String] URL to get the next set of endpoint objects if there - # are any. + # is any. attr_accessor :next_link # return [Proc] with next page method call. @@ -67,6 +67,7 @@ def self.mapper() model_properties: { value: { required: false, + read_only: true, serialized_name: 'value', type: { name: 'Sequence', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb index 13eabf1b69..7af7edb225 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb @@ -6,7 +6,7 @@ module Azure::ARM::CDN module Models # - # Properties required to create a new endpoint. + # Properties required to create or update an endpoint. # class EndpointUpdateParameters @@ -20,7 +20,8 @@ class EndpointUpdateParameters # to origin. The default value is the host name of the origin. attr_accessor :origin_host_header - # @return [String] The path used when CDN sends request to origin. + # @return [String] A directory path on the origin that CDN can use to + # retreive content from, e.g. contoso.cloudapp.net/originpath. attr_accessor :origin_path # @return [Array] List of content types on which compression @@ -44,17 +45,28 @@ class EndpointUpdateParameters # must be allowed. attr_accessor :is_https_allowed - # @return [QueryStringCachingBehavior] Defines the query string caching - # behavior. Possible values include: 'IgnoreQueryString', - # 'BypassCaching', 'UseQueryString', 'NotSet' + # @return [QueryStringCachingBehavior] Defines how CDN caches requests + # that include query strings. You can ignore any query strings when + # caching, bypass caching to prevent requests that contain query strings + # from being cached, or cache every request with a unique URL. Possible + # values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', + # 'NotSet' attr_accessor :query_string_caching_behavior - # @return [String] Customer can specify what scenario they want this CDN - # endpoint to optimize, e.g. Download, Media services. With this - # information we can apply scenario driven optimization. + # @return [OptimizationType] Specifies what scenario the customer wants + # this CDN endpoint to optimize for, e.g. Download, Media services. With + # this information, CDN can apply scenario driven optimization. Possible + # values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', + # 'VideoOnDemandMediaStreaming', 'LargeFileDownload', + # 'DynamicSiteAcceleration' attr_accessor :optimization_type - # @return [Array] List of rules defining user geo access + # @return [String] Path to a file hosted on the origin which helps + # accelerate delivery of the dynamic content and calculate the most + # optimal routes for the CDN. This is relative to the origin path. + attr_accessor :probe_path + + # @return [Array] List of rules defining the user's geo access # within a CDN endpoint. Each geo filter defines an acess rule to a # specified path or content, e.g. block APAC for path /pictures/ attr_accessor :geo_filters @@ -150,6 +162,13 @@ def self.mapper() name: 'String' } }, + probe_path: { + required: false, + serialized_name: 'properties.probePath', + type: { + name: 'String' + } + }, geo_filters: { required: false, serialized_name: 'properties.geoFilters', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/error_response.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/error_response.rb index b72b20837b..6e0d542979 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/error_response.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/error_response.rb @@ -35,6 +35,7 @@ def self.mapper() model_properties: { code: { required: false, + read_only: true, serialized_name: 'code', type: { name: 'String' @@ -42,6 +43,7 @@ def self.mapper() }, message: { required: false, + read_only: true, serialized_name: 'message', type: { name: 'String' diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/geo_filter.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/geo_filter.rb index 710aa19392..c05d084d8c 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/geo_filter.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/geo_filter.rb @@ -6,7 +6,7 @@ module Azure::ARM::CDN module Models # - # Rules defining user geo access within a CDN endpoint. + # Rules defining user's geo access within a CDN endpoint. # class GeoFilter diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation.rb index f5be7b2fa0..e506a051e4 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation.rb @@ -34,6 +34,7 @@ def self.mapper() model_properties: { name: { required: false, + read_only: true, serialized_name: 'name', type: { name: 'String' diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation_display.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation_display.rb index 9089b6d9bf..25552ac2eb 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation_display.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation_display.rb @@ -38,6 +38,7 @@ def self.mapper() model_properties: { provider: { required: false, + read_only: true, serialized_name: 'provider', type: { name: 'String' @@ -45,6 +46,7 @@ def self.mapper() }, resource: { required: false, + read_only: true, serialized_name: 'resource', type: { name: 'String' @@ -52,6 +54,7 @@ def self.mapper() }, operation: { required: false, + read_only: true, serialized_name: 'operation', type: { name: 'String' diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation_list_result.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operations_list_result.rb similarity index 89% rename from management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation_list_result.rb rename to management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operations_list_result.rb index 9a7f987b75..703aa797a8 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operation_list_result.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/operations_list_result.rb @@ -9,7 +9,7 @@ module Models # Result of the request to list CDN operations. It contains a list of # operations and a URL link to get the next set of results. # - class OperationListResult + class OperationsListResult include MsRestAzure @@ -43,7 +43,7 @@ def get_all_items # # Gets the next page of results. # - # @return [OperationListResult] with next page content. + # @return [OperationsListResult] with next page content. # def get_next_page response = @next_method.call(@next_link).value! unless @next_method.nil? @@ -55,19 +55,20 @@ def get_next_page end # - # Mapper for OperationListResult class as Ruby Hash. + # Mapper for OperationsListResult class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { required: false, - serialized_name: 'OperationListResult', + serialized_name: 'OperationsListResult', type: { name: 'Composite', - class_name: 'OperationListResult', + class_name: 'OperationsListResult', model_properties: { value: { required: false, + read_only: true, serialized_name: 'value', type: { name: 'Sequence', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/optimization_type.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/optimization_type.rb new file mode 100644 index 0000000000..88ebdca7fd --- /dev/null +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/optimization_type.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::CDN + module Models + # + # Defines values for OptimizationType + # + module OptimizationType + GeneralWebDelivery = "GeneralWebDelivery" + GeneralMediaStreaming = "GeneralMediaStreaming" + VideoOnDemandMediaStreaming = "VideoOnDemandMediaStreaming" + LargeFileDownload = "LargeFileDownload" + DynamicSiteAcceleration = "DynamicSiteAcceleration" + end + end +end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/origin_list_result.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/origin_list_result.rb index f3b22419d4..24d05cde25 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/origin_list_result.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/origin_list_result.rb @@ -67,6 +67,7 @@ def self.mapper() model_properties: { value: { required: false, + read_only: true, serialized_name: 'value', type: { name: 'Sequence', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/profile.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/profile.rb index ae704afb52..856e41f8d7 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/profile.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/profile.rb @@ -6,10 +6,8 @@ module Azure::ARM::CDN module Models # - # CDN profile represents the top level resource and the entry point into - # the CDN API. This allows users to set up a logical grouping of endpoints - # in addition to creating shared configuration settings and selecting - # pricing tiers and providers. + # CDN profile is a logical grouping of endpoints that share the same + # settings, such as CDN provider and pricing tier. # class Profile < MsRestAzure::Resource diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/profile_list_result.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/profile_list_result.rb index 5f094bd0cb..1e54201c02 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/profile_list_result.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/profile_list_result.rb @@ -67,6 +67,7 @@ def self.mapper() model_properties: { value: { required: false, + read_only: true, serialized_name: 'value', type: { name: 'Sequence', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/resource_usage.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/resource_usage.rb index 76846c46b7..28f2f2f81a 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/resource_usage.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/resource_usage.rb @@ -13,16 +13,16 @@ class ResourceUsage include MsRestAzure include MsRest::JSONable - # @return [String] Resource type of the usages. + # @return [String] Resource type for which the usage is provided. attr_accessor :resource_type # @return [String] Unit of the usage. e.g. Count. attr_accessor :unit - # @return [Integer] Actual value of the resource type. + # @return [Integer] Actual value of usage on the specified resource type. attr_accessor :current_value - # @return [Integer] Quota of the resource type. + # @return [Integer] Quota of the specified resource type. attr_accessor :limit @@ -40,6 +40,7 @@ def self.mapper() model_properties: { resource_type: { required: false, + read_only: true, serialized_name: 'resourceType', type: { name: 'String' @@ -47,6 +48,7 @@ def self.mapper() }, unit: { required: false, + read_only: true, serialized_name: 'unit', type: { name: 'String' @@ -54,6 +56,7 @@ def self.mapper() }, current_value: { required: false, + read_only: true, serialized_name: 'currentValue', type: { name: 'Number' @@ -61,6 +64,7 @@ def self.mapper() }, limit: { required: false, + read_only: true, serialized_name: 'limit', type: { name: 'Number' diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb index f03e85dbcb..57a81af146 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb @@ -66,6 +66,7 @@ def self.mapper() model_properties: { value: { required: false, + read_only: true, serialized_name: 'value', type: { name: 'Sequence', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/sso_uri.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/sso_uri.rb index 9d42f0df52..165415d91d 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/sso_uri.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/sso_uri.rb @@ -6,7 +6,8 @@ module Azure::ARM::CDN module Models # - # SSO URI required to login to the supplemental portal. + # The URI required to login to the supplemental portal from the Azure + # portal. # class SsoUri @@ -31,6 +32,7 @@ def self.mapper() model_properties: { sso_uri_value: { required: false, + read_only: true, serialized_name: 'ssoUriValue', type: { name: 'String' diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb new file mode 100644 index 0000000000..807394f61e --- /dev/null +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::CDN + module Models + # + # The result of the GetSupportedOptimizationTypes API + # + class SupportedOptimizationTypesListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Supported optimization types for a + # profile. + attr_accessor :supported_optimization_types + + + # + # Mapper for SupportedOptimizationTypesListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'SupportedOptimizationTypesListResult', + type: { + name: 'Composite', + class_name: 'SupportedOptimizationTypesListResult', + model_properties: { + supported_optimization_types: { + required: false, + read_only: true, + serialized_name: 'supportedOptimizationTypes', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OptimizationTypeElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb index a648064ce9..defb1ca440 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb @@ -13,8 +13,7 @@ class ValidateCustomDomainOutput include MsRestAzure include MsRest::JSONable - # @return [Boolean] Indicates whether the custom domain is validated or - # not. + # @return [Boolean] Indicates whether the custom domain is valid or not. attr_accessor :custom_domain_validated # @return [String] The reason why the custom domain is not valid. @@ -39,6 +38,7 @@ def self.mapper() model_properties: { custom_domain_validated: { required: false, + read_only: true, serialized_name: 'customDomainValidated', type: { name: 'Boolean' @@ -46,6 +46,7 @@ def self.mapper() }, reason: { required: false, + read_only: true, serialized_name: 'reason', type: { name: 'String' @@ -53,6 +54,7 @@ def self.mapper() }, message: { required: false, + read_only: true, serialized_name: 'message', type: { name: 'String' diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_probe_input.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_probe_input.rb new file mode 100644 index 0000000000..8a0d7affd1 --- /dev/null +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_probe_input.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::CDN + module Models + # + # Input of the validate probe API. + # + class ValidateProbeInput + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The probe URL to validate. + attr_accessor :probe_url + + + # + # Mapper for ValidateProbeInput class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ValidateProbeInput', + type: { + name: 'Composite', + class_name: 'ValidateProbeInput', + model_properties: { + probe_url: { + required: true, + serialized_name: 'probeURL', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_probe_output.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_probe_output.rb new file mode 100644 index 0000000000..eb20a7bc84 --- /dev/null +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/validate_probe_output.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::CDN + module Models + # + # Output of the validate probe API. + # + class ValidateProbeOutput + + include MsRestAzure + + include MsRest::JSONable + # @return [Boolean] Indicates whether the probe URL is accepted or not. + attr_accessor :is_valid + + # @return [String] Specifies the error code when the probe url is not + # accepted. + attr_accessor :error_code + + # @return [String] The detailed error message describing why the probe + # URL is not accepted. + attr_accessor :message + + + # + # Mapper for ValidateProbeOutput class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ValidateProbeOutput', + type: { + name: 'Composite', + class_name: 'ValidateProbeOutput', + model_properties: { + is_valid: { + required: false, + read_only: true, + serialized_name: 'isValid', + type: { + name: 'Boolean' + } + }, + error_code: { + required: false, + read_only: true, + serialized_name: 'errorCode', + type: { + name: 'String' + } + }, + message: { + required: false, + read_only: true, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/operations.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/operations.rb new file mode 100644 index 0000000000..39014940a3 --- /dev/null +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/operations.rb @@ -0,0 +1,215 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::CDN + # + # Use these APIs to manage Azure CDN resources through the Azure Resource + # Manager. You must make sure that requests made to these resources are + # secure. + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CdnManagementClient] reference to the CdnManagementClient + attr_reader :client + + # + # Lists all of the available CDN REST API operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Lists all of the available CDN REST API operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Lists all of the available CDN REST API operations. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.Cdn/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::CDN::Models::OperationsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available CDN REST API operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationsListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all of the available CDN REST API operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all of the available CDN REST API operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::CDN::Models::OperationsListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available CDN REST API operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationsListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/profiles.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/profiles.rb index 1104701281..fb274f81f1 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/profiles.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/profiles.rb @@ -549,6 +549,106 @@ def generate_sso_uri_async(resource_group_name, profile_name, custom_headers = n promise.execute end + # + # Gets the supported optimization types for the current profile. A user can + # create an endpoint with an optimization type from the listed values. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SupportedOptimizationTypesListResult] operation results. + # + def list_supported_optimization_types(resource_group_name, profile_name, custom_headers = nil) + response = list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the supported optimization types for the current profile. A user can + # create an endpoint with an optimization type from the listed values. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_supported_optimization_types_with_http_info(resource_group_name, profile_name, custom_headers = nil) + list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers).value! + end + + # + # Gets the supported optimization types for the current profile. A user can + # create an endpoint with an optimization type from the listed values. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'profile_name is nil' if profile_name.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getSupportedOptimizationTypes' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::CDN::Models::SupportedOptimizationTypesListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + # # Checks the quota and actual usage of endpoints under the given CDN profile. # diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/resource_usage_operations.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/resource_usage_operations.rb new file mode 100644 index 0000000000..1be70938ce --- /dev/null +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/resource_usage_operations.rb @@ -0,0 +1,224 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::CDN + # + # Use these APIs to manage Azure CDN resources through the Azure Resource + # Manager. You must make sure that requests made to these resources are + # secure. + # + class ResourceUsageOperations + include MsRestAzure + + # + # Creates and initializes a new instance of the ResourceUsageOperations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [CdnManagementClient] reference to the CdnManagementClient + attr_reader :client + + # + # Check the quota and actual usage of the CDN profiles under the given + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Check the quota and actual usage of the CDN profiles under the given + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Check the quota and actual usage of the CDN profiles under the given + # subscription. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::CDN::Models::ResourceUsageListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Check the quota and actual usage of the CDN profiles under the given + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResourceUsageListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Check the quota and actual usage of the CDN profiles under the given + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Check the quota and actual usage of the CDN profiles under the given + # subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::CDN::Models::ResourceUsageListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Check the quota and actual usage of the CDN profiles under the given + # subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResourceUsageListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end