Check that mandatory parameters are not nil and contain valid values

 @return [Boolean] if configuration is valid
429388
def is_valid?
      site_option_valid               = !site.nil? && !site.empty?
      api_key_option_valid            = !api_key.nil? && !api_key.empty?
      use_ssl_option_valid            = !use_ssl.nil? && !!use_ssl == use_ssl # Check this is a boolean
      api_version_option_valid        = !api_version.nil? && !api_version.empty?
      project_name_option_valid       = !project_name.nil? && !project_name.empty?
      ignored_paths_option_valid      = ignored_paths.kind_of?(Array)

      site_option_valid && api_key_option_valid && use_ssl_option_valid && api_version_option_valid &&
      project_name_option_valid && ignored_paths_option_valid
    end
646294
def validate_required_any(required_configs)
      valid = required_configs.select { |config| config_set?(config) }

      return if valid.any?

      config_list = required_configs.map { |conf| '`' + conf + '`' }.join(', ')
      message = "At least one of the configuration values has to be set: #{config_list}."
      raise ConfigurationError, message
    end
34753
def assert_valid_value(value)
      unless valid?(value)
        raise Property::InvalidValueError.new(self,value)
      end
      true
    end
490994
def valid?
      result = true

      selected.each do |view|
        view.rmq_data.validations.each do |validation|

          has_events = view.rmq_data.events

          if validation.valid?(rmq(view).data)
            if has_events && view.rmq_data.events.has_event?(:valid)
              view.rmq_data.events[:valid].fire!
            end
          else
            if has_events && view.rmq_data.events.has_event?(:invalid)
              view.rmq_data.events[:invalid].fire!
            end
            result = false
          end
        end
      end
      return result
    end
158002
def validate_ipaddr key, value, opts
      if opts[:ipaddr] == true && value.kind_of?(String)
        value = IPAddr.new(value)
      end
      value.to_s
    end
736179
def check_parameters
      errors = ""
      @url.scan(/:(\w*)/).flatten.map(&:to_sym).each do |arg|
        errors += "<li><p>parameter '#{arg.to_s}' is required</p></li>" unless @attributes.has_key?(arg)
      end
      errors.empty? ? "" : "<ul>#{errors}</ul>"
    end
88893
def validate_input(dest, args)
      return true unless should_validate(dest)
      @input.each do |p|
        val = args[p[:symbol]]
      
        # if the argument has a value, no need to test whether it is optional.
        next unless !val || val == '*' || val == ''
      
        opts = p[:opts]
        unless opts[:optional]
          raise ArgumentError, "You must specify the required input #{p[:symbol]}"
        end
      end
      return true
    end
7924
def valid?
      return false if @status.nil?
      status_validator = EnumAttributeValidator.new('String', ['error'])
      return false unless status_validator.valid?(@status)
      return false if @errors.nil?
      true
    end
991111
def _check_valid_basic(self, get_params):
        
        try:
            if get_params(self.variable):
                return self.default
        except:  # noqa e722
            pass
        return not self.default
397821
function validate(args, required) {
    var result = {
      error: false,
      message: 'No errors'
    }

    // ensure required properties were passed in the arguments hash
    if (required) {
      var keys = _.keys(args);
      required.forEach(function(field) {
        if(!_.contains(keys, field)) {
          result.error = true;
          result.message = 'The following values must be passed: ' + required.join(', ');
        }
      })
    }

    return result;

  }
254777
def valid?(format=@config[:local_format]||:conventional)
      if @config[:mailbox_validator].is_a?(Proc)
        @config[:mailbox_validator].call(self.mailbox, self.tag)
      elsif format.is_a?(Proc)
        format.call(self)
      elsif format == :conventional
        self.conventional?
      elsif format == :relaxed
        self.relaxed?
      elsif format == :redacted
        self.redacted?
      elsif format == :standard
        self.standard?
      elsif format == :none
        true
      else
        raise "Unknown format #{format}"
      end
    end
132862
def valid?
      valid = true

      # A name must be specified.
      if self.name.nil?
        valid = false
        applog(self, :error, "No name String was specified.")
      end

      # Valid states must be specified.
      if self.valid_states.nil?
        valid = false
        applog(self, :error, "No valid_states Array or Symbols was specified.")
      end

      # An initial state must be specified.
      if self.initial_state.nil?
        valid = false
        applog(self, :error, "No initial_state Symbol was specified.")
      end

      valid
    end
96795
def valued_parameters
      @valued_parameters ||= filter_parameters.select do |key,value|
        # :order is special, it must always be excluded
        key.to_sym != :order && valued_parameter?(key,value)
      end
    end
628933
def valid?
      return false if @name.nil?
      acl_validator = EnumAttributeValidator.new('String', ["public", "private"])
      return false unless acl_validator.valid?(@acl)
      return true
    end
210935
def valid?(argument)
      if argument.nil? and options[:required]
        raise Templater::TooFewArgumentsError
      elsif not argument.nil?
        if options[:as] == :hash and not argument.is_a?(Hash)
          raise Templater::MalformattedArgumentError, "Expected the argument to be a Hash, but was '#{argument.inspect}'"
        elsif options[:as] == :array and not argument.is_a?(Array)
          raise Templater::MalformattedArgumentError, "Expected the argument to be an Array, but was '#{argument.inspect}'"
        end
           
        invalid = catch :invalid do
          block.call(argument) if block
          throw :invalid, :not_invalid
        end
        raise Templater::ArgumentError, invalid unless invalid == :not_invalid
      end
    end
143466
def fields_to_validate
      required_fields = to_hash opts[:required]
      optional_fields = to_hash opts[:optional]
      required_fields.keys.each { |key| required_fields[key][:required] = true }
      optional_fields.merge(required_fields)
    end
357931
def validate_value(config, allowed_values)
      value = instance_variable_get("@#{config}")

      return unless invalid_value?(value, allowed_values)

      message = "Configuration value `#{value}` is not allowed for `#{config}`."
      raise ConfigurationError, message
    end