2020-06-25 06:12:29 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2021-03-01 07:48:50 +00:00
|
|
|
"github.com/caos/zitadel/internal/domain"
|
2020-06-25 06:12:29 +00:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2020-08-26 07:56:23 +00:00
|
|
|
type IAMMemberView struct {
|
2020-06-25 06:12:29 +00:00
|
|
|
UserID string
|
2020-08-26 07:56:23 +00:00
|
|
|
IAMID string
|
2020-06-25 06:12:29 +00:00
|
|
|
UserName string
|
|
|
|
Email string
|
|
|
|
FirstName string
|
|
|
|
LastName string
|
2020-07-22 12:21:41 +00:00
|
|
|
DisplayName string
|
2020-06-25 06:12:29 +00:00
|
|
|
Roles []string
|
|
|
|
CreationDate time.Time
|
|
|
|
ChangeDate time.Time
|
|
|
|
Sequence uint64
|
|
|
|
}
|
|
|
|
|
2020-08-26 07:56:23 +00:00
|
|
|
type IAMMemberSearchRequest struct {
|
2020-06-25 06:12:29 +00:00
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
2020-08-26 07:56:23 +00:00
|
|
|
SortingColumn IAMMemberSearchKey
|
2020-06-25 06:12:29 +00:00
|
|
|
Asc bool
|
2020-08-26 07:56:23 +00:00
|
|
|
Queries []*IAMMemberSearchQuery
|
2020-06-25 06:12:29 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 07:56:23 +00:00
|
|
|
type IAMMemberSearchKey int32
|
2020-06-25 06:12:29 +00:00
|
|
|
|
|
|
|
const (
|
2020-08-26 07:56:23 +00:00
|
|
|
IAMMemberSearchKeyUnspecified IAMMemberSearchKey = iota
|
|
|
|
IAMMemberSearchKeyUserName
|
|
|
|
IAMMemberSearchKeyEmail
|
|
|
|
IAMMemberSearchKeyFirstName
|
|
|
|
IAMMemberSearchKeyLastName
|
|
|
|
IAMMemberSearchKeyIamID
|
|
|
|
IAMMemberSearchKeyUserID
|
2020-06-25 06:12:29 +00:00
|
|
|
)
|
|
|
|
|
2020-08-26 07:56:23 +00:00
|
|
|
type IAMMemberSearchQuery struct {
|
|
|
|
Key IAMMemberSearchKey
|
2021-03-01 07:48:50 +00:00
|
|
|
Method domain.SearchMethod
|
2020-06-25 06:12:29 +00:00
|
|
|
Value interface{}
|
|
|
|
}
|
|
|
|
|
2020-08-26 07:56:23 +00:00
|
|
|
type IAMMemberSearchResponse struct {
|
2020-06-25 06:12:29 +00:00
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
|
|
|
TotalResult uint64
|
2020-08-26 07:56:23 +00:00
|
|
|
Result []*IAMMemberView
|
2020-07-15 11:24:36 +00:00
|
|
|
Sequence uint64
|
|
|
|
Timestamp time.Time
|
2020-06-25 06:12:29 +00:00
|
|
|
}
|
|
|
|
|
2020-08-26 07:56:23 +00:00
|
|
|
func (r *IAMMemberSearchRequest) EnsureLimit(limit uint64) {
|
2020-06-25 06:12:29 +00:00
|
|
|
if r.Limit == 0 || r.Limit > limit {
|
|
|
|
r.Limit = limit
|
|
|
|
}
|
|
|
|
}
|