// HasReqValidator returns true if this method
// has request body validator:
// if request body is not builtin type
487999
func (sm serverMethod) HasReqValidator() bool {
	jsObj, ok := jsObjects[sm.reqBody]
	if !ok {
		return false
	}

	return !commons.IsBuiltinType(jsObj.T.TypeString())
}
1079001
func (s *Subscription) IsValid() bool {
	if s == nil {
		return false
	}
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.conn != nil
}
1149154
func isValidHandler(vfn reflect.Value, ctxType reflect.Type, types ...reflect.Type) bool {
	fnType := vfn.Type()

	if fnType.Kind() != reflect.Func {
		return false
	}

	typesStartIdx := 0
	typesLen := len(types)
	numIn := fnType.NumIn()
	numOut := fnType.NumOut()

	if numOut != 0 {
		return false
	}

	if numIn == typesLen {
		// No context
	} else if numIn == (typesLen + 1) {
		// context, types
		firstArgType := fnType.In(0)
		if firstArgType != reflect.PtrTo(ctxType) && firstArgType != emptyInterfaceType {
			return false
		}
		typesStartIdx = 1
	} else {
		return false
	}

	for _, typeArg := range types {
		if fnType.In(typesStartIdx) != typeArg {
			return false
		}
		typesStartIdx++
	}

	return true
}
923017
func (s *Shape) IsRequired(member string) bool {
	ref, ok := s.MemberRefs[member]
	if !ok {
		panic(fmt.Sprintf(
			"attempted to check required for unknown member, %s.%s",
			s.ShapeName, member,
		))
	}
	if ref.IdempotencyToken || ref.Shape.IdempotencyToken {
		return false
	}
	if ref.Location == "uri" || ref.HostLabel {
		return true
	}
	for _, n := range s.Required {
		if n == member {
			return true
		}
	}
	return false
}
1001692
func (m *GormIdentityRepository) IsValid(ctx context.Context, id uuid.UUID) bool {
	_, err := m.Load(ctx, id)
	if err != nil {
		return false
	}
	return true
}
210601
func IsValid(expr string) bool {
	_, err := parse(expr, &match{})
	return err == nil
}
1368905
func IsValidHasher(hasher string) bool {
	switch hasher {
	case
		Argon2Hasher,
		BCryptHasher,
		BCryptSHA256Hasher,
		CryptHasher,
		MD5Hasher,
		PBKDF2SHA1Hasher,
		PBKDF2SHA256Hasher,
		SHA1Hasher,
		UnsaltedMD5Hasher,
		UnsaltedSHA1Hasher:
		return true
	}

	return false
}
493570
func (r *Result) IsValid() bool {
	if r == nil {
		return true
	}
	return len(r.Errors) == 0
}
1110263
func ReqFactory(e *ReqErrorOption) ValidationFunc {
	if e == nil {
		e = &ReqErrorOption{}
	}
	if e.UnsupportedTypeErrorOption == nil {
		e.UnsupportedTypeErrorOption = &UnsupportedTypeErrorOption{UnsupportedTypeError}
	}
	if e.ReqError == nil {
		e.ReqError = ReqError
	}
	return func(t *Target, param string) error {
		v := t.FieldValue

		switch v.Kind() {
		case reflect.String:
			if v.String() == "" {
				return e.ReqError(t.FieldInfo, v.String())
			}
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			if v.Int() == 0 {
				return e.ReqError(t.FieldInfo, fmt.Sprintf("%d", v.Int()))
			}
		case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
			if v.Uint() == 0 {
				return e.ReqError(t.FieldInfo, fmt.Sprintf("%d", v.Uint()))
			}
		case reflect.Float32, reflect.Float64:
			if v.Float() == 0 {
				return e.ReqError(t.FieldInfo, fmt.Sprintf("%f", v.Float()))
			}
		case reflect.Bool:
		// :)

		case reflect.Array, reflect.Slice:
			if v.Len() == 0 {
				return e.ReqError(t.FieldInfo, v.Len())
			}
		case reflect.Struct:
			// t.FieldValue is de-referenced
			ofv := t.StructValue.Field(t.FieldIndex)
			if ofv.Kind() == reflect.Ptr && ofv.IsNil() {
				return e.ReqError(t.FieldInfo, "nil")
			}
		default:
			return e.UnsupportedTypeError("req", t.FieldInfo)
		}
		return nil
	}
}
7828
func (s *Selection) HasMatcher(m Matcher) *Selection {
	return s.HasSelection(s.document.FindMatcher(m))
}
1266389
func BooleanValidator(input string) (interface{}, error) {
	if input == "" {
		return nil, nil
	}

	b, err := parseBool(input)
	if err != nil {
		return nil, err
	}

	return b, nil
}
1220351
func (env *environ) ConstraintsValidator(ctx context.ProviderCallContext) (constraints.Validator, error) {
	validator := constraints.NewValidator()
	validator.RegisterUnsupported(unsupportedConstraints)
	validator.RegisterVocabulary(constraints.Arch, []string{
		arch.AMD64, arch.I386,
	})
	return validator, nil
}
257327
func (e *manualEnviron) ConstraintsValidator(ctx context.ProviderCallContext) (constraints.Validator, error) {
	validator := constraints.NewValidator()
	validator.RegisterUnsupported(unsupportedConstraints)
	if isRunningController() {
		validator.UpdateVocabulary(constraints.Arch, []string{arch.HostArch()})
	} else {
		// We're running outside of the Juju controller, so we must
		// SSH to the machine and detect its architecture.
		hw, _, err := e.seriesAndHardwareCharacteristics()
		if err != nil {
			return nil, errors.Trace(err)
		}
		validator.UpdateVocabulary(constraints.Arch, []string{*hw.Arch})
	}
	return validator, nil
}
801099
func (c Cap) IsValid() bool {
	return c.center.Vector.IsUnit() && c.height <= fullHeight
}
1097610
func RequiredValidator(input string) (interface{}, error) {
	if input == "" {
		return nil, fmt.Errorf("This option is required")
	}

	return input, nil
}
987973
func (sub *subscription) IsValid() bool {
	sub.Lock()
	defer sub.Unlock()
	if sub.inboxSub == nil {
		return false
	}
	return sub.inboxSub.IsValid()
}
675932
func (key Key) IsValid() bool {
	for _, supKey := range AllSupportedKeys {
		if supKey == key {
			return true
		}
	}

	return false
}