text:
module Azure::Web::Mgmt::V2018_02_01
  #
  # WebSite Management Client
  #
  class Recommendations
    include MsRestAzure

    #
    # Creates and initializes a new instance of the Recommendations class.
    # @param client service class for accessing basic functionality.
    #
    def initialize(client)
      @client = client
    end

    # @return [WebSiteManagementClient] reference to the WebSiteManagementClient
    attr_reader :client

    #
    # List all recommendations for a subscription.
    #
    # List all recommendations for a subscription.
    #
    # @param featured [Boolean] Specify true to return only the most
    # critical recommendations. The default is false, which returns
    # all recommendations.
    # @param filter [String] Filter is specified by using OData syntax. Example:
    # $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq
    # 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq
    # duration'[PT1H|PT1M|P1D]
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [Array<Recommendation>] operation results.
    #
    def list(featured:nil, filter:nil, custom_headers:nil)
      first_page = list_as_lazy(featured:featured, filter:filter, custom_headers:custom_headers)
      first_page.get_all_items
    end

    #
    # List all recommendations for a subscription.
    #
    # List all recommendations for a subscription.
    #
    # @param featured [Boolean] Specify true to return only the most
    # critical recommendations. The default is false, which returns
    # all recommendations.
    # @param filter [String] Filter is specified by using OData syntax. Example:
    # $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq
    # 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq
    # duration'[PT1H|PT1M|P1D]
    # @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(featured:nil, filter:nil, custom_headers:nil)
      list_async(featured:featured, filter:filter, custom_headers:custom_headers).value!
    end

    #
    # List all recommendations for a subscription.
    #
    # List all recommendations for a subscription.
    #
    # @param featured [Boolean] Specify true to return only the most
    # critical recommendations. The default is false, which returns
    # all recommendations.
    # @param filter [String] Filter is specified by using OData syntax. Example:
    # $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq
    # 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq
    # duration'[PT1H|PT1M|P1D]
    # @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(featured:nil, filter:nil, 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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/recommendations'

      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: {'featured' => featured,'api-version' => @client.api_version},
          skip_encoding_query_params: {'$filter' => filter},
          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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.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

    #
    # Reset all recommendation opt-out settings for a subscription.
    #
    # Reset all recommendation opt-out settings for a subscription.
    #
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    #
    def reset_all_filters(custom_headers:nil)
      response = reset_all_filters_async(custom_headers:custom_headers).value!
      nil
    end

    #
    # Reset all recommendation opt-out settings for a subscription.
    #
    # Reset all recommendation opt-out settings for a 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 reset_all_filters_with_http_info(custom_headers:nil)
      reset_all_filters_async(custom_headers:custom_headers).value!
    end

    #
    # Reset all recommendation opt-out settings for a subscription.
    #
    # Reset all recommendation opt-out settings for a 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 reset_all_filters_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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/recommendations/reset'

      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 == 204
          error_model = JSON.load(response_content)
          fail MsRestAzure::AzureOperationError.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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

        result
      end

      promise.execute
    end

    #
    # Disables the specified rule so it will not apply to a subscription in the
    # future.
    #
    # Disables the specified rule so it will not apply to a subscription in the
    # future.
    #
    # @param name [String] Rule name
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    #
    def disable_recommendation_for_subscription(name, custom_headers:nil)
      response = disable_recommendation_for_subscription_async(name, custom_headers:custom_headers).value!
      nil
    end

    #
    # Disables the specified rule so it will not apply to a subscription in the
    # future.
    #
    # Disables the specified rule so it will not apply to a subscription in the
    # future.
    #
    # @param name [String] Rule name
    # @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 disable_recommendation_for_subscription_with_http_info(name, custom_headers:nil)
      disable_recommendation_for_subscription_async(name, custom_headers:custom_headers).value!
    end

    #
    # Disables the specified rule so it will not apply to a subscription in the
    # future.
    #
    # Disables the specified rule so it will not apply to a subscription in the
    # future.
    #
    # @param name [String] Rule name
    # @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 disable_recommendation_for_subscription_async(name, custom_headers:nil)
      fail ArgumentError, 'name is nil' if 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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/recommendations/{name}/disable'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'name' => 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 MsRestAzure::AzureOperationError.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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

        result
      end

      promise.execute
    end

    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param expired_only [Boolean] Specify false to return all
    # recommendations. The default is true, which returns only expired
    # recommendations.
    # @param filter [String] Filter is specified by using OData syntax. Example:
    # $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq
    # 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq
    # duration'[PT1H|PT1M|P1D]
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [Array<Recommendation>] operation results.
    #
    def list_history_for_web_app(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
      first_page = list_history_for_web_app_as_lazy(resource_group_name, site_name, expired_only:expired_only, filter:filter, custom_headers:custom_headers)
      first_page.get_all_items
    end

    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param expired_only [Boolean] Specify false to return all
    # recommendations. The default is true, which returns only expired
    # recommendations.
    # @param filter [String] Filter is specified by using OData syntax. Example:
    # $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq
    # 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq
    # duration'[PT1H|PT1M|P1D]
    # @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_history_for_web_app_with_http_info(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
      list_history_for_web_app_async(resource_group_name, site_name, expired_only:expired_only, filter:filter, custom_headers:custom_headers).value!
    end

    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param expired_only [Boolean] Specify false to return all
    # recommendations. The default is true, which returns only expired
    # recommendations.
    # @param filter [String] Filter is specified by using OData syntax. Example:
    # $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq
    # 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq
    # duration'[PT1H|PT1M|P1D]
    # @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_history_for_web_app_async(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
      fail ArgumentError, 'site_name is nil' if site_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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/sites/{siteName}/recommendationHistory'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'subscriptionId' => @client.subscription_id},
          query_params: {'expiredOnly' => expired_only,'api-version' => @client.api_version},
          skip_encoding_query_params: {'$filter' => filter},
          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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.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

    #
    # Get all recommendations for an app.
    #
    # Get all recommendations for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param featured [Boolean] Specify true to return only the most
    # critical recommendations. The default is false, which returns
    # all recommendations.
    # @param filter [String] Return only channels specified in the filter. Filter
    # is specified by using OData syntax. Example: $filter=channel eq 'Api' or
    # channel eq 'Notification'
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [Array<Recommendation>] operation results.
    #
    def list_recommended_rules_for_web_app(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
      first_page = list_recommended_rules_for_web_app_as_lazy(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers)
      first_page.get_all_items
    end

    #
    # Get all recommendations for an app.
    #
    # Get all recommendations for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param featured [Boolean] Specify true to return only the most
    # critical recommendations. The default is false, which returns
    # all recommendations.
    # @param filter [String] Return only channels specified in the filter. Filter
    # is specified by using OData syntax. Example: $filter=channel eq 'Api' or
    # channel eq 'Notification'
    # @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_recommended_rules_for_web_app_with_http_info(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
      list_recommended_rules_for_web_app_async(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers).value!
    end

    #
    # Get all recommendations for an app.
    #
    # Get all recommendations for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param featured [Boolean] Specify true to return only the most
    # critical recommendations. The default is false, which returns
    # all recommendations.
    # @param filter [String] Return only channels specified in the filter. Filter
    # is specified by using OData syntax. Example: $filter=channel eq 'Api' or
    # channel eq 'Notification'
    # @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_recommended_rules_for_web_app_async(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
      fail ArgumentError, 'site_name is nil' if site_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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/sites/{siteName}/recommendations'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'subscriptionId' => @client.subscription_id},
          query_params: {'featured' => featured,'api-version' => @client.api_version},
          skip_encoding_query_params: {'$filter' => filter},
          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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.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

    #
    # Disable all recommendations for an app.
    #
    # Disable all recommendations for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    #
    def disable_all_for_web_app(resource_group_name, site_name, custom_headers:nil)
      response = disable_all_for_web_app_async(resource_group_name, site_name, custom_headers:custom_headers).value!
      nil
    end

    #
    # Disable all recommendations for an app.
    #
    # Disable all recommendations for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @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 disable_all_for_web_app_with_http_info(resource_group_name, site_name, custom_headers:nil)
      disable_all_for_web_app_async(resource_group_name, site_name, custom_headers:custom_headers).value!
    end

    #
    # Disable all recommendations for an app.
    #
    # Disable all recommendations for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @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 disable_all_for_web_app_async(resource_group_name, site_name, custom_headers:nil)
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
      fail ArgumentError, 'site_name is nil' if site_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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/sites/{siteName}/recommendations/disable'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_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 == 204
          error_model = JSON.load(response_content)
          fail MsRestAzure::AzureOperationError.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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

        result
      end

      promise.execute
    end

    #
    # Reset all recommendation opt-out settings for an app.
    #
    # Reset all recommendation opt-out settings for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    #
    def reset_all_filters_for_web_app(resource_group_name, site_name, custom_headers:nil)
      response = reset_all_filters_for_web_app_async(resource_group_name, site_name, custom_headers:custom_headers).value!
      nil
    end

    #
    # Reset all recommendation opt-out settings for an app.
    #
    # Reset all recommendation opt-out settings for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @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 reset_all_filters_for_web_app_with_http_info(resource_group_name, site_name, custom_headers:nil)
      reset_all_filters_for_web_app_async(resource_group_name, site_name, custom_headers:custom_headers).value!
    end

    #
    # Reset all recommendation opt-out settings for an app.
    #
    # Reset all recommendation opt-out settings for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @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 reset_all_filters_for_web_app_async(resource_group_name, site_name, custom_headers:nil)
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
      fail ArgumentError, 'site_name is nil' if site_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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/sites/{siteName}/recommendations/reset'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_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 == 204
          error_model = JSON.load(response_content)
          fail MsRestAzure::AzureOperationError.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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

        result
      end

      promise.execute
    end

    #
    # Get a recommendation rule for an app.
    #
    # Get a recommendation rule for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param name [String] Name of the recommendation.
    # @param update_seen [Boolean] Specify true to update the
    # last-seen timestamp of the recommendation object.
    # @param recommendation_id [String] The GUID of the recommedation object if you
    # query an expired one. You don't need to specify it to query an active entry.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [RecommendationRule] operation results.
    #
    def get_rule_details_by_web_app(resource_group_name, site_name, name, update_seen:nil, recommendation_id:nil, custom_headers:nil)
      response = get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen:update_seen, recommendation_id:recommendation_id, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Get a recommendation rule for an app.
    #
    # Get a recommendation rule for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param name [String] Name of the recommendation.
    # @param update_seen [Boolean] Specify true to update the
    # last-seen timestamp of the recommendation object.
    # @param recommendation_id [String] The GUID of the recommedation object if you
    # query an expired one. You don't need to specify it to query an active entry.
    # @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 get_rule_details_by_web_app_with_http_info(resource_group_name, site_name, name, update_seen:nil, recommendation_id:nil, custom_headers:nil)
      get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen:update_seen, recommendation_id:recommendation_id, custom_headers:custom_headers).value!
    end

    #
    # Get a recommendation rule for an app.
    #
    # Get a recommendation rule for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param name [String] Name of the recommendation.
    # @param update_seen [Boolean] Specify true to update the
    # last-seen timestamp of the recommendation object.
    # @param recommendation_id [String] The GUID of the recommedation object if you
    # query an expired one. You don't need to specify it to query an active entry.
    # @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 get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen:nil, recommendation_id:nil, custom_headers:nil)
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
      fail ArgumentError, 'site_name is nil' if site_name.nil?
      fail ArgumentError, 'name is nil' if 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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/sites/{siteName}/recommendations/{name}'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'name' => name,'subscriptionId' => @client.subscription_id},
          query_params: {'updateSeen' => update_seen,'recommendationId' => recommendation_id,'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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Web::Mgmt::V2018_02_01::Models::RecommendationRule.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

    #
    # Disables the specific rule for a web site permanently.
    #
    # Disables the specific rule for a web site permanently.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Site name
    # @param name [String] Rule name
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    #
    def disable_recommendation_for_site(resource_group_name, site_name, name, custom_headers:nil)
      response = disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:custom_headers).value!
      nil
    end

    #
    # Disables the specific rule for a web site permanently.
    #
    # Disables the specific rule for a web site permanently.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Site name
    # @param name [String] Rule name
    # @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 disable_recommendation_for_site_with_http_info(resource_group_name, site_name, name, custom_headers:nil)
      disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:custom_headers).value!
    end

    #
    # Disables the specific rule for a web site permanently.
    #
    # Disables the specific rule for a web site permanently.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Site name
    # @param name [String] Rule name
    # @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 disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:nil)
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
      fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
      fail ArgumentError, 'site_name is nil' if site_name.nil?
      fail ArgumentError, 'name is nil' if 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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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.Web/sites/{siteName}/recommendations/{name}/disable'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'name' => 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 MsRestAzure::AzureOperationError.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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

        result
      end

      promise.execute
    end

    #
    # List all recommendations for a subscription.
    #
    # List all recommendations for a 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 [RecommendationCollection] operation results.
    #
    def list_next(next_page_link, custom_headers:nil)
      response = list_next_async(next_page_link, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # List all recommendations for a subscription.
    #
    # List all recommendations for a 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:custom_headers).value!
    end

    #
    # List all recommendations for a subscription.
    #
    # List all recommendations for a 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 = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.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

    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # @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 [RecommendationCollection] operation results.
    #
    def list_history_for_web_app_next(next_page_link, custom_headers:nil)
      response = list_history_for_web_app_next_async(next_page_link, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # @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_history_for_web_app_next_with_http_info(next_page_link, custom_headers:nil)
      list_history_for_web_app_next_async(next_page_link, custom_headers:custom_headers).value!
    end

    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # @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_history_for_web_app_next_async(next_page_link, custom_headers:nil)
      fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.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

    #
    # Get all recommendations for an app.
    #
    # Get all recommendations for an app.
    #
    # @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 [RecommendationCollection] operation results.
    #
    def list_recommended_rules_for_web_app_next(next_page_link, custom_headers:nil)
      response = list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Get all recommendations for an app.
    #
    # Get all recommendations for an app.
    #
    # @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_recommended_rules_for_web_app_next_with_http_info(next_page_link, custom_headers:nil)
      list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:custom_headers).value!
    end

    #
    # Get all recommendations for an app.
    #
    # Get all recommendations for an app.
    #
    # @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_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:nil)
      fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # 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?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Web::Mgmt::V2018_02_01::Models::RecommendationCollection.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

    #
    # List all recommendations for a subscription.
    #
    # List all recommendations for a subscription.
    #
    # @param featured [Boolean] Specify true to return only the most
    # critical recommendations. The default is false, which returns
    # all recommendations.
    # @param filter [String] Filter is specified by using OData syntax. Example:
    # $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq
    # 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq
    # duration'[PT1H|PT1M|P1D]
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [RecommendationCollection] which provide lazy access to pages of the
    # response.
    #
    def list_as_lazy(featured:nil, filter:nil, custom_headers:nil)
      response = list_async(featured:featured, filter:filter, custom_headers: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:custom_headers)
        end
        page
      end
    end

    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # Get past recommendations for an app, optionally specified by the time range.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param expired_only [Boolean] Specify false to return all
    # recommendations. The default is true, which returns only expired
    # recommendations.
    # @param filter [String] Filter is specified by using OData syntax. Example:
    # $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq
    # 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq
    # duration'[PT1H|PT1M|P1D]
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [RecommendationCollection] which provide lazy access to pages of the
    # response.
    #
    def list_history_for_web_app_as_lazy(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
      response = list_history_for_web_app_async(resource_group_name, site_name, expired_only:expired_only, filter:filter, custom_headers:custom_headers).value!
      unless response.nil?
        page = response.body
        page.next_method = Proc.new do |next_page_link|
          list_history_for_web_app_next_async(next_page_link, custom_headers:custom_headers)
        end
        page
      end
    end

    #
    # Get all recommendations for an app.
    #
    # Get all recommendations for an app.
    #
    # @param resource_group_name [String] Name of the resource group to which the
    # resource belongs.
    # @param site_name [String] Name of the app.
    # @param featured [Boolean] Specify true to return only the most
    # critical recommendations. The default is false, which returns
    # all recommendations.
    # @param filter [String] Return only channels specified in the filter. Filter
    # is specified by using OData syntax. Example: $filter=channel eq 'Api' or
    # channel eq 'Notification'
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [RecommendationCollection] which provide lazy access to pages of the
    # response.
    #
    def list_recommended_rules_for_web_app_as_lazy(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
      response = list_recommended_rules_for_web_app_async(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers).value!
      unless response.nil?
        page = response.body
        page.next_method = Proc.new do |next_page_link|
          list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:custom_headers)
        end
        page
      end
    end

  end
end

redpajama_set_name: RedPajamaGithub


text:
'''
Created on Jun 18, 2015

@author: Alex
'''
from ScanModules import BaseModule

class BruteForceModule(BaseModule):
    '''
    classdocs
    '''

    def __init__(self, params):
        '''
        Constructor
        '''
        super(BruteForceModule,self).__init__()


text:
#include "ghttpConnection.h"
#include "ghttpCommon.h"

// Initial size and increment amount for the connections array.
///////////////////////////////////////////////////////////////
#define CONNECTIONS_CHUNK_LEN      4

// An array of pointers to GHIConnection objects.
// A GHTTPRequest is an index into this array.
/////////////////////////////////////////////////
static GHIConnection ** ghiConnections;
static int ghiConnectionsLen;
static int ghiNumConnections;
static int ghiNextUniqueID;

// Finds a gsifree slot in the ghiConnections array.
// If there are no gsifree slots, the array size will be increased.
////////////////////////////////////////////////////////////////
static int ghiFindFreeSlot
(
	void
)
{
	int i;
	GHIConnection ** tempPtr;
	int oldLen;
	int newLen;

	// Look for an open slot.
	/////////////////////////
	for(i = 0 ; i < ghiConnectionsLen ; i++)
	{
		if(!ghiConnections[i]->inUse)
			return i;
	}

	assert(ghiNumConnections == ghiConnectionsLen);

	// Nothing found, resize the array.
	///////////////////////////////////
	oldLen = ghiConnectionsLen;
	newLen = (ghiConnectionsLen + CONNECTIONS_CHUNK_LEN);
	tempPtr = (GHIConnection **)gsirealloc(ghiConnections, sizeof(GHIConnection *) * newLen);
	if(!tempPtr)
		return -1;
	ghiConnections = tempPtr;

	// Create the new connection objects.
	/////////////////////////////////////
	for(i = oldLen ; i < newLen ; i++)
	{
		ghiConnections[i] = (GHIConnection *)gsimalloc(sizeof(GHIConnection));
		if(!ghiConnections[i])
		{
			for(i-- ; i >= oldLen ; i--)
				gsifree(ghiConnections[i]);
			return -1;
		}
		ghiConnections[i]->inUse = GHTTPFalse;
	}

	// Update the length.
	/////////////////////
	ghiConnectionsLen = newLen;

	return oldLen;
}

GHIConnection * ghiNewConnection
(
	void
)
{
	int slot;
	GHIConnection * connection;
	GHTTPBool bResult;

	ghiLock();

	// Find a gsifree slot.
	////////////////////
	slot = ghiFindFreeSlot();
	if(slot == -1)
	{
		ghiUnlock();
		return NULL;
	}

	// Get a pointer to the object.
	///////////////////////////////
	connection = ghiConnections[slot];

	// Init the object.
	///////////////////
	memset(connection, 0, sizeof(GHIConnection));
	connection->inUse = GHTTPTrue;
	connection->request = (GHTTPRequest)slot;
	connection->uniqueID = ghiNextUniqueID++;
	connection->type = GHIGET;
	connection->state = GHTTPSocketInit;
	connection->URL = NULL;
	connection->serverAddress = NULL;
	connection->serverIP = INADDR_ANY;
	connection->serverPort = (unsigned short)0;
	connection->requestPath = NULL;
	connection->sendHeaders = NULL;
	connection->saveFile = NULL;
	connection->blocking = GHTTPFalse;
	connection->persistConnection = GHTTPFalse;
	connection->result = GHTTPSuccess;
	connection->progressCallback = NULL;
	connection->completedCallback = NULL;
	connection->callbackParam = NULL;
	connection->socket = INVALID_SOCKET;
	connection->socketError = 0;
	connection->userBufferSupplied = GHTTPFalse;
	connection->statusMajorVersion = 0;
	connection->statusMinorVersion = 0;
	connection->statusCode = 0;
	connection->statusStringIndex = 0;
	connection->headerStringIndex = 0;
	connection->completed = GHTTPFalse;
	connection->fileBytesReceived = 0;
	connection->totalSize = -1;
	connection->redirectURL = NULL;
	connection->redirectCount = 0;
	connection->chunkedTransfer = GHTTPFalse;
	connection->processing = GHTTPFalse;
	connection->throttle = GHTTPFalse;
	connection->lastThrottleRecv = 0;
	connection->post = NULL;
	connection->maxRecvTime = 500; // Prevent blocking in async mode with systems that never generate WSAEWOULDBLOCK
	connection->proxyOverridePort = GHI_DEFAULT_PORT;
	connection->proxyOverrideServer = NULL;
	connection->encryptor.mInterface = NULL;

//handle used for asynch DNS lookups
#if !defined(GSI_NO_THREADS)
	connection->handle = NULL;
#endif

	bResult = ghiInitBuffer(connection, &connection->sendBuffer, SEND_BUFFER_INITIAL_SIZE, SEND_BUFFER_INCREMENT_SIZE);
	if(bResult)
		bResult = ghiInitBuffer(connection, &connection->encodeBuffer, ENCODE_BUFFER_INITIAL_SIZE, ENCODE_BUFFER_INCREMENT_SIZE);
	if(bResult)
		bResult = ghiInitBuffer(connection, &connection->recvBuffer, RECV_BUFFER_INITIAL_SIZE, RECV_BUFFER_INCREMENT_SIZE);
	if (bResult)
		bResult = ghiInitBuffer(connection, &connection->decodeBuffer, DECODE_BUFFER_INITIAL_SIZE, DECODE_BUFFER_INCREMENT_SIZE);

	if(!bResult)
	{
		ghiFreeConnection(connection);
		ghiUnlock();
		return NULL;
	}

	// One more connection.
	///////////////////////
	ghiNumConnections++;

	ghiUnlock();

	return connection;
}

GHTTPBool ghiFreeConnection
(
	GHIConnection * connection
)
{
	assert(connection);
	assert(connection->request >= 0);
	assert(connection->request < ghiConnectionsLen);
	assert(connection->inUse);

	// Check args.
	//////////////
	if(!connection)
		return GHTTPFalse;
	if(!connection->inUse)
		return GHTTPFalse;
	if(connection->request < 0)
		return GHTTPFalse;
	if(connection->request >= ghiConnectionsLen)
		return GHTTPFalse;

	ghiLock();

	// Free data.
	/////////////
	gsifree(connection->URL);
	gsifree(connection->serverAddress);
	gsifree(connection->requestPath);
	gsifree(connection->sendHeaders);
	gsifree(connection->redirectURL);
	gsifree(connection->proxyOverrideServer);
#ifndef NOFILE
	if(connection->saveFile)
		fclose(connection->saveFile);
#endif
	if(connection->socket != INVALID_SOCKET)
	{
		shutdown(connection->socket, 2);
		closesocket(connection->socket);
	}
	ghiFreeBuffer(&connection->sendBuffer);
	ghiFreeBuffer(&connection->encodeBuffer);
	ghiFreeBuffer(&connection->recvBuffer);
	ghiFreeBuffer(&connection->decodeBuffer);
	ghiFreeBuffer(&connection->getFileBuffer);
	if(connection->postingState.states)
		ghiPostCleanupState(connection);

	// Check for an auto-free post.
	///////////////////////////////
	if(connection->post && ghiIsPostAutoFree(connection->post))
	{
		ghiFreePost(connection->post);
		connection->post = NULL;
	}

	// Check for an encryptor
	if (connection->encryptor.mInitialized != GHTTPFalse)
	{
		if (connection->encryptor.mCleanupFunc)
			(connection->encryptor.mCleanupFunc)(connection, &connection->encryptor);
		connection->encryptor.mInitialized = GHTTPFalse;
	}

	// Free the slot.
	/////////////////
	connection->inUse = GHTTPFalse;

	// One less connection.
	///////////////////////
	ghiNumConnections--;

	ghiUnlock();

	return GHTTPTrue;
}

GHIConnection * ghiRequestToConnection
(
	GHTTPRequest request
)
{
	GHIConnection * connection;

	assert(request >= 0);
	assert(request < ghiConnectionsLen);

	ghiLock();

	// Check args.
	//////////////
	if((request < 0) || (request >= ghiConnectionsLen))
	{
		ghiUnlock();
		return NULL;
	}

	connection = ghiConnections[request];

	// Check for not in use.
	////////////////////////
	if(!connection->inUse)
		connection = NULL;

	ghiUnlock();

	return connection;
}

void ghiEnumConnections
(
	GHTTPBool (* callback)(GHIConnection *)
)
{
	int i;

	// Check for no connections.
	////////////////////////////
	if(ghiNumConnections <= 0)
		return;

	ghiLock();
	for(i = 0 ; i < ghiConnectionsLen ; i++)
		if(ghiConnections[i]->inUse)
			callback(ghiConnections[i]);
	ghiUnlock();
}

void ghiRedirectConnection
(
	GHIConnection * connection
)
{
	assert(connection);
	assert(connection->redirectURL);

	gsDebugFormat(GSIDebugCat_HTTP, GSIDebugType_State, GSIDebugLevel_Comment, "Redirecting Connection\n");

	// Reset state.
	///////////////
	connection->state = GHTTPSocketInit;

	// Cancel asychronous lookup if it has not already been done
#if !defined(GSI_NO_THREADS)
	if (connection->handle != NULL)
	{
		gsDebugFormat(GSIDebugCat_HTTP, GSIDebugType_State, GSIDebugLevel_Comment,
			"Cancelling Thread and freeing memory\n");
		gsiCancelResolvingHostname(*connection->handle);
		gsifree(connection->handle);
		connection->handle = NULL;
	}
#endif

	// New URL.
	///////////
	gsifree(connection->URL);
	connection->URL = connection->redirectURL;
	connection->redirectURL = NULL;

	// Reset stuff parsed from the URL.
	///////////////////////////////////
	gsifree(connection->serverAddress);
	connection->serverAddress = NULL;
	connection->serverIP = 0;
	connection->serverPort = 0;
	gsifree(connection->requestPath);
	connection->requestPath = NULL;

	// Close the socket.
	////////////////////
	shutdown(connection->socket, 2);
	closesocket(connection->socket);
	connection->socket = INVALID_SOCKET;

	// Reset buffers.
	/////////////////
	ghiResetBuffer(&connection->sendBuffer);
	ghiResetBuffer(&connection->encodeBuffer);
	ghiResetBuffer(&connection->recvBuffer);
	ghiResetBuffer(&connection->decodeBuffer);

	// Reset status.
	////////////////
	connection->statusMajorVersion = 0;
	connection->statusMinorVersion = 0;
	connection->statusCode = 0;
	connection->statusStringIndex = 0;

	connection->headerStringIndex = 0;

	// The connection isn't closed.
	///////////////////////////////
	connection->connectionClosed = GHTTPFalse;

	// Check for an encryptor
	if (connection->encryptor.mInitialized != GHTTPFalse)
	{
		// cleanup the encryptor
		if (connection->encryptor.mCleanupFunc)
			(connection->encryptor.mCleanupFunc)(connection, &connection->encryptor);
		connection->encryptor.mInitialized = GHTTPFalse;

		// if the redirect isn't secure, clear it
		if(strncmp("https://", connection->URL, 8) != 0)
		{
			connection->encryptor.mEngine = GHTTPEncryptionEngine_None;
			connection->encryptor.mInterface = NULL;
		}
	}

	// One more redirect.
	/////////////////////
	connection->redirectCount++;
}

void ghiCleanupConnections
(
	void
)
{
	int i;

	if(!ghiConnections)
		return;

	// Cleanup all running connections.
	///////////////////////////////////
	ghiEnumConnections(ghiFreeConnection);

	// Cleanup the connection states.
	/////////////////////////////////
	for(i = 0 ; i < ghiConnectionsLen ; i++)
		gsifree(ghiConnections[i]);
	gsifree(ghiConnections);
	ghiConnections = NULL;
	ghiConnectionsLen = 0;
	ghiNumConnections = 0;
}


text:
Q: Why does every toric ideal correspond to an affine toric variety? I'm reading the book Toric Varieties by Cox, Little and Schenk, and have a small question about the proof of their Proposition 1.1.11 (on page 16). The key part of the proposition is this:

Claim: Let $I\subseteq\mathbb{C}[x_1,\ldots,x_s]$ be a prime ideal generated by (pure) binomials. Then $V(I)\subseteq\mathbb{C}^s$ is an
  affine toric variety.

The idea of the proof (slightly reformulated to simplify the notation) is this:

*

*Use the fact that $I$ is both prime and binomial, to conclude that $V(I)\cap(\mathbb{C}^*)^s$ is a torus (since it's both an irreducible subvariety and a subgroup of $(\mathbb{C}^*)^s$).

*Suppose that the dimension of $V(I)\cap(\mathbb{C}^*)^s$ is $n$, and pick an isomorphism $(\mathbb{C}^*)^n\to V(I)\cap(\mathbb{C}^*)^s$.

*Form the composition $\Phi\colon (\mathbb{C}^*)^n\to V(I)\cap(\mathbb{C}^*)^s\hookrightarrow (\mathbb{C}^*)^s$, and note that it's an algebraic group homomorphism (concretely, this means that every component is given by a Laurent polynomial). Let $Y$ be the Zariski closure of $\mathrm{Im}(\Phi)$ in $\mathbb{C}^s$.

*Observe that $V(I)=Y$.

*Since we have already shown (see Proposition 1.1.8 on page 13) that every affine variety that arises as the closure of the image of an algebraic group homomorphism $(\mathbb{C}^*)^n\to(\mathbb{C^*})^s$ is an affine toric variety, the desired conclusion follows.
It's the second to last step that confuses me.
Since $\mathrm{Im}(\Phi)=V(I)\cap(\mathbb{C}^*)^s$, this essentially boils down to showing that $\overline{V(I)\cap(\mathbb{C}^*)^s}=V(I)$. The inclusion "$\subseteq$" is easy, because $V(I)$ certainly is a Zariski closed subset that contains $V(I)\cap(\mathbb{C}^*)^s$. But do we know that $V(I)$ is the smallest such subset?
Edit: I think I figured it out! See below.

A: If I'm not mistaken, this was easier than I thought. Simply note that $V(I)\cap(\mathbb{C}^*)^s$ is Zariski open in $V(I)$. Since $V(I)$ is irreducible, and every Zariski open subset of an irreducible affine variety is dense, it follows that the Zariski closure of $V(I)\cap(\mathbb{C}^*)$ in $V(I)$ is $V(I)$. And this, in turn, implies that the Zariski closure in $\mathbb{C}^s$ is $V(I)$, which is what we wanted to prorve.

redpajama_set_name: RedPajamaStackExchange


text:
`)); } $(v).detach().appendTo('#overflowDropdown'); } }); } });
Facebook Twitter LinkedIn Tumblr
Sign up for UC ANR news releases
UC ANR expert sources
Earth Day history can inspire us all
My father was ahead of his time.
Years before Americans were asked to, Jim Hayden ensured that our family conserved energy by keeping the thermostat low, turning off lights and taking "military" showers to reduce water use. My father also observed the speed limit. Our family vacations took us to national parks. I grew up with a keen appreciation for the outdoors. I remember the sense of horror and helplessness when I saw the images of distressed wildlife in the aftermath of the Santa Barbara oil spill, which devastated the beaches that were an important part of our family's life.
In part as a result of that oil spill, Earth Day came into being. And 49 years after that inaugural Earth Day event, many of us will find ourselves at a gathering dedicated to increasing awareness of the environment that supports and sustains us all.
In 1969, President Richard Nixon visited the site of an oil slick in Santa Barbara. (Photo: Wikimedia Commons)
Earth Day was launched in 1970. Many factors contributed to the call for a national day focusing on environmental stewardship, including the publication of Rachel Carson's Silent Spring - serialized in the New Yorker - and the catastrophic oil spill that occurred off the coast of Santa Barbara in 1969. The Santa Barbara oil spill galvanized U.S. Senator Gaylord Nelson (D-Wisconsin) to call for a national day of locally inspired and organized "teach-ins" on the environment - a national "Earth Day." The Earth Day model was inspired by the spirit of campus activism at the nation's colleges and universities. It wasn't top-down, but rather a grassroots effort that encouraged communities to develop educational and service events around issues and topics important to them.
Earth Day struck a chord; some estimates suggest that 1 in 10 Americans participated in the first events. Earth Day is widely credited with "sparking" the modern environmental movement. Landmark environmental legislation swiftly followed (including the Clean Air Act, Clean Water Act and Endangered Species Act). The Environmental Protection agency was founded that same year. Twenty years after its launch, Earth Day became a global movement.
You can learn more from the Earth Day Network by linking to this website.
Take part. Learn. Act.
UC ANR research efforts support a healthy and sustainable environment
UC ANR is dedicated to supporting a healthy and sustainable environment. It's part of our core mission. Highlighted below are just a few of the many projects we're working on to protect California's natural resources, build climate-resilient communities and ecosystems, and promote healthy people and communities.
Seeking Street Trees that Can Cope With Climate Change
Trees play a vital role in shading and beautifying California's urban areas. UC ANR researcher Janet Hartin says that:
"Urban areas create heat islands, with dark asphalt surfaces reradiating heat. Cities can be 10 to 20 degrees warmer than the surrounding environment."
Trees provide other benefits, including improving soil health and stability, providing habitat for wildlife and serving as a source of beauty. But climate change (resulting in reduced rainfall and higher temperatures) can create chronic stress in some street tree species.
To find a solution, UC Cooperative Extension scientists are partnering with the U.S. Forest Service "in an unprecedented 20-year research study to expand the palette of drought-adapted, climate-ready trees for several of the state's climate zones."
"The idea is to look at available but under-planted, drought-tolerant, structurally sound, pest resistant trees for Southern California that do well in even warmer climates," said Janet Hartin, UCCE horticulture advisor in San Bernardino County.
Learn more - including what tree species might be planted in your area - in this terrific read by Jeannette Warnert.
CDFA and UC ANR join forces to advance Climate-Smart Ag
A new partnership between the California Department of Food and Agriculture (CDFA) and UCANR aims to advance climate-smart ag in California. More than $1 million has been used to hire 10 UC Cooperative Extension community education specialists, who are being deployed to 10 counties to help farmers participate in CDFA programs that increase the adopting of "smart" farming and ranching practices.
The primary focus is putting into action on-farm solutions to improve (and increase) smart farming practices that reduce greenhouse gas emissions. Practices that improve soil health, nutrient management, irrigation management, and more will be emphasized.
Learn more about this innovative program here.
Be kind to the Earth by reducing food waste
Nearly 40 percent of the food produced in the U.S. is wasted and much of that waste ends up in landfills (definitely not good for our environment or the economy). The National Resources Defense Council estimates that the average family of four throws out nearly 1,000 pounds of food each year, wasting roughly $1,500. Consumers as a group waste more food than farms, grocery stores or restaurants. For tips on ways you can reduce #FoodWaste, click here. Related Reading: What a World War I Poster Can Teach Us About #FoodWaste.
4-H Sustainable You! summer camp to be offered in Ventura County
The UCCE Ventura County team will once again be hosting its week-long 4-H Sustainable You! summer day camp at UC's Hansen Agricultural Research and Extension Center (HAREC) in Santa Paula. Campers aged 9-12 are invited to spend time on a working farm, learning what it means to be sustainable through fun activities based around the five major themes: Air, Land, Energy, Water, and Food. Registration information can be found here.
For more than 100 years the UC ANR 4-H Youth Development Program has taught generations of California children about food, agriculture, leadership, and community service using learn-by-doing practices. The California 4-H Science, Engineering and Technology (STEM) Initiative seeks to increase science literacy and help address the growing need for scientists, engineers, and technical experts. 4-H empowers youth with the skills to lead for a lifetime.
Interested in learning more about 4-H in your community? Visit our statewide 4-H program page.
December 1968 Earth rise.
The above photo is one of my favorites. It was taken by Apollo 8 astronaut Bill Anders on Dec. 24, 1968, while in orbit around the moon. It shows the Earth rising for the third time above the lunar horizon. It always serves to remind me that my individual actions do matter, and when considered with the actions of others, contribute to real change ... the "moon shot." Have a great Earth Day!
By Rose Marie Hayden-Smith
Author - UCCE Advisory in Digital Communications in Food Systems & Extension Education; Editor, UC Food Observer; Food and Society Policy Fellow
climate-smart ag
Grow it: Gardening tips and resources
Summer safety: Tips to avoid foodborne and heat illnesses
Climate and California agriculture of the future
Can you taste barley varieties in beer? UC ANR scientist wants to know.
Creative, healthy cooking marks EFNEP's anniversary in Tulare County
LinkedIn (organization)

redpajama_set_name: RedPajamaCommonCrawl


In the 12 months before Shelter opened this year 9 people died sleeping rough on the streets of Ilford.
So many people are reaching out, asking how they can help.
Volunteering at the Redbridge Cold Weather Centre - the night shelter at Ilford Salvation Army - is one way you can make a difference. It's definitely a way to save a life.
Usually, we only open for the Winter season but because of some delays to Project Malachi, this year we are planning to open earlier, and for a longer period of time (until Project Malachi opens in 2019). We'll be focussing on supporting our guests to move on from the shelter, and making sure we have enough volunteers involved to make sure we can keep the provision open for a longer period of time.
Get involved. Save someone's life. Be a part of one of the biggest community efforts in Redbridge.
Fill in your details here to start the process of getting involved.


text:
Галдор Легрейд (;  ) — норвезький музичний виконавець. Його найбільше визнають виконавцем балади «On My Own», яка лунала від Норвегії на Євробаченні 2001 року в Копенгагені, Данія. Галдор фінішував останнім, одержавши лише три очки від Португалії.   Пісня «On My Own» досягла п'ятого місця в рейтингу Norway Singles Chart.

Примітки

Посилання

Співаки XXI століття
Учасники Євробачення 2001
Представники Норвегії на Євробаченні

redpajama_set_name: RedPajamaWikipedia


text:
Q: Filter results of Azure storage directory list Goal
Is there a way to (1) download every file named index.json in an Azure Storage container (in directories, subdirectories, sub-subdirectories, and on) and (2) rename each index.json with the name of its source directory?
Proposed solution
I'm pursuing a solution that (1) uses az storage fs file download in the az CLI and (2) applies a wildcard or pattern that returns every index.json in every directory level of the container, but I am not successful with (2). See failed examples below.
Current inefficient solution
My current solution is inefficient and doesn't return index.json from all levels of the container - only the top level.
I can add details around the use case if that will help. Thank you for any help or ideas on better approaches.
Example of Azure Blob structure
container/

  product-1/
    articles/
      page-1.html
      page-2.html
    fonts/
      fontawesome.ttf
    images/
      product-image-1.png
      product-image-2.png
    node-modules/
      ...
    styles/
      style.css
      style.js
    index.html
    index.json

  product-2/
    articles/
      page-3.html
      page-4.html
    fonts/
      fontawesome.ttf
    images/
      product-image-3.png
      product-image-4.png
    node-modules/
      ...

    product-2-a/
      articles/
        page-3.html
        page-4.html
      fonts/
        fontawesome.ttf
      images/
        product-image-3.png
        product-image-4.png
      node-modules/
        ...
      styles/
        style.css
        style.js
      index.html
      index.json

    styles/
      style.css
      style.js
    index.html
    index.json

  index.html

Desired result (local machine) - each .json file is a renamed index.json file:
localIndexes/
  product-1.json
  product-2.json
  product-2-a.json

Current undesirable strategy

*

*Create a JSON file that is a list of all directories in the blob (note that it does not download subdirectories, sub-subdirectories, and so on, which is not desired).

az storage fs directory list -f wwwroot --recursive false --account-name $storageAccountName --account-key $accountKey > dirs.json

Result: dirs.json (incomplete - just an example of objects included)
[
  {
    "contentLength": 0,
    "etag": "123",
    "group": "$abc",
    "isDirectory": true,
    "lastModified": "2022-01-13T23:20:19",
    "name": "product-1",
    "owner": "$abc",
    "permissions": "abc---"
  },
  {
    "contentLength": 0,
    "etag": "345",
    "group": "$abc",
    "isDirectory": true,
    "lastModified": "2022-01-13T23:20:19",
    "name": "product-2",
    "owner": "$abc",
    "permissions": "abc---"
  }
  {
    "contentLength": 0,
    "etag": "456",
    "group": "$abc",
    "isDirectory": true,
    "lastModified": "2022-01-13T23:20:19",
    "name": "styles",
    "owner": "$abc",
    "permissions": "abc---"
  }
]

*Remove objects for each unneeded .name (aka directory) from dirs.json using jq. Using my inefficient method, the script in step 3 breaks if it encounters a directory that doesn't include index.json:

for excludeDir in css \
fonts \
images \
js \
node_modules \
styles ; do
jq --arg excludeDir $excludeDir '[.[] | select(.name != $excludeDir)]' dirs.json > temp.tmp && mv temp.tmp dirs.json
done

Result: dirs.json (incomplete - just an example of objects included)
[
  {
    "contentLength": 0,
    "etag": "123",
    "group": "$abc",
    "isDirectory": true,
    "lastModified": "2022-01-13T23:20:19",
    "name": "product-1",
    "owner": "$abc",
    "permissions": "abc---"
  },
  {
    "contentLength": 0,
    "etag": "345",
    "group": "$abc",
    "isDirectory": true,
    "lastModified": "2022-01-13T23:20:19",
    "name": "product-2",
    "owner": "$abc",
    "permissions": "abc---"
  }
]

*Loop over each .name (aka directory) in dirs.json to (1) download index.json in that directory and (2) rename index.json with the name of the directory.

jq -r '.[] | "\(.name)"' dirs.json |
    while IFS="|" read -r name; do

for dir in $name ; do
blobName=`echo $name | tr -d '\r'`
az storage blob download --container-name $containerName --file localIndexes/$blobName.json --name $blobName/index.json --account-key $accountKey --account-name $storageAccountName
done

done

Incomplete result
Note that product-2-a.json is missing, as would further nested subdirectories.
localIndexes/
  product-1.json
  product-2.json

Failed attempts at using the az CLI to download index.json using wildcards/patterns
Various iterations of:
az storage fs file download -p */index.json -f wwwroot --account-name $storageAccountName --account-key $accountKey

az storage fs file download -p /**/index.json -f wwwroot --account-name $storageAccountName --account-key $accountKey

az storage fs file download -p /--pattern index.json -f wwwroot --account-name $storageAccountName --account-key $accountKey

A: There is no specific File filter from Azure side. We need to fetch all the files and the files need to be filtered at client side based on requirement.
Different file types uploaded in Azure

Files fetching from azure using C# and Power shell script
Below is the Power shell script to fetch the files

Install-Module Az.Storage
Connect-AzAccount
$MaxReturn = 20000
$Container_Name = "container_Name"
$Token = $Null
$Storage_Context = New-AzureStorageContext -StorageAccountName 'storageaccount' -StorageAccountKey 'Key'
$Container = Get-AzureStorageContainer -Name $Container_Name -Context $Storage_Context
$Blobs = Get-AzStorageBlob -Container $Container_Name -MaxCount $MaxReturn  -ContinuationToken $Token -Context $Storage_Context
Echo $Blobs

Below is the filtering of filetypes using C# code

foreach (var blob in blobs)
        {
            if (blob is CloudBlockBlob)
            {
                var blob_FileName = blob.Uri.Segments.Last().Replace("%20", " ");
                var blob_FilePath = blob.Uri.AbsolutePath.Replace(blob.Container.Uri.AbsolutePath + "/", "").Replace("%20", " ");
                var blob_Path = blob_FilePath.Replace("/" + blob_FileName, "");
                blob_Infos.Add(new BlobFileInfo
                {
                    File = blob_FileName,
                    Path = blob_Path,
                    Blob_FilePath = blob_FilePath,
                    Blob = blob
                });
            }
            if (blob is CloudBlobDirectory)
            {
                var blob_Dir = blob.Uri.OriginalString.Replace(blob.Container.Uri.OriginalString + "/", "");
                blob_Dir = blob_Dir.Remove(blob_Dir.Length - 1);
                var subBlobs = ListFolderBlobs(containerName, blob_Dir);
                blob_Infos.AddRange(subBlobs);
            }
        }
        return blob_Infos;


text:
Our Catalog Science & Math Evolution
The Cell Language Theory: Connecting Mind and Matter
The Cell Language Theory: Connecting Mind and Matter by World Scientific Publishing Europe Ltd at Translate This Website. Hurry! Limited time offer. Offer valid only while supplies last. This book represents the results of 45 years of research on a wide range of topics, including atomic physics, single-molecule enzymology, whole-cell metabolism, physiology, pharmacology, linguistics, semiotics, and cosmology. It describes the first comprehensive molecular theory of the genotype-phenotype coupling based on two key theoretical concepts: (i) the conformon, the conformational wave packet in biopolymers carrying both the free energy and genetic information; and (ii) the
This book represents the results of 45 years of research on a wide range of topics, including atomic physics, single-molecule enzymology, whole-cell metabolism, physiology, pharmacology, linguistics, semiotics, and cosmology. It describes the first comprehensive molecular theory of the genotype-phenotype coupling based on two key theoretical concepts: (i) the conformon, the conformational wave packet in biopolymers carrying both the free energy and genetic information; and (ii) the intracellular dissipative structures, the chemical concentration waves inside the cell that serve as the immediate drivers of all cell functions. conformon provide the driving forces for all molecular machines in the cell, and intracellular dissipative structures coordinate intra- and intercellular processes such as gene expression and cell-cell communications. One of the predictions made by the cell language theory (CLT) is that there are two forms of genetic information — the Watson–Crick genes transmitting information in time (identified with DNA), and the Prigoginian genes transmitting information in space (identified with RNA expression profiles). The former is analogous to sheet music or written language and the latter is akin to audio music or spoken language, both being coupled by conformons acting as the analog of the pianist. The new theory of DNA structure and function constructed on the basis of CLT can rationally account for most of the puzzling findings recently unearthed by the ENCODE (Encyclopedia of DNA Elements) project. The Cell Language Theory has important applications in biomedical sciences including drug discovery research and personalized medicine on the one hand and in the mind-body research and consciousness studies on the other. Readership: Students, researchers and practitioners of the biomedical sciences and mind-body research and consciousness studies
Manufacturer: World Scientific Publishing Europe Ltd
Publisher: World Scientific Publishing Europe Ltd
Studio: World Scientific Publishing Europe Ltd
Brand: World Scientific Publishing Europe Ltd
View More In Evolution.
If you have any questions about this product by World Scientific Publishing Europe Ltd, contact us by completing and submitting the form below. If you are looking for a specif part number, please include it with your message.
Approaches to the Evolution of Language: Social and Cognitive Bases
By Cambridge University Press
This is one of the first systematic attempts to bring language within the neo-Darwinian framework of modern evolutionary theory. Twenty-four coordinated essays by linguists, phoneticians, anthropologists, psychologists and cognitive scientists explore the origins of the complex structure of human language, emphasizing its social (as opposed to purely practical) bases, and showing the mechanisms by which this structure emerges, is maintained, and develops..
The Singing Neanderthals: The Origins of Music, Language, Mind and Body
By Orion Publishing Group
The development of language was one of the key factors that enabled the emergence of the modern mind, with its seemingly unlimited powers of imagination, curiosity and invention. It is one of the things that makes us human and, whether gestural, written or spoken, allows us to communicate ideas from the most mundane to the most profound. But while the origins of language have provoked furious debate, those of music- our other major vocal and aural communication system have been oddly neglected,
Neurogenic Disorders of Language and Cognition: Evidence-based Clinical Practice
By Pro Ed
EXCELLENT Condition.Aphasia, dementia, traumatic brain injury, TBI, stroke, cognitive disorders, communication disorders, right hemisphere.
Lucy to Language: The Benchmark Papers
The concept of the social brain has become a popular topic in the last decade and has generated interest within the research community and contributed to a wide public examination of human culture, nature, mind, and instinct, as well as aspects of social and business organisation. At its core, the hypothesis that our social life drove the dramatic enlargement of our brain, bridges the dimensions of our evolutionary history and our contemporary experience. This has been the focus of a seven-year


text:
The government and media are making people into psychos who fear each other's mere presence.
December 23, 2021 10:23 am by IWB
by ImOnTheBus
Yeah, I know I'm preaching to the choir but here's a rant:
Don't like to talk about work on the internet just feels kinda wrong, so will be vague. The media has obviously turned the fear dial way up lately and I am astounded that it still works so well after 2 f*cking years of this BS.
My work is well under 100 people and in a red state, so as far as I know: they don't have to do jack shit to address Covid, but in my opinion: they're overly cautious. Everybody has to wear masks and if somebody has so much as a sniffle they're want you to call off, and everybody has these pieces of tape near where they work to indicate 6 feet, and nobody is supposed to cross them (as if that's going to do anything).
starting a few weeks ago this coworker keeps running away from people and then going home because of The Fear. Now I'm having to pick up the slack, which is fine I guess, but the nature of my work makes this the most busy time of year by far.
See also New Madonna Vanity Fair photo shoot. These people and that whole industry is utterly demonic.
I adhere to the red tape even though I think it's silly. Went behind this coworker's piece of tape to tell them something work related and they were literally recoiling in horror from my presence with hands up in defensive posture. They ended up leaving again because of that and threatening to "report us". Genuine fear in their eyes too, I don't think it's for the sake of trying to get out of work or anything.
Didn't really get in trouble or anything but was approached about it, and it's clear that I was behind the tape and not sick at all or anything, so I guess just about me having a body that can potentially harbor disease which is what I've been doing since day 1. Also haven't told anybody there that I refuse to get the injections and have seen the same behavior toward people who brag about having it, so don't think it has anything to do with that.
What is going on is absolutely f*cked up. The government and media are purposely making people fearful of the mere presence of other people and I don't like it. Thanks for reading my rant and happy holidays.
See also Welcome to Hotel California: Lawmakers Move to Tax People Who Have Left the State
Tags government, making, media, other, people, presence, psychos Post navigation
Why did the evergrande default not cause a financial collapse?
From Germany, "Do not buy from the unvaccinated."