// DisplayName returns full name if it's not empty,
// returns username otherwise.
166176
func (u *User) DisplayName() string {
	if len(u.FullName) > 0 {
		return u.FullName
	}
	return u.Name
}
1247407
func getUserName(ctx context.Context, r *http.Request) string {
	username := dcontext.GetStringValue(ctx, auth.UserNameKey)

	// Fallback to request user with basic auth
	if username == "" {
		var ok bool
		uname, _, ok := basicAuth(r)
		if ok {
			username = uname
		}
	}

	return username
}
164093
func (state *UserState) Username(req *http.Request) string {
	username, err := state.UsernameCookie(req)
	if err != nil {
		return ""
	}
	return username
}
758421
func (s *CreateServiceSpecificCredentialInput) SetUserName(v string) *CreateServiceSpecificCredentialInput {
	s.UserName = &v
	return s
}
290437
func (cli *Client) GetOwnDisplayName() (resp *RespUserDisplayName, err error) {
	urlPath := cli.BuildURL("profile", cli.UserID, "displayname")
	_, err = cli.MakeRequest("GET", urlPath, nil, &resp)
	return
}
1114471
func (internet Internet) UserName(v reflect.Value) (interface{}, error) {
	return internet.username(), nil
}
1307602
func (m *Monitor) GetName() (string, error) {
	mn := C.glfwGetMonitorName(m.data)
	if mn == nil {
		return "", errors.New("Can't get monitor name.")
	}

	return C.GoString(mn), nil
}
409056
func (s *CreateImageBuilderInput) SetDisplayName(v string) *CreateImageBuilderInput {
	s.DisplayName = &v
	return s
}
915083
func (s *UserProfileSummary) SetDisplayName(v string) *UserProfileSummary {
	s.DisplayName = &v
	return s
}
1257849
func (l *LabelResult) GetName() string {
	if l == nil || l.Name == nil {
		return ""
	}
	return *l.Name
}
871152
func (s *PortfolioDetail) SetDisplayName(v string) *PortfolioDetail {
	s.DisplayName = &v
	return s
}
1149256
func validateUsername(username, allowedUsers string) error {
	if allowedUsers == "" {
		return fmt.Errorf("username not in allowed users list")
	}

	// Role was explicitly configured to allow any username.
	if allowedUsers == "*" {
		return nil
	}

	userList := strings.Split(allowedUsers, ",")
	for _, user := range userList {
		if strings.TrimSpace(user) == username {
			return nil
		}
	}

	return fmt.Errorf("username not in allowed users list")
}
1322710
func (s *DescribeUserProfileOutput) SetDisplayName(v string) *DescribeUserProfileOutput {
	s.DisplayName = &v
	return s
}
333683
func (s *DomainSummary) SetDisplayName(v string) *DomainSummary {
	s.DisplayName = &v
	return s
}
980570
func (s *UpdateUserProfileOutput) SetDisplayName(v string) *UpdateUserProfileOutput {
	s.DisplayName = &v
	return s
}
1195861
func (c *ChatPostMessageCall) Username(username string) *ChatPostMessageCall {
	c.username = username
	return c
}
1064980
func (s *Owner) SetDisplayName(v string) *Owner {
	s.DisplayName = &v
	return s
}