// Set new scope value
197108
func (scope *ArgScope) Set(key string, v interface{}) error {
	str, ok := v.(string)
	if !ok {
		return fmt.Errorf("%v is not a string", v)
	}
	scope.data[key] = str
	return nil
}
62699
func Set(name string) p.Plugin {
	return p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {
		defineType(name, ctx.Request)
		h.Next(ctx)
	})
}
594794
func (s *RPCServer) Set(arg SetIn, out *SetOut) error {
	return s.debugger.SetVariableInScope(arg.Scope, arg.Symbol, arg.Value)
}
1191133
func (ref *Reference) Set(value interface{}) error {
	buf := bytes.NewBuffer([]byte{})
	err := json.NewEncoder(buf).Encode(value)
	if err != nil {
		return err
	}
	_, err = ref.invokeRequest(http.MethodPut, buf)
	if err != nil {
		return err
	}
	return nil
}
1121733
func setValuesFromScope(token *jwt.Token, scopeStr string, r *http.Request, at *AccessToken) error {
	userMgr := user.NewManager(r)
	authorization, err := userMgr.GetAuthorization(at.Username, at.ClientID)
	if err != nil {
		return fmt.Errorf("failed to get authorization: %s", err)
	}
	userObj, err := userMgr.GetByName(at.Username)
	if err != nil {
		return fmt.Errorf("failed to get user: %s", err)
	}

	scopeSlice := strings.Split(scopeStr, ",")
	for _, scope := range scopeSlice {
		switch {
		case scope == "user:name":
			token.Claims[scope] = fmt.Sprintf("%s %s", userObj.Firstname, userObj.Lastname)
		case strings.HasPrefix(scope, "user:email"):
			requestedLabel := strings.TrimPrefix(scope, "user:email")
			if requestedLabel == "" || requestedLabel == "user:email" {
				requestedLabel = "main"
			}
			label := getRealLabel(requestedLabel, "email", authorization)
			email, err := userObj.GetEmailAddressByLabel(label)
			if err != nil {
				return fmt.Errorf("could not get user's email: %s", err)
			}
			token.Claims[scope] = email.EmailAddress
		case strings.HasPrefix(scope, "user:validated:email"):
			requestedLabel := strings.TrimPrefix(scope, "user:validated:email")
			if requestedLabel == "" || requestedLabel == "user:validated:email" {
				requestedLabel = "main"
			}
			label := getRealLabel(requestedLabel, "validatedemail", authorization)
			email, err := userObj.GetEmailAddressByLabel(label)
			if err != nil {
				return fmt.Errorf("could not get user's email: %s", err)
			}
			token.Claims[scope] = email.EmailAddress
		case strings.HasPrefix(scope, "user:phone"):
			requestedLabel := strings.TrimPrefix(scope, "user:phone:")
			if requestedLabel == "" || requestedLabel == "user:phone" {
				requestedLabel = "main"
			}
			label := getRealLabel(requestedLabel, "phone", authorization)
			phone, err := userObj.GetPhonenumberByLabel(label)
			if err != nil {
				return fmt.Errorf("could not get user's phone: %s", err)
			}
			token.Claims[scope] = phone.Phonenumber
		case strings.HasPrefix(scope, "user:validated:phone"):
			requestedLabel := strings.TrimPrefix(scope, "user:validated:phone:")
			if requestedLabel == "" || requestedLabel == "user:validated:phone" {
				requestedLabel = "main"
			}
			label := getRealLabel(requestedLabel, "validatedphone", authorization)
			phone, err := userObj.GetPhonenumberByLabel(label)
			if err != nil {
				return fmt.Errorf("could not get user's phone: %s", err)
			}
			token.Claims[scope] = phone.Phonenumber
		}
	}

	return nil
}
174579
func (i *Uint16) Set(value uint16) {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment = value
}
530994
func (s *UpdateResourceServerInput) SetScopes(v []*ResourceServerScopeType) *UpdateResourceServerInput {
	s.Scopes = v
	return s
}
1162498
func Set(ptr interface{}) error {
	if reflect.TypeOf(ptr).Kind() != reflect.Ptr {
		return errInvalidType
	}

	v := reflect.ValueOf(ptr).Elem()
	t := v.Type()

	if t.Kind() != reflect.Struct {
		return errInvalidType
	}

	for i := 0; i < t.NumField(); i++ {
		if defaultVal := t.Field(i).Tag.Get(fieldName); defaultVal != "-" {
			if err := setField(v.Field(i), defaultVal); err != nil {
				return err
			}
		}
	}

	return nil
}
985941
func (u *URI) Set(value string) error {
	uri, err := NewURIFromAddress(value)
	if err != nil {
		return err
	}
	*u = *uri
	return nil
}
159354
func (s *AuthenticateCognitoActionConfig) SetScope(v string) *AuthenticateCognitoActionConfig {
	s.Scope = &v
	return s
}
758299
func (s *CreateResourceServerInput) SetScopes(v []*ResourceServerScopeType) *CreateResourceServerInput {
	s.Scopes = v
	return s
}
57417
func (c *expvarStatsClient) Set(name string, value string, rate float64) {
	var s expvar.String
	s.Set(value)
	c.m.Set(name, &s)
}
1118316
func (s *ConfigRule) SetScope(v *Scope) *ConfigRule {
	s.Scope = v
	return s
}
534603
func (s *DockerVolumeConfiguration) SetScope(v string) *DockerVolumeConfiguration {
	s.Scope = &v
	return s
}
1197824
func (s *RedisAnnouncementStore) Set(new *Announcement) error {
	now := time.Now()
	new.UpdatedAt = now
	key := fmt.Sprintf("%s:%s", new.ServiceName, new.ID)
	if new.old == nil {
		new.CreatedAt = now
	}
	err := s.store.Set(key, *new)
	if err != nil {
		return err
	}
	return nil
}
1350858
func (s *ConditionalForwarder) SetReplicationScope(v string) *ConditionalForwarder {
	s.ReplicationScope = &v
	return s
}
773791
func (context *Context) Set(name string, value interface{}) {
	if context.Options == nil {
		context.Options = map[string]interface{}{}
	}
	context.Options[name] = value
}