2020-05-11 10:16:29 +00:00
|
|
|
package grpc
|
|
|
|
|
|
|
|
import "github.com/caos/zitadel/internal/model"
|
|
|
|
|
|
|
|
func searchMethodToModel(method SearchMethod) model.SearchMethod {
|
|
|
|
switch method {
|
|
|
|
case SearchMethod_SEARCHMETHOD_EQUALS:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodEquals
|
2020-05-11 10:16:29 +00:00
|
|
|
case SearchMethod_SEARCHMETHOD_CONTAINS:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodContains
|
2020-05-11 10:16:29 +00:00
|
|
|
case SearchMethod_SEARCHMETHOD_STARTS_WITH:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodStartsWith
|
2020-05-11 10:16:29 +00:00
|
|
|
case SearchMethod_SEARCHMETHOD_EQUALS_IGNORE_CASE:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodEqualsIgnoreCase
|
2020-05-11 10:16:29 +00:00
|
|
|
case SearchMethod_SEARCHMETHOD_CONTAINS_IGNORE_CASE:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodContainsIgnoreCase
|
2020-05-11 10:16:29 +00:00
|
|
|
case SearchMethod_SEARCHMETHOD_STARTS_WITH_IGNORE_CASE:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodStartsWithIgnoreCase
|
2020-06-19 13:32:03 +00:00
|
|
|
case SearchMethod_SEARCHMETHOD_NOT_EQUALS:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodNotEquals
|
2020-06-19 13:32:03 +00:00
|
|
|
case SearchMethod_SEARCHMETHOD_IS_ONE_OF:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodIsOneOf
|
2020-06-19 13:32:03 +00:00
|
|
|
case SearchMethod_SEARCHMETHOD_LIST_CONTAINS:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodListContains
|
2020-05-11 10:16:29 +00:00
|
|
|
default:
|
2020-06-23 12:47:47 +00:00
|
|
|
return model.SearchMethodEquals
|
2020-05-11 10:16:29 +00:00
|
|
|
}
|
|
|
|
}
|