2023-02-15 09:14:59 +01:00
|
|
|
package ldap
|
|
|
|
|
2023-03-14 20:20:38 +01:00
|
|
|
import (
|
|
|
|
"golang.org/x/text/language"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
|
|
)
|
2023-02-15 09:14:59 +01:00
|
|
|
|
|
|
|
type User struct {
|
|
|
|
id string
|
|
|
|
firstName string
|
|
|
|
lastName string
|
|
|
|
displayName string
|
|
|
|
nickName string
|
|
|
|
preferredUsername string
|
2023-03-14 20:20:38 +01:00
|
|
|
email domain.EmailAddress
|
2023-02-15 09:14:59 +01:00
|
|
|
emailVerified bool
|
2023-03-14 20:20:38 +01:00
|
|
|
phone domain.PhoneNumber
|
2023-02-15 09:14:59 +01:00
|
|
|
phoneVerified bool
|
|
|
|
preferredLanguage language.Tag
|
|
|
|
avatarURL string
|
|
|
|
profile string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewUser(
|
|
|
|
id string,
|
|
|
|
firstName string,
|
|
|
|
lastName string,
|
|
|
|
displayName string,
|
|
|
|
nickName string,
|
|
|
|
preferredUsername string,
|
2023-03-14 20:20:38 +01:00
|
|
|
email domain.EmailAddress,
|
2023-02-15 09:14:59 +01:00
|
|
|
emailVerified bool,
|
2023-03-14 20:20:38 +01:00
|
|
|
phone domain.PhoneNumber,
|
2023-02-15 09:14:59 +01:00
|
|
|
phoneVerified bool,
|
|
|
|
preferredLanguage language.Tag,
|
|
|
|
avatarURL string,
|
|
|
|
profile string,
|
|
|
|
) *User {
|
|
|
|
return &User{
|
|
|
|
id,
|
|
|
|
firstName,
|
|
|
|
lastName,
|
|
|
|
displayName,
|
|
|
|
nickName,
|
|
|
|
preferredUsername,
|
|
|
|
email,
|
|
|
|
emailVerified,
|
|
|
|
phone,
|
|
|
|
phoneVerified,
|
|
|
|
preferredLanguage,
|
|
|
|
avatarURL,
|
|
|
|
profile,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (u *User) GetID() string {
|
|
|
|
return u.id
|
|
|
|
}
|
|
|
|
func (u *User) GetFirstName() string {
|
|
|
|
return u.firstName
|
|
|
|
}
|
|
|
|
func (u *User) GetLastName() string {
|
|
|
|
return u.lastName
|
|
|
|
}
|
|
|
|
func (u *User) GetDisplayName() string {
|
|
|
|
return u.displayName
|
|
|
|
}
|
|
|
|
func (u *User) GetNickname() string {
|
|
|
|
return u.nickName
|
|
|
|
}
|
|
|
|
func (u *User) GetPreferredUsername() string {
|
|
|
|
return u.preferredUsername
|
|
|
|
}
|
2023-03-14 20:20:38 +01:00
|
|
|
func (u *User) GetEmail() domain.EmailAddress {
|
2023-02-15 09:14:59 +01:00
|
|
|
return u.email
|
|
|
|
}
|
|
|
|
func (u *User) IsEmailVerified() bool {
|
|
|
|
return u.emailVerified
|
|
|
|
}
|
2023-03-14 20:20:38 +01:00
|
|
|
func (u *User) GetPhone() domain.PhoneNumber {
|
2023-02-15 09:14:59 +01:00
|
|
|
return u.phone
|
|
|
|
}
|
|
|
|
func (u *User) IsPhoneVerified() bool {
|
|
|
|
return u.phoneVerified
|
|
|
|
}
|
|
|
|
func (u *User) GetPreferredLanguage() language.Tag {
|
|
|
|
return u.preferredLanguage
|
|
|
|
}
|
|
|
|
func (u *User) GetAvatarURL() string {
|
|
|
|
return u.avatarURL
|
|
|
|
}
|
|
|
|
func (u *User) GetProfile() string {
|
|
|
|
return u.profile
|
|
|
|
}
|