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