zitadel/internal/api/grpc/management/search_converter.go
Fabi 3c07a186fc
fix: todos (#1346)
* fix: pub sub in new eventstore

* fix: todos

* fix: todos

* fix: todos

* fix: todos

* fix: todos
2021-03-01 08:48:50 +01:00

32 lines
1.1 KiB
Go

package management
import (
"github.com/caos/zitadel/internal/domain"
"github.com/caos/zitadel/pkg/grpc/management"
)
func searchMethodToModel(method management.SearchMethod) domain.SearchMethod {
switch method {
case management.SearchMethod_SEARCHMETHOD_EQUALS:
return domain.SearchMethodEquals
case management.SearchMethod_SEARCHMETHOD_CONTAINS:
return domain.SearchMethodContains
case management.SearchMethod_SEARCHMETHOD_STARTS_WITH:
return domain.SearchMethodStartsWith
case management.SearchMethod_SEARCHMETHOD_EQUALS_IGNORE_CASE:
return domain.SearchMethodEqualsIgnoreCase
case management.SearchMethod_SEARCHMETHOD_CONTAINS_IGNORE_CASE:
return domain.SearchMethodContainsIgnoreCase
case management.SearchMethod_SEARCHMETHOD_STARTS_WITH_IGNORE_CASE:
return domain.SearchMethodStartsWithIgnoreCase
case management.SearchMethod_SEARCHMETHOD_NOT_EQUALS:
return domain.SearchMethodNotEquals
case management.SearchMethod_SEARCHMETHOD_IS_ONE_OF:
return domain.SearchMethodIsOneOf
case management.SearchMethod_SEARCHMETHOD_LIST_CONTAINS:
return domain.SearchMethodListContains
default:
return domain.SearchMethodEquals
}
}