// nameRequired returns true if the route requires a name.
186267
func (app *App) nameRequired(r *http.Request) bool {
	route := mux.CurrentRoute(r)
	if route == nil {
		return true
	}
	routeName := route.GetName()
	return routeName != v2.RouteNameBase && routeName != v2.RouteNameCatalog
}
1259443
func (p *ProgressBar) UpdateRequired() bool {
	return p.Current == 0 || p.Current == p.Total
}
495581
func validateRequired(v interface{}, name string) error {
	if v == nil {
		return ErrRequired
	}
	return validateNonEmpty(v, name)
}
711271
func (r fieldRequiredness) isRequired(src *ast.Field) (bool, error) {
	switch r {
	case explicitRequiredness:
		if src.Requiredness == ast.Unspecified {
			return false, requirednessRequiredError{
				FieldName: src.Name,
				Line:      src.Line,
			}
		}
	case noRequiredFields:
		if src.Requiredness == ast.Required {
			return false, cannotBeRequiredError{
				FieldName: src.Name,
				Line:      src.Line,
			}
		}
	default:
		// do nothing
	}

	// A field is considered required only if it was marked required AND it
	// does not have a default value.
	return (src.Requiredness == ast.Required && src.Default == nil), nil
}
956025
func (s *SdkConfigurationProperty) SetRequired(v bool) *SdkConfigurationProperty {
	s.Required = &v
	return s
}
36886
func (r *Route) IsResolutionRequired() bool {
	return r.ref.linkCache != nil && r.RemoteLinkAddress == ""
}
1373446
func ValidateRequired(ch *Changeset, fields []string, opts ...Option) {
	options := Options{
		message: ValidateRequiredErrorMessage,
	}
	options.apply(opts)

	for _, f := range fields {
		val, exist := ch.changes[f]

		// check values if it's not exist in changeset when changeOnly is false and changeset values are all zero value
		if !exist && !options.changeOnly && !ch.zero {
			val, exist = ch.values[f]
		}

		str, isStr := val.(string)
		if exist && (isStr && strings.TrimSpace(str) != "") || (!isStr && val != nil) {
			continue
		}

		msg := strings.Replace(options.message, "{field}", f, 1)
		AddError(ch, f, msg)
	}
}
128659
func MustRegister(name string, i interface{}) {
	if err := Register(name, i); err != nil {
		panic(err)
	}
}
682977
func (r *Route) Name(name string) *Route {
	r.name = name
	r.group.router.namedRoutes[name] = r
	return r
}
608834
func Required(name, in string) *Validation {
	var msg string
	if in == "" {
		msg = fmt.Sprintf(requiredFailNoIn, name)
	} else {
		msg = fmt.Sprintf(requiredFail, name, in)
	}
	return &Validation{
		code:    RequiredFailCode,
		Name:    name,
		In:      in,
		message: msg,
	}
}
201987
func (tx *Tx) BindNamed(query string, arg interface{}) (string, []interface{}, error) {
	return bindNamedMapper(BindType(tx.driverName), query, arg, tx.Mapper)
}
543861
func (obj *GCSObject) IsRequiredKind(requires []string) bool {
	kindName := obj.ExtractKindName()
	for _, k := range requires {
		if k == kindName {
			return true
		}
	}
	return false
}
113581
func (n *Node) Name(name string) *Node {
	if n.getRootNode().namedRoutes == nil {
		n.getRootNode().namedRoutes = map[string]*Node{name: n}
	} else {
		if _, ok := n.getRootNode().namedRoutes[name]; ok {
			panic(fmt.Errorf("mux: route already has name %q, can't set", name))
		}
		n.getRootNode().namedRoutes[name] = n
	}
	return n
}
1002754
func (v *ValidationDefinition) AddRequired(required []string) {
	for _, r := range required {
		found := false
		for _, rr := range v.Required {
			if r == rr {
				found = true
				break
			}
		}
		if !found {
			v.Required = append(v.Required, r)
		}
	}
}
817158
func (b *bitbucketConnector) groupsRequired(groupScope bool) bool {
	return len(b.teams) > 0 || groupScope
}
1024670
func (s *IndicesPutTemplateService) Name(name string) *IndicesPutTemplateService {
	s.name = name
	return s
}
416579
func LengthRequired(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusLengthRequired, response)
}