2020-08-26 07:56:23 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2022-04-26 23:01:45 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
|
|
iam_model "github.com/zitadel/zitadel/internal/iam/model"
|
|
|
|
"github.com/zitadel/zitadel/internal/view/repository"
|
2020-08-26 07:56:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type IDPProviderSearchRequest iam_model.IDPProviderSearchRequest
|
|
|
|
type IDPProviderSearchQuery iam_model.IDPProviderSearchQuery
|
|
|
|
type IDPProviderSearchKey iam_model.IDPProviderSearchKey
|
|
|
|
|
|
|
|
func (req IDPProviderSearchRequest) GetLimit() uint64 {
|
|
|
|
return req.Limit
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req IDPProviderSearchRequest) GetOffset() uint64 {
|
|
|
|
return req.Offset
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req IDPProviderSearchRequest) GetSortingColumn() repository.ColumnKey {
|
|
|
|
if req.SortingColumn == iam_model.IDPProviderSearchKeyUnspecified {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return IDPProviderSearchKey(req.SortingColumn)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req IDPProviderSearchRequest) GetAsc() bool {
|
|
|
|
return req.Asc
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req IDPProviderSearchRequest) GetQueries() []repository.SearchQuery {
|
|
|
|
result := make([]repository.SearchQuery, len(req.Queries))
|
|
|
|
for i, q := range req.Queries {
|
|
|
|
result[i] = IDPProviderSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method}
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req IDPProviderSearchQuery) GetKey() repository.ColumnKey {
|
|
|
|
return IDPProviderSearchKey(req.Key)
|
|
|
|
}
|
|
|
|
|
2021-03-01 07:48:50 +00:00
|
|
|
func (req IDPProviderSearchQuery) GetMethod() domain.SearchMethod {
|
2020-08-26 07:56:23 +00:00
|
|
|
return req.Method
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req IDPProviderSearchQuery) GetValue() interface{} {
|
|
|
|
return req.Value
|
|
|
|
}
|
|
|
|
|
|
|
|
func (key IDPProviderSearchKey) ToColumnName() string {
|
|
|
|
switch iam_model.IDPProviderSearchKey(key) {
|
|
|
|
case iam_model.IDPProviderSearchKeyAggregateID:
|
|
|
|
return IDPProviderKeyAggregateID
|
|
|
|
case iam_model.IDPProviderSearchKeyIdpConfigID:
|
|
|
|
return IDPProviderKeyIdpConfigID
|
2020-09-23 14:52:19 +00:00
|
|
|
case iam_model.IDPProviderSearchKeyState:
|
|
|
|
return IDPProviderKeyState
|
2022-04-19 06:26:12 +00:00
|
|
|
case iam_model.IDPProviderSearchKeyInstanceID:
|
|
|
|
return IDPProviderKeyInstanceID
|
2022-11-30 16:01:17 +00:00
|
|
|
case iam_model.IDPProviderSearchKeyOwnerRemoved:
|
|
|
|
return IDPProviderKeyOwnerRemoved
|
2020-08-26 07:56:23 +00:00
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|