// SetScope sets the Scope field's value.
346922
func (s *ResourceChange) SetScope(v []*string) *ResourceChange {
	s.Scope = v
	return s
}
1135835
func (s *Method) SetAuthorizationScopes(v []*string) *Method {
	s.AuthorizationScopes = v
	return s
}
680658
func (s *CreateTagOptionInput) SetValue(v string) *CreateTagOptionInput {
	s.Value = &v
	return s
}
808086
func (s *Tag) SetValue(v string) *Tag {
	s.Value = &v
	return s
}
47972
func (c *adminClient) CreateScope(ctx context.Context, md *ScopeMetadata) error {
	return c.connector.CreateScope(ctx, md)
}
918389
func (s *UsageInstruction) SetValue(v string) *UsageInstruction {
	s.Value = &v
	return s
}
189192
func (s *AuthenticateOidcActionConfig) SetScope(v string) *AuthenticateOidcActionConfig {
	s.Scope = &v
	return s
}
317472
func (s *EyeOpen) SetValue(v bool) *EyeOpen {
	s.Value = &v
	return s
}
13044
func (s *TagOptionDetail) SetValue(v string) *TagOptionDetail {
	s.Value = &v
	return s
}
1143746
func (s *DeleteAppOutput) SetApp(v *App) *DeleteAppOutput {
	s.App = v
	return s
}
1356839
func (s *CreateRouteInput) SetAuthorizationScopes(v []*string) *CreateRouteInput {
	s.AuthorizationScopes = v
	return s
}
1302280
func (s *AssociationFilter) SetValue(v string) *AssociationFilter {
	s.Value = &v
	return s
}
886411
func (s *Setting) SetValue(v string) *Setting {
	s.Value = &v
	return s
}
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
}
163409
func (v *Vars) OpenScope(th *starlark.Thread) {
	v.scopes = append(v.scopes, &scope{thread: th})
}
868268
func (s *LoadBalancerAttribute) SetValue(v string) *LoadBalancerAttribute {
	s.Value = &v
	return s
}
226799
func (s scope) set(k string, v data.Value) {
	s[len(s)-1].vars[k] = v
}