2021-08-18 08:49:04 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2022-04-26 23:01:45 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/domain"
|
2021-08-18 08:49:04 +00:00
|
|
|
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type OrgProjectMapping struct {
|
|
|
|
OrgID string
|
|
|
|
ProjectID string
|
|
|
|
}
|
|
|
|
|
|
|
|
type OrgProjectMappingViewSearchRequest struct {
|
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
|
|
|
SortingColumn OrgProjectMappingViewSearchKey
|
|
|
|
Asc bool
|
|
|
|
Queries []*OrgProjectMappingViewSearchQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
type OrgProjectMappingViewSearchKey int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
OrgProjectMappingSearchKeyUnspecified OrgProjectMappingViewSearchKey = iota
|
|
|
|
OrgProjectMappingSearchKeyProjectID
|
|
|
|
OrgProjectMappingSearchKeyOrgID
|
|
|
|
OrgProjectMappingSearchKeyProjectGrantID
|
2022-03-23 08:02:39 +00:00
|
|
|
OrgProjectMappingSearchKeyInstanceID
|
2022-11-30 16:01:17 +00:00
|
|
|
OrgProjectMappingSearchKeyOwnerRemoved
|
2021-08-18 08:49:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type OrgProjectMappingViewSearchQuery struct {
|
|
|
|
Key OrgProjectMappingViewSearchKey
|
|
|
|
Method domain.SearchMethod
|
|
|
|
Value interface{}
|
|
|
|
}
|
|
|
|
|
|
|
|
type OrgProjectMappingViewSearchResponse struct {
|
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
|
|
|
TotalResult uint64
|
|
|
|
Result []*OrgProjectMapping
|
|
|
|
Sequence uint64
|
|
|
|
Timestamp time.Time
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *OrgProjectMappingViewSearchRequest) GetSearchQuery(key OrgProjectMappingViewSearchKey) (int, *OrgProjectMappingViewSearchQuery) {
|
|
|
|
for i, q := range r.Queries {
|
|
|
|
if q.Key == key {
|
|
|
|
return i, q
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1, nil
|
|
|
|
}
|