// checkType panics if the type of this resources != t
972102
func (left *Resource) checkType(t Value_Type) Value_Type {
	if left != nil && left.GetType() != t {
		panic(fmt.Sprintf("expected type %v instead of %v", t, left.GetType()))
	}
	return t
}
563101
func (s *SnapshotCreateRepositoryService) Type(typ string) *SnapshotCreateRepositoryService {
	s.typ = typ
	return s
}
899927
func (tc *typeChecker) CheckTypes(env *TypeEnv, sorted []util.T) (*TypeEnv, Errors) {
	if env == nil {
		env = NewTypeEnv()
	} else {
		env = env.wrap()
	}
	for _, s := range sorted {
		tc.checkRule(env, s.(*Rule))
	}
	return env, tc.errs
}
56532
func (r *ReindexDestination) Type(typ string) *ReindexDestination {
	r.typ = typ
	return r
}
904535
func IsValidTokenType(tokenType string) bool {
	return tokenType == TOKEN_TYPE_RPT ||
		tokenType == TOKEN_TYPE_ACCESS ||
		tokenType == TOKEN_TYPE_REFRESH
}
125081
func checkType(name string, kind reflect.Kind, v interface{}) error {
	actualKind := reflect.TypeOf(v).Kind()
	if actualKind != kind {
		return fmt.Errorf("parameter %q value is expected to be %v, got %v",
			name, kind.String(), actualKind.String())
	}
	return nil
}
266158
func (s *PutMappingService) Type(typ string) *PutMappingService {
	s.typ = typ
	return s
}
89034
func (registry *Registry) CheckStatus() map[string]string { // TODO(stevvooe) this needs a proper type
	registry.mu.RLock()
	defer registry.mu.RUnlock()
	statusKeys := make(map[string]string)
	for k, v := range registry.registeredChecks {
		err := v.Check()
		if err != nil {
			statusKeys[k] = err.Error()
		}
	}

	return statusKeys
}
869597
func (s *Script) Type(typ string) *Script {
	s.typ = typ
	return s
}
551631
func (r *SearchRequest) SearchType(searchType string) *SearchRequest {
	r.searchType = searchType
	return r
}
50151
func (s *BulkService) Type(typ string) *BulkService {
	s.typ = typ
	return s
}
280281
func (s *IndicesStatsService) Type(types ...string) *IndicesStatsService {
	s.types = append(s.types, types...)
	return s
}
220904
func (tc *typeChecker) CheckBody(env *TypeEnv, body Body) (*TypeEnv, Errors) {

	if env == nil {
		env = NewTypeEnv()
	} else {
		env = env.wrap()
	}

	WalkExprs(body, func(expr *Expr) bool {

		closureErrs := tc.checkClosures(env, expr)
		for _, err := range closureErrs {
			tc.err(err)
		}

		hasClosureErrors := len(closureErrs) > 0

		vis := newRefChecker(env)
		Walk(vis, expr)
		for _, err := range vis.errs {
			tc.err(err)
		}

		hasRefErrors := len(vis.errs) > 0

		if err := tc.checkExpr(env, expr); err != nil {
			// Suppress this error if a more actionable one has occurred. In
			// this case, if an error occurred in a ref or closure contained in
			// this expression, and the error is due to a nil type, then it's
			// likely to be the result of the more specific error.
			skip := (hasClosureErrors || hasRefErrors) && causedByNilType(err)
			if !skip {
				tc.err(err)
			}
		}

		return true
	})

	return env, tc.errs
}
158950
func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest {
	r.typ = typ
	r.source = nil
	return r
}
685130
func IsInvalidType(err error) bool {
	_, ok := Cause(err).(InvalidTypeError)
	return ok
}
294481
func (p ProviderInstance) Type() string {
	t := string(p)
	if dotPos := strings.Index(t, "."); dotPos != -1 {
		t = t[:dotPos]
	}
	return t
}
500570
func (ftp *FTP) Type(t TypeCode) error {
	_, err := ftp.cmd(StatusOK, "TYPE %s", t)
	return err
}