2020-05-11 12:16:29 +02:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2021-03-01 08:48:50 +01:00
|
|
|
"github.com/caos/zitadel/internal/domain"
|
2020-05-11 12:16:29 +02:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ProjectGrantMemberView struct {
|
2021-03-22 14:40:25 +01:00
|
|
|
UserID string
|
|
|
|
GrantID string
|
|
|
|
ProjectID string
|
|
|
|
UserName string
|
|
|
|
Email string
|
|
|
|
FirstName string
|
|
|
|
LastName string
|
|
|
|
DisplayName string
|
|
|
|
PreferredLoginName string
|
|
|
|
Roles []string
|
|
|
|
CreationDate time.Time
|
|
|
|
ChangeDate time.Time
|
|
|
|
Sequence uint64
|
2020-05-11 12:16:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type ProjectGrantMemberSearchRequest struct {
|
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
|
|
|
SortingColumn ProjectGrantMemberSearchKey
|
|
|
|
Asc bool
|
|
|
|
Queries []*ProjectGrantMemberSearchQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
type ProjectGrantMemberSearchKey int32
|
|
|
|
|
|
|
|
const (
|
2020-06-23 14:47:47 +02:00
|
|
|
ProjectGrantMemberSearchKeyUnspecified ProjectGrantMemberSearchKey = iota
|
|
|
|
ProjectGrantMemberSearchKeyUserName
|
|
|
|
ProjectGrantMemberSearchKeyEmail
|
|
|
|
ProjectGrantMemberSearchKeyFirstName
|
|
|
|
ProjectGrantMemberSearchKeyLastName
|
|
|
|
ProjectGrantMemberSearchKeyGrantID
|
|
|
|
ProjectGrantMemberSearchKeyUserID
|
2020-08-05 18:32:25 +02:00
|
|
|
ProjectGrantMemberSearchKeyProjectID
|
2020-05-11 12:16:29 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type ProjectGrantMemberSearchQuery struct {
|
|
|
|
Key ProjectGrantMemberSearchKey
|
2021-03-01 08:48:50 +01:00
|
|
|
Method domain.SearchMethod
|
2020-06-16 11:40:18 +02:00
|
|
|
Value interface{}
|
2020-05-11 12:16:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type ProjectGrantMemberSearchResponse struct {
|
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
|
|
|
TotalResult uint64
|
|
|
|
Result []*ProjectGrantMemberView
|
2020-07-15 13:24:36 +02:00
|
|
|
Sequence uint64
|
|
|
|
Timestamp time.Time
|
2020-05-11 12:16:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *ProjectGrantMemberSearchRequest) EnsureLimit(limit uint64) {
|
|
|
|
if r.Limit == 0 || r.Limit > limit {
|
|
|
|
r.Limit = limit
|
|
|
|
}
|
|
|
|
}
|