2021-08-18 10:49:04 +02:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/domain"
|
2021-08-18 10:49:04 +02: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 09:02:39 +01:00
|
|
|
OrgProjectMappingSearchKeyInstanceID
|
2022-11-30 17:01:17 +01:00
|
|
|
OrgProjectMappingSearchKeyOwnerRemoved
|
2021-08-18 10:49:04 +02: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
|
|
|
|
}
|